@visactor/vchart 1.4.0-beta.2 → 1.4.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 (237) hide show
  1. package/build/es5/index.js +2 -2
  2. package/build/index.js +971 -523
  3. package/build/index.min.js +2 -2
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/base-chart.js +2 -1
  6. package/cjs/chart/base-chart.js.map +1 -1
  7. package/cjs/chart/stack.d.ts +0 -4
  8. package/cjs/chart/stack.js +8 -52
  9. package/cjs/chart/stack.js.map +1 -1
  10. package/cjs/compile/mark/compilable-mark.js +4 -2
  11. package/cjs/compile/mark/compilable-mark.js.map +1 -1
  12. package/cjs/compile/mark/interface.d.ts +1 -0
  13. package/cjs/compile/mark/interface.js.map +1 -1
  14. package/cjs/component/axis/base-axis.d.ts +1 -0
  15. package/cjs/component/axis/base-axis.js +5 -1
  16. package/cjs/component/axis/base-axis.js.map +1 -1
  17. package/cjs/component/axis/cartesian/band-axis.js +8 -3
  18. package/cjs/component/axis/cartesian/band-axis.js.map +1 -1
  19. package/cjs/component/axis/cartesian/interface/spec.d.ts +1 -0
  20. package/cjs/component/axis/cartesian/interface/spec.js.map +1 -1
  21. package/cjs/component/axis/cartesian/util/common.d.ts +2 -0
  22. package/cjs/component/axis/cartesian/util/common.js +14 -2
  23. package/cjs/component/axis/cartesian/util/common.js.map +1 -1
  24. package/cjs/component/base/base-component.d.ts +1 -0
  25. package/cjs/component/base/base-component.js +11 -3
  26. package/cjs/component/base/base-component.js.map +1 -1
  27. package/cjs/component/brush/brush.d.ts +3 -0
  28. package/cjs/component/brush/brush.js +34 -12
  29. package/cjs/component/brush/brush.js.map +1 -1
  30. package/cjs/component/crosshair/cartesian.d.ts +2 -1
  31. package/cjs/component/crosshair/cartesian.js +2 -6
  32. package/cjs/component/crosshair/cartesian.js.map +1 -1
  33. package/cjs/component/crosshair/polar.d.ts +2 -1
  34. package/cjs/component/crosshair/polar.js +2 -6
  35. package/cjs/component/crosshair/polar.js.map +1 -1
  36. package/cjs/component/custom-mark/custom-mark.d.ts +2 -0
  37. package/cjs/component/custom-mark/custom-mark.js +3 -0
  38. package/cjs/component/custom-mark/custom-mark.js.map +1 -1
  39. package/cjs/component/data-zoom/data-filter-base-component.d.ts +6 -0
  40. package/cjs/component/data-zoom/data-filter-base-component.js +15 -7
  41. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  42. package/cjs/component/data-zoom/data-zoom/data-zoom.d.ts +2 -2
  43. package/cjs/component/data-zoom/data-zoom/data-zoom.js +2 -4
  44. package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  45. package/cjs/component/data-zoom/scroll-bar/scroll-bar.d.ts +2 -1
  46. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js +2 -4
  47. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  48. package/cjs/component/geo/geo-coordinate.d.ts +2 -0
  49. package/cjs/component/geo/geo-coordinate.js +3 -0
  50. package/cjs/component/geo/geo-coordinate.js.map +1 -1
  51. package/cjs/component/indicator/indicator.d.ts +2 -0
  52. package/cjs/component/indicator/indicator.js +4 -3
  53. package/cjs/component/indicator/indicator.js.map +1 -1
  54. package/cjs/component/interface/common.d.ts +2 -0
  55. package/cjs/component/interface/common.js.map +1 -1
  56. package/cjs/component/label/base-label.d.ts +2 -0
  57. package/cjs/component/label/base-label.js +3 -0
  58. package/cjs/component/label/base-label.js.map +1 -1
  59. package/cjs/component/legend/base-legend.d.ts +1 -0
  60. package/cjs/component/legend/base-legend.js +17 -12
  61. package/cjs/component/legend/base-legend.js.map +1 -1
  62. package/cjs/component/map-label/component.d.ts +2 -0
  63. package/cjs/component/map-label/component.js +3 -0
  64. package/cjs/component/map-label/component.js.map +1 -1
  65. package/cjs/component/marker/base-marker.d.ts +2 -1
  66. package/cjs/component/marker/base-marker.js +2 -4
  67. package/cjs/component/marker/base-marker.js.map +1 -1
  68. package/cjs/component/player/player.d.ts +2 -1
  69. package/cjs/component/player/player.js +2 -4
  70. package/cjs/component/player/player.js.map +1 -1
  71. package/cjs/component/title/title.d.ts +2 -0
  72. package/cjs/component/title/title.js +6 -4
  73. package/cjs/component/title/title.js.map +1 -1
  74. package/cjs/component/tooltip/handler/base.d.ts +1 -1
  75. package/cjs/component/tooltip/tooltip.d.ts +2 -0
  76. package/cjs/component/tooltip/tooltip.js +3 -0
  77. package/cjs/component/tooltip/tooltip.js.map +1 -1
  78. package/cjs/core/index.d.ts +1 -1
  79. package/cjs/core/index.js +1 -1
  80. package/cjs/core/index.js.map +1 -1
  81. package/cjs/layout/base-layout.d.ts +5 -5
  82. package/cjs/layout/base-layout.js +52 -96
  83. package/cjs/layout/base-layout.js.map +1 -1
  84. package/cjs/layout/layout3d/index.d.ts +1 -1
  85. package/cjs/layout/layout3d/index.js +22 -22
  86. package/cjs/layout/layout3d/index.js.map +1 -1
  87. package/cjs/layout/util.d.ts +6 -0
  88. package/cjs/layout/util.js +220 -0
  89. package/cjs/layout/util.js.map +1 -0
  90. package/cjs/mark/cell.js +1 -1
  91. package/cjs/model/interface.d.ts +1 -0
  92. package/cjs/model/interface.js.map +1 -1
  93. package/cjs/region/interface.d.ts +6 -0
  94. package/cjs/region/interface.js.map +1 -1
  95. package/cjs/region/region.d.ts +7 -0
  96. package/cjs/region/region.js +17 -1
  97. package/cjs/region/region.js.map +1 -1
  98. package/cjs/series/bar/bar.js +11 -30
  99. package/cjs/series/bar/bar.js.map +1 -1
  100. package/cjs/series/base/base-series.d.ts +1 -0
  101. package/cjs/series/base/base-series.js +7 -2
  102. package/cjs/series/base/base-series.js.map +1 -1
  103. package/cjs/series/interface/series.d.ts +2 -1
  104. package/cjs/series/interface/series.js.map +1 -1
  105. package/cjs/series/mixin/line-mixin.js +13 -6
  106. package/cjs/series/mixin/line-mixin.js.map +1 -1
  107. package/cjs/series/util/stack.d.ts +9 -0
  108. package/cjs/series/util/stack.js +31 -0
  109. package/cjs/series/util/stack.js.map +1 -0
  110. package/cjs/theme/builtin/common/component/legend/discrete-legend.js +8 -4
  111. package/cjs/theme/builtin/common/component/legend/discrete-legend.js.map +1 -1
  112. package/cjs/theme/builtin/common/component/mark-line.js +4 -4
  113. package/cjs/theme/builtin/common/component/mark-line.js.map +1 -1
  114. package/cjs/typings/spec/common.d.ts +3 -1
  115. package/cjs/typings/spec/common.js.map +1 -1
  116. package/cjs/typings/visual.d.ts +3 -6
  117. package/cjs/typings/visual.js.map +1 -1
  118. package/cjs/util/data.d.ts +25 -0
  119. package/cjs/util/data.js +73 -4
  120. package/cjs/util/data.js.map +1 -1
  121. package/esm/chart/base-chart.js +2 -1
  122. package/esm/chart/base-chart.js.map +1 -1
  123. package/esm/chart/stack.d.ts +0 -4
  124. package/esm/chart/stack.js +7 -55
  125. package/esm/chart/stack.js.map +1 -1
  126. package/esm/compile/mark/compilable-mark.js +5 -1
  127. package/esm/compile/mark/compilable-mark.js.map +1 -1
  128. package/esm/compile/mark/interface.d.ts +1 -0
  129. package/esm/compile/mark/interface.js.map +1 -1
  130. package/esm/component/axis/base-axis.d.ts +1 -0
  131. package/esm/component/axis/base-axis.js +5 -1
  132. package/esm/component/axis/base-axis.js.map +1 -1
  133. package/esm/component/axis/cartesian/band-axis.js +9 -2
  134. package/esm/component/axis/cartesian/band-axis.js.map +1 -1
  135. package/esm/component/axis/cartesian/interface/spec.d.ts +1 -0
  136. package/esm/component/axis/cartesian/interface/spec.js.map +1 -1
  137. package/esm/component/axis/cartesian/util/common.d.ts +2 -0
  138. package/esm/component/axis/cartesian/util/common.js +11 -0
  139. package/esm/component/axis/cartesian/util/common.js.map +1 -1
  140. package/esm/component/base/base-component.d.ts +1 -0
  141. package/esm/component/base/base-component.js +11 -3
  142. package/esm/component/base/base-component.js.map +1 -1
  143. package/esm/component/brush/brush.d.ts +3 -0
  144. package/esm/component/brush/brush.js +31 -9
  145. package/esm/component/brush/brush.js.map +1 -1
  146. package/esm/component/crosshair/cartesian.d.ts +2 -1
  147. package/esm/component/crosshair/cartesian.js +2 -6
  148. package/esm/component/crosshair/cartesian.js.map +1 -1
  149. package/esm/component/crosshair/polar.d.ts +2 -1
  150. package/esm/component/crosshair/polar.js +2 -6
  151. package/esm/component/crosshair/polar.js.map +1 -1
  152. package/esm/component/custom-mark/custom-mark.d.ts +2 -0
  153. package/esm/component/custom-mark/custom-mark.js +3 -0
  154. package/esm/component/custom-mark/custom-mark.js.map +1 -1
  155. package/esm/component/data-zoom/data-filter-base-component.d.ts +6 -0
  156. package/esm/component/data-zoom/data-filter-base-component.js +15 -7
  157. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  158. package/esm/component/data-zoom/data-zoom/data-zoom.d.ts +2 -2
  159. package/esm/component/data-zoom/data-zoom/data-zoom.js +2 -4
  160. package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  161. package/esm/component/data-zoom/scroll-bar/scroll-bar.d.ts +2 -1
  162. package/esm/component/data-zoom/scroll-bar/scroll-bar.js +2 -4
  163. package/esm/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  164. package/esm/component/geo/geo-coordinate.d.ts +2 -0
  165. package/esm/component/geo/geo-coordinate.js +3 -0
  166. package/esm/component/geo/geo-coordinate.js.map +1 -1
  167. package/esm/component/indicator/indicator.d.ts +2 -0
  168. package/esm/component/indicator/indicator.js +4 -3
  169. package/esm/component/indicator/indicator.js.map +1 -1
  170. package/esm/component/interface/common.d.ts +2 -0
  171. package/esm/component/interface/common.js.map +1 -1
  172. package/esm/component/label/base-label.d.ts +2 -0
  173. package/esm/component/label/base-label.js +3 -0
  174. package/esm/component/label/base-label.js.map +1 -1
  175. package/esm/component/legend/base-legend.d.ts +1 -0
  176. package/esm/component/legend/base-legend.js +17 -12
  177. package/esm/component/legend/base-legend.js.map +1 -1
  178. package/esm/component/map-label/component.d.ts +2 -0
  179. package/esm/component/map-label/component.js +3 -0
  180. package/esm/component/map-label/component.js.map +1 -1
  181. package/esm/component/marker/base-marker.d.ts +2 -1
  182. package/esm/component/marker/base-marker.js +2 -4
  183. package/esm/component/marker/base-marker.js.map +1 -1
  184. package/esm/component/player/player.d.ts +2 -1
  185. package/esm/component/player/player.js +2 -4
  186. package/esm/component/player/player.js.map +1 -1
  187. package/esm/component/title/title.d.ts +2 -0
  188. package/esm/component/title/title.js +6 -4
  189. package/esm/component/title/title.js.map +1 -1
  190. package/esm/component/tooltip/handler/base.d.ts +1 -1
  191. package/esm/component/tooltip/tooltip.d.ts +2 -0
  192. package/esm/component/tooltip/tooltip.js +3 -0
  193. package/esm/component/tooltip/tooltip.js.map +1 -1
  194. package/esm/core/index.d.ts +1 -1
  195. package/esm/core/index.js +1 -1
  196. package/esm/core/index.js.map +1 -1
  197. package/esm/layout/base-layout.d.ts +5 -5
  198. package/esm/layout/base-layout.js +53 -95
  199. package/esm/layout/base-layout.js.map +1 -1
  200. package/esm/layout/layout3d/index.d.ts +1 -1
  201. package/esm/layout/layout3d/index.js +22 -22
  202. package/esm/layout/layout3d/index.js.map +1 -1
  203. package/esm/layout/util.d.ts +6 -0
  204. package/esm/layout/util.js +211 -0
  205. package/esm/layout/util.js.map +1 -0
  206. package/esm/mark/cell.js +1 -1
  207. package/esm/model/interface.d.ts +1 -0
  208. package/esm/model/interface.js.map +1 -1
  209. package/esm/region/interface.d.ts +6 -0
  210. package/esm/region/interface.js.map +1 -1
  211. package/esm/region/region.d.ts +7 -0
  212. package/esm/region/region.js +17 -1
  213. package/esm/region/region.js.map +1 -1
  214. package/esm/series/bar/bar.js +13 -30
  215. package/esm/series/bar/bar.js.map +1 -1
  216. package/esm/series/base/base-series.d.ts +1 -0
  217. package/esm/series/base/base-series.js +7 -2
  218. package/esm/series/base/base-series.js.map +1 -1
  219. package/esm/series/interface/series.d.ts +2 -1
  220. package/esm/series/interface/series.js.map +1 -1
  221. package/esm/series/mixin/line-mixin.js +13 -6
  222. package/esm/series/mixin/line-mixin.js.map +1 -1
  223. package/esm/series/util/stack.d.ts +9 -0
  224. package/esm/series/util/stack.js +23 -0
  225. package/esm/series/util/stack.js.map +1 -0
  226. package/esm/theme/builtin/common/component/legend/discrete-legend.js +8 -4
  227. package/esm/theme/builtin/common/component/legend/discrete-legend.js.map +1 -1
  228. package/esm/theme/builtin/common/component/mark-line.js +4 -4
  229. package/esm/theme/builtin/common/component/mark-line.js.map +1 -1
  230. package/esm/typings/spec/common.d.ts +3 -1
  231. package/esm/typings/spec/common.js.map +1 -1
  232. package/esm/typings/visual.d.ts +3 -6
  233. package/esm/typings/visual.js.map +1 -1
  234. package/esm/util/data.d.ts +25 -0
  235. package/esm/util/data.js +69 -0
  236. package/esm/util/data.js.map +1 -1
  237. package/package.json +11 -11
package/build/index.js CHANGED
@@ -1510,7 +1510,7 @@
1510
1510
  function LinearToSRGB(c) {
1511
1511
  return c < .0031308 ? 12.92 * c : 1.055 * Math.pow(c, .41666) - .055;
1512
1512
  }
1513
- let Color$1 = class Color {
1513
+ let Color$2 = class Color {
1514
1514
  static Brighter(source) {
1515
1515
  let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
1516
1516
  return 1 === b ? source : new Color(source).brighter(b).toRGBA();
@@ -1729,7 +1729,7 @@
1729
1729
 
1730
1730
  var ColorUtil = /*#__PURE__*/Object.freeze({
1731
1731
  __proto__: null,
1732
- Color: Color$1,
1732
+ Color: Color$2,
1733
1733
  DEFAULT_COLORS: DEFAULT_COLORS,
1734
1734
  RGB: RGB,
1735
1735
  hexToRgb: hexToRgb,
@@ -6760,7 +6760,7 @@
6760
6760
  }
6761
6761
  }
6762
6762
 
6763
- const { Color } = ColorUtil;
6763
+ const { Color: Color$1 } = ColorUtil;
6764
6764
 
6765
6765
  const warn = (msg, detail) => {
6766
6766
  if (isFunction$1(config.warnHandler)) {
@@ -7111,15 +7111,15 @@
7111
7111
  let d0Fuc, r0Fuc;
7112
7112
  return d1 < d0 ? (d0Fuc = normalize$2(d1, d0), r0Fuc = interpolate(r1, r0)) : (d0Fuc = normalize$2(d0, d1), r0Fuc = interpolate(r0, r1)), x => r0Fuc(d0Fuc(x));
7113
7113
  }
7114
- function bandSpace(count, paddingInner, paddingOuter) {
7114
+ function bandSpace$1(count, paddingInner, paddingOuter) {
7115
7115
  let space;
7116
7116
  return space = 1 === count ? count + 2 * paddingOuter : count - paddingInner + 2 * paddingOuter, count ? space > 0 ? space : 1 : 0;
7117
7117
  }
7118
- function scaleWholeRangeSize(count, bandwidth, paddingInner, paddingOuter) {
7119
- return bandSpace(count, paddingInner, paddingOuter) * (bandwidth / (1 - paddingInner));
7118
+ function scaleWholeRangeSize$1(count, bandwidth, paddingInner, paddingOuter) {
7119
+ return bandSpace$1(count, paddingInner, paddingOuter) * (bandwidth / (1 - paddingInner));
7120
7120
  }
7121
7121
  function calculateBandwidthFromWholeRangeSize(count, wholeSize, paddingInner, paddingOuter, round) {
7122
- const space = bandSpace(count, paddingInner, paddingOuter);
7122
+ const space = bandSpace$1(count, paddingInner, paddingOuter);
7123
7123
  let step = wholeSize / Math.max(1, space || 1);
7124
7124
  round && (step = Math.floor(step));
7125
7125
  let bandwidth = step * (1 - paddingInner);
@@ -7196,7 +7196,7 @@
7196
7196
  reverse = wholeRange[1] < wholeRange[0];
7197
7197
  let start = wholeRange[Number(reverse) - 0];
7198
7198
  const stop = wholeRange[1 - Number(reverse)],
7199
- space = bandSpace(n, this._paddingInner, this._paddingOuter);
7199
+ space = bandSpace$1(n, this._paddingInner, this._paddingOuter);
7200
7200
  this._step = (stop - start) / Math.max(1, space || 1), this._round && (this._step = Math.floor(this._step)), start += (stop - start - this._step * (n - this._paddingInner)) * this._align, this.isBandwidthFixed() || (this._bandwidth = this._step * (1 - this._paddingInner)), this._round && (start = Math.round(start), this.isBandwidthFixed() || (this._bandwidth = Math.round(this._bandwidth)));
7201
7201
  const values = range(n).map(i => start + this._step * i);
7202
7202
  return super.range(reverse ? values.reverse() : values), this;
@@ -7209,7 +7209,7 @@
7209
7209
  autoBandwidth < this._minBandwidth ? (this._bandwidth = this._minBandwidth, this._isFixed = !0) : autoBandwidth > this._maxBandwidth ? (this._bandwidth = this._maxBandwidth, this._isFixed = !0) : (this._bandwidth = void 0, this._isFixed = !1);
7210
7210
  }
7211
7211
  if (this.isBandwidthFixed()) {
7212
- const wholeLength = scaleWholeRangeSize(super.domain().length, this._bandwidth, this._paddingInner, this._paddingOuter),
7212
+ const wholeLength = scaleWholeRangeSize$1(super.domain().length, this._bandwidth, this._paddingInner, this._paddingOuter),
7213
7213
  rangeFactorSize = Math.min((range[1] - range[0]) / wholeLength, 1);
7214
7214
  if (null === (_a = this._rangeFactor) || void 0 === _a ? void 0 : _a.length) {
7215
7215
  const [rangeFactorStart, rangeFactorEnd] = this._rangeFactor,
@@ -7335,13 +7335,13 @@
7335
7335
  if (isNil$1(b) || "boolean" === t) return () => b;
7336
7336
  if ("number" === t) return interpolateNumber(a, b);
7337
7337
  if ("string" === t) {
7338
- if (c = Color$1.parseColorString(b)) {
7339
- const rgb = interpolateRgb(Color$1.parseColorString(a), c);
7338
+ if (c = Color$2.parseColorString(b)) {
7339
+ const rgb = interpolateRgb(Color$2.parseColorString(a), c);
7340
7340
  return t => rgb(t).formatRgb();
7341
7341
  }
7342
7342
  return interpolateNumber(Number(a), Number(b));
7343
7343
  }
7344
- return b instanceof RGB ? interpolateRgb(a, b) : b instanceof Color$1 ? interpolateRgb(a.color, b.color) : b instanceof Date ? interpolateDate(a, b) : interpolateNumber(Number(a), Number(b));
7344
+ return b instanceof RGB ? interpolateRgb(a, b) : b instanceof Color$2 ? interpolateRgb(a.color, b.color) : b instanceof Date ? interpolateDate(a, b) : interpolateNumber(Number(a), Number(b));
7345
7345
  }
7346
7346
 
7347
7347
  class ContinuousScale extends BaseScale {
@@ -19912,7 +19912,8 @@
19912
19912
  }
19913
19913
  ResourceLoader.cache = new Map();
19914
19914
 
19915
- const tempMatrix = new Matrix();
19915
+ const tempMatrix = new Matrix(),
19916
+ tempBounds$1 = new AABBBounds();
19916
19917
  const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "lineCap", "lineJoin", "miterLimit", "scaleX", "scaleY", "angle", "anchor"];
19917
19918
  const tempConstantXYKey = ["x", "y"],
19918
19919
  tempConstantScaleXYKey = ["scaleX", "scaleY"],
@@ -20234,9 +20235,18 @@
20234
20235
  var _a, _b, _c, _d;
20235
20236
  if (hasAnimation) {
20236
20237
  const keys = Object.keys(attrs),
20237
- animateAttrs = isClear ? keys.reduce((res, key) => (res[key] = void 0 === attrs[key] ? this.getDefaultAttribute(key) : attrs[key], res), {}) : attrs,
20238
- animate = this.animate();
20239
- animate.stateNames = stateNames, animate.to(animateAttrs, null !== (_b = null === (_a = this.stateAnimateConfig) || void 0 === _a ? void 0 : _a.duration) && void 0 !== _b ? _b : DefaultStateAnimateConfig.duration, null !== (_d = null === (_c = this.stateAnimateConfig) || void 0 === _c ? void 0 : _c.easing) && void 0 !== _d ? _d : DefaultStateAnimateConfig.easing);
20238
+ noWorkAAttr = this.getNoWorkAnimateAttr(),
20239
+ animateAttrs = {};
20240
+ let noAnimateAttrs;
20241
+ isClear ? keys.forEach(key => {
20242
+ noWorkAAttr[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = void 0 === attrs[key] ? this.getDefaultAttribute(key) : attrs[key];
20243
+ }) : keys.forEach(key => {
20244
+ noWorkAAttr[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = attrs[key];
20245
+ });
20246
+ const animate = this.animate();
20247
+ animate.stateNames = stateNames, animate.to(animateAttrs, null !== (_b = null === (_a = this.stateAnimateConfig) || void 0 === _a ? void 0 : _a.duration) && void 0 !== _b ? _b : DefaultStateAnimateConfig.duration, null !== (_d = null === (_c = this.stateAnimateConfig) || void 0 === _c ? void 0 : _c.easing) && void 0 !== _d ? _d : DefaultStateAnimateConfig.easing), noAnimateAttrs && this.setAttributes(noAnimateAttrs, !1, {
20248
+ type: AttributeUpdateType.STATE
20249
+ });
20240
20250
  } else this.setAttributes(attrs, !1, {
20241
20251
  type: AttributeUpdateType.STATE
20242
20252
  });
@@ -20330,35 +20340,55 @@
20330
20340
  needUpdateLayout() {
20331
20341
  return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);
20332
20342
  }
20343
+ getAnchor(anchor, params) {
20344
+ const _anchor = [0, 0],
20345
+ getBounds = () => {
20346
+ if (params.b) return params.b;
20347
+ const {
20348
+ scaleX: scaleX,
20349
+ scaleY: scaleY,
20350
+ angle: angle
20351
+ } = this.attribute;
20352
+ return tempBounds$1.copy(this._AABBBounds), this.setAttributes({
20353
+ scaleX: 1,
20354
+ scaleY: 1,
20355
+ angle: 0
20356
+ }), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds$1), this.setAttributes({
20357
+ scaleX: scaleX,
20358
+ scaleY: scaleY,
20359
+ angle: angle
20360
+ }), params.b;
20361
+ };
20362
+ if ("string" == typeof anchor[0]) {
20363
+ const ratio = parseFloat(anchor[0]) / 100,
20364
+ bounds = getBounds();
20365
+ _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
20366
+ } else _anchor[0] = anchor[0];
20367
+ if ("string" == typeof anchor[1]) {
20368
+ const ratio = parseFloat(anchor[1]) / 100,
20369
+ bounds = getBounds();
20370
+ _anchor[1] = bounds.y1 + (bounds.y2 - bounds.y1) * ratio;
20371
+ } else _anchor[1] = anchor[1];
20372
+ return _anchor;
20373
+ }
20333
20374
  doUpdateLocalMatrix() {
20334
20375
  const {
20335
- x = DefaultTransform.x,
20336
- y = DefaultTransform.y,
20337
- scaleX = DefaultTransform.scaleX,
20338
- scaleY = DefaultTransform.scaleY,
20339
- angle = DefaultTransform.angle,
20340
- scaleCenter: scaleCenter,
20341
- anchor: anchor,
20342
- postMatrix: postMatrix
20343
- } = this.attribute,
20344
- _anchor = [0, 0];
20345
- if (anchor) {
20346
- if ("string" == typeof anchor[0]) {
20347
- const ratio = parseFloat(anchor[0]) / 100,
20348
- bounds = this.AABBBounds;
20349
- _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
20350
- } else _anchor[0] = anchor[0];
20351
- if ("string" == typeof anchor[1]) {
20352
- const ratio = parseFloat(anchor[1]) / 100,
20353
- bounds = this.AABBBounds;
20354
- _anchor[1] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
20355
- } else _anchor[1] = anchor[1];
20356
- }
20357
- if (!scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);else {
20376
+ x = DefaultTransform.x,
20377
+ y = DefaultTransform.y,
20378
+ scaleX = DefaultTransform.scaleX,
20379
+ scaleY = DefaultTransform.scaleY,
20380
+ angle = DefaultTransform.angle,
20381
+ scaleCenter: scaleCenter,
20382
+ anchor: anchor,
20383
+ postMatrix: postMatrix
20384
+ } = this.attribute;
20385
+ let _anchor = [0, 0];
20386
+ const params = {};
20387
+ if (anchor && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);else {
20358
20388
  const m = this._transMatrix;
20359
- m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]), m.translate(x, y), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
20360
- x: scaleCenter[0],
20361
- y: scaleCenter[1]
20389
+ m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]), m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
20390
+ x: _anchor[0],
20391
+ y: _anchor[1]
20362
20392
  });
20363
20393
  }
20364
20394
  const p = this.getOffsetXY(DefaultTransform);
@@ -26342,7 +26372,7 @@
26342
26372
  distance = defaultOuterBorder.distance,
26343
26373
  lineWidth = defaultOuterBorder.lineWidth
26344
26374
  } = outerBorder;
26345
- aabbBounds.expand(distance + shadowBlur + lineWidth / 2);
26375
+ aabbBounds.expand(distance + (shadowBlur + lineWidth) / 2);
26346
26376
  }
26347
26377
  return aabbBounds;
26348
26378
  }
@@ -26381,7 +26411,7 @@
26381
26411
  distance = defaultOuterBorder.distance,
26382
26412
  lineWidth = defaultOuterBorder.lineWidth
26383
26413
  } = outerBorder;
26384
- boundStroke(aabbBounds, distance + shadowBlur + lineWidth / 2, !0, strokeBoundsBuffer);
26414
+ boundStroke(aabbBounds, distance + (shadowBlur + lineWidth) / 2, !0, strokeBoundsBuffer);
26385
26415
  }
26386
26416
  return aabbBounds;
26387
26417
  }
@@ -33718,7 +33748,7 @@
33718
33748
  const {
33719
33749
  context: context
33720
33750
  } = drawContext;
33721
- context.highPerformanceSave();
33751
+ context.highPerformanceSave(), context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0);
33722
33752
  const b = graphic.AABBBounds;
33723
33753
  return !0 !== graphic.attribute._debug_bounds && graphic.attribute._debug_bounds(context, graphic), context.strokeRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore(), !0;
33724
33754
  }
@@ -37656,12 +37686,12 @@
37656
37686
  if ((!isValid$1(colorKey.a) && !isValid$1(colorKey.l)) || !isString$1(color)) {
37657
37687
  return color;
37658
37688
  }
37659
- let c = new Color(color);
37689
+ let c = new Color$1(color);
37660
37690
  if (isValid$1(colorKey.l)) {
37661
37691
  const { r, g, b } = c.color;
37662
37692
  const { h, s } = rgbToHsl(r, g, b);
37663
37693
  const rgb = hslToRgb(h, s, colorKey.l);
37664
- const newColor = new Color(`rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`);
37694
+ const newColor = new Color$1(`rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`);
37665
37695
  newColor.setOpacity(c.color.opacity);
37666
37696
  c = newColor;
37667
37697
  }
@@ -40599,17 +40629,17 @@
40599
40629
  }
40600
40630
  function parseFieldData(spec, parameters) {
40601
40631
  const field = spec.field,
40602
- refData = getGrammarOutput(spec.data, parameters);
40603
- let fieldData = [];
40632
+ refData = getGrammarOutput(spec.data, parameters),
40633
+ fieldData = [];
40604
40634
  if (isArray$4(field)) field.forEach(entry => {
40605
40635
  const getter = field$3(entry);
40606
40636
  refData && refData.forEach(datum => {
40607
- fieldData = fieldData.concat(getter(datum));
40637
+ fieldData.push(getter(datum));
40608
40638
  });
40609
40639
  });else {
40610
40640
  const getter = field$3(field);
40611
40641
  refData && refData.forEach(datum => {
40612
- fieldData = fieldData.concat(getter(datum));
40642
+ fieldData.push(getter(datum));
40613
40643
  });
40614
40644
  }
40615
40645
  return fieldData;
@@ -45628,10 +45658,14 @@
45628
45658
  return group ? group.findAll(node => "group" !== node.type, !0) : [];
45629
45659
  }
45630
45660
 
45631
- const defaultAlternativeColors = ["#ffffff", "#000000"];
45661
+ const defaultAlternativeColors = ["#ffffff", "#000000"],
45662
+ {
45663
+ Color: Color
45664
+ } = ColorUtil;
45632
45665
  function labelSmartInvert(foregroundColorOrigin, backgroundColorOrogin, textType, contrastRatiosThreshold, alternativeColors) {
45633
- const foregroundColor = formatColorToHex(foregroundColorOrigin),
45634
- backgroundColor = formatColorToHex(backgroundColorOrogin);
45666
+ if ("string" != typeof foregroundColorOrigin || "string" != typeof backgroundColorOrogin) return foregroundColorOrigin;
45667
+ const foregroundColor = new Color(foregroundColorOrigin).toHex(),
45668
+ backgroundColor = new Color(backgroundColorOrogin).toHex();
45635
45669
  return contrastAccessibilityChecker(foregroundColor, backgroundColor, textType, contrastRatiosThreshold) ? foregroundColor : improveContrastReverse(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors);
45636
45670
  }
45637
45671
  function improveContrastReverse(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors) {
@@ -45656,16 +45690,6 @@
45656
45690
  R = RsRGB <= .03928 ? RsRGB / 12.92 : Math.pow((RsRGB + .055) / 1.055, 2.4), G = GsRGB <= .03928 ? GsRGB / 12.92 : Math.pow((GsRGB + .055) / 1.055, 2.4), B = BsRGB <= .03928 ? BsRGB / 12.92 : Math.pow((BsRGB + .055) / 1.055, 2.4);
45657
45691
  return .2126 * R + .7152 * G + .0722 * B;
45658
45692
  }
45659
- function formatColorToHex(originColor) {
45660
- if (null == originColor ? void 0 : originColor.includes("#")) return originColor;
45661
- const c = new Color$1(originColor),
45662
- {
45663
- r: r,
45664
- g: g,
45665
- b: b
45666
- } = c.color;
45667
- return "#" + rgbToHex(r, g, b);
45668
- }
45669
45693
  function smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor) {
45670
45694
  let result;
45671
45695
  switch (fillStrategy) {
@@ -47039,7 +47063,7 @@
47039
47063
  return listener;
47040
47064
  }
47041
47065
  _smartInvert(labels) {
47042
- var _a, _b, _c, _d;
47066
+ var _a, _b, _c, _d, _e;
47043
47067
  const option = this.attribute.smartInvert || {},
47044
47068
  {
47045
47069
  textType: textType,
@@ -47049,18 +47073,18 @@
47049
47073
  fillStrategy = null !== (_a = option.fillStrategy) && void 0 !== _a ? _a : "invertBase",
47050
47074
  strokeStrategy = null !== (_b = option.strokeStrategy) && void 0 !== _b ? _b : "base",
47051
47075
  brightColor = null !== (_c = option.brightColor) && void 0 !== _c ? _c : "#ffffff",
47052
- darkColor = null !== (_d = option.darkColor) && void 0 !== _d ? _d : "#000000";
47076
+ darkColor = null !== (_d = option.darkColor) && void 0 !== _d ? _d : "#000000",
47077
+ outsideEnable = null !== (_e = option.outsideEnable) && void 0 !== _e && _e;
47053
47078
  if ("null" !== fillStrategy || "null" !== strokeStrategy) for (let i = 0; i < labels.length; i++) {
47054
47079
  const label = labels[i];
47055
47080
  if (!label) continue;
47056
47081
  const baseMark = this._idToGraphic.get(label.attribute.id),
47057
- isInside = this._canPlaceInside(label.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds),
47058
47082
  backgroundColor = baseMark.attribute.fill,
47059
47083
  foregroundColor = label.attribute.fill,
47060
47084
  baseColor = backgroundColor,
47061
47085
  invertColor = labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors),
47062
47086
  similarColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor;
47063
- if (isInside) {
47087
+ if (outsideEnable) {
47064
47088
  const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
47065
47089
  if (fill && label.setAttributes({
47066
47090
  fill: fill
@@ -47070,21 +47094,32 @@
47070
47094
  stroke: stroke
47071
47095
  });
47072
47096
  } else {
47073
- if (0 === label.attribute.lineWidth) continue;
47074
- if (label.attribute.stroke) {
47075
- label.setAttributes({
47076
- fill: labelSmartInvert(label.attribute.fill, label.attribute.stroke, textType, contrastRatiosThreshold, alternativeColors)
47097
+ if (this._canPlaceInside(label.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds)) {
47098
+ const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
47099
+ if (fill && label.setAttributes({
47100
+ fill: fill
47101
+ }), 0 === label.attribute.lineWidth) continue;
47102
+ const stroke = smartInvertStrategy(strokeStrategy, baseColor, invertColor, similarColor);
47103
+ stroke && label.setAttributes({
47104
+ stroke: stroke
47105
+ });
47106
+ } else {
47107
+ if (0 === label.attribute.lineWidth) continue;
47108
+ if (label.attribute.stroke) {
47109
+ label.setAttributes({
47110
+ fill: labelSmartInvert(label.attribute.fill, label.attribute.stroke, textType, contrastRatiosThreshold, alternativeColors)
47111
+ });
47112
+ continue;
47113
+ }
47114
+ const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
47115
+ fill && label.setAttributes({
47116
+ fill: fill
47117
+ });
47118
+ const stroke = smartInvertStrategy(strokeStrategy, baseColor, invertColor, similarColor);
47119
+ stroke && label.setAttributes({
47120
+ stroke: stroke
47077
47121
  });
47078
- continue;
47079
47122
  }
47080
- const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
47081
- fill && label.setAttributes({
47082
- fill: fill
47083
- });
47084
- const stroke = smartInvertStrategy(strokeStrategy, baseColor, invertColor, similarColor);
47085
- stroke && label.setAttributes({
47086
- stroke: stroke
47087
- });
47088
47123
  }
47089
47124
  }
47090
47125
  }
@@ -51635,7 +51670,7 @@
51635
51670
  opacity: .85
51636
51671
  },
51637
51672
  unSelected: {
51638
- fill: "#D8D8D8"
51673
+ opacity: .5
51639
51674
  }
51640
51675
  }
51641
51676
  },
@@ -56069,11 +56104,13 @@
56069
56104
  space: 6,
56070
56105
  style: {
56071
56106
  lineWidth: 0,
56072
- fillOpacity: 1
56107
+ fillOpacity: 1,
56108
+ opacity: 1
56073
56109
  },
56074
56110
  state: {
56075
56111
  unSelected: {
56076
- fillOpacity: 0.5
56112
+ fillOpacity: 0.2,
56113
+ opacity: 1
56077
56114
  }
56078
56115
  }
56079
56116
  },
@@ -56083,11 +56120,13 @@
56083
56120
  fill: { type: 'palette', key: 'secondaryFontColor', default: '#89909d' },
56084
56121
  fontSize: THEME_CONSTANTS.l5FontSize,
56085
56122
  lineHeight: THEME_CONSTANTS.l5LineHeight,
56086
- fontFamily: THEME_CONSTANTS.defaultFontFamily
56123
+ fontFamily: THEME_CONSTANTS.defaultFontFamily,
56124
+ opacity: 1
56087
56125
  },
56088
56126
  state: {
56089
56127
  unSelected: {
56090
- fill: { type: 'palette', key: 'disableFontColor' }
56128
+ fill: { type: 'palette', key: 'disableFontColor' },
56129
+ opacity: 1
56091
56130
  }
56092
56131
  }
56093
56132
  }
@@ -56221,21 +56260,21 @@
56221
56260
  startSymbol: {
56222
56261
  visible: false,
56223
56262
  symbolType: 'triangle',
56263
+ size: 10,
56224
56264
  style: {
56225
56265
  stroke: null,
56226
56266
  lineWidth: 0,
56227
- fill: 'rgba(46, 47, 50)',
56228
- size: 10
56267
+ fill: 'rgba(46, 47, 50)'
56229
56268
  }
56230
56269
  },
56231
56270
  endSymbol: {
56232
56271
  visible: true,
56233
56272
  symbolType: 'triangle',
56273
+ size: 10,
56234
56274
  style: {
56235
56275
  stroke: null,
56236
56276
  lineWidth: 0,
56237
- fill: 'rgba(46, 47, 50)',
56238
- size: 10
56277
+ fill: 'rgba(46, 47, 50)'
56239
56278
  }
56240
56279
  },
56241
56280
  label: {
@@ -57278,6 +57317,103 @@
57278
57317
  }
57279
57318
  return (_a = fields[field].alias) !== null && _a !== void 0 ? _a : field;
57280
57319
  }
57320
+ function getRegionStackGroup(region, setInitialValue, filter) {
57321
+ const stackValueGroup = {};
57322
+ region.getSeries().forEach(s => {
57323
+ var _a;
57324
+ const stackData = s.getStackData();
57325
+ const stackValue = s.getStackValue();
57326
+ const stackValueField = s.getStackValueField();
57327
+ const filterEnable = filter ? filter(s) : true;
57328
+ if (stackData && stackValueField && filterEnable) {
57329
+ stackValueGroup[stackValue] = (_a = stackValueGroup[stackValue]) !== null && _a !== void 0 ? _a : {
57330
+ nodes: {}
57331
+ };
57332
+ stackGroup(s, stackData, stackValueGroup[stackValue], stackValueField, setInitialValue);
57333
+ }
57334
+ });
57335
+ return stackValueGroup;
57336
+ }
57337
+ function stackTotal(stackData, valueField) {
57338
+ if ('values' in stackData && stackData.values.length) {
57339
+ const total = sum(stackData.values, valueField);
57340
+ const percent = max(stackData.values, STACK_FIELD_END_PERCENT);
57341
+ stackData.values.forEach(v => {
57342
+ v[STACK_FIELD_TOTAL] = total;
57343
+ v[STACK_FIELD_TOTAL_PERCENT] = percent;
57344
+ delete v[STACK_FIELD_TOTAL_TOP];
57345
+ });
57346
+ const maxNode = stackData.values.reduce((max, current) => {
57347
+ return current[STACK_FIELD_END] > max[STACK_FIELD_END] ? current : max;
57348
+ });
57349
+ maxNode[STACK_FIELD_TOTAL_TOP] = true;
57350
+ return;
57351
+ }
57352
+ for (const key in stackData.nodes) {
57353
+ stackTotal(stackData.nodes[key], valueField);
57354
+ }
57355
+ }
57356
+ function stackOffsetSilhouette(stackCache) {
57357
+ if (!stackCache.values.length) {
57358
+ return;
57359
+ }
57360
+ const centerValue = stackCache.values[stackCache.values.length - 1][STACK_FIELD_END] / 2;
57361
+ for (let j = 0; j < stackCache.values.length; j++) {
57362
+ stackCache.values[j][STACK_FIELD_START_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_START] - centerValue;
57363
+ stackCache.values[j][STACK_FIELD_END_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_END] - centerValue;
57364
+ }
57365
+ }
57366
+ function stack(stackCache, stackInverse) {
57367
+ if (stackCache.values.length > 0) {
57368
+ let positiveStart = 0;
57369
+ let negativeStart = 0;
57370
+ let sign = 1;
57371
+ let value = 0;
57372
+ const maxLength = stackCache.values.length;
57373
+ for (let index = 0; index < maxLength; index++) {
57374
+ const v = stackCache.values[stackInverse ? maxLength - 1 - index : index];
57375
+ value = v[STACK_FIELD_END];
57376
+ if (value >= 0) {
57377
+ v[STACK_FIELD_START] = positiveStart;
57378
+ positiveStart += v[STACK_FIELD_END];
57379
+ v[STACK_FIELD_END] = positiveStart;
57380
+ }
57381
+ else {
57382
+ v[STACK_FIELD_START] = negativeStart;
57383
+ negativeStart += v[STACK_FIELD_END];
57384
+ v[STACK_FIELD_END] = negativeStart;
57385
+ }
57386
+ }
57387
+ for (let index = 0; index < maxLength; index++) {
57388
+ const v = stackCache.values[stackInverse ? maxLength - 1 - index : index];
57389
+ value = v[STACK_FIELD_END];
57390
+ const denominator = value >= 0 ? positiveStart : negativeStart;
57391
+ sign = value >= 0 ? 1 : -1;
57392
+ v[STACK_FIELD_START_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_START] / denominator) * sign;
57393
+ v[STACK_FIELD_END_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_END] / denominator) * sign;
57394
+ }
57395
+ }
57396
+ for (const key in stackCache.nodes) {
57397
+ stack(stackCache.nodes[key], stackInverse);
57398
+ }
57399
+ }
57400
+ function stackGroup(s, stackData, stackCache, valueField, setInitialValue) {
57401
+ if ('values' in stackData) {
57402
+ setInitialValue && stackData.values.forEach(v => (v[STACK_FIELD_END] = toValidNumber(v[valueField])));
57403
+ stackCache.values.push(...stackData.values);
57404
+ stackCache.series.push({ s: s, values: stackData.values });
57405
+ return;
57406
+ }
57407
+ for (const key in stackData.nodes) {
57408
+ !stackCache.nodes[key] &&
57409
+ (stackCache.nodes[key] = {
57410
+ values: [],
57411
+ series: [],
57412
+ nodes: {}
57413
+ });
57414
+ stackGroup(s, stackData.nodes[key], stackCache.nodes[key], valueField, setInitialValue);
57415
+ }
57416
+ }
57281
57417
 
57282
57418
  const findHierarchyNode = (hierarchyData, key, keyField = 'key', childrenField = 'children') => {
57283
57419
  for (let i = 0; i < hierarchyData.length; i++) {
@@ -57667,6 +57803,25 @@
57667
57803
  }
57668
57804
  return inverse;
57669
57805
  }
57806
+ function scaleWholeRangeSize(count, bandwidth, paddingInner, paddingOuter) {
57807
+ if (paddingInner === 1) {
57808
+ paddingInner = 0;
57809
+ }
57810
+ const space = bandSpace(count, paddingInner, paddingOuter);
57811
+ const step = bandwidth / (1 - paddingInner);
57812
+ const wholeSize = space * step;
57813
+ return wholeSize;
57814
+ }
57815
+ function bandSpace(count, paddingInner, paddingOuter) {
57816
+ let space;
57817
+ if (count === 1) {
57818
+ space = count + paddingOuter * 2;
57819
+ }
57820
+ else {
57821
+ space = count - paddingInner + paddingOuter * 2;
57822
+ }
57823
+ return count ? (space > 0 ? space : 1) : 0;
57824
+ }
57670
57825
 
57671
57826
  const getAxis$1 = (chart, type, pos) => {
57672
57827
  const axesComponents = chart
@@ -61378,9 +61533,24 @@
61378
61533
  })(IFilterMode || (IFilterMode = {}));
61379
61534
 
61380
61535
  class Region extends BaseModel {
61536
+ getMaxWidth() {
61537
+ return this._maxRegionWidth;
61538
+ }
61539
+ setMaxWidth(value) {
61540
+ this._maxRegionWidth = value;
61541
+ }
61542
+ getMaxHeight() {
61543
+ return this._maxRegionHeight;
61544
+ }
61545
+ setMaxHeight(value) {
61546
+ this._maxRegionHeight = value;
61547
+ }
61381
61548
  getGroupMark() {
61382
61549
  return this._groupMark;
61383
61550
  }
61551
+ getStackInverse() {
61552
+ return this._spec.stackInverse === true;
61553
+ }
61384
61554
  constructor(spec, ctx) {
61385
61555
  var _a;
61386
61556
  super(spec, ctx);
@@ -61486,8 +61656,9 @@
61486
61656
  }
61487
61657
  }
61488
61658
  _compareSpec() {
61659
+ var _a, _b;
61489
61660
  const result = super._compareSpec();
61490
- if (!isEqual$1(this._originalSpec.style, this._spec.style)) {
61661
+ if (!isEqual$1((_a = this._originalSpec) === null || _a === void 0 ? void 0 : _a.style, (_b = this._spec) === null || _b === void 0 ? void 0 : _b.style)) {
61491
61662
  result.reMake = true;
61492
61663
  }
61493
61664
  return result;
@@ -61604,92 +61775,105 @@
61604
61775
  }
61605
61776
  Region.type = 'region';
61606
61777
 
61607
- class Layout {
61608
- constructor(_spec, ctx) {
61609
- this._leftCurrent = 0;
61610
- this._topCurrent = 0;
61611
- this._rightCurrent = 0;
61612
- this._bottomCurrent = 0;
61613
- this._onError = ctx === null || ctx === void 0 ? void 0 : ctx.onError;
61614
- }
61615
- layoutItems(_chart, items, chartLayoutRect, chartViewBox) {
61616
- this._chartLayoutRect = chartLayoutRect;
61617
- this._chartViewBox = chartViewBox;
61618
- this._leftCurrent = chartLayoutRect.x;
61619
- this._topCurrent = chartLayoutRect.y;
61620
- this._rightCurrent = chartLayoutRect.x + chartLayoutRect.width;
61621
- this._bottomCurrent = chartLayoutRect.height + chartLayoutRect.y;
61622
- items.sort((a, b) => b.layoutLevel - a.layoutLevel);
61623
- this.layoutNormalInlineItems(items.filter(x => x.layoutType === 'normal-inline'));
61624
- this.layoutNormalItems(items.filter(x => x.layoutType === 'normal'));
61625
- const layoutTemp = {
61626
- _leftCurrent: this._leftCurrent,
61627
- _topCurrent: this._topCurrent,
61628
- _rightCurrent: this._rightCurrent,
61629
- _bottomCurrent: this._bottomCurrent
61630
- };
61631
- const regionItems = items.filter(x => x.layoutType === 'region');
61632
- const relativeItems = items.filter(x => x.layoutType === 'region-relative');
61633
- this.layoutRegionItems(regionItems, relativeItems);
61634
- if (relativeItems.some(i => i.getAutoIndent())) {
61635
- const { top, bottom, left, right } = this._checkAutoIndent(relativeItems);
61636
- if (top || bottom || left || right) {
61637
- this._topCurrent = layoutTemp._topCurrent + top;
61638
- this._bottomCurrent = layoutTemp._bottomCurrent - bottom;
61639
- this._leftCurrent = layoutTemp._leftCurrent + left;
61640
- this._rightCurrent = layoutTemp._rightCurrent - right;
61641
- this.layoutRegionItems(regionItems, relativeItems);
61642
- }
61778
+ function getPositionItems(items) {
61779
+ const startItems = [];
61780
+ const middleItems = [];
61781
+ const endItems = [];
61782
+ items.forEach(item => {
61783
+ if (isNil$1(item.getSpec().position) || item.getSpec().position === 'start') {
61784
+ startItems.push(item);
61643
61785
  }
61644
- this.layoutAbsoluteItems(items.filter(x => x.layoutType === 'absolute'));
61645
- }
61646
- layoutNormalItems(normalItems) {
61647
- normalItems.forEach(item => {
61648
- const layoutRect = this.getItemComputeLayoutRect(item);
61649
- const rect = item.computeBoundsInRect(layoutRect);
61650
- item.setLayoutRect(rect);
61651
- if (item.layoutOrient === 'left') {
61786
+ else if (item.getSpec().position === 'middle') {
61787
+ middleItems.push(item);
61788
+ }
61789
+ else if (item.getSpec().position === 'end') {
61790
+ endItems.push(item);
61791
+ }
61792
+ });
61793
+ return {
61794
+ startItems,
61795
+ endItems,
61796
+ middleItems
61797
+ };
61798
+ }
61799
+ function adjustItemsToCenter(allItems, isVertical, containerLength) {
61800
+ if (isVertical) {
61801
+ allItems.forEach(items => {
61802
+ const lastItem = last(items);
61803
+ const length = lastItem.getLayoutStartPoint().y + lastItem.getLayoutRect().height - items[0].getLayoutStartPoint().y;
61804
+ const centerY = (containerLength - length) / 2;
61805
+ items.forEach(item => {
61652
61806
  item.setLayoutStartPosition({
61653
- x: this._leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
61654
- y: this._topCurrent + item.layoutOffsetY + item.layoutPaddingTop
61807
+ x: item.getLayoutStartPoint().x,
61808
+ y: item.getLayoutStartPoint().y + centerY
61655
61809
  });
61656
- this._leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
61657
- }
61658
- else if (item.layoutOrient === 'top') {
61810
+ });
61811
+ });
61812
+ }
61813
+ else {
61814
+ allItems.forEach(items => {
61815
+ const lastItem = last(items);
61816
+ const length = lastItem.getLayoutStartPoint().x + lastItem.getLayoutRect().width - items[0].getLayoutStartPoint().x;
61817
+ const centerX = (containerLength - length) / 2;
61818
+ items.forEach(item => {
61659
61819
  item.setLayoutStartPosition({
61660
- x: this._leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
61661
- y: this._topCurrent + item.layoutOffsetY + item.layoutPaddingTop
61820
+ x: item.getLayoutStartPoint().x + centerX,
61821
+ y: item.getLayoutStartPoint().y
61662
61822
  });
61663
- this._topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
61664
- }
61665
- else if (item.layoutOrient === 'right') {
61823
+ });
61824
+ });
61825
+ }
61826
+ }
61827
+ function layoutRightStartOrMiddleItems(items, layout, limitHeight, isMiddle) {
61828
+ if (items.length) {
61829
+ let maxWidth = 0;
61830
+ let preRight = layout.rightCurrent;
61831
+ let preTop = layout.topCurrent;
61832
+ const allItems = [];
61833
+ let singleLineItems = [];
61834
+ items.forEach(item => {
61835
+ const layoutRect = layout.getItemComputeLayoutRect(item);
61836
+ const rect = item.computeBoundsInRect(layoutRect);
61837
+ item.setLayoutRect(rect);
61838
+ const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
61839
+ const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
61840
+ item.setLayoutStartPosition({
61841
+ x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
61842
+ y: preTop + item.layoutOffsetY + item.layoutPaddingTop
61843
+ });
61844
+ maxWidth = Math.max(maxWidth, itemTotalWidth);
61845
+ preTop += itemTotalHeight;
61846
+ if (preTop > limitHeight) {
61847
+ preRight -= maxWidth;
61848
+ maxWidth = itemTotalWidth;
61849
+ preTop = layout.topCurrent + itemTotalHeight;
61666
61850
  item.setLayoutStartPosition({
61667
- x: this._rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
61668
- y: this._topCurrent + item.layoutOffsetY + item.layoutPaddingTop
61851
+ x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
61852
+ y: layout.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
61669
61853
  });
61670
- this._rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
61854
+ allItems.push(singleLineItems);
61855
+ singleLineItems = [item];
61671
61856
  }
61672
- else if (item.layoutOrient === 'bottom') {
61673
- item.setLayoutStartPosition({
61674
- x: this._leftCurrent + item.layoutOffsetX + item.layoutPaddingRight,
61675
- y: this._bottomCurrent + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
61676
- });
61677
- this._bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
61857
+ else {
61858
+ singleLineItems.push(item);
61678
61859
  }
61679
61860
  });
61861
+ allItems.push(singleLineItems);
61862
+ if (isMiddle) {
61863
+ adjustItemsToCenter(allItems, true, limitHeight);
61864
+ }
61865
+ layout.rightCurrent = preRight - maxWidth;
61680
61866
  }
61681
- layoutNormalInlineItems(normalItems) {
61682
- const leftItems = normalItems.filter(item => item.layoutOrient === 'left');
61683
- const rightItems = normalItems.filter(item => item.layoutOrient === 'right');
61684
- const topItems = normalItems.filter(item => item.layoutOrient === 'top');
61685
- const bottomItems = normalItems.filter(item => item.layoutOrient === 'bottom');
61686
- const limitWidth = this._chartLayoutRect.width + this._chartLayoutRect.x;
61687
- const limitHeight = this._chartLayoutRect.height + this._chartLayoutRect.y;
61867
+ }
61868
+ function layoutLeftStartOrMiddleItems(items, layout, limitHeight, isMiddle) {
61869
+ if (items.length) {
61688
61870
  let maxWidth = 0;
61689
- let preLeft = this._leftCurrent;
61690
- let preTop = this._topCurrent;
61691
- leftItems.forEach((item, index) => {
61692
- const layoutRect = this.getItemComputeLayoutRect(item);
61871
+ let preLeft = layout.leftCurrent;
61872
+ let preTop = layout.topCurrent;
61873
+ const allItems = [];
61874
+ let singleLineItems = [];
61875
+ items.forEach(item => {
61876
+ const layoutRect = layout.getItemComputeLayoutRect(item);
61693
61877
  const rect = item.computeBoundsInRect(layoutRect);
61694
61878
  item.setLayoutRect(rect);
61695
61879
  const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
@@ -61703,19 +61887,34 @@
61703
61887
  if (preTop > limitHeight) {
61704
61888
  preLeft += maxWidth;
61705
61889
  maxWidth = itemTotalWidth;
61706
- preTop = this._topCurrent + itemTotalHeight;
61890
+ preTop = layout.topCurrent + itemTotalHeight;
61707
61891
  item.setLayoutStartPosition({
61708
61892
  x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft,
61709
- y: this._topCurrent + item.layoutOffsetY + item.layoutPaddingTop
61893
+ y: layout.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
61710
61894
  });
61895
+ allItems.push(singleLineItems);
61896
+ singleLineItems = [item];
61897
+ }
61898
+ else {
61899
+ singleLineItems.push(item);
61711
61900
  }
61712
61901
  });
61713
- this._leftCurrent = preLeft + maxWidth;
61902
+ allItems.push(singleLineItems);
61903
+ if (isMiddle) {
61904
+ adjustItemsToCenter(allItems, true, limitHeight);
61905
+ }
61906
+ layout.leftCurrent = preLeft + maxWidth;
61907
+ }
61908
+ }
61909
+ function layoutTopStartOrMiddleItems(items, layout, limitWidth, isMiddle) {
61910
+ if (items.length) {
61714
61911
  let maxHeight = 0;
61715
- preLeft = this._leftCurrent;
61716
- preTop = this._topCurrent;
61717
- topItems.forEach((item, index) => {
61718
- const layoutRect = this.getItemComputeLayoutRect(item);
61912
+ let preLeft = layout.leftCurrent;
61913
+ let preTop = layout.topCurrent;
61914
+ const allItems = [];
61915
+ let singleLineItems = [];
61916
+ items.forEach(item => {
61917
+ const layoutRect = layout.getItemComputeLayoutRect(item);
61719
61918
  const rect = item.computeBoundsInRect(layoutRect);
61720
61919
  item.setLayoutRect(rect);
61721
61920
  const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
@@ -61727,72 +61926,314 @@
61727
61926
  maxHeight = Math.max(maxHeight, itemTotalHeight);
61728
61927
  preLeft += itemTotalWidth;
61729
61928
  if (preLeft > limitWidth) {
61730
- preLeft = this._leftCurrent + itemTotalWidth;
61929
+ preLeft = layout.leftCurrent + itemTotalWidth;
61731
61930
  preTop += maxHeight;
61732
61931
  maxHeight = itemTotalHeight;
61733
61932
  item.setLayoutStartPosition({
61734
- x: this._leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
61933
+ x: layout.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
61735
61934
  y: preTop + item.layoutOffsetY + item.layoutPaddingTop
61736
61935
  });
61936
+ allItems.push(singleLineItems);
61937
+ singleLineItems = [item];
61938
+ }
61939
+ else {
61940
+ singleLineItems.push(item);
61737
61941
  }
61738
61942
  });
61739
- this._topCurrent = preTop + maxHeight;
61740
- maxWidth = 0;
61741
- let preRight = this._rightCurrent;
61742
- preTop = this._topCurrent;
61743
- rightItems.forEach((item, index) => {
61744
- const layoutRect = this.getItemComputeLayoutRect(item);
61943
+ allItems.push(singleLineItems);
61944
+ if (isMiddle) {
61945
+ adjustItemsToCenter(allItems, false, limitWidth);
61946
+ }
61947
+ layout.topCurrent = preTop + maxHeight;
61948
+ }
61949
+ }
61950
+ function layoutBottomStartOrMiddleItems(items, layout, limitWidth, isMiddle) {
61951
+ if (items.length) {
61952
+ let maxHeight = 0;
61953
+ let preLeft = layout.leftCurrent;
61954
+ let preBottom = layout.bottomCurrent;
61955
+ const allItems = [];
61956
+ let singleLineItems = [];
61957
+ items.forEach(item => {
61958
+ const layoutRect = layout.getItemComputeLayoutRect(item);
61745
61959
  const rect = item.computeBoundsInRect(layoutRect);
61746
61960
  item.setLayoutRect(rect);
61747
61961
  const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
61748
61962
  const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
61749
61963
  item.setLayoutStartPosition({
61750
- x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
61751
- y: preTop + item.layoutOffsetY + item.layoutPaddingTop
61964
+ x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft,
61965
+ y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
61752
61966
  });
61753
- maxWidth = Math.max(maxWidth, itemTotalWidth);
61754
- preTop += itemTotalHeight;
61755
- if (preTop > limitHeight) {
61967
+ maxHeight = Math.max(maxHeight, itemTotalHeight);
61968
+ preLeft += itemTotalWidth;
61969
+ if (preLeft > limitWidth) {
61970
+ allItems.push(singleLineItems);
61971
+ preLeft = layout.leftCurrent + itemTotalWidth;
61972
+ preBottom -= maxHeight;
61973
+ maxHeight = itemTotalHeight;
61974
+ item.setLayoutStartPosition({
61975
+ x: layout.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
61976
+ y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
61977
+ });
61978
+ singleLineItems = [item];
61979
+ }
61980
+ else {
61981
+ singleLineItems.push(item);
61982
+ }
61983
+ });
61984
+ allItems.push(singleLineItems);
61985
+ if (isMiddle) {
61986
+ adjustItemsToCenter(allItems, false, limitWidth);
61987
+ }
61988
+ layout.bottomCurrent = preBottom - maxHeight;
61989
+ }
61990
+ }
61991
+ function layoutLeftInlineItems(items, layout, limitHeight) {
61992
+ const { startItems, middleItems, endItems } = getPositionItems(items);
61993
+ if (startItems.length) {
61994
+ layoutLeftStartOrMiddleItems(startItems, layout, limitHeight, false);
61995
+ }
61996
+ if (middleItems.length) {
61997
+ layoutLeftStartOrMiddleItems(middleItems, layout, limitHeight, true);
61998
+ }
61999
+ if (endItems.length) {
62000
+ let maxWidth = 0;
62001
+ let preLeft = layout.leftCurrent;
62002
+ let preBottom = layout.bottomCurrent;
62003
+ endItems.forEach(item => {
62004
+ const layoutRect = layout.getItemComputeLayoutRect(item);
62005
+ const rect = item.computeBoundsInRect(layoutRect);
62006
+ item.setLayoutRect(rect);
62007
+ const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
62008
+ const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
62009
+ if (preBottom < itemTotalHeight) {
62010
+ preLeft += maxWidth;
62011
+ maxWidth = itemTotalWidth;
62012
+ preBottom = layout.bottomCurrent;
62013
+ item.setLayoutStartPosition({
62014
+ x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft,
62015
+ y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
62016
+ });
62017
+ }
62018
+ else {
62019
+ item.setLayoutStartPosition({
62020
+ x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft,
62021
+ y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
62022
+ });
62023
+ maxWidth = Math.max(maxWidth, itemTotalWidth);
62024
+ preBottom -= itemTotalHeight;
62025
+ }
62026
+ });
62027
+ layout.leftCurrent = preLeft + maxWidth;
62028
+ }
62029
+ }
62030
+ function layoutRightInlineItems(items, layout, limitHeight) {
62031
+ const { startItems, middleItems, endItems } = getPositionItems(items);
62032
+ if (startItems.length) {
62033
+ layoutRightStartOrMiddleItems(startItems, layout, limitHeight, false);
62034
+ }
62035
+ if (middleItems.length) {
62036
+ layoutRightStartOrMiddleItems(middleItems, layout, limitHeight, true);
62037
+ }
62038
+ if (endItems.length) {
62039
+ let maxWidth = 0;
62040
+ let preRight = layout.rightCurrent;
62041
+ let preBottom = layout.bottomCurrent;
62042
+ endItems.forEach(item => {
62043
+ const layoutRect = layout.getItemComputeLayoutRect(item);
62044
+ const rect = item.computeBoundsInRect(layoutRect);
62045
+ item.setLayoutRect(rect);
62046
+ const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
62047
+ const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
62048
+ if (preBottom < itemTotalHeight) {
61756
62049
  preRight -= maxWidth;
61757
62050
  maxWidth = itemTotalWidth;
61758
- preTop = this._topCurrent + itemTotalHeight;
62051
+ preBottom = layout.bottomCurrent;
61759
62052
  item.setLayoutStartPosition({
61760
62053
  x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
61761
- y: this._topCurrent + item.layoutOffsetY + item.layoutPaddingTop
62054
+ y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
61762
62055
  });
61763
62056
  }
62057
+ else {
62058
+ item.setLayoutStartPosition({
62059
+ x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
62060
+ y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
62061
+ });
62062
+ maxWidth = Math.max(maxWidth, itemTotalWidth);
62063
+ preBottom -= itemTotalHeight;
62064
+ }
61764
62065
  });
61765
- this._rightCurrent = preRight - maxWidth;
61766
- maxHeight = 0;
61767
- preLeft = this._leftCurrent;
61768
- let preBottom = this._bottomCurrent;
61769
- bottomItems.forEach((item, index) => {
61770
- const layoutRect = this.getItemComputeLayoutRect(item);
62066
+ layout.rightCurrent = preRight - maxWidth;
62067
+ }
62068
+ }
62069
+ function layoutTopInlineItems(items, layout, limitWidth) {
62070
+ const { startItems, middleItems, endItems } = getPositionItems(items);
62071
+ if (startItems.length) {
62072
+ layoutTopStartOrMiddleItems(startItems, layout, limitWidth, false);
62073
+ }
62074
+ if (middleItems.length) {
62075
+ layoutTopStartOrMiddleItems(middleItems, layout, limitWidth, true);
62076
+ }
62077
+ if (endItems.length) {
62078
+ let maxHeight = 0;
62079
+ let preTop = layout.topCurrent;
62080
+ let preRight = layout.rightCurrent;
62081
+ endItems.forEach(item => {
62082
+ const layoutRect = layout.getItemComputeLayoutRect(item);
61771
62083
  const rect = item.computeBoundsInRect(layoutRect);
61772
62084
  item.setLayoutRect(rect);
61773
62085
  const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
61774
62086
  const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
61775
- item.setLayoutStartPosition({
61776
- x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft,
61777
- y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
61778
- });
61779
- maxHeight = Math.max(maxHeight, itemTotalHeight);
61780
- preLeft += itemTotalWidth;
61781
- if (preLeft > limitWidth) {
61782
- preLeft = this._leftCurrent + itemTotalWidth;
62087
+ if (preRight < itemTotalWidth) {
62088
+ preRight = layout.rightCurrent;
62089
+ preTop += maxHeight;
62090
+ maxHeight = itemTotalHeight;
62091
+ item.setLayoutStartPosition({
62092
+ x: layout.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
62093
+ y: preTop + item.layoutOffsetY + item.layoutPaddingTop
62094
+ });
62095
+ }
62096
+ else {
62097
+ item.setLayoutStartPosition({
62098
+ x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
62099
+ y: preTop + item.layoutOffsetY + item.layoutPaddingTop
62100
+ });
62101
+ maxHeight = Math.max(maxHeight, itemTotalHeight);
62102
+ preRight -= itemTotalWidth;
62103
+ }
62104
+ });
62105
+ layout.topCurrent = preTop + maxHeight;
62106
+ }
62107
+ }
62108
+ function layoutBottomInlineItems(items, layout, limitWidth) {
62109
+ const { startItems, middleItems, endItems } = getPositionItems(items);
62110
+ if (startItems.length) {
62111
+ layoutBottomStartOrMiddleItems(startItems, layout, limitWidth, false);
62112
+ }
62113
+ if (middleItems.length) {
62114
+ layoutBottomStartOrMiddleItems(middleItems, layout, limitWidth, true);
62115
+ }
62116
+ if (endItems.length) {
62117
+ let maxHeight = 0;
62118
+ let preBottom = layout.bottomCurrent;
62119
+ let preRight = layout.rightCurrent;
62120
+ endItems.forEach(item => {
62121
+ const layoutRect = layout.getItemComputeLayoutRect(item);
62122
+ const rect = item.computeBoundsInRect(layoutRect);
62123
+ item.setLayoutRect(rect);
62124
+ const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
62125
+ const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
62126
+ if (preRight < itemTotalWidth) {
62127
+ preRight = layout.rightCurrent;
61783
62128
  preBottom -= maxHeight;
61784
62129
  maxHeight = itemTotalHeight;
61785
62130
  item.setLayoutStartPosition({
61786
- x: this._leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
62131
+ x: layout.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
62132
+ y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
62133
+ });
62134
+ }
62135
+ else {
62136
+ item.setLayoutStartPosition({
62137
+ x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
61787
62138
  y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
61788
62139
  });
62140
+ maxHeight = Math.max(maxHeight, itemTotalHeight);
62141
+ preRight -= itemTotalWidth;
61789
62142
  }
61790
62143
  });
61791
- this._bottomCurrent = preBottom - maxHeight;
62144
+ layout.bottomCurrent = preBottom - maxHeight;
62145
+ }
62146
+ }
62147
+
62148
+ class Layout {
62149
+ constructor(_spec, ctx) {
62150
+ this.leftCurrent = 0;
62151
+ this.topCurrent = 0;
62152
+ this.rightCurrent = 0;
62153
+ this.bottomCurrent = 0;
62154
+ this._onError = ctx === null || ctx === void 0 ? void 0 : ctx.onError;
62155
+ }
62156
+ layoutItems(_chart, items, chartLayoutRect, chartViewBox) {
62157
+ this._chartLayoutRect = chartLayoutRect;
62158
+ this._chartViewBox = chartViewBox;
62159
+ this.leftCurrent = chartLayoutRect.x;
62160
+ this.topCurrent = chartLayoutRect.y;
62161
+ this.rightCurrent = chartLayoutRect.x + chartLayoutRect.width;
62162
+ this.bottomCurrent = chartLayoutRect.height + chartLayoutRect.y;
62163
+ items.sort((a, b) => b.layoutLevel - a.layoutLevel);
62164
+ this.layoutNormalInlineItems(items.filter(x => x.layoutType === 'normal-inline'));
62165
+ this.layoutNormalItems(items.filter(x => x.layoutType === 'normal'));
62166
+ const layoutTemp = {
62167
+ leftCurrent: this.leftCurrent,
62168
+ topCurrent: this.topCurrent,
62169
+ rightCurrent: this.rightCurrent,
62170
+ bottomCurrent: this.bottomCurrent
62171
+ };
62172
+ const regionItems = items.filter(x => x.layoutType === 'region');
62173
+ const relativeItems = items.filter(x => x.layoutType === 'region-relative');
62174
+ this.layoutRegionItems(regionItems, relativeItems);
62175
+ if (relativeItems.some(i => i.getAutoIndent())) {
62176
+ const { top, bottom, left, right } = this._checkAutoIndent(relativeItems);
62177
+ if (top || bottom || left || right) {
62178
+ this.topCurrent = layoutTemp.topCurrent + top;
62179
+ this.bottomCurrent = layoutTemp.bottomCurrent - bottom;
62180
+ this.leftCurrent = layoutTemp.leftCurrent + left;
62181
+ this.rightCurrent = layoutTemp.rightCurrent - right;
62182
+ this.layoutRegionItems(regionItems, relativeItems);
62183
+ }
62184
+ }
62185
+ this.layoutAbsoluteItems(items.filter(x => x.layoutType === 'absolute'));
62186
+ }
62187
+ layoutNormalItems(normalItems) {
62188
+ normalItems.forEach(item => {
62189
+ const layoutRect = this.getItemComputeLayoutRect(item);
62190
+ const rect = item.computeBoundsInRect(layoutRect);
62191
+ item.setLayoutRect(rect);
62192
+ if (item.layoutOrient === 'left') {
62193
+ item.setLayoutStartPosition({
62194
+ x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
62195
+ y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
62196
+ });
62197
+ this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
62198
+ }
62199
+ else if (item.layoutOrient === 'top') {
62200
+ item.setLayoutStartPosition({
62201
+ x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
62202
+ y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
62203
+ });
62204
+ this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
62205
+ }
62206
+ else if (item.layoutOrient === 'right') {
62207
+ item.setLayoutStartPosition({
62208
+ x: this.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
62209
+ y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
62210
+ });
62211
+ this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
62212
+ }
62213
+ else if (item.layoutOrient === 'bottom') {
62214
+ item.setLayoutStartPosition({
62215
+ x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingRight,
62216
+ y: this.bottomCurrent + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
62217
+ });
62218
+ this.bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
62219
+ }
62220
+ });
62221
+ }
62222
+ layoutNormalInlineItems(normalItems) {
62223
+ const leftItems = normalItems.filter(item => item.layoutOrient === 'left');
62224
+ const rightItems = normalItems.filter(item => item.layoutOrient === 'right');
62225
+ const topItems = normalItems.filter(item => item.layoutOrient === 'top');
62226
+ const bottomItems = normalItems.filter(item => item.layoutOrient === 'bottom');
62227
+ const limitWidth = this._chartLayoutRect.width + this._chartLayoutRect.x;
62228
+ const limitHeight = this._chartLayoutRect.height + this._chartLayoutRect.y;
62229
+ layoutLeftInlineItems(leftItems, this, limitHeight);
62230
+ layoutTopInlineItems(topItems, this, limitWidth);
62231
+ layoutRightInlineItems(rightItems, this, limitHeight);
62232
+ layoutBottomInlineItems(bottomItems, this, limitWidth);
61792
62233
  }
61793
62234
  layoutRegionItems(regionItems, regionRelativeItems) {
61794
- let regionRelativeTotalWidth = this._rightCurrent - this._leftCurrent;
61795
- let regionRelativeTotalHeight = this._bottomCurrent - this._topCurrent;
62235
+ let regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;
62236
+ let regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;
61796
62237
  regionRelativeItems
61797
62238
  .filter(x => x.layoutOrient === 'left' || x.layoutOrient === 'right')
61798
62239
  .forEach(item => {
@@ -61801,18 +62242,18 @@
61801
62242
  item.setLayoutRect({ width: rect.width });
61802
62243
  if (item.layoutOrient === 'left') {
61803
62244
  item.setLayoutStartPosition({
61804
- x: this._leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft
62245
+ x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft
61805
62246
  });
61806
- this._leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
62247
+ this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
61807
62248
  }
61808
62249
  else if (item.layoutOrient === 'right') {
61809
- this._rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
62250
+ this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
61810
62251
  item.setLayoutStartPosition({
61811
- x: this._rightCurrent + item.layoutOffsetX + item.layoutPaddingLeft
62252
+ x: this.rightCurrent + item.layoutOffsetX + item.layoutPaddingLeft
61812
62253
  });
61813
62254
  }
61814
62255
  });
61815
- regionRelativeTotalWidth = this._rightCurrent - this._leftCurrent;
62256
+ regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;
61816
62257
  regionRelativeItems
61817
62258
  .filter(x => x.layoutOrient === 'top' || x.layoutOrient === 'bottom')
61818
62259
  .forEach(item => {
@@ -61821,26 +62262,28 @@
61821
62262
  item.setLayoutRect({ height: rect.height });
61822
62263
  if (item.layoutOrient === 'top') {
61823
62264
  item.setLayoutStartPosition({
61824
- y: this._topCurrent + item.layoutOffsetY + item.layoutPaddingTop
62265
+ y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
61825
62266
  });
61826
- this._topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
62267
+ this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
61827
62268
  }
61828
62269
  else if (item.layoutOrient === 'bottom') {
61829
- this._bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
62270
+ this.bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
61830
62271
  item.setLayoutStartPosition({
61831
- y: this._bottomCurrent + item.layoutOffsetY + item.layoutPaddingTop
62272
+ y: this.bottomCurrent + item.layoutOffsetY + item.layoutPaddingTop
61832
62273
  });
61833
62274
  }
61834
62275
  });
61835
- regionRelativeTotalHeight = this._bottomCurrent - this._topCurrent;
62276
+ regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;
62277
+ const regionWidth = Math.min(regionRelativeTotalWidth, ...regionItems.map(region => { var _a, _b; return (_b = (_a = region.getMaxWidth) === null || _a === void 0 ? void 0 : _a.call(region)) !== null && _b !== void 0 ? _b : Number.MAX_VALUE; }));
62278
+ const regionHeight = Math.min(regionRelativeTotalHeight, ...regionItems.map(region => { var _a, _b; return (_b = (_a = region.getMaxHeight) === null || _a === void 0 ? void 0 : _a.call(region)) !== null && _b !== void 0 ? _b : Number.MAX_VALUE; }));
61836
62279
  regionItems.forEach(region => {
61837
62280
  region.setLayoutRect({
61838
- width: regionRelativeTotalWidth,
61839
- height: regionRelativeTotalHeight
62281
+ width: regionWidth,
62282
+ height: regionHeight
61840
62283
  });
61841
62284
  region.setLayoutStartPosition({
61842
- x: this._leftCurrent + region.layoutOffsetX + region.layoutPaddingLeft,
61843
- y: this._topCurrent + region.layoutOffsetY + region.layoutPaddingTop
62285
+ x: this.leftCurrent + region.layoutOffsetX + region.layoutPaddingLeft,
62286
+ y: this.topCurrent + region.layoutOffsetY + region.layoutPaddingTop
61844
62287
  });
61845
62288
  });
61846
62289
  regionRelativeItems.forEach(item => {
@@ -61852,6 +62295,11 @@
61852
62295
  item.setLayoutStartPosition({
61853
62296
  y: relativeRegion.getLayoutStartPoint().y + item.layoutOffsetY + item.layoutPaddingTop
61854
62297
  });
62298
+ if (item.layoutOrient === 'right') {
62299
+ item.setLayoutStartPosition({
62300
+ x: item.getLayoutStartPoint().x + regionWidth - regionRelativeTotalWidth
62301
+ });
62302
+ }
61855
62303
  }
61856
62304
  else if (['top', 'bottom'].includes(item.layoutOrient)) {
61857
62305
  const relativeRegion = this.filterRegionsWithID(regionItems, item.layoutBindRegionID[0]);
@@ -61861,6 +62309,11 @@
61861
62309
  item.setLayoutStartPosition({
61862
62310
  x: relativeRegion.getLayoutStartPoint().x + item.layoutOffsetX + item.layoutPaddingLeft
61863
62311
  });
62312
+ if (item.layoutOrient === 'bottom') {
62313
+ item.setLayoutStartPosition({
62314
+ y: item.getLayoutStartPoint().y + regionHeight - regionRelativeTotalHeight
62315
+ });
62316
+ }
61864
62317
  }
61865
62318
  });
61866
62319
  }
@@ -61879,8 +62332,8 @@
61879
62332
  }
61880
62333
  getItemComputeLayoutRect(item) {
61881
62334
  const result = {
61882
- width: this._rightCurrent - this._leftCurrent - item.layoutPaddingLeft - item.layoutPaddingRight,
61883
- height: this._bottomCurrent - this._topCurrent - item.layoutPaddingTop - item.layoutPaddingBottom
62335
+ width: this.rightCurrent - this.leftCurrent - item.layoutPaddingLeft - item.layoutPaddingRight,
62336
+ height: this.bottomCurrent - this.topCurrent - item.layoutPaddingTop - item.layoutPaddingBottom
61884
62337
  };
61885
62338
  return result;
61886
62339
  }
@@ -61891,8 +62344,8 @@
61891
62344
  bottom: 0,
61892
62345
  right: 0
61893
62346
  };
61894
- const rightCurrent = this._chartViewBox.x2 - this._chartViewBox.x1 - this._rightCurrent;
61895
- const bottomCurrent = this._chartViewBox.y2 - this._chartViewBox.y1 - this._bottomCurrent;
62347
+ const rightCurrent = this._chartViewBox.x2 - this._chartViewBox.x1 - this.rightCurrent;
62348
+ const bottomCurrent = this._chartViewBox.y2 - this._chartViewBox.y1 - this.bottomCurrent;
61896
62349
  items.forEach(i => {
61897
62350
  if (!i.getVisible() || !i.getAutoIndent()) {
61898
62351
  return;
@@ -61900,11 +62353,11 @@
61900
62353
  const vOrH = i.layoutOrient === 'left' || i.layoutOrient === 'right';
61901
62354
  const outer = i.getLastComputeOutBounds();
61902
62355
  if (vOrH) {
61903
- result.top = Math.max(result.top, outer.y1 - this._topCurrent);
62356
+ result.top = Math.max(result.top, outer.y1 - this.topCurrent);
61904
62357
  result.bottom = Math.max(result.bottom, outer.y2 - bottomCurrent);
61905
62358
  }
61906
62359
  else {
61907
- result.left = Math.max(result.left, outer.x1 - this._leftCurrent);
62360
+ result.left = Math.max(result.left, outer.x1 - this.leftCurrent);
61908
62361
  result.right = Math.max(result.right, outer.x2 - rightCurrent);
61909
62362
  }
61910
62363
  });
@@ -62224,6 +62677,9 @@
62224
62677
  }
62225
62678
  }
62226
62679
 
62680
+ const keptInUpdateAttribute = {
62681
+ defined: true
62682
+ };
62227
62683
  class CompilableMark extends GrammarItem {
62228
62684
  getSupport3d() {
62229
62685
  return this._support3d;
@@ -62440,6 +62896,9 @@
62440
62896
  dependency: [this.stateKeyToSignalName('markUpdateRank')]
62441
62897
  };
62442
62898
  }
62899
+ else if (keptInUpdateAttribute[key]) {
62900
+ updateStyles[key] = normalStyle[key].style;
62901
+ }
62443
62902
  else {
62444
62903
  enterStyles[key] = this.compileCommonAttributeCallback(key, 'normal');
62445
62904
  }
@@ -62858,7 +63317,7 @@
62858
63317
  computeColor = color(data, this._attributeContext, opt, markData);
62859
63318
  }
62860
63319
  if (isValid$1(opacity)) {
62861
- computeColor = Color.SetOpacity(computeColor, opacity);
63320
+ computeColor = Color$1.SetOpacity(computeColor, opacity);
62862
63321
  }
62863
63322
  return {
62864
63323
  offset: isFunction$1(offset) ? offset(data, this._attributeContext, opt, markData) : offset,
@@ -63003,7 +63462,7 @@
63003
63462
  VChart.useMark([ComponentMark, GroupMark, ImageMark]);
63004
63463
  Factory.registerRegion('region', Region);
63005
63464
  Factory.registerLayout('base', Layout);
63006
- const version = "1.4.0-beta.2";
63465
+ const version = "1.4.0";
63007
63466
  Logger.getInstance(LoggerLevel.Error);
63008
63467
 
63009
63468
  const WordCloud3dAnimation = (params) => {
@@ -64240,17 +64699,26 @@
64240
64699
  });
64241
64700
  }
64242
64701
  encodeDefined(mark, attr) {
64243
- var _a, _b;
64702
+ var _a, _b, _c, _d, _e, _f;
64244
64703
  if (!mark) {
64245
64704
  return;
64246
64705
  }
64247
64706
  const statistics = (_b = (_a = this.getViewDataStatistics()) === null || _a === void 0 ? void 0 : _a.latestData) === null || _b === void 0 ? void 0 : _b[this.getStackValueField()];
64248
64707
  if (this._invalidType === 'zero' || (statistics && (statistics === null || statistics === void 0 ? void 0 : statistics.allValid))) {
64708
+ if (((_d = (_c = mark.stateStyle.normal) === null || _c === void 0 ? void 0 : _c[attr]) === null || _d === void 0 ? void 0 : _d.style) === true) {
64709
+ return;
64710
+ }
64249
64711
  this.setMarkStyle(mark, { [attr]: true }, 'normal', AttributeLevel.Series);
64250
64712
  }
64251
64713
  else {
64714
+ if (((_f = (_e = mark.stateStyle.normal) === null || _e === void 0 ? void 0 : _e[attr]) === null || _f === void 0 ? void 0 : _f.style) !== true) {
64715
+ return;
64716
+ }
64252
64717
  this.setMarkStyle(mark, { [attr]: this._getInvalidDefined }, 'normal', AttributeLevel.Series);
64253
64718
  }
64719
+ if (mark.getProduct()) {
64720
+ mark.compileEncode();
64721
+ }
64254
64722
  }
64255
64723
  }
64256
64724
 
@@ -65250,6 +65718,10 @@
65250
65718
  getStack() {
65251
65719
  return this._stack;
65252
65720
  }
65721
+ getStackValue() {
65722
+ var _a;
65723
+ return (_a = this._spec.stackValue) !== null && _a !== void 0 ? _a : `${PREFIX}_series_${this.type}`;
65724
+ }
65253
65725
  getPercent() {
65254
65726
  return this._percent;
65255
65727
  }
@@ -65343,6 +65815,9 @@
65343
65815
  this._stackOffsetSilhouette = this._spec.stackOffsetSilhouette;
65344
65816
  this._stack = this._spec.stackOffsetSilhouette || this._stack;
65345
65817
  }
65818
+ if (isValid$1(this._spec.stackValue)) {
65819
+ this._stack = true;
65820
+ }
65346
65821
  if (isValid$1(this._spec.invalidType)) {
65347
65822
  this._invalidType = this._spec.invalidType;
65348
65823
  }
@@ -65777,8 +66252,8 @@
65777
66252
  _compareSpec(ignoreCheckKeys) {
65778
66253
  var _a, _b;
65779
66254
  const result = super._compareSpec();
65780
- const currentKeys = Object.keys(this._originalSpec).sort();
65781
- const nextKeys = Object.keys(this._spec).sort();
66255
+ const currentKeys = Object.keys(this._originalSpec || {}).sort();
66256
+ const nextKeys = Object.keys(this._spec || {}).sort();
65782
66257
  if (!isEqual$1(currentKeys, nextKeys)) {
65783
66258
  result.reMake = true;
65784
66259
  return result;
@@ -67114,27 +67589,23 @@
67114
67589
  class Stack {
67115
67590
  constructor(chart) {
67116
67591
  this.stackRegion = ({ model }) => {
67117
- const stackCache = {
67118
- nodes: {}
67119
- };
67120
- model.getSeries().forEach(s => {
67121
- const stackData = s.getStackData();
67122
- const stackValueField = s.getStackValueField();
67123
- if (stackData && stackValueField) {
67124
- this.stackGroup(stackData, stackCache, stackValueField);
67592
+ const stackValueGroup = getRegionStackGroup(model, true);
67593
+ for (const stackValue in stackValueGroup) {
67594
+ for (const key in stackValueGroup[stackValue].nodes) {
67595
+ stack(stackValueGroup[stackValue].nodes[key], model.getStackInverse());
67125
67596
  }
67126
- });
67127
- for (const key in stackCache.nodes) {
67128
- this.stack(stackCache.nodes[key]);
67129
67597
  }
67130
- for (const key in stackCache.nodes) {
67131
- this.stackOffsetSilhouette(stackCache.nodes[key]);
67598
+ for (const stackValue in stackValueGroup) {
67599
+ for (const key in stackValueGroup[stackValue].nodes) {
67600
+ stackOffsetSilhouette(stackValueGroup[stackValue].nodes[key]);
67601
+ }
67132
67602
  }
67133
67603
  model.getSeries().forEach(s => {
67134
67604
  const stackData = s.getStackData();
67605
+ const stackValue = s.getStackValue();
67135
67606
  const stackValueField = s.getStackValueField();
67136
67607
  if (stackData && stackValueField) {
67137
- this.stackTotal(stackCache, stackValueField);
67608
+ stackTotal(stackValueGroup[stackValue], stackValueField);
67138
67609
  }
67139
67610
  });
67140
67611
  };
@@ -67150,81 +67621,6 @@
67150
67621
  this.stackRegion({ model: r });
67151
67622
  });
67152
67623
  }
67153
- stackTotal(stackData, valueField) {
67154
- if ('values' in stackData && stackData.values.length) {
67155
- const total = sum(stackData.values, valueField);
67156
- const percent = max(stackData.values, STACK_FIELD_END_PERCENT);
67157
- stackData.values.forEach(v => {
67158
- v[STACK_FIELD_TOTAL] = total;
67159
- v[STACK_FIELD_TOTAL_PERCENT] = percent;
67160
- delete v[STACK_FIELD_TOTAL_TOP];
67161
- });
67162
- const maxNode = stackData.values.reduce((max, current) => {
67163
- return current[STACK_FIELD_END] > max[STACK_FIELD_END] ? current : max;
67164
- });
67165
- maxNode[STACK_FIELD_TOTAL_TOP] = true;
67166
- return;
67167
- }
67168
- for (const key in stackData.nodes) {
67169
- this.stackTotal(stackData.nodes[key], valueField);
67170
- }
67171
- }
67172
- stackOffsetSilhouette(stackCache) {
67173
- if (!stackCache.values.length) {
67174
- return;
67175
- }
67176
- const centerValue = stackCache.values[stackCache.values.length - 1][STACK_FIELD_END] / 2;
67177
- for (let j = 0; j < stackCache.values.length; j++) {
67178
- stackCache.values[j][STACK_FIELD_START_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_START] - centerValue;
67179
- stackCache.values[j][STACK_FIELD_END_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_END] - centerValue;
67180
- }
67181
- }
67182
- stack(stackCache) {
67183
- if (stackCache.values.length > 0) {
67184
- let positiveStart = 0;
67185
- let negativeStart = 0;
67186
- let sign = 1;
67187
- let value = 0;
67188
- stackCache.values.forEach(v => {
67189
- value = v[STACK_FIELD_END];
67190
- if (value >= 0) {
67191
- v[STACK_FIELD_START] = positiveStart;
67192
- positiveStart += v[STACK_FIELD_END];
67193
- v[STACK_FIELD_END] = positiveStart;
67194
- }
67195
- else {
67196
- v[STACK_FIELD_START] = negativeStart;
67197
- negativeStart += v[STACK_FIELD_END];
67198
- v[STACK_FIELD_END] = negativeStart;
67199
- }
67200
- });
67201
- stackCache.values.forEach(v => {
67202
- value = v[STACK_FIELD_END];
67203
- const denominator = value >= 0 ? positiveStart : negativeStart;
67204
- sign = value >= 0 ? 1 : -1;
67205
- v[STACK_FIELD_START_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_START] / denominator) * sign;
67206
- v[STACK_FIELD_END_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_END] / denominator) * sign;
67207
- });
67208
- }
67209
- for (const key in stackCache.nodes) {
67210
- this.stack(stackCache.nodes[key]);
67211
- }
67212
- }
67213
- stackGroup(stackData, stackCache, valueField) {
67214
- if ('values' in stackData) {
67215
- stackData.values.forEach(v => (v[STACK_FIELD_END] = toValidNumber(v[valueField])));
67216
- stackCache.values.push(...stackData.values);
67217
- return;
67218
- }
67219
- for (const key in stackData.nodes) {
67220
- !stackCache.nodes[key] &&
67221
- (stackCache.nodes[key] = {
67222
- values: [],
67223
- nodes: {}
67224
- });
67225
- this.stackGroup(stackData.nodes[key], stackCache.nodes[key], valueField);
67226
- }
67227
- }
67228
67624
  }
67229
67625
 
67230
67626
  class BaseChart extends CompilableBase {
@@ -67413,6 +67809,9 @@
67413
67809
  if (!has$2(spec, 'tooltip')) {
67414
67810
  spec.tooltip = {};
67415
67811
  }
67812
+ if (isValid$1(spec.stackInverse)) {
67813
+ spec.region.forEach((r) => !isValid$1(r.stackInverse) && (r.stackInverse = spec.stackInverse));
67814
+ }
67416
67815
  }
67417
67816
  init(options = {}) {
67418
67817
  this.initRegion();
@@ -68363,6 +68762,48 @@
68363
68762
  }
68364
68763
  RectMark.type = MarkTypeEnum.rect;
68365
68764
 
68765
+ function stackWithMinHeight(stackCache, stackInverse, context) {
68766
+ if (stackCache.values.length > 0) {
68767
+ let seriesInfo = stackCache.series;
68768
+ if (stackInverse) {
68769
+ seriesInfo = [...seriesInfo].reverse();
68770
+ }
68771
+ let lastY;
68772
+ seriesInfo.forEach(({ s, values }, sIndex) => {
68773
+ var _a, _b;
68774
+ const barMinHeight = s.getSpec().barMinHeight;
68775
+ const seriesScale = (_b = (_a = s[context.axisHelper]).getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
68776
+ const inverse = s[context.axisHelper].isInverse();
68777
+ for (let index = 0; index < values.length; index++) {
68778
+ const obj = values[stackInverse ? values.length - 1 - index : index];
68779
+ const y1 = valueInScaleRange(s[context.startMethod](obj), seriesScale);
68780
+ let y = valueInScaleRange(s[context.endMethod](obj), seriesScale);
68781
+ if (index === 0 && sIndex === 0) {
68782
+ lastY = y1;
68783
+ }
68784
+ let height = Math.abs(y1 - y);
68785
+ if (height < barMinHeight) {
68786
+ height = barMinHeight;
68787
+ }
68788
+ let flag = 1;
68789
+ if (y < y1) {
68790
+ flag = -1;
68791
+ }
68792
+ else if (y === y1) {
68793
+ flag = context.isVertical ? (inverse ? 1 : -1) : inverse ? -1 : 1;
68794
+ }
68795
+ y = lastY + flag * height;
68796
+ obj[context.start] = lastY;
68797
+ obj[context.end] = y;
68798
+ lastY = y;
68799
+ }
68800
+ });
68801
+ }
68802
+ for (const key in stackCache.nodes) {
68803
+ stackWithMinHeight(stackCache.nodes[key], stackInverse, context);
68804
+ }
68805
+ }
68806
+
68366
68807
  VChart.useMark([RectMark, TextMark]);
68367
68808
  const DefaultBandWidth$2 = 6;
68368
68809
  const RECT_X = `${PREFIX}_rect_x`;
@@ -68456,61 +68897,19 @@
68456
68897
  endMethod = 'dataToPositionX';
68457
68898
  axisHelper = '_xAxisHelper';
68458
68899
  }
68459
- const barSeriesArr = region.getSeries().filter(s => s.type === SeriesTypeEnum.bar && s.getStackData());
68460
- const groupedStackData = {};
68461
- const iterateStackData = (data, preKey, seriesId) => {
68462
- Object.keys(data.nodes).forEach(key => {
68463
- const currentKey = preKey ? `${preKey}_${key}` : key;
68464
- if (data.nodes[key].nodes) {
68465
- iterateStackData(data.nodes[key], currentKey, seriesId);
68466
- }
68467
- else {
68468
- if (!groupedStackData[currentKey]) {
68469
- groupedStackData[currentKey] = [];
68470
- }
68471
- data.nodes[key].values.forEach((obj) => {
68472
- obj.seriesId = seriesId;
68473
- groupedStackData[currentKey].push(obj);
68474
- });
68475
- }
68476
- });
68477
- };
68478
- barSeriesArr.forEach(s => {
68479
- const stackData = s.getStackData();
68480
- iterateStackData(stackData, '', s.id);
68481
- });
68482
- Object.keys(groupedStackData).forEach(key => {
68483
- const values = groupedStackData[key];
68484
- values.sort((a, b) => Math.abs(a[STACK_FIELD_START]) - Math.abs(b[STACK_FIELD_START]));
68485
- let lastY;
68486
- values.forEach((obj, index) => {
68487
- var _a, _b;
68488
- const series = barSeriesArr.find(s => s.id === obj.seriesId);
68489
- const barMinHeight = series.getSpec().barMinHeight;
68490
- const seriesScale = (_b = (_a = series[axisHelper]).getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
68491
- const inverse = series[axisHelper].isInverse();
68492
- const y1 = valueInScaleRange(series[startMethod](obj), seriesScale);
68493
- let y = valueInScaleRange(series[endMethod](obj), seriesScale);
68494
- if (index === 0) {
68495
- lastY = y1;
68496
- }
68497
- let height = Math.abs(y1 - y);
68498
- if (height < barMinHeight) {
68499
- height = barMinHeight;
68500
- }
68501
- let flag = 1;
68502
- if (y < y1) {
68503
- flag = -1;
68504
- }
68505
- else if (y === y1) {
68506
- flag = isVertical ? (inverse ? 1 : -1) : inverse ? -1 : 1;
68507
- }
68508
- y = lastY + flag * height;
68509
- obj[start] = lastY;
68510
- obj[end] = y;
68511
- lastY = y;
68512
- });
68513
- });
68900
+ const stackValueGroup = getRegionStackGroup(region, false, s => s.type === SeriesTypeEnum.bar);
68901
+ for (const stackValue in stackValueGroup) {
68902
+ for (const key in stackValueGroup[stackValue].nodes) {
68903
+ stackWithMinHeight(stackValueGroup[stackValue].nodes[key], region.getStackInverse(), {
68904
+ isVertical,
68905
+ start,
68906
+ end,
68907
+ startMethod,
68908
+ endMethod,
68909
+ axisHelper
68910
+ });
68911
+ }
68912
+ }
68514
68913
  }
68515
68914
  _calculateRectPosition(datum, isVertical) {
68516
68915
  var _a, _b;
@@ -82999,13 +83398,15 @@
82999
83398
  return this._container;
83000
83399
  }
83001
83400
  _compareSpec() {
83401
+ var _a;
83002
83402
  const result = super._compareSpec();
83003
83403
  if (!result.reMake) {
83004
83404
  result.reMake = ['seriesId', 'seriesIndex', 'regionId', 'regionIndex'].some(k => {
83005
- return isEqual$1(this._originalSpec[k], this.getSpec()[k]);
83405
+ var _a;
83406
+ return isEqual$1((_a = this._originalSpec) === null || _a === void 0 ? void 0 : _a[k], this.getSpec()[k]);
83006
83407
  });
83007
83408
  }
83008
- if (this._originalSpec.visible !== this.getSpec().visible) {
83409
+ if (((_a = this._originalSpec) === null || _a === void 0 ? void 0 : _a.visible) !== this.getSpec().visible) {
83009
83410
  result.reCompile = true;
83010
83411
  }
83011
83412
  return result;
@@ -83016,6 +83417,16 @@
83016
83417
  }
83017
83418
  clear() {
83018
83419
  var _a;
83420
+ const components = this.getVRenderComponents();
83421
+ if (components && components.length) {
83422
+ components.forEach(c => {
83423
+ var _a;
83424
+ if (c) {
83425
+ (_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(c);
83426
+ c = null;
83427
+ }
83428
+ });
83429
+ }
83019
83430
  this._container = null;
83020
83431
  (_a = this.pluginService) === null || _a === void 0 ? void 0 : _a.disposeAll();
83021
83432
  this.pluginService = null;
@@ -83124,7 +83535,7 @@
83124
83535
  if (this._relatedAxisComponent && this._filterMode === IFilterMode.axis) {
83125
83536
  const axisScale = this._relatedAxisComponent.getScale();
83126
83537
  const axisSpec = this._relatedAxisComponent.getSpec();
83127
- if (this._auto) {
83538
+ if (this._auto && this._getAxisBandSize(axisSpec)) {
83128
83539
  axisScale.range((_a = this._stateScale) === null || _a === void 0 ? void 0 : _a.range(), true);
83129
83540
  }
83130
83541
  const newRangeFactor = axisScale.range()[0] < axisScale.range()[1] || axisSpec.inverse
@@ -83547,15 +83958,23 @@
83547
83958
  var _a;
83548
83959
  (_a = this._component) === null || _a === void 0 ? void 0 : _a.showAll();
83549
83960
  }
83961
+ _getAxisBandSize(axisSpec) {
83962
+ const bandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.bandSize;
83963
+ const maxBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.maxBandSize;
83964
+ const minBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.minBandSize;
83965
+ if (bandSize || minBandSize || maxBandSize) {
83966
+ return { bandSize, maxBandSize, minBandSize };
83967
+ }
83968
+ return undefined;
83969
+ }
83550
83970
  _autoUpdate(rect) {
83551
- var _a, _b, _c;
83971
+ var _a, _b, _c, _d;
83552
83972
  if (!this._auto) {
83553
83973
  return true;
83554
83974
  }
83555
83975
  const axisSpec = (_a = this._relatedAxisComponent) === null || _a === void 0 ? void 0 : _a.getSpec();
83556
- const bandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.bandSize;
83557
- const maxBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.maxBandSize;
83558
- const minBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.minBandSize;
83976
+ const bandSizeResult = this._getAxisBandSize(axisSpec);
83977
+ const { bandSize, maxBandSize, minBandSize } = bandSizeResult !== null && bandSizeResult !== void 0 ? bandSizeResult : {};
83559
83978
  if ((rect === null || rect === void 0 ? void 0 : rect.height) === ((_b = this._cacheRect) === null || _b === void 0 ? void 0 : _b.height) &&
83560
83979
  (rect === null || rect === void 0 ? void 0 : rect.width) === ((_c = this._cacheRect) === null || _c === void 0 ? void 0 : _c.width) &&
83561
83980
  this._fixedBandSize === bandSize) {
@@ -83566,7 +83985,7 @@
83566
83985
  const scale = this._stateScale;
83567
83986
  scale.range(this._isHorizontal ? [0, rect.width] : axisSpec.inverse ? [0, rect.height] : [rect.height, 0]);
83568
83987
  if (isDiscrete(scale.type)) {
83569
- if (bandSize || minBandSize || maxBandSize) {
83988
+ if (bandSizeResult) {
83570
83989
  if (this._start || this._end) {
83571
83990
  scale.rangeFactor([this._start, this._end], true);
83572
83991
  }
@@ -83579,26 +83998,26 @@
83579
83998
  if (minBandSize) {
83580
83999
  scale.minBandwidth(minBandSize, true);
83581
84000
  }
83582
- scale.rescale(false);
83583
- let [start, end] = scale.rangeFactor();
83584
- if ((!start && !end) || !scale.isBandwidthFixed()) {
83585
- start = 0;
83586
- end = 1;
84001
+ scale.rescale();
84002
+ }
84003
+ let [start, end] = (_d = scale.rangeFactor()) !== null && _d !== void 0 ? _d : [];
84004
+ if ((!start && !end) || !scale.isBandwidthFixed()) {
84005
+ start = 0;
84006
+ end = 1;
84007
+ this.hide();
84008
+ isShown = false;
84009
+ }
84010
+ else {
84011
+ if (start === 0 && end === 1) {
83587
84012
  this.hide();
83588
84013
  isShown = false;
83589
84014
  }
83590
84015
  else {
83591
- if (start === 0 && end === 1) {
83592
- this.hide();
83593
- isShown = false;
83594
- }
83595
- else {
83596
- this.show();
83597
- }
84016
+ this.show();
83598
84017
  }
83599
- this._start = start;
83600
- this._end = end;
83601
84018
  }
84019
+ this._start = start;
84020
+ this._end = end;
83602
84021
  }
83603
84022
  this.setStartAndEnd(this._start, this._end);
83604
84023
  this._cacheVisibility = isShown;
@@ -83723,13 +84142,8 @@
83723
84142
  }
83724
84143
  return attrs;
83725
84144
  }
83726
- clear() {
83727
- var _a;
83728
- if (this._component) {
83729
- (_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._component);
83730
- this._component = null;
83731
- }
83732
- super.clear();
84145
+ getVRenderComponents() {
84146
+ return [this._component];
83733
84147
  }
83734
84148
  }
83735
84149
  ScrollBar.type = ComponentTypeEnum.scrollBar;
@@ -84012,13 +84426,8 @@
84012
84426
  }
84013
84427
  };
84014
84428
  }
84015
- clear() {
84016
- var _a;
84017
- if (this._component) {
84018
- (_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._component);
84019
- this._component = null;
84020
- }
84021
- super.clear();
84429
+ getVRenderComponents() {
84430
+ return [this._component];
84022
84431
  }
84023
84432
  }
84024
84433
  DataZoom.type = ComponentTypeEnum.dataZoom;
@@ -84093,6 +84502,9 @@
84093
84502
  }
84094
84503
  changeRegions(regions) {
84095
84504
  }
84505
+ getVRenderComponents() {
84506
+ return [];
84507
+ }
84096
84508
  onRender(ctx) {
84097
84509
  }
84098
84510
  }
@@ -84115,6 +84527,7 @@
84115
84527
  this._needInitOutState = true;
84116
84528
  this._isFirstState = true;
84117
84529
  this._cacheInteractiveRangeAttrs = [];
84530
+ this._needEnablePickable = true;
84118
84531
  }
84119
84532
  static createComponent(spec, options) {
84120
84533
  const brushSpec = spec.brush || options.defaultSpec;
@@ -84187,9 +84600,11 @@
84187
84600
  }
84188
84601
  if (operateType === IOperateType.drawing) {
84189
84602
  this._needInitOutState = false;
84603
+ this._needEnablePickable = true;
84190
84604
  }
84191
84605
  if (operateType === IOperateType.drawEnd) {
84192
84606
  this._needInitOutState = true;
84607
+ this._needEnablePickable = false;
84193
84608
  }
84194
84609
  if (operateType === IOperateType.brushClear) {
84195
84610
  this._initMarkBrushState(componentIndex, '');
@@ -84266,6 +84681,7 @@
84266
84681
  this._outOfBrushElementsMap[elementKey] = el;
84267
84682
  delete this._inBrushElementsMap[operateMask.name][elementKey];
84268
84683
  }
84684
+ graphicItem.setAttribute('pickable', !this._needEnablePickable);
84269
84685
  });
84270
84686
  });
84271
84687
  }
@@ -84300,6 +84716,7 @@
84300
84716
  graphicItem.addState('outOfBrush');
84301
84717
  this._linkedOutOfBrushElementsMap[elementKey] = el;
84302
84718
  }
84719
+ graphicItem.setAttribute('pickable', !this._needEnablePickable);
84303
84720
  });
84304
84721
  });
84305
84722
  }
@@ -84320,17 +84737,38 @@
84320
84737
  y: b * p.x + d * p.y + f + dy
84321
84738
  };
84322
84739
  });
84323
- const globalAABBBoundsOffset = brushMask.globalAABBBounds
84740
+ brushMask.globalAABBBounds
84324
84741
  .clone()
84325
84742
  .set(brushMask.globalAABBBounds.x1 + dx, brushMask.globalAABBBounds.y1 + dy, brushMask.globalAABBBounds.x2 + dx, brushMask.globalAABBBounds.y2 + dy);
84326
84743
  const x = item.globalTransMatrix.e;
84327
84744
  const y = item.globalTransMatrix.f;
84745
+ let itemBounds = [];
84328
84746
  if (item.type === 'symbol') {
84329
- return globalAABBBoundsOffset.contains(x, y) && polygonContainPoint(pointsCoord, x, y);
84747
+ const { size: itemSize = 0 } = item === null || item === void 0 ? void 0 : item.attribute;
84748
+ const size = array(itemSize)[0];
84749
+ itemBounds = [
84750
+ {
84751
+ x: x - size,
84752
+ y: y - size
84753
+ },
84754
+ {
84755
+ x: x + size,
84756
+ y: y - size
84757
+ },
84758
+ {
84759
+ x: x + size,
84760
+ y: y + size
84761
+ },
84762
+ {
84763
+ x: x - size,
84764
+ y: y + size
84765
+ }
84766
+ ];
84767
+ return polygonIntersectPolygon(pointsCoord, itemBounds);
84330
84768
  }
84331
84769
  else if (item.type === 'rect') {
84332
84770
  const { width = 0, height = 0 } = item === null || item === void 0 ? void 0 : item.attribute;
84333
- const pointsRect = [
84771
+ itemBounds = [
84334
84772
  {
84335
84773
  x: x,
84336
84774
  y: y
@@ -84348,7 +84786,7 @@
84348
84786
  y: y + height
84349
84787
  }
84350
84788
  ];
84351
- return polygonIntersectPolygon(pointsCoord, pointsRect);
84789
+ return polygonIntersectPolygon(pointsCoord, itemBounds);
84352
84790
  }
84353
84791
  return brushMask.globalAABBBounds.intersects(item.globalAABBBounds);
84354
84792
  }
@@ -84428,6 +84866,9 @@
84428
84866
  }
84429
84867
  changeRegions(regions) {
84430
84868
  }
84869
+ getVRenderComponents() {
84870
+ return this._brushComponents;
84871
+ }
84431
84872
  _compareSpec() {
84432
84873
  if (this._brushComponents) {
84433
84874
  this._relativeRegions.forEach((region, index) => {
@@ -84980,6 +85421,9 @@
84980
85421
  }
84981
85422
  changeRegions() {
84982
85423
  }
85424
+ getVRenderComponents() {
85425
+ return [];
85426
+ }
84983
85427
  }
84984
85428
  MapLabelComponent.type = ComponentTypeEnum.mapLabel;
84985
85429
  MapLabelComponent.speckey = 'mapLabel';
@@ -85372,6 +85816,9 @@
85372
85816
  };
85373
85817
  this._visible = (_a = spec.visible) !== null && _a !== void 0 ? _a : true;
85374
85818
  }
85819
+ getVRenderComponents() {
85820
+ return [];
85821
+ }
85375
85822
  created() {
85376
85823
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
85377
85824
  super.created();
@@ -85485,9 +85932,10 @@
85485
85932
  }
85486
85933
  }
85487
85934
  _compareSpec() {
85935
+ var _a, _b;
85488
85936
  const result = super._compareSpec();
85489
85937
  result.reRender = true;
85490
- if (this._originalSpec.type !== this._spec.type) {
85938
+ if (((_a = this._originalSpec) === null || _a === void 0 ? void 0 : _a.type) !== ((_b = this._spec) === null || _b === void 0 ? void 0 : _b.type)) {
85491
85939
  result.reMake = true;
85492
85940
  return result;
85493
85941
  }
@@ -86646,6 +87094,7 @@
86646
87094
  this.updateFixedWholeLength();
86647
87095
  }
86648
87096
  updateFixedWholeLength() {
87097
+ var _a;
86649
87098
  if (this._scale) {
86650
87099
  if (this._spec.bandSize) {
86651
87100
  this._scale.bandwidth(this._spec.bandSize);
@@ -86656,6 +87105,17 @@
86656
87105
  if (this._spec.minBandSize) {
86657
87106
  this._scale.minBandwidth(this._spec.minBandSize);
86658
87107
  }
87108
+ if (this._scale.isBandwidthFixed() &&
87109
+ this._spec.autoRegionSize &&
87110
+ (this._spec.bandSize || this._spec.maxBandSize)) {
87111
+ const rangeSize = scaleWholeRangeSize(this._scale.domain().length, (_a = this._spec.bandSize) !== null && _a !== void 0 ? _a : this._spec.maxBandSize, this._scale.paddingInner(), this._scale.paddingOuter());
87112
+ if (['bottom', 'top'].includes(this._orient)) {
87113
+ this._regions.forEach(region => region.setMaxWidth(rangeSize));
87114
+ }
87115
+ else if (['left', 'right'].includes(this._orient)) {
87116
+ this._regions.forEach(region => region.setMaxHeight(rangeSize));
87117
+ }
87118
+ }
86659
87119
  }
86660
87120
  }
86661
87121
  }
@@ -87476,9 +87936,10 @@
87476
87936
  onRender(ctx) {
87477
87937
  }
87478
87938
  _compareSpec() {
87939
+ var _a, _b;
87479
87940
  const result = super._compareSpec();
87480
87941
  result.reRender = true;
87481
- if (this._spec.orient !== this._originalSpec.orient) {
87942
+ if (((_a = this._spec) === null || _a === void 0 ? void 0 : _a.orient) !== ((_b = this._originalSpec) === null || _b === void 0 ? void 0 : _b.orient)) {
87482
87943
  result.reMake = true;
87483
87944
  return result;
87484
87945
  }
@@ -87555,31 +88016,33 @@
87555
88016
  this._cacheAttrs = attrs;
87556
88017
  const width = isFinite(this._legendComponent.AABBBounds.width()) ? this._legendComponent.AABBBounds.width() : 0;
87557
88018
  const height = isFinite(this._legendComponent.AABBBounds.height()) ? this._legendComponent.AABBBounds.height() : 0;
87558
- const layout = this.layoutOrient === 'bottom' || this.layoutOrient === 'top' ? 'horizontal' : 'vertical';
87559
- const position = this._position;
87560
- const { width: rectWidth, height: rectHeight } = fullSpace;
87561
- let offsetX = 0;
87562
- let offsetY = 0;
87563
- if (layout === 'horizontal') {
87564
- if (position === 'middle') {
87565
- offsetX = (rectWidth - width) / 2;
87566
- }
87567
- else if (position === 'end') {
87568
- offsetX = rectWidth - width;
87569
- }
87570
- }
87571
- else {
87572
- if (position === 'middle') {
87573
- offsetY = (rectHeight - height) / 2;
88019
+ if (this.layoutType !== 'normal-inline') {
88020
+ const layout = this.layoutOrient === 'bottom' || this.layoutOrient === 'top' ? 'horizontal' : 'vertical';
88021
+ const position = this._position;
88022
+ const { width: rectWidth, height: rectHeight } = fullSpace;
88023
+ let offsetX = 0;
88024
+ let offsetY = 0;
88025
+ if (layout === 'horizontal') {
88026
+ if (position === 'middle') {
88027
+ offsetX = (rectWidth - width) / 2;
88028
+ }
88029
+ else if (position === 'end') {
88030
+ offsetX = rectWidth - width;
88031
+ }
87574
88032
  }
87575
- else if (position === 'end') {
87576
- offsetY = rectHeight - height;
88033
+ else {
88034
+ if (position === 'middle') {
88035
+ offsetY = (rectHeight - height) / 2;
88036
+ }
88037
+ else if (position === 'end') {
88038
+ offsetY = rectHeight - height;
88039
+ }
87577
88040
  }
88041
+ this._legendComponent.setAttributes({
88042
+ dx: offsetX,
88043
+ dy: offsetY
88044
+ });
87578
88045
  }
87579
- this._legendComponent.setAttributes({
87580
- dx: offsetX,
87581
- dy: offsetY
87582
- });
87583
88046
  result.x2 = result.x1 + width;
87584
88047
  result.y2 = result.y1 + height;
87585
88048
  return result;
@@ -87600,15 +88063,13 @@
87600
88063
  (_b = (_a = this.effect).onSelectedDataChange) === null || _b === void 0 ? void 0 : _b.call(_a);
87601
88064
  this.event.emit(ChartEvent.legendSelectedDataChange, { model: this });
87602
88065
  }
88066
+ getVRenderComponents() {
88067
+ return [this._legendComponent];
88068
+ }
87603
88069
  clear() {
87604
- var _a;
87605
- if (this._legendComponent) {
87606
- (_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._legendComponent);
87607
- this._legendComponent = null;
87608
- }
88070
+ super.clear();
87609
88071
  this._cacheAttrs = null;
87610
88072
  this._preSelectedData = null;
87611
- super.clear();
87612
88073
  }
87613
88074
  }
87614
88075
 
@@ -88222,12 +88683,10 @@
88222
88683
  isRelativeModel(model) {
88223
88684
  return eachSeries(this._regions, s => model === s) || this._regions.includes(model);
88224
88685
  }
88686
+ getVRenderComponents() {
88687
+ return [this._indicatorComponent];
88688
+ }
88225
88689
  clear() {
88226
- var _a;
88227
- if (this._indicatorComponent) {
88228
- (_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._indicatorComponent);
88229
- this._indicatorComponent = null;
88230
- }
88231
88690
  this._cacheAttrs = null;
88232
88691
  super.clear();
88233
88692
  }
@@ -88275,8 +88734,9 @@
88275
88734
  onRender(ctx) {
88276
88735
  }
88277
88736
  _compareSpec() {
88737
+ var _a, _b;
88278
88738
  const result = super._compareSpec();
88279
- if (this._originalSpec.orient !== this._spec.orient) {
88739
+ if (((_a = this._originalSpec) === null || _a === void 0 ? void 0 : _a.orient) !== ((_b = this._spec) === null || _b === void 0 ? void 0 : _b.orient)) {
88280
88740
  result.reMake = true;
88281
88741
  }
88282
88742
  result.change = true;
@@ -88364,14 +88824,12 @@
88364
88824
  this._cacheAttrs = attrs;
88365
88825
  return this._titleComponent;
88366
88826
  }
88827
+ getVRenderComponents() {
88828
+ return [this._titleComponent];
88829
+ }
88367
88830
  clear() {
88368
- var _a;
88369
- if (this._titleComponent) {
88370
- (_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._titleComponent);
88371
- this._titleComponent = null;
88372
- }
88373
- this._cacheAttrs = null;
88374
88831
  super.clear();
88832
+ this._cacheAttrs = null;
88375
88833
  }
88376
88834
  }
88377
88835
  Title.type = ComponentTypeEnum.title;
@@ -88654,6 +89112,9 @@
88654
89112
  }
88655
89113
  changeRegions(regions) {
88656
89114
  }
89115
+ getVRenderComponents() {
89116
+ return [];
89117
+ }
88657
89118
  collectFeatures() {
88658
89119
  const features = [];
88659
89120
  this._regions.forEach(r => {
@@ -89530,22 +89991,15 @@
89530
89991
  }
89531
89992
  limitTagInBounds(label, this._getLimitBounds());
89532
89993
  }
89533
- clear() {
89534
- [
89994
+ getVRenderComponents() {
89995
+ return [
89535
89996
  this._xCrosshair,
89536
89997
  this._xTopLabel,
89537
89998
  this._xBottomLabel,
89538
89999
  this._yCrosshair,
89539
90000
  this._yLeftLabel,
89540
90001
  this._yRightLabel
89541
- ].forEach(c => {
89542
- var _a;
89543
- if (c) {
89544
- (_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(c);
89545
- c = null;
89546
- }
89547
- });
89548
- super.clear();
90002
+ ];
89549
90003
  }
89550
90004
  }
89551
90005
  CartesianCrossHair.type = ComponentTypeEnum.cartesianCrosshair;
@@ -89892,15 +90346,13 @@
89892
90346
  }
89893
90347
  limitTagInBounds(label, this._getLimitBounds());
89894
90348
  }
89895
- clear() {
89896
- [(this._radiusCrosshair, this._radiusLabelCrosshair, this._angleCrosshair, this._angleLabelCrosshair)].forEach(c => {
89897
- var _a;
89898
- if (c) {
89899
- (_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(c);
89900
- c = null;
89901
- }
89902
- });
89903
- super.clear();
90349
+ getVRenderComponents() {
90350
+ return [
90351
+ this._radiusCrosshair,
90352
+ this._radiusLabelCrosshair,
90353
+ this._angleCrosshair,
90354
+ this._angleLabelCrosshair
90355
+ ];
89904
90356
  }
89905
90357
  }
89906
90358
  PolarCrossHair.type = ComponentTypeEnum.polarCrosshair;
@@ -90124,13 +90576,8 @@
90124
90576
  }
90125
90577
  onRender(ctx) {
90126
90578
  }
90127
- clear() {
90128
- var _a;
90129
- super.clear();
90130
- if (this._playerComponent) {
90131
- (_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._playerComponent);
90132
- }
90133
- this._playerComponent = null;
90579
+ getVRenderComponents() {
90580
+ return [this._playerComponent];
90134
90581
  }
90135
90582
  _computeLayoutRect(rect, width, height) {
90136
90583
  switch (this._orient) {
@@ -90517,13 +90964,8 @@
90517
90964
  (_a = this._option) === null || _a === void 0 ? void 0 : _a.onError('need at least one series');
90518
90965
  return null;
90519
90966
  }
90520
- clear() {
90521
- var _a;
90522
- if (this._markerComponent) {
90523
- (_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._markerComponent);
90524
- this._markerComponent = null;
90525
- }
90526
- super.clear();
90967
+ getVRenderComponents() {
90968
+ return [this._markerComponent];
90527
90969
  }
90528
90970
  }
90529
90971
 
@@ -93391,6 +93833,9 @@
93391
93833
  }
93392
93834
  changeRegions(regions) {
93393
93835
  }
93836
+ getVRenderComponents() {
93837
+ return [];
93838
+ }
93394
93839
  _registerEvent() {
93395
93840
  }
93396
93841
  _releaseEvent() {
@@ -93639,6 +94084,9 @@
93639
94084
  }
93640
94085
  changeRegions(regions) {
93641
94086
  }
94087
+ getVRenderComponents() {
94088
+ return [];
94089
+ }
93642
94090
  }
93643
94091
  BaseLabelComponent.type = ComponentTypeEnum.label;
93644
94092
 
@@ -94276,17 +94724,17 @@
94276
94724
  layoutItems(_chart, items, chartLayoutRect, chartViewBox) {
94277
94725
  this._chartLayoutRect = chartLayoutRect;
94278
94726
  this._chartViewBox = chartViewBox;
94279
- this._leftCurrent = chartLayoutRect.x;
94280
- this._topCurrent = chartLayoutRect.y;
94281
- this._rightCurrent = chartLayoutRect.x + chartLayoutRect.width;
94282
- this._bottomCurrent = chartLayoutRect.height + chartLayoutRect.y;
94727
+ this.leftCurrent = chartLayoutRect.x;
94728
+ this.topCurrent = chartLayoutRect.y;
94729
+ this.rightCurrent = chartLayoutRect.x + chartLayoutRect.width;
94730
+ this.bottomCurrent = chartLayoutRect.height + chartLayoutRect.y;
94283
94731
  items.sort((a, b) => b.layoutLevel - a.layoutLevel);
94284
94732
  this.layoutNormalItems(items.filter(x => x.layoutType === 'normal'));
94285
94733
  const layoutTemp = {
94286
- _leftCurrent: this._leftCurrent,
94287
- _topCurrent: this._topCurrent,
94288
- _rightCurrent: this._rightCurrent,
94289
- _bottomCurrent: this._bottomCurrent
94734
+ leftCurrent: this.leftCurrent,
94735
+ _topCurrent: this.topCurrent,
94736
+ _rightCurrent: this.rightCurrent,
94737
+ _bottomCurrent: this.bottomCurrent
94290
94738
  };
94291
94739
  const regionItems = items.filter(x => x.layoutType === 'region');
94292
94740
  const relativeItems = items.filter(x => x.layoutType === 'region-relative');
@@ -94299,10 +94747,10 @@
94299
94747
  const layoutRect = zItems[0].getLayoutRect();
94300
94748
  extraWH = layoutRect;
94301
94749
  }
94302
- this._leftCurrent += extraWH.width / 8;
94303
- this._rightCurrent -= extraWH.width / 8;
94304
- this._topCurrent += extraWH.height / 8;
94305
- this._bottomCurrent -= extraWH.height / 8;
94750
+ this.leftCurrent += extraWH.width / 8;
94751
+ this.rightCurrent -= extraWH.width / 8;
94752
+ this.topCurrent += extraWH.height / 8;
94753
+ this.bottomCurrent -= extraWH.height / 8;
94306
94754
  const offsetWH = {
94307
94755
  offsetBottom: 0,
94308
94756
  offsetTop: 0,
@@ -94313,10 +94761,10 @@
94313
94761
  if (relativeItems.some(i => i.getAutoIndent())) {
94314
94762
  const { top, bottom, left, right } = this._checkAutoIndent(relativeItems);
94315
94763
  if (top || bottom || left || right) {
94316
- this._topCurrent = layoutTemp._topCurrent + top;
94317
- this._bottomCurrent = layoutTemp._bottomCurrent - bottom;
94318
- this._leftCurrent = layoutTemp._leftCurrent + left;
94319
- this._rightCurrent = layoutTemp._rightCurrent - right;
94764
+ this.topCurrent = layoutTemp._topCurrent + top;
94765
+ this.bottomCurrent = layoutTemp._bottomCurrent - bottom;
94766
+ this.leftCurrent = layoutTemp.leftCurrent + left;
94767
+ this.rightCurrent = layoutTemp._rightCurrent - right;
94320
94768
  this.layoutRegionItems(regionItems, relativeItems);
94321
94769
  }
94322
94770
  }
@@ -94357,8 +94805,8 @@
94357
94805
  });
94358
94806
  }
94359
94807
  layoutRegionItems(regionItems, regionRelativeItems, extraOffset) {
94360
- let regionRelativeTotalWidth = this._rightCurrent - this._leftCurrent;
94361
- let regionRelativeTotalHeight = this._bottomCurrent - this._topCurrent;
94808
+ let regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;
94809
+ let regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;
94362
94810
  if (!extraOffset) {
94363
94811
  extraOffset = { offsetLeft: 0, offsetRight: 0, offsetTop: 0, offsetBottom: 0 };
94364
94812
  }
@@ -94370,18 +94818,18 @@
94370
94818
  item.setLayoutRect({ width: rect.width });
94371
94819
  if (item.layoutOrient === 'left') {
94372
94820
  item.setLayoutStartPosition({
94373
- x: this._leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft + extraOffset.offsetLeft
94821
+ x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft + extraOffset.offsetLeft
94374
94822
  });
94375
- this._leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight + extraOffset.offsetLeft;
94823
+ this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight + extraOffset.offsetLeft;
94376
94824
  }
94377
94825
  else if (item.layoutOrient === 'right') {
94378
- this._rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight + extraOffset.offsetRight;
94826
+ this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight + extraOffset.offsetRight;
94379
94827
  item.setLayoutStartPosition({
94380
- x: this._rightCurrent + item.layoutOffsetX + item.layoutPaddingLeft
94828
+ x: this.rightCurrent + item.layoutOffsetX + item.layoutPaddingLeft
94381
94829
  });
94382
94830
  }
94383
94831
  });
94384
- regionRelativeTotalWidth = this._rightCurrent - this._leftCurrent;
94832
+ regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;
94385
94833
  regionRelativeItems
94386
94834
  .filter(x => x.layoutOrient === 'top' || x.layoutOrient === 'bottom')
94387
94835
  .forEach(item => {
@@ -94390,27 +94838,27 @@
94390
94838
  item.setLayoutRect({ height: rect.height });
94391
94839
  if (item.layoutOrient === 'top') {
94392
94840
  item.setLayoutStartPosition({
94393
- y: this._topCurrent + item.layoutOffsetY + item.layoutPaddingTop + extraOffset.offsetTop
94841
+ y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop + extraOffset.offsetTop
94394
94842
  });
94395
- this._topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
94843
+ this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
94396
94844
  }
94397
94845
  else if (item.layoutOrient === 'bottom') {
94398
- this._bottomCurrent -=
94846
+ this.bottomCurrent -=
94399
94847
  rect.height + item.layoutPaddingTop + item.layoutPaddingBottom + extraOffset.offsetBottom;
94400
94848
  item.setLayoutStartPosition({
94401
- y: this._bottomCurrent + item.layoutOffsetY + item.layoutPaddingTop
94849
+ y: this.bottomCurrent + item.layoutOffsetY + item.layoutPaddingTop
94402
94850
  });
94403
94851
  }
94404
94852
  });
94405
- regionRelativeTotalHeight = this._bottomCurrent - this._topCurrent;
94853
+ regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;
94406
94854
  regionItems.forEach(region => {
94407
94855
  region.setLayoutRect({
94408
94856
  width: regionRelativeTotalWidth,
94409
94857
  height: regionRelativeTotalHeight
94410
94858
  });
94411
94859
  region.setLayoutStartPosition({
94412
- x: this._leftCurrent + region.layoutOffsetX + region.layoutPaddingLeft,
94413
- y: this._topCurrent + region.layoutOffsetY + region.layoutPaddingTop
94860
+ x: this.leftCurrent + region.layoutOffsetX + region.layoutPaddingLeft,
94861
+ y: this.topCurrent + region.layoutOffsetY + region.layoutPaddingTop
94414
94862
  });
94415
94863
  });
94416
94864
  regionRelativeItems.forEach(item => {
@@ -94439,13 +94887,13 @@
94439
94887
  extraOffset = { offsetLeft: 0, offsetRight: 0, offsetTop: 0, offsetBottom: 0 };
94440
94888
  }
94441
94889
  const result = {
94442
- width: this._rightCurrent -
94443
- this._leftCurrent -
94890
+ width: this.rightCurrent -
94891
+ this.leftCurrent -
94444
94892
  item.layoutPaddingLeft -
94445
94893
  item.layoutPaddingRight -
94446
94894
  (extraOffset.offsetLeft + extraOffset.offsetRight),
94447
- height: this._bottomCurrent -
94448
- this._topCurrent -
94895
+ height: this.bottomCurrent -
94896
+ this.topCurrent -
94449
94897
  item.layoutPaddingTop -
94450
94898
  item.layoutPaddingBottom -
94451
94899
  (extraOffset.offsetTop + extraOffset.offsetBottom)