@visactor/vchart 1.2.1-alpha.2 → 1.2.1

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 (47) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +145 -45
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/base-chart.js +1 -1
  6. package/cjs/chart/base-chart.js.map +1 -1
  7. package/cjs/component/axis/cartesian/axis.d.ts +8 -0
  8. package/cjs/component/axis/cartesian/axis.js +33 -3
  9. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  10. package/cjs/constant/event.d.ts +1 -0
  11. package/cjs/constant/event.js +3 -2
  12. package/cjs/constant/event.js.map +1 -1
  13. package/cjs/core/index.d.ts +1 -1
  14. package/cjs/core/index.js +1 -1
  15. package/cjs/core/index.js.map +1 -1
  16. package/cjs/core/vchart.js.map +1 -1
  17. package/cjs/data/initialize.js +2 -1
  18. package/cjs/data/initialize.js.map +1 -1
  19. package/cjs/layout/base-layout.js +2 -2
  20. package/cjs/layout/base-layout.js.map +1 -1
  21. package/cjs/model/interface.d.ts +1 -0
  22. package/cjs/model/interface.js.map +1 -1
  23. package/cjs/model/layout-item.d.ts +1 -0
  24. package/cjs/model/layout-item.js +4 -0
  25. package/cjs/model/layout-item.js.map +1 -1
  26. package/esm/chart/base-chart.js +1 -1
  27. package/esm/chart/base-chart.js.map +1 -1
  28. package/esm/component/axis/cartesian/axis.d.ts +8 -0
  29. package/esm/component/axis/cartesian/axis.js +33 -3
  30. package/esm/component/axis/cartesian/axis.js.map +1 -1
  31. package/esm/constant/event.d.ts +1 -0
  32. package/esm/constant/event.js +3 -2
  33. package/esm/constant/event.js.map +1 -1
  34. package/esm/core/index.d.ts +1 -1
  35. package/esm/core/index.js +1 -1
  36. package/esm/core/index.js.map +1 -1
  37. package/esm/core/vchart.js.map +1 -1
  38. package/esm/data/initialize.js +2 -2
  39. package/esm/data/initialize.js.map +1 -1
  40. package/esm/layout/base-layout.js +2 -2
  41. package/esm/layout/base-layout.js.map +1 -1
  42. package/esm/model/interface.d.ts +1 -0
  43. package/esm/model/interface.js.map +1 -1
  44. package/esm/model/layout-item.d.ts +1 -0
  45. package/esm/model/layout-item.js +4 -0
  46. package/esm/model/layout-item.js.map +1 -1
  47. package/package.json +10 -10
package/build/index.js CHANGED
@@ -37029,7 +37029,7 @@
37029
37029
  return {
37030
37030
  from: {
37031
37031
  x: computedX + computedWidth / 2,
37032
- x1: computedX + computedWidth / 2,
37032
+ x1: isNil(x1) ? void 0 : computedX + computedWidth / 2,
37033
37033
  width: isNil(width) ? void 0 : 0
37034
37034
  },
37035
37035
  to: {
@@ -37042,7 +37042,7 @@
37042
37042
  return {
37043
37043
  from: {
37044
37044
  y: computedY + computedHeight / 2,
37045
- y1: computedY + computedHeight / 2,
37045
+ y1: isNil(y1) ? void 0 : computedY + computedHeight / 2,
37046
37046
  height: isNil(height) ? void 0 : 0
37047
37047
  },
37048
37048
  to: {
@@ -37055,9 +37055,9 @@
37055
37055
  return {
37056
37056
  from: {
37057
37057
  x: computedX + computedWidth / 2,
37058
- x1: computedX + computedWidth / 2,
37059
37058
  y: computedY + computedHeight / 2,
37060
- y1: computedY + computedHeight / 2,
37059
+ x1: isNil(x1) ? void 0 : computedX + computedWidth / 2,
37060
+ y1: isNil(y1) ? void 0 : computedY + computedHeight / 2,
37061
37061
  width: isNil(width) ? void 0 : 0,
37062
37062
  height: isNil(height) ? void 0 : 0
37063
37063
  },
@@ -37073,7 +37073,9 @@
37073
37073
  }
37074
37074
  };
37075
37075
  const growCenterOut = (element, options, animationParameters) => {
37076
- const width = element.getGraphicAttribute("width", !1),
37076
+ const x1 = element.getGraphicAttribute("x1", !1),
37077
+ y1 = element.getGraphicAttribute("y1", !1),
37078
+ width = element.getGraphicAttribute("width", !1),
37077
37079
  height = element.getGraphicAttribute("height", !1),
37078
37080
  computedX = element.getGraphicItem().attribute.x,
37079
37081
  computedWidth = element.getGraphicItem().attribute.width,
@@ -37084,16 +37086,15 @@
37084
37086
  return {
37085
37087
  to: {
37086
37088
  x: computedX + computedWidth / 2,
37087
- x1: computedX + computedWidth / 2,
37088
- width: isNil(width) ? void 0 : 0,
37089
- height: height
37089
+ x1: isNil(x1) ? void 0 : computedX + computedWidth / 2,
37090
+ width: isNil(width) ? void 0 : 0
37090
37091
  }
37091
37092
  };
37092
37093
  case "y":
37093
37094
  return {
37094
37095
  to: {
37095
37096
  y: computedY + computedHeight / 2,
37096
- y1: computedY + computedHeight / 2,
37097
+ y1: isNil(y1) ? void 0 : computedY + computedHeight / 2,
37097
37098
  height: isNil(height) ? void 0 : 0
37098
37099
  }
37099
37100
  };
@@ -37101,9 +37102,9 @@
37101
37102
  return {
37102
37103
  to: {
37103
37104
  x: computedX + computedWidth / 2,
37104
- x1: computedX + computedWidth / 2,
37105
37105
  y: computedY + computedHeight / 2,
37106
- y1: computedY + computedHeight / 2,
37106
+ x1: isNil(x1) ? void 0 : computedX + computedWidth / 2,
37107
+ y1: isNil(y1) ? void 0 : computedY + computedHeight / 2,
37107
37108
  width: isNil(width) ? void 0 : 0,
37108
37109
  height: isNil(height) ? void 0 : 0
37109
37110
  }
@@ -37119,7 +37120,7 @@
37119
37120
  return "negative" === (null == options ? void 0 : options.orient) ? {
37120
37121
  from: {
37121
37122
  x: computedX1,
37122
- x1: computedX1,
37123
+ x1: isNil(x1) ? void 0 : computedX1,
37123
37124
  width: isNil(width) ? void 0 : 0
37124
37125
  },
37125
37126
  to: {
@@ -37130,7 +37131,7 @@
37130
37131
  } : {
37131
37132
  from: {
37132
37133
  x: computedX,
37133
- x1: computedX,
37134
+ x1: isNil(x1) ? void 0 : computedX,
37134
37135
  width: isNil(width) ? void 0 : 0
37135
37136
  },
37136
37137
  to: {
@@ -37152,7 +37153,7 @@
37152
37153
  return {
37153
37154
  from: {
37154
37155
  x: overallValue,
37155
- x1: overallValue,
37156
+ x1: isNil(x1) ? void 0 : overallValue,
37156
37157
  width: isNil(width) ? void 0 : 0
37157
37158
  },
37158
37159
  to: {
@@ -37167,25 +37168,27 @@
37167
37168
  return !1 !== (null !== (_a = null == options ? void 0 : options.overall) && void 0 !== _a && _a) ? growWidthInOverall(element, options, animationParameters) : growWidthInIndividual(element, options);
37168
37169
  };
37169
37170
  function growWidthOutIndividual(element, options, animationParameters) {
37170
- const width = element.getGraphicAttribute("width", !1),
37171
+ const x1 = element.getGraphicAttribute("x1", !1),
37172
+ width = element.getGraphicAttribute("width", !1),
37171
37173
  computedX = element.getGraphicItem().attribute.x,
37172
37174
  computedX1 = computedX + element.getGraphicItem().attribute.width;
37173
37175
  return "negative" === (null == options ? void 0 : options.orient) ? {
37174
37176
  to: {
37175
37177
  x: computedX1,
37176
- x1: computedX1,
37178
+ x1: isNil(x1) ? void 0 : computedX1,
37177
37179
  width: isNil(width) ? void 0 : 0
37178
37180
  }
37179
37181
  } : {
37180
37182
  to: {
37181
37183
  x: computedX,
37182
- x1: computedX,
37184
+ x1: isNil(x1) ? void 0 : computedX,
37183
37185
  width: isNil(width) ? void 0 : 0
37184
37186
  }
37185
37187
  };
37186
37188
  }
37187
37189
  function growWidthOutOverall(element, options, animationParameters) {
37188
- const width = element.getGraphicAttribute("width", !1);
37190
+ const x1 = element.getGraphicAttribute("x1", !1),
37191
+ width = element.getGraphicAttribute("width", !1);
37189
37192
  let overallValue;
37190
37193
  if ("negative" === (null == options ? void 0 : options.orient)) {
37191
37194
  const groupRight = animationParameters.group ? animationParameters.group.getBounds().width() : animationParameters.width;
@@ -37194,7 +37197,7 @@
37194
37197
  return {
37195
37198
  to: {
37196
37199
  x: overallValue,
37197
- x1: overallValue,
37200
+ x1: isNil(x1) ? void 0 : overallValue,
37198
37201
  width: isNil(width) ? void 0 : 0
37199
37202
  }
37200
37203
  };
@@ -37212,7 +37215,7 @@
37212
37215
  return "negative" === (null == options ? void 0 : options.orient) ? {
37213
37216
  from: {
37214
37217
  y: computedY1,
37215
- y1: computedY1,
37218
+ y1: isNil(y1) ? void 0 : computedY1,
37216
37219
  height: isNil(height) ? void 0 : 0
37217
37220
  },
37218
37221
  to: {
@@ -37223,7 +37226,7 @@
37223
37226
  } : {
37224
37227
  from: {
37225
37228
  y: computedY,
37226
- y1: computedY,
37229
+ y1: isNil(y1) ? void 0 : computedY,
37227
37230
  height: isNil(height) ? void 0 : 0
37228
37231
  },
37229
37232
  to: {
@@ -37245,7 +37248,7 @@
37245
37248
  return {
37246
37249
  from: {
37247
37250
  y: overallValue,
37248
- y1: overallValue,
37251
+ y1: isNil(y1) ? void 0 : overallValue,
37249
37252
  height: isNil(height) ? void 0 : 0
37250
37253
  },
37251
37254
  to: {
@@ -37260,25 +37263,27 @@
37260
37263
  return !1 !== (null !== (_a = null == options ? void 0 : options.overall) && void 0 !== _a && _a) ? growHeightInOverall(element, options, animationParameters) : growHeightInIndividual(element, options);
37261
37264
  };
37262
37265
  function growHeightOutIndividual(element, options, animationParameters) {
37263
- const height = element.getGraphicAttribute("height", !1),
37266
+ const y1 = element.getGraphicAttribute("y1", !1),
37267
+ height = element.getGraphicAttribute("height", !1),
37264
37268
  computedY = element.getGraphicItem().attribute.y,
37265
37269
  computedY1 = computedY + element.getGraphicItem().attribute.height;
37266
37270
  return "negative" === (null == options ? void 0 : options.orient) ? {
37267
37271
  to: {
37268
37272
  y: computedY1,
37269
- y1: computedY1,
37273
+ y1: isNil(y1) ? void 0 : computedY1,
37270
37274
  height: isNil(height) ? void 0 : 0
37271
37275
  }
37272
37276
  } : {
37273
37277
  to: {
37274
37278
  y: computedY,
37275
- y1: computedY,
37279
+ y1: isNil(y1) ? void 0 : computedY,
37276
37280
  height: isNil(height) ? void 0 : 0
37277
37281
  }
37278
37282
  };
37279
37283
  }
37280
37284
  function growHeightOutOverall(element, options, animationParameters) {
37281
- const height = element.getGraphicAttribute("height", !1);
37285
+ const y1 = element.getGraphicAttribute("y1", !1),
37286
+ height = element.getGraphicAttribute("height", !1);
37282
37287
  let overallValue;
37283
37288
  if ("negative" === (null == options ? void 0 : options.orient)) {
37284
37289
  const groupBottom = animationParameters.group ? animationParameters.group.getBounds().height() : animationParameters.height;
@@ -37287,7 +37292,7 @@
37287
37292
  return {
37288
37293
  to: {
37289
37294
  y: overallValue,
37290
- y1: overallValue,
37295
+ y1: isNil(y1) ? void 0 : overallValue,
37291
37296
  height: isNil(height) ? void 0 : 0
37292
37297
  }
37293
37298
  };
@@ -39012,7 +39017,8 @@
39012
39017
  return isNil(stateAnimationCounts) || Object.values(stateAnimationCounts).every(count => 0 === count);
39013
39018
  }
39014
39019
  getAnimatorCount() {
39015
- return this.animators.size;
39020
+ let count = 0;
39021
+ return this.animators.forEach(animators => count += animators.length), count;
39016
39022
  }
39017
39023
  getElementAnimators(element, animationState) {
39018
39024
  var _a;
@@ -39749,6 +39755,10 @@
39749
39755
  this.encodeState(state, spec.encode[state]);
39750
39756
  }), this.animation(spec.animation), this.animationState(spec.animationState), this.morph(spec.morph, spec.morphKey, spec.morphElementKey), this.layout(spec.layout), this.configure(spec), this.transform(spec.transform), this.parseAddition(spec), this.spec = spec, this.markType = spec.type, this.commit(), this;
39751
39757
  }
39758
+ parameters() {
39759
+ var _a;
39760
+ return null !== (_a = this._finalParameters) && void 0 !== _a ? _a : super.parameters();
39761
+ }
39752
39762
  parseAddition(spec) {
39753
39763
  return this;
39754
39764
  }
@@ -39863,7 +39873,7 @@
39863
39873
  getAllElements() {
39864
39874
  const elements = this.elements.slice();
39865
39875
  return this.elementMap.forEach(element => {
39866
- element.diffState === DiffState.exit && elements.push(element);
39876
+ element.diffState !== DiffState.exit || elements.includes(element) || elements.push(element);
39867
39877
  }), this.spec.sort && elements.sort((elementA, elementB) => this.spec.sort(elementA.getDatum(), elementB.getDatum())), elements;
39868
39878
  }
39869
39879
  getScalesByChannel() {
@@ -40168,10 +40178,10 @@
40168
40178
  super.clear(), this.transforms = null, this.elementMap = null, this.elements = null, this.graphicItem = null, this.animate = null, null === (_a = this.group) || void 0 === _a || _a.removeChild(this), this.group = null;
40169
40179
  }
40170
40180
  prepareRelease() {
40171
- this.animate.stop(), this.elementMap.forEach(element => element.diffState = DiffState.exit);
40181
+ this.animate.stop(), this.elementMap.forEach(element => element.diffState = DiffState.exit), this._finalParameters = this.parameters();
40172
40182
  }
40173
40183
  release() {
40174
- this.releaseEvent(), this.elements.forEach(element => element.release()), this.elementMap.clear(), this.animate && this.animate.release(), this.graphicItem && removeGraphicItem(this.graphicItem), this.detachAll(), super.release();
40184
+ this.releaseEvent(), this.elements.forEach(element => element.release()), this.elementMap.clear(), this._finalParameters = null, this.animate && this.animate.release(), this.graphicItem && removeGraphicItem(this.graphicItem), this.detachAll(), super.release();
40175
40185
  }
40176
40186
  }
40177
40187
 
@@ -49895,6 +49905,10 @@
49895
49905
  removeChild(mark) {
49896
49906
  return this.children = this.children.filter(child => child !== mark), this;
49897
49907
  }
49908
+ includesChild(mark) {
49909
+ let descendant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
49910
+ return !!this.children.includes(mark) || !!descendant && this.children.some(child => child.markType === GrammarMarkType.group && child.includesChild(mark, !0));
49911
+ }
49898
49912
  updateLayoutChildren() {
49899
49913
  return this.children.length ? (this.layoutChildren || (this.layoutChildren = []), this.layoutChildren = this.children.filter(child => child.needLayout()), this) : this;
49900
49914
  }
@@ -50655,7 +50669,7 @@
50655
50669
  var _a, _b;
50656
50670
  const grammarType = grammar.grammarType,
50657
50671
  key = this._mapKey(grammar);
50658
- this._grammarMap[grammarType] ? (this._grammars[grammarType].push(grammar), isNil(key) || (this._grammarMap[grammarType][key] ? null === (_a = this._warning) || void 0 === _a || _a.call(this, key, grammar) : this._grammarMap[grammarType][key] = grammar)) : (this._grammars.customized.push(grammar), isNil(key) || (this._grammarMap.customized[key] ? null === (_b = this._warning) || void 0 === _b || _b.call(this, key, grammar) : this._grammarMap.customized[key] = grammar)), this._size += 1;
50672
+ return this._grammarMap[grammarType] ? (this._grammars[grammarType].push(grammar), isNil(key) || (this._grammarMap[grammarType][key] ? null === (_a = this._warning) || void 0 === _a || _a.call(this, key, grammar) : this._grammarMap[grammarType][key] = grammar)) : (this._grammars.customized.push(grammar), isNil(key) || (this._grammarMap.customized[key] ? null === (_b = this._warning) || void 0 === _b || _b.call(this, key, grammar) : this._grammarMap.customized[key] = grammar)), this._size += 1, this;
50659
50673
  }
50660
50674
  unrecord(grammar) {
50661
50675
  const grammarType = grammar.grammarType,
@@ -50747,6 +50761,46 @@
50747
50761
  this._size = 0, this._grammars = null, this._grammarMap = null;
50748
50762
  }
50749
50763
  }
50764
+ class RecordedTreeGrammars extends RecordedGrammars {
50765
+ constructor() {
50766
+ super(...arguments), this._markNodes = [];
50767
+ }
50768
+ record(grammar) {
50769
+ if (super.record(grammar), "mark" === grammar.grammarType) {
50770
+ const mark = grammar,
50771
+ currentNode = {
50772
+ mark: mark,
50773
+ parent: null,
50774
+ children: []
50775
+ };
50776
+ this._markNodes.forEach(node => {
50777
+ const targetMark = node.mark;
50778
+ targetMark.markType === GrammarMarkType.group && targetMark.includesChild(mark, !1) ? (node.children.push(currentNode), currentNode.parent = node) : mark.markType === GrammarMarkType.group && mark.includesChild(targetMark, !1) && (currentNode.children.push(node), node.parent = currentNode);
50779
+ }), this._markNodes.push(currentNode);
50780
+ }
50781
+ return this;
50782
+ }
50783
+ unrecord(grammar) {
50784
+ if (super.unrecord(grammar), "mark" === grammar.grammarType) {
50785
+ const mark = grammar,
50786
+ currentNode = this._markNodes.find(node => node.mark === mark);
50787
+ this._markNodes.forEach(node => {
50788
+ const targetMark = node.mark;
50789
+ targetMark.markType === GrammarMarkType.group && targetMark.includesChild(mark, !1) ? (node.children = node.children.filter(n => n !== currentNode), currentNode.parent = null) : mark.markType === GrammarMarkType.group && mark.includesChild(targetMark, !1) && (currentNode.children = currentNode.children.filter(n => n !== node), node.parent = null);
50790
+ }), this._markNodes = this._markNodes.filter(n => n !== currentNode);
50791
+ }
50792
+ return this;
50793
+ }
50794
+ getAllMarkNodes() {
50795
+ return this._markNodes;
50796
+ }
50797
+ clear() {
50798
+ super.clear(), this._markNodes = [];
50799
+ }
50800
+ release() {
50801
+ super.release(), this._markNodes = null;
50802
+ }
50803
+ }
50750
50804
 
50751
50805
  class ViewAnimate {
50752
50806
  constructor(view) {
@@ -51118,7 +51172,7 @@
51118
51172
  }
51119
51173
  removeGrammar(grammar) {
51120
51174
  const recordedGrammar = isString(grammar) ? this.getGrammarById(grammar) : grammar;
51121
- return recordedGrammar && this.grammars.find(storedGrammar => storedGrammar.uid === recordedGrammar.uid) ? (this._cachedGrammars.record(recordedGrammar), this._dataflow.remove(recordedGrammar), this.grammars.unrecord(recordedGrammar), this) : this;
51175
+ return recordedGrammar && this.grammars.find(storedGrammar => storedGrammar.uid === recordedGrammar.uid) ? ("mark" === recordedGrammar.grammarType && recordedGrammar.prepareRelease(), this._cachedGrammars.record(recordedGrammar), this._dataflow.remove(recordedGrammar), this.grammars.unrecord(recordedGrammar), this) : this;
51122
51176
  }
51123
51177
  removeAllGrammars() {
51124
51178
  return this.grammars.traverse(grammar => {
@@ -51357,12 +51411,23 @@
51357
51411
  }
51358
51412
  releaseCachedGrammars() {
51359
51413
  this._cachedGrammars.traverse(grammar => {
51360
- if ("mark" === grammar.grammarType) {
51361
- const mark = grammar;
51362
- mark.prepareRelease(), mark.animate.animate(), 0 === mark.animate.getAnimatorCount() ? mark.release() : mark.addEventListener("animationEnd", event => {
51363
- 0 === mark.animate.getAnimatorCount() && mark.release();
51364
- });
51365
- } else grammar.release();
51414
+ "mark" !== grammar.grammarType && grammar.release();
51415
+ });
51416
+ const markNodes = this._cachedGrammars.getAllMarkNodes(),
51417
+ releaseUp = node => {
51418
+ if (node.mark.view && 0 === node.mark.animate.getAnimatorCount() && (!node.children || 0 === node.children.length)) {
51419
+ node.mark.release();
51420
+ const parent = node.parent;
51421
+ parent && (node.parent.children = node.parent.children.filter(n => n !== node), node.parent = null, releaseUp(parent));
51422
+ }
51423
+ };
51424
+ markNodes.forEach(node => {
51425
+ node.mark.animate.animate();
51426
+ }), markNodes.forEach(node => {
51427
+ const mark = node.mark;
51428
+ 0 === mark.animate.getAnimatorCount() ? releaseUp(node) : mark.addEventListener("animationEnd", () => {
51429
+ 0 === mark.animate.getAnimatorCount() && releaseUp(node);
51430
+ });
51366
51431
  }), this._cachedGrammars.clear();
51367
51432
  }
51368
51433
  runAfter(callback) {
@@ -51574,7 +51639,7 @@
51574
51639
  }
51575
51640
  initialize() {
51576
51641
  var _a;
51577
- this.grammars = new RecordedGrammars(grammar => grammar.id(), (key, grammar) => this.logger.warn(`Grammar id '${key}' has been occupied`, grammar)), this._cachedGrammars = new RecordedGrammars(grammar => grammar.id()), this._options.logger && Logger.setInstance(this._options.logger), this.logger = Logger.getInstance(null !== (_a = this._options.logLevel) && void 0 !== _a ? _a : 0), this._dataflow = new Dataflow(), this.animate = new ViewAnimate(this), this._morph = new Morph(), this._options.hooks && (Object.keys(this._options.hooks).forEach(key => {
51642
+ this.grammars = new RecordedGrammars(grammar => grammar.id(), (key, grammar) => this.logger.warn(`Grammar id '${key}' has been occupied`, grammar)), this._cachedGrammars = new RecordedTreeGrammars(grammar => grammar.id()), this._options.logger && Logger.setInstance(this._options.logger), this.logger = Logger.getInstance(null !== (_a = this._options.logLevel) && void 0 !== _a ? _a : 0), this._dataflow = new Dataflow(), this.animate = new ViewAnimate(this), this._morph = new Morph(), this._options.hooks && (Object.keys(this._options.hooks).forEach(key => {
51578
51643
  this.on(key, this._options.hooks[key]);
51579
51644
  }), this.hooks = this._options.hooks), this.container = null, this.renderer = null, this._globalCursor = !1, this._eventListeners = [], this._eventConfig = initializeEventConfig(this._options.eventConfig), this.globalCursor(this._eventConfig.globalCursor), this._background = this._options.background, this.parseBuiltIn(), configureEnvironment(this._options), this.initializeRenderer(), this._eventConfig.disable || this.initEvent(), this.initializeBuiltEvents(), this._currentDataflow = null, this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before;
51580
51645
  }
@@ -51704,6 +51769,7 @@
51704
51769
  ChartEvent["drill"] = "drill";
51705
51770
  ChartEvent["layoutStart"] = "layoutStart";
51706
51771
  ChartEvent["layoutEnd"] = "layoutEnd";
51772
+ ChartEvent["layoutRectUpdate"] = "layoutRectUpdate";
51707
51773
  ChartEvent["playerPlay"] = "playerPlay";
51708
51774
  ChartEvent["playerPause"] = "playerPause";
51709
51775
  ChartEvent["playerEnd"] = "playerEnd";
@@ -54385,7 +54451,7 @@
54385
54451
  });
54386
54452
  }
54387
54453
  else if (Array.isArray(values)) {
54388
- dataView.parse(values);
54454
+ dataView.parse(cloneDeep(values));
54389
54455
  }
54390
54456
  else if (isString(values) &&
54391
54457
  (!parser || parser.type === 'csv' || parser.type === 'dsv' || parser.type === 'tsv')) {
@@ -55886,6 +55952,9 @@
55886
55952
  layoutLevel = LayoutLevel.Region;
55887
55953
  layoutZIndex = 0;
55888
55954
  chartLayoutRect;
55955
+ getVisible() {
55956
+ return this._spec?.visible !== false;
55957
+ }
55889
55958
  _setLayoutAttributeFromSpec(spec, chartViewRect) {
55890
55959
  if (this._spec.visible !== false) {
55891
55960
  const padding = normalizeLayoutPaddingSpec(spec.padding);
@@ -57271,9 +57340,8 @@
57271
57340
  };
57272
57341
  const rightCurrent = this._chartViewBox.x2 - this._chartViewBox.x1 - this._rightCurrent;
57273
57342
  const bottomCurrent = this._chartViewBox.y2 - this._chartViewBox.y1 - this._bottomCurrent;
57274
- items.filter;
57275
57343
  items.forEach(i => {
57276
- if (!i.getAutoIndent()) {
57344
+ if (!i.getVisible() || !i.getAutoIndent()) {
57277
57345
  return;
57278
57346
  }
57279
57347
  const vOrH = i.layoutOrient === 'left' || i.layoutOrient === 'right';
@@ -58345,7 +58413,7 @@
58345
58413
  VChart.useMark([ComponentMark, GroupMark, ImageMark]);
58346
58414
  Factory.registerRegion('region', Region);
58347
58415
  Factory.registerLayout('base', Layout);
58348
- const version = "1.2.1-alpha.2";
58416
+ const version = "1.2.1";
58349
58417
  Logger.getInstance(LoggerLevel.Error);
58350
58418
 
58351
58419
  var SeriesMarkNameEnum;
@@ -59580,6 +59648,7 @@
59580
59648
  this._layoutRect.height = viewRect.height - this.padding.top - this.padding.bottom;
59581
59649
  this._layoutRect.x = this.padding.left;
59582
59650
  this._layoutRect.y = this.padding.top;
59651
+ this._event.emit(ChartEvent.layoutRectUpdate, {});
59583
59652
  }
59584
59653
  getCurrentTheme() {
59585
59654
  return this._theme;
@@ -81080,6 +81149,7 @@
81080
81149
  _axisStyle;
81081
81150
  _latestBounds;
81082
81151
  _verticalLimitSize;
81152
+ _layoutCache = { width: 0, height: 0, _lastComputeOutBounds: { x1: 0, x2: 0, y1: 0, y2: 0 } };
81083
81153
  constructor(spec, options) {
81084
81154
  super(spec, {
81085
81155
  ...options
@@ -81434,7 +81504,7 @@
81434
81504
  }
81435
81505
  result.width = Math.ceil(result.width);
81436
81506
  result.height = Math.ceil(result.height);
81437
- return this._setRectInSpec(result);
81507
+ return this._setRectInSpec(this._layoutCacheProcessing(result));
81438
81508
  }
81439
81509
  boundsInRect(rect) {
81440
81510
  let result = { x1: 0, y1: 0, x2: 0, y2: 0 };
@@ -81586,6 +81656,9 @@
81586
81656
  super.initEvent();
81587
81657
  if (this.visible) {
81588
81658
  this.event.on(ChartEvent.layoutEnd, this._fixAxisOnZero);
81659
+ this.event.on(ChartEvent.layoutRectUpdate, () => {
81660
+ this._clearLayoutCache();
81661
+ });
81589
81662
  }
81590
81663
  }
81591
81664
  _fixAxisOnZero = () => {
@@ -81637,6 +81710,33 @@
81637
81710
  }
81638
81711
  }
81639
81712
  };
81713
+ _layoutCacheProcessing(rect) {
81714
+ ['width', 'height'].forEach(key => {
81715
+ if (rect[key] < this._layoutCache[key]) {
81716
+ rect[key] = this._layoutCache[key];
81717
+ }
81718
+ else {
81719
+ this._layoutCache[key] = rect[key];
81720
+ }
81721
+ });
81722
+ ['x1', 'x2', 'y1', 'y2'].forEach(key => {
81723
+ if (this._lastComputeOutBounds[key] < this._layoutCache._lastComputeOutBounds[key]) {
81724
+ this._lastComputeOutBounds[key] = this._layoutCache._lastComputeOutBounds[key];
81725
+ }
81726
+ else {
81727
+ this._layoutCache._lastComputeOutBounds[key] = this._lastComputeOutBounds[key];
81728
+ }
81729
+ });
81730
+ return rect;
81731
+ }
81732
+ _clearLayoutCache() {
81733
+ this._layoutCache.width = 0;
81734
+ this._layoutCache.height = 0;
81735
+ this._layoutCache._lastComputeOutBounds = { x1: 0, x2: 0, y1: 0, y2: 0 };
81736
+ }
81737
+ onDataUpdate() {
81738
+ this._clearLayoutCache();
81739
+ }
81640
81740
  }
81641
81741
 
81642
81742
  const e10 = Math.sqrt(50);