@visactor/vchart 1.9.1 → 1.9.2

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 (217) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +1068 -958
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/base/base-chart.d.ts +1 -1
  6. package/cjs/chart/base/base-chart.js.map +1 -1
  7. package/cjs/chart/box-plot/box-plot-transformer.js +1 -1
  8. package/cjs/chart/box-plot/box-plot-transformer.js.map +1 -1
  9. package/cjs/chart/correlation/correlation-transformer.js.map +1 -1
  10. package/cjs/component/axis/base-axis.d.ts +3 -2
  11. package/cjs/component/axis/base-axis.js +4 -4
  12. package/cjs/component/axis/base-axis.js.map +1 -1
  13. package/cjs/component/axis/cartesian/axis.js +4 -2
  14. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  15. package/cjs/component/axis/cartesian/time-axis.js +3 -3
  16. package/cjs/component/axis/cartesian/time-axis.js.map +1 -1
  17. package/cjs/component/axis/mixin/band-axis-mixin.d.ts +1 -0
  18. package/cjs/component/axis/mixin/band-axis-mixin.js +24 -12
  19. package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
  20. package/cjs/component/axis/polar/axis.js +2 -1
  21. package/cjs/component/axis/polar/axis.js.map +1 -1
  22. package/cjs/component/data-zoom/data-filter-base-component.d.ts +1 -0
  23. package/cjs/component/data-zoom/data-filter-base-component.js +2 -2
  24. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  25. package/cjs/component/data-zoom/data-zoom/data-zoom.js +15 -13
  26. package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  27. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js +15 -13
  28. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  29. package/cjs/component/data-zoom/util.d.ts +1 -1
  30. package/cjs/component/data-zoom/util.js.map +1 -1
  31. package/cjs/component/label/label.d.ts +2 -2
  32. package/cjs/component/label/label.js.map +1 -1
  33. package/cjs/component/label/total-label.js.map +1 -1
  34. package/cjs/component/label/util.js +9 -13
  35. package/cjs/component/label/util.js.map +1 -1
  36. package/cjs/component/legend/util.d.ts +7 -1
  37. package/cjs/component/marker/mark-area/mark-area.js.map +1 -1
  38. package/cjs/component/marker/mark-line/mark-line.js.map +1 -1
  39. package/cjs/component/marker/mark-point/mark-point.js.map +1 -1
  40. package/cjs/component/title/title.js.map +1 -1
  41. package/cjs/core/index.d.ts +1 -1
  42. package/cjs/core/index.js +1 -1
  43. package/cjs/core/index.js.map +1 -1
  44. package/cjs/core/vchart.js +3 -2
  45. package/cjs/core/vchart.js.map +1 -1
  46. package/cjs/mark/group.d.ts +1 -1
  47. package/cjs/mark/group.js.map +1 -1
  48. package/cjs/plugin/components/tooltip-handler/base.js +4 -3
  49. package/cjs/plugin/components/tooltip-handler/base.js.map +1 -1
  50. package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.js +27 -22
  51. package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +1 -1
  52. package/cjs/plugin/components/tooltip-handler/dom/model/content-model.d.ts +1 -1
  53. package/cjs/plugin/components/tooltip-handler/dom/model/content-model.js.map +1 -1
  54. package/cjs/plugin/components/tooltip-handler/dom/model/shape-model.js +3 -3
  55. package/cjs/plugin/components/tooltip-handler/dom/model/shape-model.js.map +1 -1
  56. package/cjs/plugin/components/tooltip-handler/dom/model/style-constants.js +2 -1
  57. package/cjs/plugin/components/tooltip-handler/dom/model/style-constants.js.map +1 -1
  58. package/cjs/plugin/components/tooltip-handler/dom/utils/style.js +4 -1
  59. package/cjs/plugin/components/tooltip-handler/dom/utils/style.js.map +1 -1
  60. package/cjs/series/area/area.js +9 -9
  61. package/cjs/series/area/area.js.map +1 -1
  62. package/cjs/series/bar/bar.js +23 -23
  63. package/cjs/series/bar/bar.js.map +1 -1
  64. package/cjs/series/base/base-series-transformer.js +3 -2
  65. package/cjs/series/base/base-series-transformer.js.map +1 -1
  66. package/cjs/series/base/base-series.d.ts +2 -1
  67. package/cjs/series/base/base-series.js.map +1 -1
  68. package/cjs/series/box-plot/box-plot.js +19 -19
  69. package/cjs/series/box-plot/box-plot.js.map +1 -1
  70. package/cjs/series/cartesian/cartesian.d.ts +1 -0
  71. package/cjs/series/cartesian/cartesian.js +18 -13
  72. package/cjs/series/cartesian/cartesian.js.map +1 -1
  73. package/cjs/series/circle-packing/circle-packing.js.map +1 -1
  74. package/cjs/series/correlation/correlation.js.map +1 -1
  75. package/cjs/series/heatmap/heatmap.d.ts +1 -1
  76. package/cjs/series/heatmap/heatmap.js.map +1 -1
  77. package/cjs/series/line/constant.d.ts +1 -1
  78. package/cjs/series/line/constant.js.map +1 -1
  79. package/cjs/series/mixin/line-mixin.d.ts +1 -1
  80. package/cjs/series/mixin/line-mixin.js +3 -3
  81. package/cjs/series/mixin/line-mixin.js.map +1 -1
  82. package/cjs/series/pie/pie.js.map +1 -1
  83. package/cjs/series/polar/animation.js +3 -3
  84. package/cjs/series/polar/animation.js.map +1 -1
  85. package/cjs/series/radar/radar.js.map +1 -1
  86. package/cjs/series/range-area/constant.d.ts +1 -1
  87. package/cjs/series/range-area/constant.js.map +1 -1
  88. package/cjs/series/range-area/range-area.js +12 -12
  89. package/cjs/series/range-area/range-area.js.map +1 -1
  90. package/cjs/series/range-column/range-column-transformer.d.ts +1 -1
  91. package/cjs/series/range-column/range-column-transformer.js.map +1 -1
  92. package/cjs/series/range-column/range-column.d.ts +1 -1
  93. package/cjs/series/range-column/range-column.js.map +1 -1
  94. package/cjs/series/rose/rose.js.map +1 -1
  95. package/cjs/series/sankey/sankey.js.map +1 -1
  96. package/cjs/series/scatter/scatter.js.map +1 -1
  97. package/cjs/series/sunburst/sunburst.js.map +1 -1
  98. package/cjs/series/waterfall/waterfall.js +14 -14
  99. package/cjs/series/waterfall/waterfall.js.map +1 -1
  100. package/cjs/series/word-cloud/word-cloud-3d.js.map +1 -1
  101. package/cjs/theme/builtin/common/series/rangeColumn.d.ts +1 -1
  102. package/cjs/theme/builtin/common/series/rangeColumn.js.map +1 -1
  103. package/cjs/util/scale.d.ts +2 -1
  104. package/cjs/util/scale.js.map +1 -1
  105. package/cjs/util/space.d.ts +1 -1
  106. package/cjs/util/space.js.map +1 -1
  107. package/cjs/util/spec/common.d.ts +1 -1
  108. package/cjs/util/spec/common.js.map +1 -1
  109. package/cjs/util/spec/merge-theme.d.ts +1 -1
  110. package/cjs/util/spec/merge-theme.js.map +1 -1
  111. package/esm/chart/base/base-chart.d.ts +1 -1
  112. package/esm/chart/base/base-chart.js.map +1 -1
  113. package/esm/chart/box-plot/box-plot-transformer.js +1 -1
  114. package/esm/chart/box-plot/box-plot-transformer.js.map +1 -1
  115. package/esm/chart/correlation/correlation-transformer.js.map +1 -1
  116. package/esm/component/axis/base-axis.d.ts +3 -2
  117. package/esm/component/axis/base-axis.js +1 -3
  118. package/esm/component/axis/base-axis.js.map +1 -1
  119. package/esm/component/axis/cartesian/axis.js +4 -2
  120. package/esm/component/axis/cartesian/axis.js.map +1 -1
  121. package/esm/component/axis/cartesian/time-axis.js +3 -3
  122. package/esm/component/axis/cartesian/time-axis.js.map +1 -1
  123. package/esm/component/axis/mixin/band-axis-mixin.d.ts +1 -0
  124. package/esm/component/axis/mixin/band-axis-mixin.js +23 -12
  125. package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
  126. package/esm/component/axis/polar/axis.js +2 -1
  127. package/esm/component/axis/polar/axis.js.map +1 -1
  128. package/esm/component/data-zoom/data-filter-base-component.d.ts +1 -0
  129. package/esm/component/data-zoom/data-filter-base-component.js +2 -2
  130. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  131. package/esm/component/data-zoom/data-zoom/data-zoom.js +15 -13
  132. package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  133. package/esm/component/data-zoom/scroll-bar/scroll-bar.js +15 -13
  134. package/esm/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  135. package/esm/component/data-zoom/util.d.ts +1 -1
  136. package/esm/component/data-zoom/util.js.map +1 -1
  137. package/esm/component/label/label.d.ts +2 -2
  138. package/esm/component/label/label.js.map +1 -1
  139. package/esm/component/label/total-label.js.map +1 -1
  140. package/esm/component/label/util.js +9 -13
  141. package/esm/component/label/util.js.map +1 -1
  142. package/esm/component/legend/util.d.ts +7 -1
  143. package/esm/component/marker/mark-area/mark-area.js.map +1 -1
  144. package/esm/component/marker/mark-line/mark-line.js.map +1 -1
  145. package/esm/component/marker/mark-point/mark-point.js.map +1 -1
  146. package/esm/component/title/title.js.map +1 -1
  147. package/esm/core/index.d.ts +1 -1
  148. package/esm/core/index.js +1 -1
  149. package/esm/core/index.js.map +1 -1
  150. package/esm/core/vchart.js +3 -2
  151. package/esm/core/vchart.js.map +1 -1
  152. package/esm/mark/group.d.ts +1 -1
  153. package/esm/mark/group.js.map +1 -1
  154. package/esm/plugin/components/tooltip-handler/base.js +4 -3
  155. package/esm/plugin/components/tooltip-handler/base.js.map +1 -1
  156. package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.js +25 -20
  157. package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +1 -1
  158. package/esm/plugin/components/tooltip-handler/dom/model/content-model.d.ts +1 -1
  159. package/esm/plugin/components/tooltip-handler/dom/model/content-model.js.map +1 -1
  160. package/esm/plugin/components/tooltip-handler/dom/model/shape-model.js +3 -3
  161. package/esm/plugin/components/tooltip-handler/dom/model/shape-model.js.map +1 -1
  162. package/esm/plugin/components/tooltip-handler/dom/model/style-constants.js +2 -1
  163. package/esm/plugin/components/tooltip-handler/dom/model/style-constants.js.map +1 -1
  164. package/esm/plugin/components/tooltip-handler/dom/utils/style.js +4 -1
  165. package/esm/plugin/components/tooltip-handler/dom/utils/style.js.map +1 -1
  166. package/esm/series/area/area.js +9 -9
  167. package/esm/series/area/area.js.map +1 -1
  168. package/esm/series/bar/bar.js +22 -22
  169. package/esm/series/bar/bar.js.map +1 -1
  170. package/esm/series/base/base-series-transformer.js +2 -2
  171. package/esm/series/base/base-series-transformer.js.map +1 -1
  172. package/esm/series/base/base-series.d.ts +2 -1
  173. package/esm/series/base/base-series.js.map +1 -1
  174. package/esm/series/box-plot/box-plot.js +19 -19
  175. package/esm/series/box-plot/box-plot.js.map +1 -1
  176. package/esm/series/cartesian/cartesian.d.ts +1 -0
  177. package/esm/series/cartesian/cartesian.js +17 -12
  178. package/esm/series/cartesian/cartesian.js.map +1 -1
  179. package/esm/series/circle-packing/circle-packing.js.map +1 -1
  180. package/esm/series/correlation/correlation.js.map +1 -1
  181. package/esm/series/heatmap/heatmap.d.ts +1 -1
  182. package/esm/series/heatmap/heatmap.js.map +1 -1
  183. package/esm/series/line/constant.d.ts +1 -1
  184. package/esm/series/line/constant.js.map +1 -1
  185. package/esm/series/mixin/line-mixin.d.ts +1 -1
  186. package/esm/series/mixin/line-mixin.js +3 -3
  187. package/esm/series/mixin/line-mixin.js.map +1 -1
  188. package/esm/series/pie/pie.js.map +1 -1
  189. package/esm/series/polar/animation.js +4 -2
  190. package/esm/series/polar/animation.js.map +1 -1
  191. package/esm/series/radar/radar.js.map +1 -1
  192. package/esm/series/range-area/constant.d.ts +1 -1
  193. package/esm/series/range-area/constant.js.map +1 -1
  194. package/esm/series/range-area/range-area.js +12 -12
  195. package/esm/series/range-area/range-area.js.map +1 -1
  196. package/esm/series/range-column/range-column-transformer.d.ts +1 -1
  197. package/esm/series/range-column/range-column-transformer.js.map +1 -1
  198. package/esm/series/range-column/range-column.d.ts +1 -1
  199. package/esm/series/range-column/range-column.js.map +1 -1
  200. package/esm/series/rose/rose.js.map +1 -1
  201. package/esm/series/sankey/sankey.js.map +1 -1
  202. package/esm/series/scatter/scatter.js.map +1 -1
  203. package/esm/series/sunburst/sunburst.js.map +1 -1
  204. package/esm/series/waterfall/waterfall.js +13 -13
  205. package/esm/series/waterfall/waterfall.js.map +1 -1
  206. package/esm/series/word-cloud/word-cloud-3d.js.map +1 -1
  207. package/esm/theme/builtin/common/series/rangeColumn.d.ts +1 -1
  208. package/esm/theme/builtin/common/series/rangeColumn.js.map +1 -1
  209. package/esm/util/scale.d.ts +2 -1
  210. package/esm/util/scale.js.map +1 -1
  211. package/esm/util/space.d.ts +1 -1
  212. package/esm/util/space.js.map +1 -1
  213. package/esm/util/spec/common.d.ts +1 -1
  214. package/esm/util/spec/common.js.map +1 -1
  215. package/esm/util/spec/merge-theme.d.ts +1 -1
  216. package/esm/util/spec/merge-theme.js.map +1 -1
  217. package/package.json +12 -12
package/build/index.js CHANGED
@@ -484,17 +484,17 @@
484
484
  const isDate = value => isType$1(value, "Date");
485
485
  var isDate$1 = isDate;
486
486
 
487
- const isNumber$1 = function (value) {
487
+ const isNumber = function (value) {
488
488
  let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
489
489
  const type = typeof value;
490
490
  return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
491
491
  };
492
- var isNumber$2 = isNumber$1;
492
+ var isNumber$1 = isNumber;
493
493
 
494
494
  const isNumeric = value => "string" == typeof value && !isNaN(Number(value)) && !isNaN(parseFloat(value));
495
495
  var isNumeric$1 = isNumeric;
496
496
 
497
- const isValidNumber = value => isNumber$2(value) && Number.isFinite(value);
497
+ const isValidNumber = value => isNumber$1(value) && Number.isFinite(value);
498
498
  var isValidNumber$1 = isValidNumber;
499
499
 
500
500
  const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
@@ -540,7 +540,7 @@
540
540
  if (!isValid$1(value) || "object" != typeof value) return value;
541
541
  const isArr = isArray$1(value),
542
542
  length = value.length;
543
- result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$1(value) || isNumber$2(value) || isString$1(value) ? value : isDate$1(value) ? new Date(+value) : void 0;
543
+ result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$1(value) || isNumber$1(value) || isString$1(value) ? value : isDate$1(value) ? new Date(+value) : void 0;
544
544
  const props = isArr ? void 0 : Object.keys(Object(value));
545
545
  let index = -1;
546
546
  if (result) for (; ++index < (props || value).length;) {
@@ -1007,10 +1007,10 @@
1007
1007
  return this.x = x, this.y = y, this;
1008
1008
  }
1009
1009
  add(point) {
1010
- return isNumber$2(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
1010
+ return isNumber$1(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
1011
1011
  }
1012
1012
  sub(point) {
1013
- return isNumber$2(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
1013
+ return isNumber$1(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
1014
1014
  }
1015
1015
  multi(point) {
1016
1016
  throw new Error("暂不支持");
@@ -1600,10 +1600,10 @@
1600
1600
  return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
1601
1601
  }
1602
1602
  function rgb(value) {
1603
- return isNumber$2(value) ? new RGB(value >> 16, value >> 8 & 255, 255 & value, 1) : isArray$1(value) ? new RGB(value[0], value[1], value[2]) : new RGB(255, 255, 255);
1603
+ return isNumber$1(value) ? new RGB(value >> 16, value >> 8 & 255, 255 & value, 1) : isArray$1(value) ? new RGB(value[0], value[1], value[2]) : new RGB(255, 255, 255);
1604
1604
  }
1605
1605
  function rgba(value) {
1606
- return isNumber$2(value) ? new RGB(value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value) : isArray$1(value) ? new RGB(value[0], value[1], value[2], value[3]) : new RGB(255, 255, 255, 1);
1606
+ return isNumber$1(value) ? new RGB(value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value) : isArray$1(value) ? new RGB(value[0], value[1], value[2], value[3]) : new RGB(255, 255, 255, 1);
1607
1607
  }
1608
1608
  function SRGBToLinear(c) {
1609
1609
  return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
@@ -2248,7 +2248,7 @@
2248
2248
  }(LoggerLevel || (LoggerLevel = {}));
2249
2249
  class Logger {
2250
2250
  static getInstance(level, method) {
2251
- return Logger._instance && isNumber$2(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
2251
+ return Logger._instance && isNumber$1(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
2252
2252
  }
2253
2253
  static setInstance(logger) {
2254
2254
  return Logger._instance = logger;
@@ -8336,6 +8336,9 @@
8336
8336
  clear() {
8337
8337
  this.transformCbList = null, this.commandList.length = 0, this.curves.length = 0;
8338
8338
  }
8339
+ beginPath() {
8340
+ this.clear();
8341
+ }
8339
8342
  toString() {
8340
8343
  if (!this.toStringCbList) {
8341
8344
  const list = [];
@@ -8345,7 +8348,7 @@
8345
8348
  let path = "";
8346
8349
  for (let i = 0; i < bezierPathList.length; i += 6) path += `C${bezierPathList[i]} ${bezierPathList[i + 1]} ${bezierPathList[i + 2]} ${bezierPathList[i + 3]} ${bezierPathList[i + 4]} ${bezierPathList[i + 5]}`;
8347
8350
  return path;
8348
- }, list[enumCommandMap.Z] = cmd => "Z", this.toStringCbList = list;
8351
+ }, list[enumCommandMap.R] = cmd => `M${cmd[1]} ${cmd[2]} h${cmd[3]} v${cmd[4]} H${cmd[1]}Z`, list[enumCommandMap.Z] = cmd => "Z", this.toStringCbList = list;
8349
8352
  }
8350
8353
  const list = this.toStringCbList;
8351
8354
  let path = "";
@@ -8684,6 +8687,7 @@
8684
8687
  zIndex: 0,
8685
8688
  layout: null,
8686
8689
  boundsPadding: 0,
8690
+ renderStyle: "default",
8687
8691
  pickMode: "accurate",
8688
8692
  customPickShape: null,
8689
8693
  boundsMode: "accurate",
@@ -9236,9 +9240,6 @@
9236
9240
  function isNotAroundZero(val) {
9237
9241
  return val > EPSILON || val < -EPSILON;
9238
9242
  }
9239
- function isNumber(data) {
9240
- return "number" == typeof data && Number.isFinite(data);
9241
- }
9242
9243
  const _v0 = [0, 0],
9243
9244
  _v1 = [0, 0],
9244
9245
  _v2 = [0, 0];
@@ -10013,7 +10014,7 @@
10013
10014
  }
10014
10015
  const globalTheme = new Theme();
10015
10016
  function getTheme$1(graphic, theme) {
10016
- return graphic.glyphHost ? getTheme$1(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || globalTheme.getTheme();
10017
+ return graphic.glyphHost ? getTheme$1(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || graphic.attachedThemeGraphic && getTheme$1(graphic.attachedThemeGraphic) || globalTheme.getTheme();
10017
10018
  }
10018
10019
  function getThemeFromGroup(graphic) {
10019
10020
  let g;
@@ -10178,10 +10179,13 @@
10178
10179
  delete() {
10179
10180
  this.parent && this.parent.removeChild(this);
10180
10181
  }
10181
- removeAllChild() {
10182
+ removeAllChild(deep) {
10182
10183
  if (!this._idMap) return;
10183
10184
  let child = this._firstChild;
10184
- for (; child;) child.parent = null, child._prev = null, child._next = null, child = child._next;
10185
+ for (; child;) {
10186
+ const next = child._next;
10187
+ child.parent = null, child._prev = null, child._next = null, child = child._next, child = next;
10188
+ }
10185
10189
  this._firstChild = null, this._lastChild = null, this._idMap.clear(), this._structEdit = !0, this.setCount(1 - this._count);
10186
10190
  }
10187
10191
  replaceChild(newChild, oldChild) {
@@ -11782,7 +11786,7 @@
11782
11786
  }
11783
11787
  onBind() {
11784
11788
  var _a, _b, _c, _d, _e, _f, _g, _h;
11785
- this.fromNumber = isNumber$2(null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) ? null === (_b = this.from) || void 0 === _b ? void 0 : _b.text : Number.parseFloat(null === (_c = this.from) || void 0 === _c ? void 0 : _c.text), this.toNumber = isNumber$2(null === (_d = this.to) || void 0 === _d ? void 0 : _d.text) ? null === (_e = this.to) || void 0 === _e ? void 0 : _e.text : Number.parseFloat(null === (_f = this.to) || void 0 === _f ? void 0 : _f.text), Number.isFinite(this.toNumber) || (this.fromNumber = 0), Number.isFinite(this.toNumber) || (this.valid = !1), !1 !== this.valid && (this.decimalLength = null !== (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.fixed) && void 0 !== _h ? _h : Math.max(getDecimalPlaces(this.fromNumber), getDecimalPlaces(this.toNumber)));
11789
+ this.fromNumber = isNumber$1(null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) ? null === (_b = this.from) || void 0 === _b ? void 0 : _b.text : Number.parseFloat(null === (_c = this.from) || void 0 === _c ? void 0 : _c.text), this.toNumber = isNumber$1(null === (_d = this.to) || void 0 === _d ? void 0 : _d.text) ? null === (_e = this.to) || void 0 === _e ? void 0 : _e.text : Number.parseFloat(null === (_f = this.to) || void 0 === _f ? void 0 : _f.text), Number.isFinite(this.toNumber) || (this.fromNumber = 0), Number.isFinite(this.toNumber) || (this.valid = !1), !1 !== this.valid && (this.decimalLength = null !== (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.fixed) && void 0 !== _h ? _h : Math.max(getDecimalPlaces(this.fromNumber), getDecimalPlaces(this.toNumber)));
11786
11790
  }
11787
11791
  onEnd() {}
11788
11792
  onUpdate(end, ratio, out) {
@@ -12468,7 +12472,7 @@
12468
12472
  return res;
12469
12473
  };
12470
12474
  const samplingPoints = (points, count) => {
12471
- const validatePoints = points.filter(point => !1 !== point.defined && isNumber$2(point.x) && isNumber$2(point.y));
12475
+ const validatePoints = points.filter(point => !1 !== point.defined && isNumber$1(point.x) && isNumber$1(point.y));
12472
12476
  if (0 === validatePoints.length) return [];
12473
12477
  if (1 === validatePoints.length) return new Array(count).fill(0).map(i => validatePoints[0]);
12474
12478
  const res = [];
@@ -12504,7 +12508,7 @@
12504
12508
  var _a;
12505
12509
  return res.concat(null !== (_a = seg.points) && void 0 !== _a ? _a : []);
12506
12510
  }, []));
12507
- const validatePoints = points.filter(point => !1 !== point.defined && isNumber$2(point.x) && isNumber$2(point.y));
12511
+ const validatePoints = points.filter(point => !1 !== point.defined && isNumber$1(point.x) && isNumber$1(point.y));
12508
12512
  if (!validatePoints.length) return [];
12509
12513
  const allPoints = [];
12510
12514
  validatePoints.forEach(point => {
@@ -13087,18 +13091,10 @@
13087
13091
  class ResourceLoader {
13088
13092
  static GetImage(url, mark) {
13089
13093
  var _a;
13090
- let data = ResourceLoader.cache.get(url);
13094
+ const data = ResourceLoader.cache.get(url);
13091
13095
  data ? "fail" === data.loadState ? application.global.getRequestAnimationFrame()(() => {
13092
13096
  mark.imageLoadFail(url);
13093
- }) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : (data = {
13094
- type: "image",
13095
- loadState: "init"
13096
- }, ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise ? (data.waitingMark = [mark], data.dataPromise.then(res => {
13097
- var _a;
13098
- data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map((mark, index) => {
13099
- (null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
13100
- });
13101
- })) : (data.loadState = "fail", mark.imageLoadFail(url)));
13097
+ }) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : ResourceLoader.loadImage(url, mark);
13102
13098
  }
13103
13099
  static GetSvg(svgStr, mark) {
13104
13100
  var _a;
@@ -13124,8 +13120,60 @@
13124
13120
  loadState: "init"
13125
13121
  }, ResourceLoader.cache.set(url, data), "arrayBuffer" === type ? data.dataPromise = application.global.loadArrayBuffer(url) : "blob" === type ? data.dataPromise = application.global.loadBlob(url) : "json" === type && (data.dataPromise = application.global.loadJson(url)), data.dataPromise.then(data => data.data));
13126
13122
  }
13123
+ static loading() {
13124
+ setTimeout(() => {
13125
+ if (!ResourceLoader.isLoading && ResourceLoader.toLoadAueue.length) {
13126
+ ResourceLoader.isLoading = !0;
13127
+ const tasks = ResourceLoader.toLoadAueue.splice(0, 10),
13128
+ promises = [];
13129
+ tasks.forEach(task => {
13130
+ const {
13131
+ url: url,
13132
+ marks: marks
13133
+ } = task,
13134
+ data = {
13135
+ type: "image",
13136
+ loadState: "init"
13137
+ };
13138
+ if (ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise) {
13139
+ data.waitingMark = marks;
13140
+ const end = data.dataPromise.then(res => {
13141
+ var _a;
13142
+ data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map((mark, index) => {
13143
+ (null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
13144
+ });
13145
+ });
13146
+ promises.push(end);
13147
+ } else data.loadState = "fail", marks.forEach(mark => mark.imageLoadFail(url));
13148
+ }), Promise.all(promises).then(() => {
13149
+ ResourceLoader.isLoading = !1, ResourceLoader.loading();
13150
+ }).catch(error => {
13151
+ console.error(error), ResourceLoader.isLoading = !1, ResourceLoader.loading();
13152
+ });
13153
+ }
13154
+ }, 0);
13155
+ }
13156
+ static loadImage(url, mark) {
13157
+ const index = getIndex(url, ResourceLoader.toLoadAueue);
13158
+ if (-1 !== index) return ResourceLoader.toLoadAueue[index].marks.push(mark), void ResourceLoader.loading();
13159
+ ResourceLoader.toLoadAueue.push({
13160
+ url: url,
13161
+ marks: [mark]
13162
+ }), ResourceLoader.loading();
13163
+ }
13164
+ static improveImageLoading(url) {
13165
+ const index = getIndex(url, ResourceLoader.toLoadAueue);
13166
+ if (-1 !== index) {
13167
+ const elememt = ResourceLoader.toLoadAueue.splice(index, 1);
13168
+ ResourceLoader.toLoadAueue.unshift(elememt[0]);
13169
+ }
13170
+ }
13171
+ }
13172
+ function getIndex(url, arr) {
13173
+ for (let i = 0; i < arr.length; i++) if (arr[i].url === url) return i;
13174
+ return -1;
13127
13175
  }
13128
- ResourceLoader.cache = new Map();
13176
+ ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
13129
13177
 
13130
13178
  const tempMatrix = new Matrix(),
13131
13179
  tempBounds$1 = new AABBBounds();
@@ -13221,7 +13269,7 @@
13221
13269
  if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
13222
13270
  application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
13223
13271
  const bounds = this.doUpdateAABBBounds(full);
13224
- return this.addUpdateLayoutTag(), application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0), bounds;
13272
+ return application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0), bounds;
13225
13273
  }
13226
13274
  combindShadowAABBBounds(bounds) {
13227
13275
  if (this.shadowRoot) {
@@ -13230,7 +13278,8 @@
13230
13278
  }
13231
13279
  }
13232
13280
  tryUpdateGlobalAABBBounds() {
13233
- return this._globalAABBBounds ? this._globalAABBBounds.setValue(this._AABBBounds.x1, this._AABBBounds.y1, this._AABBBounds.x2, this._AABBBounds.y2) : this._globalAABBBounds = this.AABBBounds.clone(), this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
13281
+ const b = this.AABBBounds;
13282
+ return this._globalAABBBounds ? this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2) : this._globalAABBBounds = b.clone(), this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
13234
13283
  }
13235
13284
  tryUpdateGlobalTransMatrix() {
13236
13285
  if (this._globalTransMatrix) {
@@ -13741,7 +13790,7 @@
13741
13790
  data: "init",
13742
13791
  state: null
13743
13792
  };
13744
- this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background);
13793
+ this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : isObject$2(image) ? (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background) : cache.state = "fail";
13745
13794
  }
13746
13795
  imageLoadSuccess(url, image, cb) {
13747
13796
  if (!this.resources) return;
@@ -14211,8 +14260,9 @@
14211
14260
  return child.stage = null, application.graphicService.onRemove(child), this.addUpdateBoundTag(), data;
14212
14261
  }
14213
14262
  removeAllChild() {
14263
+ let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
14214
14264
  this.forEachChildren(child => {
14215
- application.graphicService.onRemove(child);
14265
+ application.graphicService.onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
14216
14266
  }), super.removeAllChild(), this.addUpdateBoundTag();
14217
14267
  }
14218
14268
  setStage(stage, layer) {
@@ -15538,7 +15588,7 @@
15538
15588
 
15539
15589
  class BaseSymbol {
15540
15590
  bounds(size, bounds) {
15541
- if (isNumber$2(size)) {
15591
+ if (isNumber$1(size)) {
15542
15592
  const halfS = size / 2;
15543
15593
  bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS;
15544
15594
  } else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2;
@@ -15969,10 +16019,10 @@
15969
16019
  super(...arguments), this.type = "rect", this.pathStr = "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z";
15970
16020
  }
15971
16021
  draw(ctx, size, x, y) {
15972
- return isNumber$2(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
16022
+ return isNumber$1(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
15973
16023
  }
15974
16024
  drawOffset(ctx, size, x, y, offset) {
15975
- return isNumber$2(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
16025
+ return isNumber$1(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
15976
16026
  }
15977
16027
  }
15978
16028
  var rect = new RectSymbol();
@@ -16450,16 +16500,7 @@
16450
16500
  deltaY = -height;
16451
16501
  }
16452
16502
  let deltaX = 0;
16453
- switch (this.globalAlign) {
16454
- case "left":
16455
- deltaX = 0;
16456
- break;
16457
- case "center":
16458
- deltaX = -width / 2;
16459
- break;
16460
- case "right":
16461
- deltaX = -width;
16462
- }
16503
+ "right" === this.globalAlign || "end" === this.globalAlign ? deltaX = -width : "center" === this.globalAlign && (deltaX = -width / 2);
16463
16504
  let frameHeight = this[this.directionKey.height];
16464
16505
  this.singleLine && (frameHeight = this.lines[0].height + 1);
16465
16506
  let lastLineTag = !1;
@@ -16608,9 +16649,9 @@
16608
16649
  let direction = this.direction;
16609
16650
  if (this.verticalEllipsis) text = "...", direction = "vertical", baseline -= this.ellipsisWidth / 2;else {
16610
16651
  if ("hide" === this.ellipsis) return;
16611
- if ("add" === this.ellipsis) text += "...", "right" === textAlign && (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
16652
+ if ("add" === this.ellipsis) text += "...", "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
16612
16653
  const index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
16613
- if (text = text.slice(0, index), text += "...", "right" === textAlign) {
16654
+ if (text = text.slice(0, index), text += "...", "right" === textAlign || "end" === textAlign) {
16614
16655
  const {
16615
16656
  width: width
16616
16657
  } = measureTextCanvas(this.text.slice(index), this.character);
@@ -16801,17 +16842,7 @@
16801
16842
  maxHeight = this.height;
16802
16843
  let x = this.left,
16803
16844
  spacing = 0;
16804
- if (this.actualWidth < width && !isWidthMax) switch (this.textAlign) {
16805
- case "right":
16806
- x = width - this.actualWidth;
16807
- break;
16808
- case "center":
16809
- x = (width - this.actualWidth) / 2;
16810
- break;
16811
- case "justify":
16812
- this.paragraphs.length < 2 ? x = (width - this.actualWidth) / 2 : spacing = (width - this.actualWidth) / (this.paragraphs.length - 1);
16813
- }
16814
- this.paragraphs.map(function (paragraph) {
16845
+ this.actualWidth < width && !isWidthMax && ("right" === this.textAlign || "end" === this.textAlign ? x = width - this.actualWidth : "center" === this.textAlign ? x = (width - this.actualWidth) / 2 : "justify" === this.textAlign && (this.paragraphs.length < 2 ? x = (width - this.actualWidth) / 2 : spacing = (width - this.actualWidth) / (this.paragraphs.length - 1))), this.paragraphs.map(function (paragraph) {
16815
16846
  paragraph instanceof RichTextIcon ? (paragraph["_" + directionKey.x] = x, x += paragraph[directionKey.width] + spacing, paragraph["_" + directionKey.y] = "top" === paragraph.attribute.textBaseline ? 0 : "bottom" === paragraph.attribute.textBaseline ? maxHeight - paragraph.height : (maxHeight - paragraph.height) / 2) : (paragraph[directionKey.left] = x, x += paragraph[directionKey.width] + spacing);
16816
16847
  });
16817
16848
  }
@@ -17035,10 +17066,10 @@
17035
17066
  }
17036
17067
  } else {
17037
17068
  const richTextConfig = textConfig[i];
17038
- if (isNumber$2(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text.includes("\n")) {
17069
+ if (isNumber$1(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text && richTextConfig.text.includes("\n")) {
17039
17070
  const textParts = richTextConfig.text.split("\n");
17040
17071
  for (let j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig));
17041
- } else paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
17072
+ } else richTextConfig.text && paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
17042
17073
  }
17043
17074
  const maxWidthFinite = "number" == typeof maxWidth && Number.isFinite(maxWidth) && maxWidth > 0,
17044
17075
  maxHeightFinite = "number" == typeof maxHeight && Number.isFinite(maxHeight) && maxHeight > 0,
@@ -17283,7 +17314,7 @@
17283
17314
  } = this.attribute;
17284
17315
  if (0 === cornerRadius || "0%" === cornerRadius) return 0;
17285
17316
  const deltaRadius = Math.abs(outerRadius - innerRadius);
17286
- return Math.min(isNumber$2(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
17317
+ return Math.min(isNumber$1(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
17287
17318
  }
17288
17319
  getParsedAngle() {
17289
17320
  const arcTheme = getTheme$1(this).arc;
@@ -19127,7 +19158,7 @@
19127
19158
  const halfPi = pi$1 / 2;
19128
19159
  function createRectPath(path, x, y, width, height, rectCornerRadius) {
19129
19160
  let cornerRadius;
19130
- if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$2(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs$1(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
19161
+ if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$1(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs$1(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
19131
19162
  const cornerRadiusArr = rectCornerRadius;
19132
19163
  let cr0, cr1;
19133
19164
  switch (cornerRadiusArr.length) {
@@ -19235,7 +19266,7 @@
19235
19266
  y = bounds.y1,
19236
19267
  width = bounds.width(),
19237
19268
  height = bounds.height();
19238
- return isNumber$2(boundsPadding) ? (x += boundsPadding, y += boundsPadding, width -= 2 * boundsPadding, height -= 2 * boundsPadding) : (x += boundsPadding[3], y += boundsPadding[0], width -= boundsPadding[1] + boundsPadding[3], height -= boundsPadding[0] + boundsPadding[2]), {
19269
+ return isNumber$1(boundsPadding) ? (x += boundsPadding, y += boundsPadding, width -= 2 * boundsPadding, height -= 2 * boundsPadding) : (x += boundsPadding[3], y += boundsPadding[0], width -= boundsPadding[1] + boundsPadding[3], height -= boundsPadding[0] + boundsPadding[2]), {
19239
19270
  x: x,
19240
19271
  y: y,
19241
19272
  width: width,
@@ -20092,11 +20123,12 @@
20092
20123
  }
20093
20124
  drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
20094
20125
  var _a, _b, _c, _d, _e;
20126
+ const {
20127
+ points: points
20128
+ } = area.attribute;
20129
+ if (points.length < 2) return;
20095
20130
  context.beginPath();
20096
20131
  const z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
20097
- {
20098
- points: points
20099
- } = area.attribute,
20100
20132
  startP = points[0];
20101
20133
  context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
20102
20134
  for (let i = 1; i < points.length; i++) {
@@ -20253,6 +20285,7 @@
20253
20285
  }
20254
20286
  _drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, connect, fillCb, strokeCb) {
20255
20287
  var _a, _b, _c, _d;
20288
+ if (!(cache && cache.top && cache.bottom && cache.top.curves && cache.top.curves.length && cache.bottom.curves && cache.bottom.curves.length)) return;
20256
20289
  let {
20257
20290
  connectedType: connectedType,
20258
20291
  connectedX: connectedX,
@@ -20261,7 +20294,6 @@
20261
20294
  } = attribute;
20262
20295
  const da = [];
20263
20296
  if (connect && (isArray$1(defaultAttribute) ? (connectedType = null !== (_a = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _a ? _a : defaultAttribute[1].connectedType, connectedX = null !== (_b = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _b ? _b : defaultAttribute[1].connectedX, connectedY = null !== (_c = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _c ? _c : defaultAttribute[1].connectedY, connectedStyle = null !== (_d = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _d ? _d : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), isArray$1(defaultAttribute) ? defaultAttribute.forEach(i => da.push(i)) : da.push(defaultAttribute), da.push(attribute)), connect && "none" === connectedType) return !1;
20264
- if (!cache) return;
20265
20297
  context.beginPath();
20266
20298
  const {
20267
20299
  points: points,
@@ -20930,7 +20962,9 @@
20930
20962
  image: url
20931
20963
  } = image.attribute;
20932
20964
  if (!url || !image.resources) return;
20933
- if ("success" !== image.resources.get(url).state) return;
20965
+ const res = image.resources.get(url);
20966
+ if ("loading" === res.state && isString$1(url)) return void ResourceLoader.improveImageLoading(url);
20967
+ if ("success" !== res.state) return;
20934
20968
  const {
20935
20969
  context: context
20936
20970
  } = renderService.drawParams;
@@ -20970,6 +21004,197 @@
20970
21004
  },
20971
21005
  __metadata$V = undefined && undefined.__metadata || function (k, v) {
20972
21006
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21007
+ };
21008
+ const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
21009
+ const tempDirtyBounds = new AABBBounds();
21010
+ class ShadowRootDrawItemInterceptorContribution {
21011
+ constructor() {
21012
+ this.order = 1;
21013
+ }
21014
+ afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21015
+ return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21016
+ }
21017
+ beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21018
+ return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21019
+ }
21020
+ drawItem(graphic, renderService, drawContext, drawContribution, params) {
21021
+ if (!graphic.shadowRoot) return !1;
21022
+ const {
21023
+ context: context
21024
+ } = drawContext;
21025
+ if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
21026
+ tempDirtyBounds.copy(drawContribution.dirtyBounds);
21027
+ const m = graphic.globalTransMatrix.getInverse();
21028
+ drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
21029
+ }
21030
+ return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
21031
+ }
21032
+ }
21033
+ class DebugDrawItemInterceptorContribution {
21034
+ constructor() {
21035
+ this.order = 1;
21036
+ }
21037
+ afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21038
+ return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21039
+ }
21040
+ drawItem(graphic, renderService, drawContext, drawContribution, params) {
21041
+ if (!graphic.attribute._debug_bounds) return !1;
21042
+ const {
21043
+ context: context
21044
+ } = drawContext;
21045
+ context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
21046
+ const b = graphic.AABBBounds;
21047
+ 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;
21048
+ }
21049
+ }
21050
+ let CommonDrawItemInterceptorContribution = class {
21051
+ constructor() {
21052
+ this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
21053
+ }
21054
+ afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21055
+ for (let i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
21056
+ return !1;
21057
+ }
21058
+ beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21059
+ if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
21060
+ for (let i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].beforeDrawItem && this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
21061
+ return !1;
21062
+ }
21063
+ };
21064
+ CommonDrawItemInterceptorContribution = __decorate$1d([injectable(), __metadata$V("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
21065
+ class InteractiveDrawItemInterceptorContribution {
21066
+ constructor() {
21067
+ this.order = 1;
21068
+ }
21069
+ beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21070
+ return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
21071
+ }
21072
+ beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
21073
+ let interactiveGraphic = graphic.interactiveGraphic;
21074
+ if (graphic.attribute.globalZIndex) {
21075
+ interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
21076
+ globalZIndex: 0,
21077
+ zIndex: graphic.attribute.globalZIndex
21078
+ }, !1, {
21079
+ skipUpdateCallback: !0
21080
+ }), drawContext.stage.tryInitInteractiveLayer();
21081
+ const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
21082
+ if (interactiveLayer) {
21083
+ this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
21084
+ }
21085
+ return !0;
21086
+ }
21087
+ if (interactiveGraphic) {
21088
+ drawContext.stage.tryInitInteractiveLayer();
21089
+ const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
21090
+ if (interactiveLayer) {
21091
+ this.getShadowRoot(interactiveLayer).removeChild(interactiveGraphic);
21092
+ }
21093
+ graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
21094
+ }
21095
+ return !1;
21096
+ }
21097
+ beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
21098
+ const baseGraphic = graphic.baseGraphic;
21099
+ if (baseGraphic) {
21100
+ this.processing = !0;
21101
+ const {
21102
+ context: context
21103
+ } = drawContext;
21104
+ return context.highPerformanceSave(), context.setTransformFromMatrix(baseGraphic.parent.globalTransMatrix, !0), baseGraphic.isContainer ? drawContribution.renderGroup(baseGraphic, drawContext, baseGraphic.parent.globalTransMatrix) : drawContribution.renderItem(baseGraphic, drawContext), context.highPerformanceRestore(), this.processing = !1, !0;
21105
+ }
21106
+ return !1;
21107
+ }
21108
+ getShadowRoot(interactiveLayer) {
21109
+ var _a;
21110
+ let group = interactiveLayer.getElementById("_interactive_group");
21111
+ return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
21112
+ }
21113
+ }
21114
+ class Canvas3DDrawItemInterceptor {
21115
+ constructor() {
21116
+ this.order = 1;
21117
+ }
21118
+ beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21119
+ if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
21120
+ drawContext.in3dInterceptor = !0;
21121
+ const {
21122
+ context: context,
21123
+ stage: stage
21124
+ } = renderService.drawParams;
21125
+ context.canvas;
21126
+ context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
21127
+ const m = context.currentMatrix;
21128
+ m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
21129
+ const matrix = mat4Allocate.allocate();
21130
+ mat3Tomat4(matrix, m);
21131
+ const lastModelMatrix = context.modelMatrix;
21132
+ if (lastModelMatrix) {
21133
+ if (matrix) {
21134
+ const m = mat4Allocate.allocate();
21135
+ context.modelMatrix = multiplyMat4Mat4(m, lastModelMatrix, matrix);
21136
+ }
21137
+ } else context.modelMatrix = matrix;
21138
+ if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
21139
+ let isPie = !1,
21140
+ is3d = !1;
21141
+ if (graphic.forEachChildren(c => (isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie)), graphic.forEachChildren(c => (is3d = !!c.findFace, !is3d)), isPie) {
21142
+ const children = graphic.getChildren(),
21143
+ sortedChildren = [...children];
21144
+ sortedChildren.sort((a, b) => {
21145
+ var _a, _b, _c, _d;
21146
+ let angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
21147
+ angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
21148
+ for (; angle1 < 0;) angle1 += pi2;
21149
+ for (; angle2 < 0;) angle2 += pi2;
21150
+ return angle2 - angle1;
21151
+ }), sortedChildren.forEach(c => {
21152
+ c._next = null, c._prev = null;
21153
+ }), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(c => {
21154
+ graphic.appendChild(c);
21155
+ });
21156
+ const m = graphic.parent.globalTransMatrix;
21157
+ drawContext.hack_pieFace = "outside", drawContribution.renderGroup(graphic, drawContext, m), drawContext.hack_pieFace = "inside", drawContribution.renderGroup(graphic, drawContext, m), drawContext.hack_pieFace = "top", drawContribution.renderGroup(graphic, drawContext, m), graphic.removeAllChild(), children.forEach(c => {
21158
+ c._next = null, c._prev = null;
21159
+ }), children.forEach(c => {
21160
+ graphic.appendChild(c);
21161
+ });
21162
+ } else if (is3d) {
21163
+ const children = graphic.getChildren(),
21164
+ zChildren = children.map(g => ({
21165
+ ave_z: g.findFace().vertices.map(v => {
21166
+ var _a;
21167
+ return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
21168
+ }).reduce((a, b) => a + b, 0),
21169
+ g: g
21170
+ }));
21171
+ zChildren.sort((a, b) => b.ave_z - a.ave_z), graphic.removeAllChild(), zChildren.forEach(i => {
21172
+ i.g._next = null, i.g._prev = null;
21173
+ }), graphic.update(), zChildren.forEach(i => {
21174
+ graphic.add(i.g);
21175
+ }), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), children.forEach(g => {
21176
+ g._next = null, g._prev = null;
21177
+ }), graphic.update(), children.forEach(g => {
21178
+ graphic.add(g);
21179
+ });
21180
+ } else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
21181
+ } else drawContribution.renderItem(graphic, drawContext);
21182
+ return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
21183
+ }
21184
+ initCanvasCtx(context) {
21185
+ context.setTransformForCurrent();
21186
+ }
21187
+ }
21188
+
21189
+ var __decorate$1c = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21190
+ var d,
21191
+ c = arguments.length,
21192
+ r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21193
+ if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21194
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
21195
+ },
21196
+ __metadata$U = undefined && undefined.__metadata || function (k, v) {
21197
+ if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
20973
21198
  },
20974
21199
  __param$z = undefined && undefined.__param || function (paramIndex, decorator) {
20975
21200
  return function (target, key) {
@@ -21008,7 +21233,7 @@
21008
21233
  this.prepare(updateBounds), this.prepareRenderList(), this.beforeDraw(params), this.draw(params), this.afterDraw(params);
21009
21234
  }
21010
21235
  };
21011
- DefaultRenderService = __decorate$1d([injectable(), __param$z(0, inject(DrawContribution)), __metadata$V("design:paramtypes", [Object])], DefaultRenderService);
21236
+ DefaultRenderService = __decorate$1c([injectable(), __param$z(0, inject(DrawContribution)), __metadata$U("design:paramtypes", [Object])], DefaultRenderService);
21012
21237
 
21013
21238
  var renderModule$1 = new ContainerModule(bind => {
21014
21239
  bind(RenderService).to(DefaultRenderService).inSingletonScope();
@@ -21017,7 +21242,7 @@
21017
21242
  const PickerService = Symbol.for("PickerService");
21018
21243
  const GlobalPickerService = Symbol.for("GlobalPickerService");
21019
21244
 
21020
- var __decorate$1c = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21245
+ var __decorate$1b = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21021
21246
  var d,
21022
21247
  c = arguments.length,
21023
21248
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
@@ -21050,7 +21275,7 @@
21050
21275
  return context.highPerformanceRestore(), result;
21051
21276
  }
21052
21277
  };
21053
- ShadowRootPickItemInterceptorContribution = __decorate$1c([injectable()], ShadowRootPickItemInterceptorContribution);
21278
+ ShadowRootPickItemInterceptorContribution = __decorate$1b([injectable()], ShadowRootPickItemInterceptorContribution);
21054
21279
  let InteractivePickItemInterceptorContribution = class {
21055
21280
  constructor() {
21056
21281
  this.order = 1;
@@ -21069,7 +21294,7 @@
21069
21294
  return null;
21070
21295
  }
21071
21296
  };
21072
- InteractivePickItemInterceptorContribution = __decorate$1c([injectable()], InteractivePickItemInterceptorContribution);
21297
+ InteractivePickItemInterceptorContribution = __decorate$1b([injectable()], InteractivePickItemInterceptorContribution);
21073
21298
  let Canvas3DPickItemInterceptor = class {
21074
21299
  constructor() {
21075
21300
  this.order = 1;
@@ -21129,7 +21354,7 @@
21129
21354
  context.setTransformForCurrent();
21130
21355
  }
21131
21356
  };
21132
- Canvas3DPickItemInterceptor = __decorate$1c([injectable()], Canvas3DPickItemInterceptor);
21357
+ Canvas3DPickItemInterceptor = __decorate$1b([injectable()], Canvas3DPickItemInterceptor);
21133
21358
 
21134
21359
  var pickModule = new ContainerModule((bind, unbind, isBound) => {
21135
21360
  isBound(PickerService) || (bind(GlobalPickerService).toSelf(), bind(PickerService).toService(GlobalPickerService)), bind(Canvas3DPickItemInterceptor).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(Canvas3DPickItemInterceptor), bind(ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(ShadowRootPickItemInterceptorContribution), bind(InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(InteractivePickItemInterceptorContribution), bindContributionProvider(bind, PickItemInterceptor);
@@ -21142,14 +21367,14 @@
21142
21367
  const AutoEnablePlugins = Symbol.for("AutoEnablePlugins");
21143
21368
  const PluginService = Symbol.for("PluginService");
21144
21369
 
21145
- var __decorate$1b = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21370
+ var __decorate$1a = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21146
21371
  var d,
21147
21372
  c = arguments.length,
21148
21373
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21149
21374
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21150
21375
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21151
21376
  },
21152
- __metadata$U = undefined && undefined.__metadata || function (k, v) {
21377
+ __metadata$T = undefined && undefined.__metadata || function (k, v) {
21153
21378
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21154
21379
  },
21155
21380
  __param$y = undefined && undefined.__param || function (paramIndex, decorator) {
@@ -21192,7 +21417,7 @@
21192
21417
  }), this.onRegisterPlugin = [];
21193
21418
  }
21194
21419
  };
21195
- DefaultPluginService = __decorate$1b([injectable(), __param$y(0, inject(ContributionProvider)), __param$y(0, named(AutoEnablePlugins)), __metadata$U("design:paramtypes", [Object])], DefaultPluginService);
21420
+ DefaultPluginService = __decorate$1a([injectable(), __param$y(0, inject(ContributionProvider)), __param$y(0, named(AutoEnablePlugins)), __metadata$T("design:paramtypes", [Object])], DefaultPluginService);
21196
21421
 
21197
21422
  var pluginModule = new ContainerModule(bind => {
21198
21423
  bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
@@ -21206,14 +21431,14 @@
21206
21431
  bind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope(), bindContributionProvider(bind, TextMeasureContribution);
21207
21432
  });
21208
21433
 
21209
- var __decorate$1a = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21434
+ var __decorate$19 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21210
21435
  var d,
21211
21436
  c = arguments.length,
21212
21437
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21213
21438
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21214
21439
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21215
21440
  },
21216
- __metadata$T = undefined && undefined.__metadata || function (k, v) {
21441
+ __metadata$S = undefined && undefined.__metadata || function (k, v) {
21217
21442
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21218
21443
  };
21219
21444
  let CanvasLayerHandlerContribution = class {
@@ -21283,16 +21508,16 @@
21283
21508
  this.canvas.release();
21284
21509
  }
21285
21510
  };
21286
- CanvasLayerHandlerContribution = __decorate$1a([injectable(), __metadata$T("design:paramtypes", [])], CanvasLayerHandlerContribution);
21511
+ CanvasLayerHandlerContribution = __decorate$19([injectable(), __metadata$S("design:paramtypes", [])], CanvasLayerHandlerContribution);
21287
21512
 
21288
- var __decorate$19 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21513
+ var __decorate$18 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21289
21514
  var d,
21290
21515
  c = arguments.length,
21291
21516
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21292
21517
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21293
21518
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21294
21519
  },
21295
- __metadata$S = undefined && undefined.__metadata || function (k, v) {
21520
+ __metadata$R = undefined && undefined.__metadata || function (k, v) {
21296
21521
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21297
21522
  };
21298
21523
  let EmptyLayerHandlerContribution = class {
@@ -21327,16 +21552,16 @@
21327
21552
  }
21328
21553
  release() {}
21329
21554
  };
21330
- EmptyLayerHandlerContribution = __decorate$19([injectable(), __metadata$S("design:paramtypes", [])], EmptyLayerHandlerContribution);
21555
+ EmptyLayerHandlerContribution = __decorate$18([injectable(), __metadata$R("design:paramtypes", [])], EmptyLayerHandlerContribution);
21331
21556
 
21332
- var __decorate$18 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21557
+ var __decorate$17 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21333
21558
  var d,
21334
21559
  c = arguments.length,
21335
21560
  r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21336
21561
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21337
21562
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21338
21563
  },
21339
- __metadata$R = undefined && undefined.__metadata || function (k, v) {
21564
+ __metadata$Q = undefined && undefined.__metadata || function (k, v) {
21340
21565
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21341
21566
  };
21342
21567
  let OffscreenLayerHandlerContribution = class {
@@ -21398,7 +21623,7 @@
21398
21623
  }
21399
21624
  merge(layerHandlers) {}
21400
21625
  };
21401
- OffscreenLayerHandlerContribution = __decorate$18([injectable(), __metadata$R("design:paramtypes", [])], OffscreenLayerHandlerContribution);
21626
+ OffscreenLayerHandlerContribution = __decorate$17([injectable(), __metadata$Q("design:paramtypes", [])], OffscreenLayerHandlerContribution);
21402
21627
 
21403
21628
  var layerHandlerModules = new ContainerModule(bind => {
21404
21629
  bind(CanvasLayerHandlerContribution).toSelf(), bind(OffscreenLayerHandlerContribution).toSelf(), bind(EmptyLayerHandlerContribution).toSelf(), bind(StaticLayerHandlerContribution).toService(CanvasLayerHandlerContribution), bind(DynamicLayerHandlerContribution).toService(OffscreenLayerHandlerContribution), bind(VirtualLayerHandlerContribution).toService(EmptyLayerHandlerContribution);
@@ -21514,197 +21739,6 @@
21514
21739
  return result;
21515
21740
  }
21516
21741
 
21517
- var __decorate$17 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21518
- var d,
21519
- c = arguments.length,
21520
- r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
21521
- if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
21522
- return c > 3 && r && Object.defineProperty(target, key, r), r;
21523
- },
21524
- __metadata$Q = undefined && undefined.__metadata || function (k, v) {
21525
- if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
21526
- };
21527
- const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
21528
- const tempDirtyBounds = new AABBBounds();
21529
- class ShadowRootDrawItemInterceptorContribution {
21530
- constructor() {
21531
- this.order = 1;
21532
- }
21533
- afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21534
- return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21535
- }
21536
- beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21537
- return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21538
- }
21539
- drawItem(graphic, renderService, drawContext, drawContribution, params) {
21540
- if (!graphic.shadowRoot) return !1;
21541
- const {
21542
- context: context
21543
- } = drawContext;
21544
- if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
21545
- tempDirtyBounds.copy(drawContribution.dirtyBounds);
21546
- const m = graphic.globalTransMatrix.getInverse();
21547
- drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
21548
- }
21549
- return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
21550
- }
21551
- }
21552
- class DebugDrawItemInterceptorContribution {
21553
- constructor() {
21554
- this.order = 1;
21555
- }
21556
- afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21557
- return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
21558
- }
21559
- drawItem(graphic, renderService, drawContext, drawContribution, params) {
21560
- if (!graphic.attribute._debug_bounds) return !1;
21561
- const {
21562
- context: context
21563
- } = drawContext;
21564
- context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
21565
- const b = graphic.AABBBounds;
21566
- 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;
21567
- }
21568
- }
21569
- let CommonDrawItemInterceptorContribution = class {
21570
- constructor() {
21571
- this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
21572
- }
21573
- afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21574
- for (let i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
21575
- return !1;
21576
- }
21577
- beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21578
- if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
21579
- for (let i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].beforeDrawItem && this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
21580
- return !1;
21581
- }
21582
- };
21583
- CommonDrawItemInterceptorContribution = __decorate$17([injectable(), __metadata$Q("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
21584
- class InteractiveDrawItemInterceptorContribution {
21585
- constructor() {
21586
- this.order = 1;
21587
- }
21588
- beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21589
- return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
21590
- }
21591
- beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
21592
- let interactiveGraphic = graphic.interactiveGraphic;
21593
- if (graphic.attribute.globalZIndex) {
21594
- interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
21595
- globalZIndex: 0,
21596
- zIndex: graphic.attribute.globalZIndex
21597
- }, !1, {
21598
- skipUpdateCallback: !0
21599
- }), drawContext.stage.tryInitInteractiveLayer();
21600
- const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
21601
- if (interactiveLayer) {
21602
- this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
21603
- }
21604
- return !0;
21605
- }
21606
- if (interactiveGraphic) {
21607
- drawContext.stage.tryInitInteractiveLayer();
21608
- const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
21609
- if (interactiveLayer) {
21610
- this.getShadowRoot(interactiveLayer).removeChild(interactiveGraphic);
21611
- }
21612
- graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
21613
- }
21614
- return !1;
21615
- }
21616
- beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
21617
- const baseGraphic = graphic.baseGraphic;
21618
- if (baseGraphic) {
21619
- this.processing = !0;
21620
- const {
21621
- context: context
21622
- } = drawContext;
21623
- return context.highPerformanceSave(), context.setTransformFromMatrix(baseGraphic.parent.globalTransMatrix, !0), baseGraphic.isContainer ? drawContribution.renderGroup(baseGraphic, drawContext, baseGraphic.parent.globalTransMatrix) : drawContribution.renderItem(baseGraphic, drawContext), context.highPerformanceRestore(), this.processing = !1, !0;
21624
- }
21625
- return !1;
21626
- }
21627
- getShadowRoot(interactiveLayer) {
21628
- var _a;
21629
- let group = interactiveLayer.getElementById("_interactive_group");
21630
- return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
21631
- }
21632
- }
21633
- class Canvas3DDrawItemInterceptor {
21634
- constructor() {
21635
- this.order = 1;
21636
- }
21637
- beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
21638
- if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
21639
- drawContext.in3dInterceptor = !0;
21640
- const {
21641
- context: context,
21642
- stage: stage
21643
- } = renderService.drawParams;
21644
- context.canvas;
21645
- context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
21646
- const m = context.currentMatrix;
21647
- m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
21648
- const matrix = mat4Allocate.allocate();
21649
- mat3Tomat4(matrix, m);
21650
- const lastModelMatrix = context.modelMatrix;
21651
- if (lastModelMatrix) {
21652
- if (matrix) {
21653
- const m = mat4Allocate.allocate();
21654
- context.modelMatrix = multiplyMat4Mat4(m, lastModelMatrix, matrix);
21655
- }
21656
- } else context.modelMatrix = matrix;
21657
- if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
21658
- let isPie = !1,
21659
- is3d = !1;
21660
- if (graphic.forEachChildren(c => (isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie)), graphic.forEachChildren(c => (is3d = !!c.findFace, !is3d)), isPie) {
21661
- const children = graphic.getChildren(),
21662
- sortedChildren = [...children];
21663
- sortedChildren.sort((a, b) => {
21664
- var _a, _b, _c, _d;
21665
- let angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
21666
- angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
21667
- for (; angle1 < 0;) angle1 += pi2;
21668
- for (; angle2 < 0;) angle2 += pi2;
21669
- return angle2 - angle1;
21670
- }), sortedChildren.forEach(c => {
21671
- c._next = null, c._prev = null;
21672
- }), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(c => {
21673
- graphic.appendChild(c);
21674
- });
21675
- const m = graphic.parent.globalTransMatrix;
21676
- drawContext.hack_pieFace = "outside", drawContribution.renderGroup(graphic, drawContext, m), drawContext.hack_pieFace = "inside", drawContribution.renderGroup(graphic, drawContext, m), drawContext.hack_pieFace = "top", drawContribution.renderGroup(graphic, drawContext, m), graphic.removeAllChild(), children.forEach(c => {
21677
- c._next = null, c._prev = null;
21678
- }), children.forEach(c => {
21679
- graphic.appendChild(c);
21680
- });
21681
- } else if (is3d) {
21682
- const children = graphic.getChildren(),
21683
- zChildren = children.map(g => ({
21684
- ave_z: g.findFace().vertices.map(v => {
21685
- var _a;
21686
- return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
21687
- }).reduce((a, b) => a + b, 0),
21688
- g: g
21689
- }));
21690
- zChildren.sort((a, b) => b.ave_z - a.ave_z), graphic.removeAllChild(), zChildren.forEach(i => {
21691
- i.g._next = null, i.g._prev = null;
21692
- }), graphic.update(), zChildren.forEach(i => {
21693
- graphic.add(i.g);
21694
- }), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), children.forEach(g => {
21695
- g._next = null, g._prev = null;
21696
- }), graphic.update(), children.forEach(g => {
21697
- graphic.add(g);
21698
- });
21699
- } else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
21700
- } else drawContribution.renderItem(graphic, drawContext);
21701
- return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
21702
- }
21703
- initCanvasCtx(context) {
21704
- context.setTransformForCurrent();
21705
- }
21706
- }
21707
-
21708
21742
  var __decorate$16 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
21709
21743
  var d,
21710
21744
  c = arguments.length,
@@ -21746,20 +21780,26 @@
21746
21780
  height: height
21747
21781
  } = drawContext;
21748
21782
  if (!context) return;
21783
+ if (drawContext.keepMatrix) {
21784
+ if (context.nativeContext && context.nativeContext.getTransform) {
21785
+ const t = context.nativeContext.getTransform();
21786
+ context.setTransformFromMatrix(t, !0, 1);
21787
+ }
21788
+ } else context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
21749
21789
  const dirtyBounds = this.dirtyBounds.setValue(0, 0, width, height);
21750
21790
  if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {
21751
21791
  const b = getRectIntersect(dirtyBounds, stage.dirtyBounds, !1);
21752
21792
  dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
21753
21793
  }
21754
21794
  const d = context.dpr % 1;
21755
- (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
21795
+ (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds);
21756
21796
  const drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
21757
21797
  context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort((a, b) => {
21758
21798
  var _a, _b;
21759
21799
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
21760
21800
  }).forEach(group => {
21761
21801
  group.isContainer ? this.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)) : this.renderItem(group, drawContext);
21762
- }), context.restore(), context.restore(), context.draw(), context.inuse = !1;
21802
+ }), context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1);
21763
21803
  }
21764
21804
  doRegister() {
21765
21805
  throw new Error("暂不支持");
@@ -21840,7 +21880,7 @@
21840
21880
  }
21841
21881
  getRenderContribution(graphic) {
21842
21882
  let renderer;
21843
- return renderer || (renderer = this.selectRenderByNumberType(graphic.numberType)), renderer || (renderer = this.selectRenderByType(graphic.type)), renderer;
21883
+ return renderer || (renderer = this.selectRenderByNumberType(graphic.numberType, graphic)), renderer || (renderer = this.selectRenderByType(graphic.type)), renderer;
21844
21884
  }
21845
21885
  renderItem(graphic, drawContext, params) {
21846
21886
  if (this.InterceptorContributions.length) for (let i = 0; i < this.InterceptorContributions.length; i++) {
@@ -21872,8 +21912,13 @@
21872
21912
  selectRenderByType(type) {
21873
21913
  return Logger.getInstance().warn("未知错误,不应该走到这里"), null;
21874
21914
  }
21875
- selectRenderByNumberType(type) {
21876
- return this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
21915
+ selectRenderByNumberType(type, graphic) {
21916
+ let data;
21917
+ if (graphic.attribute.renderStyle) {
21918
+ const currentRenderMap = this.styleRenderMap.get(graphic.attribute.renderStyle);
21919
+ data = currentRenderMap && currentRenderMap.get(type);
21920
+ }
21921
+ return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
21877
21922
  }
21878
21923
  clearScreen(renderService, context, drawContext) {
21879
21924
  var _a, _b;
@@ -22160,14 +22205,22 @@
22160
22205
  x = 0,
22161
22206
  y = 0
22162
22207
  } = drawContext;
22163
- context && (context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0), context.save(), drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext), context.translate(x, y, !0), context.save(), renderService.renderTreeRoots.sort((a, b) => {
22164
- var _a, _b;
22165
- return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
22166
- }).forEach(group => {
22167
- this.renderGroup(group, drawContext);
22168
- }), this.hooks.completeDraw.tap("top-draw", () => {
22169
- context.restore(), context.restore(), context.draw(), context.inuse = !1, this.rendering = !1;
22170
- }));
22208
+ if (context) {
22209
+ if (drawContext.keepMatrix) {
22210
+ if (context.nativeContext && context.nativeContext.getTransform) {
22211
+ const t = context.nativeContext.getTransform();
22212
+ context.setTransformFromMatrix(t, !0, 1);
22213
+ }
22214
+ } else context.inuse = !0, context.clearMatrix();
22215
+ context.setTransformForCurrent(!0), context.save(), drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext), context.translate(x, y, !0), context.save(), renderService.renderTreeRoots.sort((a, b) => {
22216
+ var _a, _b;
22217
+ return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
22218
+ }).forEach(group => {
22219
+ this.renderGroup(group, drawContext);
22220
+ }), this.hooks.completeDraw.tap("top-draw", () => {
22221
+ context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1), this.rendering = !1;
22222
+ });
22223
+ }
22171
22224
  });
22172
22225
  }
22173
22226
  _increaseRender(group, drawContext) {
@@ -22360,6 +22413,8 @@
22360
22413
  activate(context) {
22361
22414
  this.pluginService = context, context.stage.hooks.afterRender.tap(this.key, stage => {
22362
22415
  stage && stage === this.pluginService.stage && this.drawHTML(context.stage.renderService);
22416
+ }), application.graphicService.hooks.onRemove.tap(this.key, graphic => {
22417
+ this.removeDom(graphic);
22363
22418
  }), application.graphicService.hooks.onRelease.tap(this.key, graphic => {
22364
22419
  this.removeDom(graphic);
22365
22420
  });
@@ -22404,28 +22459,29 @@
22404
22459
  } = html;
22405
22460
  graphic.bindDom || (graphic.bindDom = new Map());
22406
22461
  const lastDom = graphic.bindDom.get(dom);
22407
- if (lastDom && (!container || container === lastDom.container)) return;
22408
- let nativeDom, nativeContainer;
22409
- graphic.bindDom.forEach(_ref => {
22410
- let {
22462
+ let wrapGroup, nativeContainer;
22463
+ if (!lastDom || container && container !== lastDom.container) {
22464
+ let nativeDom;
22465
+ graphic.bindDom.forEach(_ref => {
22466
+ let {
22467
+ wrapGroup: wrapGroup
22468
+ } = _ref;
22469
+ application.global.removeDom(wrapGroup);
22470
+ }), "string" == typeof dom ? (nativeDom = new DOMParser().parseFromString(dom, "text/html").firstChild, nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
22471
+ const _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
22472
+ nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer(), wrapGroup = application.global.createDom({
22473
+ tagName: "div",
22474
+ width: width,
22475
+ height: height,
22476
+ style: style,
22477
+ parent: nativeContainer
22478
+ }), wrapGroup && (wrapGroup.appendChild(nativeDom), graphic.bindDom.set(dom, {
22479
+ dom: nativeDom,
22480
+ container: container,
22411
22481
  wrapGroup: wrapGroup
22412
- } = _ref;
22413
- application.global.removeDom(wrapGroup);
22414
- }), "string" == typeof dom ? (nativeDom = new DOMParser().parseFromString(dom, "text/html").firstChild, nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
22415
- const _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
22416
- nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer();
22417
- const wrapGroup = application.global.createDom({
22418
- tagName: "div",
22419
- width: width,
22420
- height: height,
22421
- style: style,
22422
- parent: nativeContainer
22423
- });
22424
- wrapGroup && (wrapGroup.appendChild(nativeDom), graphic.bindDom.set(dom, {
22425
- dom: nativeDom,
22426
- container: container,
22427
- wrapGroup: wrapGroup
22428
- })), wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
22482
+ }));
22483
+ } else wrapGroup = lastDom.wrapGroup, nativeContainer = wrapGroup.parentNode;
22484
+ wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
22429
22485
  let left = 0,
22430
22486
  top = 0;
22431
22487
  const b = graphic.globalAABBBounds;
@@ -22468,34 +22524,48 @@
22468
22524
  constructor() {
22469
22525
  this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds();
22470
22526
  }
22527
+ pauseLayout(p) {
22528
+ this.pause = p;
22529
+ }
22530
+ tryLayoutChildren(graphic) {
22531
+ graphic.firstChild && this.tryLayout(graphic.firstChild);
22532
+ }
22471
22533
  tryLayout(graphic) {
22472
- if (this.layouting) return;
22473
- this.layouting = !0;
22534
+ let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
22535
+ if (this.pause) return;
22474
22536
  const p = graphic.parent;
22475
- if (!p || !graphic.needUpdateLayout()) return;
22537
+ if (!(force || p && graphic.needUpdateLayout())) return;
22476
22538
  const theme = getTheme$1(p).group,
22477
22539
  {
22478
22540
  display = theme.display
22479
22541
  } = p.attribute;
22480
22542
  if ("flex" !== display) return;
22481
22543
  const {
22482
- flexDirection = theme.flexDirection,
22483
- flexWrap = theme.flexWrap,
22484
- justifyContent = theme.justifyContent,
22485
- alignItems = theme.alignItems,
22486
- alignContent = theme.alignContent,
22487
- clip = theme.clip
22544
+ flexDirection = theme.flexDirection,
22545
+ flexWrap = theme.flexWrap,
22546
+ alignItems = theme.alignItems,
22547
+ clip = theme.clip
22548
+ } = p.attribute,
22549
+ {
22550
+ alignContent = null != alignItems ? alignItems : theme.alignContent
22551
+ } = p.attribute;
22552
+ let {
22553
+ width: width,
22554
+ height: height,
22555
+ justifyContent = theme.justifyContent
22488
22556
  } = p.attribute;
22489
- let childrenWidth = 0,
22490
- childrenHeight = 0,
22491
- boundsLegal = 0;
22492
- if (p.forEachChildren(child => {
22493
- const bounds = child.AABBBounds;
22494
- "column" === flexDirection || "column-reverse" === flexDirection ? (childrenHeight += bounds.height(), childrenWidth = Math.max(childrenWidth, bounds.width())) : (childrenWidth += bounds.width(), childrenHeight = Math.max(childrenHeight, bounds.height())), boundsLegal += bounds.x1, boundsLegal += bounds.y1, boundsLegal += bounds.x2, boundsLegal += bounds.y2;
22495
- }), !isFinite(boundsLegal)) return;
22496
- const width = p.attribute.width || childrenWidth,
22497
- height = p.attribute.height || childrenHeight;
22498
- p.attribute.width || (p.attribute.width = 0), p.attribute.height || (p.attribute.height = 0), this.tempBounds.copy(p._AABBBounds);
22557
+ const children = p.getChildren();
22558
+ if (null == width || null == height) {
22559
+ let childrenWidth = 0,
22560
+ childrenHeight = 0,
22561
+ boundsLegal = 0;
22562
+ if (children.forEach(child => {
22563
+ const bounds = this.getAABBBounds(child);
22564
+ bounds.empty() || ("column" === flexDirection || "column-reverse" === flexDirection ? (childrenHeight += bounds.height(), childrenWidth = Math.max(childrenWidth, bounds.width())) : (childrenWidth += bounds.width(), childrenHeight = Math.max(childrenHeight, bounds.height())), boundsLegal += bounds.x1, boundsLegal += bounds.y1, boundsLegal += bounds.x2, boundsLegal += bounds.y2);
22565
+ }), !isFinite(boundsLegal)) return;
22566
+ width = childrenWidth, height = childrenHeight;
22567
+ }
22568
+ p.attribute.width = width, p.attribute.height = height, this.tempBounds.copy(p._AABBBounds);
22499
22569
  const result = {
22500
22570
  main: {
22501
22571
  len: width,
@@ -22504,18 +22574,18 @@
22504
22574
  cross: {
22505
22575
  len: height,
22506
22576
  field: "y"
22507
- },
22508
- dir: 1
22577
+ }
22509
22578
  },
22510
22579
  main = result.main,
22511
22580
  cross = result.cross;
22512
- "row-reverse" === flexDirection ? result.dir = -1 : "column" === flexDirection ? (main.len = height, cross.len = width, main.field = "y", cross.field = "x") : "column-reverse" === flexDirection && (main.len = height, cross.len = width, main.field = "y", cross.field = "x", result.dir = -1);
22581
+ "column" !== flexDirection && "column-reverse" !== flexDirection || (main.len = height, cross.len = width, main.field = "y", cross.field = "x"), "row-reverse" !== flexDirection && "column-reverse" !== flexDirection || ("flex-start" === justifyContent ? justifyContent = "flex-end" : "flex-end" === justifyContent ? justifyContent = "flex-start" : children.reverse());
22513
22582
  let mainLen = 0,
22514
22583
  crossLen = 0;
22515
22584
  const mianLenArray = [];
22516
- p.forEachChildren(c => {
22517
- const b = c.AABBBounds,
22518
- ml = "x" === main.field ? b.width() : b.height(),
22585
+ children.forEach(c => {
22586
+ const b = this.getAABBBounds(c);
22587
+ if (b.empty()) return;
22588
+ const ml = "x" === main.field ? b.width() : b.height(),
22519
22589
  cl = "x" === cross.field ? b.width() : b.height();
22520
22590
  mianLenArray.push({
22521
22591
  mainLen: ml,
@@ -22550,107 +22620,168 @@
22550
22620
  mainLen: mainLen,
22551
22621
  crossLen: crossLen
22552
22622
  });
22553
- const children = p.getChildren();
22554
22623
  let lastIdx = 0;
22555
22624
  if (mainList.forEach(s => {
22556
22625
  this.layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, s), lastIdx = s.idx + 1;
22557
22626
  }), crossLen = mainList.reduce((a, b) => a + b.crossLen, 0), 1 === mainList.length) {
22558
- if ("flex-end" === alignItems) {
22559
- const anchorPos = cross.len;
22560
- this.layoutCross(children, alignItems, cross, anchorPos, mianLenArray, mainList[0], 0);
22561
- } else if ("center" === alignItems) {
22562
- const anchorPos = cross.len / 2;
22563
- this.layoutCross(children, alignItems, cross, anchorPos, mianLenArray, mainList[0], 0);
22564
- } else children.forEach(child => {
22565
- child.attribute[cross.field] = getPadding(child, cross.field);
22566
- });
22627
+ const anchorPosMap = {
22628
+ "flex-start": 0,
22629
+ "flex-end": cross.len,
22630
+ center: cross.len / 2
22631
+ };
22632
+ this.layoutCross(children, alignItems, cross, anchorPosMap, mianLenArray, mainList[0], 0);
22567
22633
  } else if ("flex-start" === alignContent) {
22568
22634
  lastIdx = 0;
22569
22635
  let anchorPos = 0;
22570
22636
  mainList.forEach((s, i) => {
22571
- this.layoutCross(children, "flex-start", cross, anchorPos, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen;
22637
+ const anchorPosMap = {
22638
+ "flex-start": anchorPos,
22639
+ "flex-end": anchorPos + s.crossLen,
22640
+ center: anchorPos + s.crossLen / 2
22641
+ };
22642
+ this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen;
22572
22643
  });
22573
22644
  } else if ("center" === alignContent) {
22574
22645
  lastIdx = 0;
22575
22646
  let anchorPos = Math.max(0, (cross.len - crossLen) / 2);
22576
22647
  mainList.forEach((s, i) => {
22577
- this.layoutCross(children, "center", cross, anchorPos + s.crossLen / 2, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen;
22648
+ const anchorPosMap = {
22649
+ "flex-start": anchorPos,
22650
+ "flex-end": anchorPos + s.crossLen,
22651
+ center: anchorPos + s.crossLen / 2
22652
+ };
22653
+ this.layoutCross(children, "center", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen;
22578
22654
  });
22579
22655
  } else if ("space-around" === alignContent) {
22580
22656
  lastIdx = 0;
22581
22657
  const padding = Math.max(0, (cross.len - crossLen) / mainList.length / 2);
22582
22658
  let anchorPos = padding;
22583
22659
  mainList.forEach((s, i) => {
22584
- this.layoutCross(children, "flex-start", cross, anchorPos, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen + 2 * padding;
22660
+ const anchorPosMap = {
22661
+ "flex-start": anchorPos,
22662
+ "flex-end": anchorPos + s.crossLen,
22663
+ center: anchorPos + s.crossLen / 2
22664
+ };
22665
+ this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen + 2 * padding;
22585
22666
  });
22586
22667
  } else if ("space-between" === alignContent) {
22587
22668
  lastIdx = 0;
22588
22669
  const padding = Math.max(0, (cross.len - crossLen) / (2 * mainList.length - 2));
22589
22670
  let anchorPos = 0;
22590
22671
  mainList.forEach((s, i) => {
22591
- this.layoutCross(children, "flex-start", cross, anchorPos, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen + 2 * padding;
22672
+ const anchorPosMap = {
22673
+ "flex-start": anchorPos,
22674
+ "flex-end": anchorPos + s.crossLen,
22675
+ center: anchorPos + s.crossLen / 2
22676
+ };
22677
+ this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen + 2 * padding;
22592
22678
  });
22593
22679
  }
22594
22680
  children.forEach((child, idx) => {
22595
22681
  child.addUpdateBoundTag(), child.addUpdatePositionTag(), child.clearUpdateLayoutTag();
22596
- }), p.addUpdateLayoutTag(), clip || this.tempBounds.equals(p.AABBBounds) || (this.tryLayout(p), this.layouting = !1);
22682
+ }), p.addUpdateLayoutTag();
22683
+ const b = this.getAABBBounds(p);
22684
+ clip || this.tempBounds.equals(b) || this.tryLayout(p, !1);
22685
+ }
22686
+ getAABBBounds(graphic) {
22687
+ this.skipBoundsTrigger = !0;
22688
+ const b = graphic.AABBBounds;
22689
+ return this.skipBoundsTrigger = !1, b;
22690
+ }
22691
+ updateChildPos(posBaseLeftTop, lastP, lastBP) {
22692
+ return posBaseLeftTop + (null != lastP ? lastP : 0) - lastBP;
22597
22693
  }
22598
22694
  layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, currSeg) {
22599
22695
  if ("flex-start" === justifyContent) {
22600
22696
  let pos = 0;
22601
- for (let i = lastIdx; i <= currSeg.idx; i++) children[i].attribute[main.field] = pos + getPadding(children[i], main.field), pos += mianLenArray[i].mainLen;
22697
+ for (let i = lastIdx; i <= currSeg.idx; i++) {
22698
+ const posBaseLeftTop = pos + getPadding(children[i], main.field),
22699
+ b = this.getAABBBounds(children[i]);
22700
+ !b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen;
22701
+ }
22602
22702
  } else if ("flex-end" === justifyContent) {
22603
22703
  let pos = main.len;
22604
- for (let i = lastIdx; i <= currSeg.idx; i++) pos -= mianLenArray[i].mainLen, children[i].attribute[main.field] = pos + getPadding(children[i], main.field);
22704
+ for (let i = lastIdx; i <= currSeg.idx; i++) {
22705
+ pos -= mianLenArray[i].mainLen;
22706
+ const posBaseLeftTop = pos + getPadding(children[i], main.field),
22707
+ b = this.getAABBBounds(children[i]);
22708
+ !b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`]));
22709
+ }
22605
22710
  } else if ("space-around" === justifyContent) {
22606
22711
  if (currSeg.mainLen >= main.len) {
22607
22712
  let pos = 0;
22608
- for (let i = lastIdx; i <= currSeg.idx; i++) children[i].attribute[main.field] = pos + getPadding(children[i], main.field), pos += mianLenArray[i].mainLen;
22713
+ for (let i = lastIdx; i <= currSeg.idx; i++) {
22714
+ const posBaseLeftTop = pos + getPadding(children[i], main.field),
22715
+ b = this.getAABBBounds(children[i]);
22716
+ !b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen;
22717
+ }
22609
22718
  } else {
22610
22719
  const size = currSeg.idx - lastIdx + 1,
22611
22720
  padding = (main.len - currSeg.mainLen) / size / 2;
22612
22721
  let pos = padding;
22613
- for (let i = lastIdx; i <= currSeg.idx; i++) children[i].attribute[main.field] = pos + getPadding(children[i], main.field), pos += mianLenArray[i].mainLen + 2 * padding;
22722
+ for (let i = lastIdx; i <= currSeg.idx; i++) {
22723
+ const posBaseLeftTop = pos + getPadding(children[i], main.field),
22724
+ b = this.getAABBBounds(children[i]);
22725
+ !b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen + 2 * padding;
22726
+ }
22614
22727
  }
22615
22728
  } else if ("space-between" === justifyContent) {
22616
22729
  if (currSeg.mainLen >= main.len) {
22617
22730
  let pos = 0;
22618
- for (let i = lastIdx; i <= currSeg.idx; i++) children[i].attribute[main.field] = pos + getPadding(children[i], main.field), pos += mianLenArray[i].mainLen;
22731
+ for (let i = lastIdx; i <= currSeg.idx; i++) {
22732
+ const posBaseLeftTop = pos + getPadding(children[i], main.field),
22733
+ b = this.getAABBBounds(children[i]);
22734
+ !b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen;
22735
+ }
22619
22736
  } else {
22620
22737
  const size = currSeg.idx - lastIdx + 1,
22621
22738
  padding = (main.len - currSeg.mainLen) / (2 * size - 2);
22622
22739
  let pos = 0;
22623
- for (let i = lastIdx; i <= currSeg.idx; i++) children[i].attribute[main.field] = pos + getPadding(children[i], main.field), pos += mianLenArray[i].mainLen + 2 * padding;
22740
+ for (let i = lastIdx; i <= currSeg.idx; i++) {
22741
+ const posBaseLeftTop = pos + getPadding(children[i], main.field),
22742
+ b = this.getAABBBounds(children[i]);
22743
+ !b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen + 2 * padding;
22744
+ }
22624
22745
  }
22625
22746
  } else if ("center" === justifyContent) {
22626
22747
  let pos = (main.len - currSeg.mainLen) / 2;
22627
- for (let i = lastIdx; i <= currSeg.idx; i++) children[i].attribute[main.field] = pos + getPadding(children[i], main.field), pos += mianLenArray[i].mainLen;
22748
+ for (let i = lastIdx; i <= currSeg.idx; i++) {
22749
+ const posBaseLeftTop = pos + getPadding(children[i], main.field),
22750
+ b = this.getAABBBounds(children[i]);
22751
+ !b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen;
22752
+ }
22628
22753
  }
22629
22754
  }
22630
- layoutCross(children, alignItem, cross, anchorPos, lenArray, currSeg, lastIdx) {
22631
- if ("flex-end" === alignItem) for (let i = lastIdx; i <= currSeg.idx; i++) children[i].attribute[cross.field] = anchorPos - lenArray[i].crossLen + getPadding(children[i], cross.field);else if ("center" === alignItem) for (let i = lastIdx; i <= currSeg.idx; i++) children[i].attribute[cross.field] = anchorPos - lenArray[i].crossLen / 2 + getPadding(children[i], cross.field);else for (let i = lastIdx; i <= currSeg.idx; i++) children[i].attribute[cross.field] = anchorPos + getPadding(children[i], cross.field);
22755
+ layoutCross(children, alignItem, cross, anchorPosMap, lenArray, currSeg, lastIdx) {
22756
+ var _a;
22757
+ for (let i = lastIdx; i <= currSeg.idx; i++) {
22758
+ const child = children[i];
22759
+ let {
22760
+ alignSelf: alignSelf
22761
+ } = child.attribute;
22762
+ alignSelf && "auto" !== alignSelf || (alignSelf = alignItem);
22763
+ const b = this.getAABBBounds(child),
22764
+ anchorPos = null !== (_a = anchorPosMap[alignSelf]) && void 0 !== _a ? _a : anchorPosMap["flex-start"];
22765
+ "flex-end" === alignSelf ? !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos - lenArray[i].crossLen + getPadding(child, cross.field), child.attribute[cross.field], b[`${cross.field}1`])) : "center" === alignSelf ? !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos - lenArray[i].crossLen / 2 + getPadding(child, cross.field), child.attribute[cross.field], b[`${cross.field}1`])) : !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos + getPadding(child, cross.field), child.attribute[cross.field], b[`${cross.field}1`]));
22766
+ }
22632
22767
  }
22633
22768
  activate(context) {
22634
22769
  this.pluginService = context, application.graphicService.hooks.onAttributeUpdate.tap(this.key, graphic => {
22635
- graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic), this.layouting = !1;
22770
+ graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage && graphic.stage === this.pluginService.stage && this.tryLayout(graphic, !1);
22636
22771
  }), application.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, (graphic, stage, willUpdate, bounds) => {
22637
- graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === this.pluginService.stage && graphic.isContainer && _tempBounds.copy(bounds);
22772
+ graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === this.pluginService.stage && graphic.isContainer && !this.skipBoundsTrigger && _tempBounds.copy(bounds);
22638
22773
  }), application.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, (graphic, stage, bounds, params, selfChange) => {
22639
- stage && stage === this.pluginService.stage && graphic.isContainer && (_tempBounds.equals(bounds) || (this.tryLayout(graphic), this.layouting = !1));
22774
+ stage && stage === this.pluginService.stage && graphic.isContainer && !this.skipBoundsTrigger && (_tempBounds.equals(bounds) || this.tryLayout(graphic, !1));
22640
22775
  }), application.graphicService.hooks.onSetStage.tap(this.key, graphic => {
22641
- graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic), this.layouting = !1;
22776
+ graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic, !1);
22642
22777
  });
22643
22778
  }
22644
22779
  deactivate(context) {
22645
- application.graphicService.hooks.onAttributeUpdate.taps = application.graphicService.hooks.onAttributeUpdate.taps.filter(item => item.name !== this.key), application.graphicService.hooks.onSetStage.taps = application.graphicService.hooks.onSetStage.taps.filter(item => item.name !== this.key);
22780
+ application.graphicService.hooks.onAttributeUpdate.taps = application.graphicService.hooks.onAttributeUpdate.taps.filter(item => item.name !== this.key), application.graphicService.hooks.beforeUpdateAABBBounds.taps = application.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => item.name !== this.key), application.graphicService.hooks.afterUpdateAABBBounds.taps = application.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => item.name !== this.key), application.graphicService.hooks.onSetStage.taps = application.graphicService.hooks.onSetStage.taps.filter(item => item.name !== this.key);
22646
22781
  }
22647
22782
  }
22648
22783
  function getPadding(graphic, field) {
22649
- if (!graphic.attribute.boundsPadding) return 0;
22650
- if (isNumber(graphic.attribute.boundsPadding)) return graphic.attribute.boundsPadding;
22651
- if (isArray$1(graphic.attribute.boundsPadding) && 1 === graphic.attribute.boundsPadding.length) return graphic.attribute.boundsPadding[0];
22652
- const paddingArray = parsePadding(graphic.attribute.boundsPadding);
22653
- return "x" === field ? paddingArray[3] : "y" === field ? paddingArray[0] : 0;
22784
+ return 0;
22654
22785
  }
22655
22786
 
22656
22787
  const defaultTicker = new DefaultTicker();
@@ -23064,6 +23195,9 @@
23064
23195
  this.pluginService.unRegister(plugin);
23065
23196
  }));
23066
23197
  }
23198
+ getPluginsByName(name) {
23199
+ return this.pluginService.findPluginsByName(name);
23200
+ }
23067
23201
  tryUpdateAABBBounds() {
23068
23202
  const viewBox = this._viewBox;
23069
23203
  return this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2), this._AABBBounds;
@@ -23097,7 +23231,7 @@
23097
23231
  render(layers, params) {
23098
23232
  this.ticker.start(), this.timeline.resume();
23099
23233
  const state = this.state;
23100
- this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
23234
+ this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this.renderLayerList(this.children, params), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
23101
23235
  }
23102
23236
  combineLayersToWindow() {}
23103
23237
  renderNextFrame(layers, force) {
@@ -23124,7 +23258,8 @@
23124
23258
  background: layer === this.defaultLayer ? this.background : void 0,
23125
23259
  updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty())
23126
23260
  }, Object.assign({
23127
- renderStyle: this.renderStyle
23261
+ renderStyle: this.renderStyle,
23262
+ keepMatrix: this.params.renderKeepMatrix
23128
23263
  }, params)));
23129
23264
  }), this.interactiveLayer && !layerList.includes(this.interactiveLayer) && this.interactiveLayer.render({
23130
23265
  renderService: this.renderService,
@@ -23723,11 +23858,17 @@
23723
23858
  if (!params.bounds.contains(point.x, point.y)) return result;
23724
23859
  offsetX = params.bounds.x1, offsetY = params.bounds.y1;
23725
23860
  }
23726
- this.pickContext && (this.pickContext.inuse = !0), params.pickContext = this.pickContext, this.pickContext && this.pickContext.clearMatrix(!0, 1);
23861
+ if (this.pickContext) if (params.keepMatrix) {
23862
+ if (this.pickContext.nativeContext && this.pickContext.nativeContext.getTransform) {
23863
+ const t = this.pickContext.nativeContext.getTransform();
23864
+ this.pickContext.setTransformFromMatrix(t, !0, 1);
23865
+ }
23866
+ } else this.pickContext.inuse = !0, this.pickContext.clearMatrix(!0, 1);
23867
+ params.pickContext = this.pickContext;
23727
23868
  const parentMatrix = new Matrix(1, 0, 0, 1, offsetX, offsetY);
23728
23869
  let group;
23729
23870
  for (let i = graphics.length - 1; i >= 0 && (result = graphics[i].isContainer ? this.pickGroup(graphics[i], point, parentMatrix, params) : this.pickItem(graphics[i], point, parentMatrix, params), !result.graphic); i--) group || (group = result.group);
23730
- if (result.graphic || (result.group = group), this.pickContext && (this.pickContext.inuse = !1), result.graphic) {
23871
+ if (result.graphic || (result.group = group), this.pickContext && !params.keepMatrix && (this.pickContext.inuse = !1), result.graphic) {
23731
23872
  let g = result.graphic;
23732
23873
  for (; g.parent;) g = g.parent;
23733
23874
  g.shadowHost && (result.params = {
@@ -24439,7 +24580,7 @@
24439
24580
  if (v === null || v === undefined || v === '') {
24440
24581
  return false;
24441
24582
  }
24442
- if (isNumber$2(v)) {
24583
+ if (isNumber$1(v)) {
24443
24584
  return true;
24444
24585
  }
24445
24586
  return +v === +v;
@@ -24532,7 +24673,7 @@
24532
24673
  const n = array.length;
24533
24674
  for (let i = 0; i < n; i += 1) {
24534
24675
  let value = valueGetter(array[i]);
24535
- isNil$1(value) || !isNumber$2(value = +value) || Number.isNaN(value) || (isNil$1(min) ? (min = value, max = value) : (min = Math.min(min, value), max = Math.max(max, value)));
24676
+ isNil$1(value) || !isNumber$1(value = +value) || Number.isNaN(value) || (isNil$1(min) ? (min = value, max = value) : (min = Math.min(min, value), max = Math.max(max, value)));
24536
24677
  }
24537
24678
  return [min, max];
24538
24679
  }
@@ -25017,7 +25158,7 @@
25017
25158
  return this._isFixed && !!this._bandwidth;
25018
25159
  }
25019
25160
  _isBandwidthFixedByUser() {
25020
- return this._isFixed && this._userBandwidth && isNumber$2(this._userBandwidth);
25161
+ return this._isFixed && this._userBandwidth && isNumber$1(this._userBandwidth);
25021
25162
  }
25022
25163
  clone() {
25023
25164
  var _a, _b, _c;
@@ -25285,13 +25426,13 @@
25285
25426
  }
25286
25427
  }
25287
25428
  function parseNiceOptions(originalDomain, option) {
25288
- const hasForceMin = isNumber$2(option.forceMin),
25289
- hasForceMax = isNumber$2(option.forceMax);
25429
+ const hasForceMin = isNumber$1(option.forceMin),
25430
+ hasForceMax = isNumber$1(option.forceMax);
25290
25431
  let niceType = null;
25291
25432
  const niceMinMax = [];
25292
25433
  let niceDomain = null;
25293
25434
  const domainValidator = hasForceMin && hasForceMax ? x => x >= option.forceMin && x <= option.forceMax : hasForceMin ? x => x >= option.forceMin : hasForceMax ? x => x <= option.forceMax : null;
25294
- return hasForceMin ? niceMinMax[0] = option.forceMin : isNumber$2(option.min) && option.min <= Math.min(originalDomain[0], originalDomain[originalDomain.length - 1]) && (niceMinMax[0] = option.min), hasForceMax ? niceMinMax[1] = option.forceMax : isNumber$2(option.max) && option.max >= Math.max(originalDomain[0], originalDomain[originalDomain.length - 1]) && (niceMinMax[1] = option.max), isNumber$2(niceMinMax[0]) && isNumber$2(niceMinMax[1]) ? (niceDomain = originalDomain.slice(), niceDomain[0] = niceMinMax[0], niceDomain[niceDomain.length - 1] = niceMinMax[1]) : niceType = isNumber$2(niceMinMax[0]) || isNumber$2(niceMinMax[1]) ? isNumber$2(niceMinMax[0]) ? "max" : "min" : "all", {
25435
+ return hasForceMin ? niceMinMax[0] = option.forceMin : isNumber$1(option.min) && option.min <= Math.min(originalDomain[0], originalDomain[originalDomain.length - 1]) && (niceMinMax[0] = option.min), hasForceMax ? niceMinMax[1] = option.forceMax : isNumber$1(option.max) && option.max >= Math.max(originalDomain[0], originalDomain[originalDomain.length - 1]) && (niceMinMax[1] = option.max), isNumber$1(niceMinMax[0]) && isNumber$1(niceMinMax[1]) ? (niceDomain = originalDomain.slice(), niceDomain[0] = niceMinMax[0], niceDomain[niceDomain.length - 1] = niceMinMax[1]) : niceType = isNumber$1(niceMinMax[0]) || isNumber$1(niceMinMax[1]) ? isNumber$1(niceMinMax[0]) ? "max" : "min" : "all", {
25295
25436
  niceType: niceType,
25296
25437
  niceDomain: niceDomain,
25297
25438
  niceMinMax: niceMinMax,
@@ -26523,7 +26664,7 @@
26523
26664
  }] : [];
26524
26665
  }
26525
26666
  function getLinePoints(items, includeOnePoint, lastPoints, isArea) {
26526
- if (!items || !items.length || 1 === items.length && includeOnePoint) return [];
26667
+ if (!items || !items.length || 1 === items.length && !includeOnePoint) return [];
26527
26668
  return items.some(item => isValidPointsChannel(Object.keys(item.nextAttrs), "line")) ? items.map((item, index) => {
26528
26669
  var _a;
26529
26670
  const attrs = item.nextAttrs,
@@ -26539,7 +26680,7 @@
26539
26680
  }
26540
26681
  function getLargeRectsPoints(items, includeOnePoint) {
26541
26682
  let lastPoints = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
26542
- if (!items || !items.length || 1 === items.length && includeOnePoint) return [];
26683
+ if (!items || !items.length || 1 === items.length && !includeOnePoint) return [];
26543
26684
  const arr = new Float32Array(4 * items.length);
26544
26685
  return items.forEach((item, index) => {
26545
26686
  var _a, _b, _c, _d;
@@ -26553,7 +26694,7 @@
26553
26694
  }
26554
26695
  function getLargeSymbolsPoints(items, includeOnePoint) {
26555
26696
  let lastPoints = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
26556
- if (!items || !items.length || 1 === items.length && includeOnePoint) return [];
26697
+ if (!items || !items.length || 1 === items.length && !includeOnePoint) return [];
26557
26698
  const arr = new Float32Array(2 * items.length);
26558
26699
  return items.forEach((item, index) => {
26559
26700
  var _a, _b;
@@ -26594,6 +26735,57 @@
26594
26735
  return [GrammarMarkType.line, GrammarMarkType.area, GrammarMarkType.largeRects, GrammarMarkType.largeSymbols].includes(markType);
26595
26736
  }
26596
26737
 
26738
+ function invokeEncoderToItems(element, items, encoder, parameters, onlyFullEncodeFirst) {
26739
+ encoder && (isFunctionType(encoder) ? items.forEach(item => {
26740
+ const attributes = invokeFunctionType(encoder, parameters, item.datum, element);
26741
+ Object.assign(item.nextAttrs, attributes);
26742
+ }) : Object.keys(encoder).forEach(channel => {
26743
+ var _a, _b;
26744
+ const encode = encoder[channel],
26745
+ encodeItems = onlyFullEncodeFirst && !isPositionOrSizeChannel(element.mark.markType, channel) ? [items[0]] : items;
26746
+ if (isScaleEncode(encode)) {
26747
+ const scale = getGrammarOutput(encode.scale, parameters),
26748
+ offset = null !== (_a = null == encode ? void 0 : encode.offset) && void 0 !== _a ? _a : 0,
26749
+ bandOffset = !isNil$1(encode.band) && scale.bandwidth ? scale.bandwidth() * encode.band : null,
26750
+ hasField = isString$1(null == encode ? void 0 : encode.field),
26751
+ fieldAccessor = hasField ? field$3(encode.field) : null;
26752
+ let to = hasField ? null : isNil$1(null == encode ? void 0 : encode.value) ? 0 : null === (_b = scale.scale) || void 0 === _b ? void 0 : _b.call(scale, encode.value);
26753
+ encodeItems.forEach(item => {
26754
+ var _a;
26755
+ hasField && (to = null === (_a = scale.scale) || void 0 === _a ? void 0 : _a.call(scale, fieldAccessor(item.datum))), item.nextAttrs[channel] = isNumber$1(to) || isNumber$1(bandOffset) ? to + offset + bandOffset : to;
26756
+ });
26757
+ } else if (isFieldEncode(encode)) {
26758
+ const fieldAccessor = field$3(encode.field);
26759
+ encodeItems.forEach(item => {
26760
+ item.nextAttrs[channel] = fieldAccessor(item.datum);
26761
+ });
26762
+ } else encodeItems.forEach(item => {
26763
+ item.nextAttrs[channel] = invokeFunctionType(encode, parameters, item.datum, element);
26764
+ });
26765
+ }));
26766
+ }
26767
+ function invokeEncoder(encoder, datum, element, parameters) {
26768
+ if (!encoder) return null;
26769
+ if (isFunctionType(encoder)) return invokeFunctionType(encoder, parameters, datum, element);
26770
+ const attributes = {};
26771
+ return Object.keys(encoder).forEach(channel => {
26772
+ var _a, _b, _c;
26773
+ const encode = encoder[channel];
26774
+ if (isScaleEncode(encode)) {
26775
+ const scale = getGrammarOutput(encode.scale, parameters),
26776
+ offset = null !== (_a = null == encode ? void 0 : encode.offset) && void 0 !== _a ? _a : 0,
26777
+ bandOffset = !isNil$1(encode.band) && scale.bandwidth ? scale.bandwidth() * encode.band : null,
26778
+ hasField = isString$1(null == encode ? void 0 : encode.field),
26779
+ fieldAccessor = hasField ? field$3(encode.field) : null,
26780
+ to = hasField ? null === (_b = scale.scale) || void 0 === _b ? void 0 : _b.call(scale, fieldAccessor(datum)) : isNil$1(null == encode ? void 0 : encode.value) ? 0 : null === (_c = scale.scale) || void 0 === _c ? void 0 : _c.call(scale, encode.value);
26781
+ attributes[channel] = isNumber$1(to) || isNumber$1(bandOffset) ? to + offset + bandOffset : to;
26782
+ } else if (isFieldEncode(encode)) {
26783
+ const fieldAccessor = field$3(encode.field);
26784
+ attributes[channel] = fieldAccessor(datum);
26785
+ } else attributes[channel] = invokeFunctionType(encode, parameters, datum, element);
26786
+ }), attributes;
26787
+ }
26788
+
26597
26789
  class GlyphMeta {
26598
26790
  constructor(marks, encoders, defaultEncoder, progressiveChannels) {
26599
26791
  this.channelEncoder = {}, this.marks = marks, encoders && this.registerChannelEncoder(encoders), defaultEncoder && this.registerDefaultEncoder(defaultEncoder), this.progressiveChannels && this.registerProgressiveChannels(progressiveChannels);
@@ -26709,83 +26901,6 @@
26709
26901
  return creator ? creator(attributes) : null;
26710
26902
  };
26711
26903
 
26712
- function invokeEncoderToItems(element, items, encoder, parameters, onlyFullEncodeFirst) {
26713
- encoder && (isFunctionType(encoder) ? items.forEach(item => {
26714
- const attributes = invokeFunctionType(encoder, parameters, item.datum, element);
26715
- Object.assign(item.nextAttrs, attributes);
26716
- }) : Object.keys(encoder).forEach(channel => {
26717
- var _a, _b;
26718
- const encode = encoder[channel],
26719
- encodeItems = onlyFullEncodeFirst && !isPositionOrSizeChannel(element.mark.markType, channel) ? [items[0]] : items;
26720
- if (isScaleEncode(encode)) {
26721
- const scale = getGrammarOutput(encode.scale, parameters),
26722
- offset = null !== (_a = null == encode ? void 0 : encode.offset) && void 0 !== _a ? _a : 0,
26723
- bandOffset = !isNil$1(encode.band) && scale.bandwidth ? scale.bandwidth() * encode.band : null,
26724
- hasField = isString$1(null == encode ? void 0 : encode.field),
26725
- fieldAccessor = hasField ? field$3(encode.field) : null;
26726
- let to = hasField ? null : isNil$1(null == encode ? void 0 : encode.value) ? 0 : null === (_b = scale.scale) || void 0 === _b ? void 0 : _b.call(scale, encode.value);
26727
- encodeItems.forEach(item => {
26728
- var _a;
26729
- hasField && (to = null === (_a = scale.scale) || void 0 === _a ? void 0 : _a.call(scale, fieldAccessor(item.datum))), item.nextAttrs[channel] = isNumber$2(to) || isNumber$2(bandOffset) ? to + offset + bandOffset : to;
26730
- });
26731
- } else if (isFieldEncode(encode)) {
26732
- const fieldAccessor = field$3(encode.field);
26733
- encodeItems.forEach(item => {
26734
- item.nextAttrs[channel] = fieldAccessor(item.datum);
26735
- });
26736
- } else encodeItems.forEach(item => {
26737
- item.nextAttrs[channel] = invokeFunctionType(encode, parameters, item.datum, element);
26738
- });
26739
- }));
26740
- }
26741
- function invokeEncoder(encoder, datum, element, parameters) {
26742
- if (!encoder) return null;
26743
- if (isFunctionType(encoder)) return invokeFunctionType(encoder, parameters, datum, element);
26744
- const attributes = {};
26745
- return Object.keys(encoder).forEach(channel => {
26746
- var _a, _b, _c;
26747
- const encode = encoder[channel];
26748
- if (isScaleEncode(encode)) {
26749
- const scale = getGrammarOutput(encode.scale, parameters),
26750
- offset = null !== (_a = null == encode ? void 0 : encode.offset) && void 0 !== _a ? _a : 0,
26751
- bandOffset = !isNil$1(encode.band) && scale.bandwidth ? scale.bandwidth() * encode.band : null,
26752
- hasField = isString$1(null == encode ? void 0 : encode.field),
26753
- fieldAccessor = hasField ? field$3(encode.field) : null,
26754
- to = hasField ? null === (_b = scale.scale) || void 0 === _b ? void 0 : _b.call(scale, fieldAccessor(datum)) : isNil$1(null == encode ? void 0 : encode.value) ? 0 : null === (_c = scale.scale) || void 0 === _c ? void 0 : _c.call(scale, encode.value);
26755
- attributes[channel] = isNumber$2(to) || isNumber$2(bandOffset) ? to + offset + bandOffset : to;
26756
- } else if (isFieldEncode(encode)) {
26757
- const fieldAccessor = field$3(encode.field);
26758
- attributes[channel] = fieldAccessor(datum);
26759
- } else attributes[channel] = invokeFunctionType(encode, parameters, datum, element);
26760
- }), attributes;
26761
- }
26762
- function splitEncoderInLarge(markType, encoder, glyphType) {
26763
- if (isFunctionType(encoder)) return {
26764
- themeEncoder: {},
26765
- positionEncoder: encoder
26766
- };
26767
- const themeEncoder = {},
26768
- positionEncoder = {};
26769
- if (markType === GrammarMarkType.glyph && Factory$1.getGlyph(glyphType)) {
26770
- const glyphMeta = Factory$1.getGlyph(glyphType),
26771
- progressiveChannels = glyphMeta.getProgressiveChannels();
26772
- if (progressiveChannels) Object.keys(encoder).forEach(channel => {
26773
- progressiveChannels.includes(channel) ? positionEncoder[channel] = encoder[channel] : themeEncoder[channel] = encoder[channel];
26774
- });else {
26775
- const markTypes = Array.from(new Set(Object.values(glyphMeta.getMarks())));
26776
- Object.keys(encoder).forEach(channel => {
26777
- markTypes.some(type => isPositionOrSizeChannel(type, channel)) ? positionEncoder[channel] = encoder[channel] : themeEncoder[channel] = encoder[channel];
26778
- });
26779
- }
26780
- } else Object.keys(encoder).forEach(channel => {
26781
- isPositionOrSizeChannel(markType, channel) ? positionEncoder[channel] = encoder[channel] : themeEncoder[channel] = encoder[channel];
26782
- });
26783
- return {
26784
- positionEncoder: positionEncoder,
26785
- themeEncoder: themeEncoder
26786
- };
26787
- }
26788
-
26789
26904
  const isMarkType = type => !!GrammarMarkType[type];
26790
26905
  function createGraphicItem(mark, markType) {
26791
26906
  let attrs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
@@ -27015,7 +27130,7 @@
27015
27130
  }
27016
27131
  updateGraphicItem(config) {
27017
27132
  if (!this.graphicItem) return;
27018
- isNil$1(config.clip) || this.graphicItem.setAttribute("clip", config.clip), isNil$1(config.interactive) || this.graphicItem.setAttribute("pickable", config.interactive), isNil$1(config.zIndex) || this.graphicItem.setAttribute("zIndex", config.zIndex), this.diffState === DiffState.exit ? this.graphicItem.releaseStatus = "willRelease" : this.graphicItem.releaseStatus = void 0;
27133
+ isNil$1(config.clip) || this.graphicItem.setAttribute("clip", config.clip), isNil$1(config.zIndex) || this.graphicItem.setAttribute("zIndex", config.zIndex), isNil$1(config.clipPath) || this.graphicItem.setAttribute("path", isArray$1(config.clipPath) ? config.clipPath : config.clipPath([this])), isNil$1(config.interactive) || this.graphicItem.setAttribute("pickable", config.interactive), isNil$1(config.zIndex) || this.graphicItem.setAttribute("zIndex", config.zIndex), this.diffState === DiffState.exit ? this.graphicItem.releaseStatus = "willRelease" : this.graphicItem.releaseStatus = void 0;
27019
27134
  const stateAnimation = this.mark.animate.getAnimationConfigs("state");
27020
27135
  0 !== stateAnimation.length && (this.graphicItem.stateAnimateConfig = stateAnimation[0].originConfig);
27021
27136
  }
@@ -27394,7 +27509,7 @@
27394
27509
  handler: this.handleStart
27395
27510
  }];
27396
27511
  let eventName = triggerOff;
27397
- return "empty" === triggerOff ? (eventName = trigger, this._resetType = "view") : isString$1(triggerOff) ? triggerOff.includes("view:") ? (eventName = triggerOff.replace("view:", ""), this._resetType = "view") : (eventName = triggerOff, this._resetType = "self") : isNumber$2(triggerOff) ? (eventName = null, this._resetType = "timeout") : this._resetType = null, eventName && eventName !== trigger && events.push({
27512
+ return "empty" === triggerOff ? (eventName = trigger, this._resetType = "view") : isString$1(triggerOff) ? triggerOff.includes("view:") ? (eventName = triggerOff.replace("view:", ""), this._resetType = "view") : (eventName = triggerOff, this._resetType = "self") : isNumber$1(triggerOff) ? (eventName = null, this._resetType = "timeout") : this._resetType = null, eventName && eventName !== trigger && events.push({
27398
27513
  type: eventName,
27399
27514
  handler: this.handleReset
27400
27515
  }), events;
@@ -30845,7 +30960,7 @@
30845
30960
  x += point.x, y += point.y, pickContext.setTransformForCurrent();
30846
30961
  } else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
30847
30962
  let picked = !0;
30848
- if (!onlyTranslate || rect.shadowRoot || isNumber$2(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
30963
+ if (!onlyTranslate || rect.shadowRoot || isNumber$1(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
30849
30964
  if (picked) return !0;
30850
30965
  const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
30851
30966
  pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
@@ -30913,7 +31028,7 @@
30913
31028
  x += point.x, y += point.y, pickContext.setTransformForCurrent();
30914
31029
  } else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
30915
31030
  let picked = !0;
30916
- if (!onlyTranslate || isNumber$2(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
31031
+ if (!onlyTranslate || isNumber$1(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
30917
31032
  if (picked) return !0;
30918
31033
  const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
30919
31034
  pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
@@ -32508,6 +32623,14 @@
32508
32623
  height: bounds.height()
32509
32624
  };
32510
32625
  }
32626
+ function isRichText(attributes) {
32627
+ let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
32628
+ return typeKey in attributes && "rich" === attributes[typeKey] || isObject$2(attributes.text) && "rich" === attributes.text.type;
32629
+ }
32630
+ function richTextAttributeTransform(attributes) {
32631
+ var _a, _b;
32632
+ return attributes.width = null !== (_a = attributes.width) && void 0 !== _a ? _a : 0, attributes.height = null !== (_b = attributes.height) && void 0 !== _b ? _b : 0, attributes.maxWidth = attributes.maxLineWidth, attributes.textConfig = attributes.text.text || attributes.text, attributes;
32633
+ }
32511
32634
 
32512
32635
  function loadTagComponent() {
32513
32636
  registerGroup(), registerRect(), registerSymbol(), registerRichtext(), registerText();
@@ -32528,7 +32651,7 @@
32528
32651
  super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Tag.defaultAttributes, attributes)), this.name = "tag";
32529
32652
  }
32530
32653
  render() {
32531
- var _a, _b, _c, _d;
32654
+ var _a, _b;
32532
32655
  const {
32533
32656
  text = "",
32534
32657
  textStyle = {},
@@ -32560,7 +32683,7 @@
32560
32683
  shapeStyle = __rest$6(shape, ["visible"]);
32561
32684
  if (isBoolean$1(shapeVisible)) {
32562
32685
  const size = (null == shapeStyle ? void 0 : shapeStyle.size) || 10,
32563
- maxSize = isNumber$2(size) ? size : Math.max(size[0], size[1]);
32686
+ maxSize = isNumber$1(size) ? size : Math.max(size[0], size[1]);
32564
32687
  symbol = group.createOrUpdateChild("tag-shape", Object.assign(Object.assign({
32565
32688
  symbolType: "circle",
32566
32689
  size: size,
@@ -32572,39 +32695,15 @@
32572
32695
  }), "symbol"), isEmpty(null == state ? void 0 : state.shape) || (symbol.states = state.shape), shapeVisible && (symbolPlaceWidth = maxSize + space);
32573
32696
  }
32574
32697
  let textShape;
32575
- if (tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth, "rich" === type) {
32576
- const richTextAttrs = Object.assign(Object.assign({
32577
- textConfig: text,
32578
- visible: isValid$1(text) && !1 !== visible
32579
- }, textStyle), {
32580
- x: textX,
32581
- y: 0,
32582
- width: null !== (_a = textStyle.width) && void 0 !== _a ? _a : 0,
32583
- height: null !== (_b = textStyle.height) && void 0 !== _b ? _b : 0
32584
- });
32585
- textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext");
32586
- const {
32587
- visible: bgVisible
32588
- } = panel,
32589
- backgroundStyle = __rest$6(panel, ["visible"]);
32590
- if (visible && isBoolean$1(bgVisible)) {
32591
- const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
32592
- visible: bgVisible && !!text,
32593
- x: textShape.AABBBounds.x1,
32594
- y: textShape.AABBBounds.y1,
32595
- width: textShape.AABBBounds.width(),
32596
- height: textShape.AABBBounds.height()
32597
- }), "rect");
32598
- isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
32599
- }
32600
- } else if ("html" === type) {
32601
- const richTextAttrs = Object.assign(Object.assign({
32602
- textConfig: [],
32698
+ tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth;
32699
+ if (isRichText({
32700
+ text: text
32701
+ }) || "rich" === type) {
32702
+ const richTextAttrs = Object.assign(Object.assign(Object.assign({}, richTextAttributeTransform(Object.assign({
32703
+ type: type,
32704
+ text: text
32705
+ }, textStyle))), textStyle), {
32603
32706
  visible: isValid$1(text) && !1 !== visible,
32604
- html: Object.assign(Object.assign({
32605
- dom: text
32606
- }, DEFAULT_HTML_TEXT_SPEC), textStyle)
32607
- }, textStyle), {
32608
32707
  x: textX,
32609
32708
  y: 0
32610
32709
  });
@@ -32625,7 +32724,7 @@
32625
32724
  }
32626
32725
  } else {
32627
32726
  const textAttrs = Object.assign(Object.assign({
32628
- text: text,
32727
+ text: isObject$2(text) && "type" in text && "text" === text.type ? text.text : text,
32629
32728
  visible: isValid$1(text) && !1 !== visible,
32630
32729
  lineHeight: null == textStyle ? void 0 : textStyle.fontSize
32631
32730
  }, textStyle), {
@@ -32633,12 +32732,12 @@
32633
32732
  y: 0
32634
32733
  });
32635
32734
  isNil$1(textAttrs.lineHeight) && (textAttrs.lineHeight = textStyle.fontSize), textShape = group.createOrUpdateChild("tag-text", textAttrs, "text"), isEmpty(null == state ? void 0 : state.text) || (textShape.states = state.text);
32636
- const textBounds = measureTextSize(textAttrs.text, textStyle, null === (_c = this.stage) || void 0 === _c ? void 0 : _c.getTheme().text.fontFamily),
32735
+ const textBounds = measureTextSize(textAttrs.text, textStyle, null === (_a = this.stage) || void 0 === _a ? void 0 : _a.getTheme().text.fontFamily),
32637
32736
  textWidth = textBounds.width,
32638
32737
  textHeight = textBounds.height;
32639
32738
  tagWidth += textWidth;
32640
- const size = null !== (_d = shape.size) && void 0 !== _d ? _d : 10,
32641
- maxSize = isNumber$2(size) ? size : Math.max(size[0], size[1]);
32739
+ const size = null !== (_b = shape.size) && void 0 !== _b ? _b : 10,
32740
+ maxSize = isNumber$1(size) ? size : Math.max(size[0], size[1]);
32642
32741
  tagHeight += Math.max(textHeight, shape.visible ? maxSize : 0);
32643
32742
  const {
32644
32743
  textAlign: textAlign,
@@ -32646,11 +32745,21 @@
32646
32745
  } = textStyle;
32647
32746
  (isValid$1(minWidth) || isValid$1(maxWidth)) && (isValid$1(minWidth) && tagWidth < minWidth && (tagWidth = minWidth), isValid$1(maxWidth) && tagWidth > maxWidth && (tagWidth = maxWidth, textShape.setAttribute("maxLineWidth", maxWidth - parsedPadding[1] - parsedPadding[2])));
32648
32747
  let x = 0,
32649
- y = 0;
32650
- "center" === textAlign ? (x -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2)) : "right" === textAlign || "end" === textAlign ? (x -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : "left" !== textAlign && "start" !== textAlign || group.setAttribute("x", parsedPadding[3]), !textAlwaysCenter || "left" !== textAlign && "start" !== textAlign || textShape.setAttributes({
32651
- x: textX + tagWidth / 2,
32652
- textAlign: "center"
32653
- }), "middle" === textBaseline ? (y -= tagHeight / 2, symbol && symbol.setAttribute("y", 0)) : "bottom" === textBaseline ? (y -= tagHeight, symbol && symbol.setAttribute("y", -textHeight / 2), group.setAttribute("y", -parsedPadding[2])) : "top" === textBaseline && (group.setAttribute("y", parsedPadding[0]), symbol && symbol.setAttribute("y", textHeight / 2));
32748
+ y = 0,
32749
+ flag = 0;
32750
+ if ("left" === textAlign || "start" === textAlign ? flag = 1 : "right" === textAlign || "end" === textAlign ? flag = -1 : "center" === textAlign && (flag = 0), flag ? flag < 0 ? (x -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : flag > 0 && group.setAttribute("x", parsedPadding[3]) : (x -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2)), textAlwaysCenter && flag) {
32751
+ const containerWidth = tagWidth - parsedPadding[1] - parsedPadding[3],
32752
+ tsWidth = textWidth + symbolPlaceWidth,
32753
+ textX = (containerWidth - tsWidth) / 2 + symbolPlaceWidth + textWidth / 2,
32754
+ symbolX = (containerWidth - tsWidth) / 2 + maxSize / 2;
32755
+ textShape.setAttributes({
32756
+ x: textX * flag,
32757
+ textAlign: "center"
32758
+ }), null == symbol || symbol.setAttributes({
32759
+ x: symbolX * flag
32760
+ }), group.setAttribute("x", parsedPadding[2 + flag] * flag);
32761
+ }
32762
+ "middle" === textBaseline ? (y -= tagHeight / 2, symbol && symbol.setAttribute("y", 0)) : "bottom" === textBaseline ? (y -= tagHeight, symbol && symbol.setAttribute("y", -textHeight / 2), group.setAttribute("y", -parsedPadding[2])) : "top" === textBaseline && (group.setAttribute("y", parsedPadding[0]), symbol && symbol.setAttribute("y", textHeight / 2));
32654
32763
  const {
32655
32764
  visible: bgVisible
32656
32765
  } = panel,
@@ -33910,18 +34019,7 @@
33910
34019
  state && !isEmpty(state) && (target.states = state);
33911
34020
  }
33912
34021
  _createLabelText(attributes) {
33913
- var _a, _b;
33914
- if ("rich" === attributes.textType) {
33915
- attributes.textConfig = attributes.text, attributes.width = null !== (_a = attributes.width) && void 0 !== _a ? _a : 0, attributes.height = null !== (_b = attributes.height) && void 0 !== _b ? _b : 0, attributes.maxWidth = attributes.maxLineWidth;
33916
- return graphicCreator.richtext(attributes);
33917
- }
33918
- if ("html" === attributes.textType) {
33919
- attributes.textConfig = [], attributes.html = Object.assign(Object.assign({
33920
- dom: attributes.text
33921
- }, DEFAULT_HTML_TEXT_SPEC), attributes);
33922
- return graphicCreator.richtext(attributes);
33923
- }
33924
- return graphicCreator.text(attributes);
34022
+ return isRichText(attributes, "textType") ? graphicCreator.richtext(richTextAttributeTransform(attributes)) : graphicCreator.text(attributes);
33925
34023
  }
33926
34024
  _prepare() {
33927
34025
  var _a, _b, _c, _d, _e;
@@ -33992,8 +34090,10 @@
33992
34090
  const textData = text.attribute,
33993
34091
  baseMark = this.getRelatedGraphic(textData);
33994
34092
  if (!baseMark) continue;
33995
- const textBounds = this.getGraphicBounds(text),
33996
- actualPosition = isFunction$1(position) ? position(textData) : position,
34093
+ text.attachedThemeGraphic = this;
34094
+ const textBounds = this.getGraphicBounds(text);
34095
+ text.attachedThemeGraphic = null;
34096
+ const actualPosition = isFunction$1(position) ? position(textData) : position,
33997
34097
  graphicBounds = this._isCollectionBase ? this.getGraphicBounds(null, this._idToPoint.get(textData.id), actualPosition) : this.getGraphicBounds(baseMark, {
33998
34098
  x: textData.x,
33999
34099
  y: textData.y
@@ -35157,7 +35257,7 @@
35157
35257
  super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Segment.defaultAttributes, attributes)), this.name = "segment";
35158
35258
  }
35159
35259
  render() {
35160
- this.removeAllChild(), this._reset();
35260
+ this.removeAllChild(!0), this._reset();
35161
35261
  const {
35162
35262
  startSymbol: startSymbol,
35163
35263
  endSymbol: endSymbol,
@@ -35426,7 +35526,7 @@
35426
35526
  return this.add(offscreenGroup), this._renderInner(offscreenGroup), this.removeChild(offscreenGroup), this.attribute = currentAttribute, offscreenGroup.AABBBounds;
35427
35527
  }
35428
35528
  render() {
35429
- this.removeAllChild(), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
35529
+ this.removeAllChild(!0), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
35430
35530
  x: 0,
35431
35531
  y: 0,
35432
35532
  pickable: !1
@@ -35533,12 +35633,10 @@
35533
35633
  pickable: !1
35534
35634
  });
35535
35635
  return labelGroup.name = `${AXIS_ELEMENT_NAME.labelContainer}-layer-${layer}`, labelGroup.id = this._getNodeId(`label-container-layer-${layer}`), container.add(labelGroup), data.forEach((item, index) => {
35536
- var _a, _b, _c;
35636
+ var _a;
35537
35637
  const labelStyle = this._getLabelAttribute(item, index, data, layer);
35538
35638
  let text;
35539
- if ("rich" === labelStyle.type ? (labelStyle.textConfig = labelStyle.text, labelStyle.width = null !== (_a = labelStyle.width) && void 0 !== _a ? _a : 0, labelStyle.height = null !== (_b = labelStyle.height) && void 0 !== _b ? _b : 0, text = graphicCreator.richtext(labelStyle)) : "html" === labelStyle.type ? (labelStyle.textConfig = [], labelStyle.html = Object.assign(Object.assign({
35540
- dom: labelStyle.text
35541
- }, DEFAULT_HTML_TEXT_SPEC), labelStyle), text = graphicCreator.richtext(labelStyle)) : text = graphicCreator.text(labelStyle), text.name = AXIS_ELEMENT_NAME.label, text.id = this._getNodeId(`layer${layer}-label-${item.id}`), isEmpty(null === (_c = this.attribute.label) || void 0 === _c ? void 0 : _c.state)) text.states = DEFAULT_STATES$2;else {
35639
+ if (text = isRichText(labelStyle) ? graphicCreator.richtext(richTextAttributeTransform(labelStyle)) : graphicCreator.text(labelStyle), text.name = AXIS_ELEMENT_NAME.label, text.id = this._getNodeId(`layer${layer}-label-${item.id}`), isEmpty(null === (_a = this.attribute.label) || void 0 === _a ? void 0 : _a.state)) text.states = DEFAULT_STATES$2;else {
35542
35640
  const labelState = merge$2({}, DEFAULT_STATES$2, this.attribute.label.state);
35543
35641
  Object.keys(labelState).forEach(key => {
35544
35642
  isFunction$1(labelState[key]) && (labelState[key] = labelState[key](item, index, data, layer));
@@ -36664,7 +36762,7 @@
36664
36762
  return this._prevInnerView;
36665
36763
  }
36666
36764
  render() {
36667
- this.removeAllChild(), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
36765
+ this.removeAllChild(!0), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
36668
36766
  x: 0,
36669
36767
  y: 0,
36670
36768
  pickable: !1
@@ -37877,7 +37975,7 @@
37877
37975
  var _a;
37878
37976
  this.setAttribute("pickable", !1);
37879
37977
  const markerVisible = null === (_a = this.attribute.visible) || void 0 === _a || _a;
37880
- !1 === this.attribute.interactive && this.setAttribute("childrenPickable", !1), markerVisible && this.isValidPoints() ? this._container ? (this._updateContainer(), this.updateMarker()) : (this._initContainer(), this.initMarker(this._container)) : (this._container = null, this.removeAllChild());
37978
+ !1 === this.attribute.interactive && this.setAttribute("childrenPickable", !1), markerVisible && this.isValidPoints() ? this._container ? (this._updateContainer(), this.updateMarker()) : (this._initContainer(), this.initMarker(this._container)) : (this._container = null, this.removeAllChild(!0));
37881
37979
  }
37882
37980
  }
37883
37981
 
@@ -38664,8 +38762,8 @@
38664
38762
  textAlign: "center",
38665
38763
  textBaseline: "middle"
38666
38764
  }, textStyle), null === (_b = this.stage) || void 0 === _b ? void 0 : _b.getTheme().text.fontFamily),
38667
- handlerSizeX = isNumber$2(handlerSize) ? handlerSize : handlerSize[0],
38668
- handlerSizeY = isNumber$2(handlerSize) ? handlerSize : handlerSize[1],
38765
+ handlerSizeX = isNumber$1(handlerSize) ? handlerSize : handlerSize[0],
38766
+ handlerSizeY = isNumber$1(handlerSize) ? handlerSize : handlerSize[1],
38669
38767
  text = graphicCreator.text(Object.assign({
38670
38768
  x: isHorizontal ? handlerSizeX / 2 + handlerSpace + maxTextWidth / 2 : 0,
38671
38769
  y: isHorizontal ? 0 : handlerSizeY / 2 + handlerSpace + maxTextHeight / 2,
@@ -38694,7 +38792,7 @@
38694
38792
  this.attribute.disableTriggerEvent || (this.preHandler && (this.preHandler.addEventListener("pointerenter", this._onHover), this.preHandler.addEventListener("pointerleave", this._onUnHover), this.preHandler.addEventListener("pointerdown", this._onClick)), this.nextHandler && (this.nextHandler.addEventListener("pointerenter", this._onHover), this.nextHandler.addEventListener("pointerleave", this._onUnHover), this.nextHandler.addEventListener("pointerdown", this._onClick)));
38695
38793
  }
38696
38794
  _reset() {
38697
- this.removeAllChild(), this._current = 1, this._total = this.attribute.total, this.preHandler = this.nextHandler = this.text = null;
38795
+ this.removeAllChild(!0), this._current = 1, this._total = this.attribute.total, this.preHandler = this.nextHandler = this.text = null;
38698
38796
  }
38699
38797
  }
38700
38798
  Pager.defaultAttributes = {
@@ -38731,7 +38829,7 @@
38731
38829
  super(...arguments), this.name = "legend", this._title = null;
38732
38830
  }
38733
38831
  render() {
38734
- this.removeAllChild();
38832
+ this.removeAllChild(!0);
38735
38833
  const {
38736
38834
  interactive = !0,
38737
38835
  title: title,
@@ -38994,7 +39092,8 @@
38994
39092
  shape.fill && isNil$1(shapeStyle.state[key].fill) && color && (shapeStyle.state[key].fill = color), shape.stroke && isNil$1(shapeStyle.state[key].stroke) && color && (shapeStyle.state[key].stroke = color);
38995
39093
  }), this._appendDataToShape(itemShape, LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeStyle.state), itemShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), innerGroup.add(itemShape);
38996
39094
  }
38997
- let focusSpace = 0;
39095
+ let labelShape,
39096
+ focusSpace = 0;
38998
39097
  if (focus) {
38999
39098
  const focusSize = get$1(focusIconStyle, "size", DEFAULT_SHAPE_SIZE);
39000
39099
  focusShape = graphicCreator.symbol(Object.assign(Object.assign({
@@ -39007,29 +39106,32 @@
39007
39106
  boundsPadding: parsedPadding
39008
39107
  })), this._appendDataToShape(focusShape, LEGEND_ELEMENT_NAME.focus, item, itemGroup), focusSpace = focusSize;
39009
39108
  }
39010
- const labelShape = graphicCreator.text(Object.assign(Object.assign({
39011
- x: shapeSize / 2 + shapeSpace,
39012
- y: 0,
39013
- textAlign: "start",
39014
- textBaseline: "middle",
39015
- lineHeight: null === (_b = labelStyle.style) || void 0 === _b ? void 0 : _b.fontSize
39016
- }, labelStyle.style), {
39017
- text: labelAttr.formatMethod ? labelAttr.formatMethod(label, item, index) : label
39018
- }));
39019
- this._appendDataToShape(labelShape, LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelStyle.state), labelShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), innerGroup.add(labelShape);
39109
+ const text = labelAttr.formatMethod ? labelAttr.formatMethod(label, item, index) : label,
39110
+ labelAttributes = Object.assign(Object.assign({
39111
+ x: shapeSize / 2 + shapeSpace,
39112
+ y: 0,
39113
+ textAlign: "start",
39114
+ textBaseline: "middle",
39115
+ lineHeight: null === (_b = labelStyle.style) || void 0 === _b ? void 0 : _b.fontSize
39116
+ }, labelStyle.style), {
39117
+ text: text
39118
+ });
39119
+ labelShape = isRichText(labelAttributes) ? graphicCreator.richtext(richTextAttributeTransform(labelAttributes)) : graphicCreator.text(labelAttributes), this._appendDataToShape(labelShape, LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelStyle.state), labelShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), innerGroup.add(labelShape);
39020
39120
  const labelSpace = get$1(labelAttr, "space", DEFAULT_LABEL_SPACE);
39021
39121
  if (isValid$1(value)) {
39022
39122
  const valueSpace = get$1(valueAttr, "space", focus ? DEFAULT_VALUE_SPACE : 0),
39023
- valueShape = graphicCreator.text(Object.assign(Object.assign({
39123
+ valueText = valueAttr.formatMethod ? valueAttr.formatMethod(value, item, index) : value,
39124
+ valueAttributes = Object.assign(Object.assign({
39024
39125
  x: 0,
39025
39126
  y: 0,
39026
39127
  textAlign: "start",
39027
39128
  textBaseline: "middle",
39028
39129
  lineHeight: valueStyle.style.fontSize
39029
39130
  }, valueStyle.style), {
39030
- text: valueAttr.formatMethod ? valueAttr.formatMethod(value, item, index) : value
39031
- }));
39032
- if (this._appendDataToShape(valueShape, LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, valueStyle.state), valueShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), this._itemWidthByUser) {
39131
+ text: valueText
39132
+ });
39133
+ let valueShape;
39134
+ if (valueShape = isRichText(valueAttributes) ? graphicCreator.richtext(richTextAttributeTransform(valueAttributes)) : graphicCreator.text(valueAttributes), this._appendDataToShape(valueShape, LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, valueStyle.state), valueShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), this._itemWidthByUser) {
39033
39135
  const layoutWidth = this._itemWidthByUser - parsedPadding[1] - parsedPadding[3] - shapeSize - shapeSpace - labelSpace - focusSpace - valueSpace,
39034
39136
  valueBounds = valueShape.AABBBounds,
39035
39137
  labelBounds = labelShape.AABBBounds,
@@ -39448,7 +39550,7 @@
39448
39550
  }
39449
39551
  render() {
39450
39552
  var _a, _b;
39451
- this.removeAllChild();
39553
+ this.removeAllChild(!0);
39452
39554
  const {
39453
39555
  layout = "horizontal",
39454
39556
  railWidth: railWidth,
@@ -40261,7 +40363,7 @@
40261
40363
  super(...arguments), this.name = "indicator";
40262
40364
  }
40263
40365
  render() {
40264
- var _a, _b, _c;
40366
+ var _a;
40265
40367
  const {
40266
40368
  visible: visible,
40267
40369
  title = {},
@@ -40278,20 +40380,7 @@
40278
40380
  if (!0 !== visible) return void (group && group.hideAll());
40279
40381
  if (isValid$1(title)) if (!1 !== title.visible) {
40280
40382
  const titleStyle = merge$2({}, get$1(DEFAULT_INDICATOR_THEME, "title.style"), title.style);
40281
- "rich" === titleStyle.type ? this._title = group.createOrUpdateChild("indicator-title", Object.assign(Object.assign({
40282
- textConfig: titleStyle.text
40283
- }, titleStyle), {
40284
- visible: title.visible,
40285
- x: 0,
40286
- y: 0,
40287
- width: null !== (_a = titleStyle.width) && void 0 !== _a ? _a : 0,
40288
- height: null !== (_b = titleStyle.height) && void 0 !== _b ? _b : 0
40289
- }), "richtext") : "html" === titleStyle.type ? this._title = group.createOrUpdateChild("indicator-title", Object.assign(Object.assign({
40290
- textConfig: [],
40291
- html: Object.assign(Object.assign({
40292
- dom: titleStyle.text
40293
- }, DEFAULT_HTML_TEXT_SPEC), titleStyle)
40294
- }, titleStyle), {
40383
+ isRichText(titleStyle) ? this._title = group.createOrUpdateChild("indicator-title", Object.assign(Object.assign({}, richTextAttributeTransform(titleStyle)), {
40295
40384
  visible: title.visible,
40296
40385
  x: 0,
40297
40386
  y: 0
@@ -40309,24 +40398,10 @@
40309
40398
  const contents = array(content),
40310
40399
  contentComponents = [];
40311
40400
  contents.forEach((contentItem, i) => {
40312
- var _a, _b;
40313
40401
  if (!1 !== contentItem.visible) {
40314
40402
  const contentStyle = merge$2({}, get$1(DEFAULT_INDICATOR_THEME, "content.style"), contentItem.style);
40315
40403
  let contentComponent;
40316
- contentComponent = "rich" === contentStyle.type ? group.createOrUpdateChild("indicator-content-" + i, Object.assign(Object.assign({
40317
- textConfig: contentStyle.text
40318
- }, contentStyle), {
40319
- visible: title.visible,
40320
- x: 0,
40321
- y: 0,
40322
- width: null !== (_a = contentStyle.width) && void 0 !== _a ? _a : 0,
40323
- height: null !== (_b = contentStyle.height) && void 0 !== _b ? _b : 0
40324
- }), "richtext") : "html" === contentStyle.type ? group.createOrUpdateChild("indicator-content-" + i, Object.assign(Object.assign({
40325
- textConfig: [],
40326
- html: Object.assign(Object.assign({
40327
- dom: contentStyle.text
40328
- }, DEFAULT_HTML_TEXT_SPEC), contentStyle)
40329
- }, contentStyle), {
40404
+ contentComponent = isRichText(contentStyle) ? group.createOrUpdateChild("indicator-content-" + i, Object.assign(Object.assign({}, richTextAttributeTransform(contentStyle)), {
40330
40405
  visible: title.visible,
40331
40406
  x: 0,
40332
40407
  y: 0
@@ -40343,7 +40418,7 @@
40343
40418
  }), this._content = contentComponents;
40344
40419
  }
40345
40420
  this._setGlobalAutoFit(limit), this._setYPosition();
40346
- const totalHeight = null !== (_c = null == group ? void 0 : group.AABBBounds.height()) && void 0 !== _c ? _c : 0;
40421
+ const totalHeight = null !== (_a = null == group ? void 0 : group.AABBBounds.height()) && void 0 !== _a ? _a : 0;
40347
40422
  group.setAttribute("y", size.height / 2 - totalHeight / 2), group.setAttribute("x", size.width / 2);
40348
40423
  }
40349
40424
  _setLocalAutoFit(limit, indicatorItem, indicatorItemSpec) {
@@ -40719,7 +40794,7 @@
40719
40794
  railSectionLength = null !== (_a = isHorizontal$1(this._orient) ? this._railStyle.height : this._railStyle.width) && void 0 !== _a ? _a : RailDefaultSize[1],
40720
40795
  controllerPx = controllers.reduce((len, controller) => {
40721
40796
  const size = controller.style.size,
40722
- maxSize = isNumber$2(size) ? size : max$1(size[0], size[1]);
40797
+ maxSize = isNumber$1(size) ? size : max$1(size[0], size[1]);
40723
40798
  return len + controller.space + maxSize;
40724
40799
  }, 0),
40725
40800
  sliderPx = this._sliderVisible ? (isHorizontal$1(this._orient) ? null === (_b = this._size) || void 0 === _b ? void 0 : _b.width : null === (_c = this._size) || void 0 === _c ? void 0 : _c.height) - controllerPx : 0,
@@ -40732,7 +40807,7 @@
40732
40807
  size: size
40733
40808
  }
40734
40809
  } = controller,
40735
- maxSize = isNumber$2(size) ? size : max$1(size[0], size[1]);
40810
+ maxSize = isNumber$1(size) ? size : max$1(size[0], size[1]);
40736
40811
  return this._layoutInfo[key] = Object.assign(Object.assign({}, this._layoutInfo[key]), {
40737
40812
  size: maxSize,
40738
40813
  x: isHorizontal$1(this._orient) ? px + space : (this._size.width - maxSize) / 2,
@@ -40751,7 +40826,7 @@
40751
40826
  size: size
40752
40827
  }
40753
40828
  } = controller,
40754
- maxSize = isNumber$2(size) ? size : max$1(size[0], size[1]);
40829
+ maxSize = isNumber$1(size) ? size : max$1(size[0], size[1]);
40755
40830
  return this._layoutInfo[key] = Object.assign(Object.assign({}, this._layoutInfo[key]), {
40756
40831
  size: maxSize,
40757
40832
  x: isHorizontal$1(this._orient) ? px + space : (this._size.width - maxSize) / 2,
@@ -41431,7 +41506,7 @@
41431
41506
  const titleHeight = isVisible(titleAttr) ? titleAttr.height + titleAttr.spaceRow : 0;
41432
41507
  if (this._tooltipContent = this.createOrUpdateChild("tooltip-content", {
41433
41508
  visible: !0
41434
- }, "group"), this._tooltipContent.removeAllChild(), content && content.length) {
41509
+ }, "group"), this._tooltipContent.removeAllChild(!0), content && content.length) {
41435
41510
  this._tooltipContent.setAttribute("x", padding[3]), this._tooltipContent.setAttribute("y", padding[0] + titleHeight);
41436
41511
  let lastYPos = 0;
41437
41512
  content.forEach((item, i) => {
@@ -42641,7 +42716,7 @@
42641
42716
  };
42642
42717
  const normalizePadding = value => {
42643
42718
  var _a, _b, _c, _d;
42644
- return isNumber$2(value) ? {
42719
+ return isNumber$1(value) ? {
42645
42720
  top: value,
42646
42721
  bottom: value,
42647
42722
  left: value,
@@ -43523,10 +43598,10 @@
43523
43598
  delayAfter: delayAfter
43524
43599
  }), loopTime += delay + duration + delayAfter;
43525
43600
  });
43526
- const oneByOneDelay = isNumber$2(oneByOne) ? oneByOne : !0 === oneByOne ? loopTime : 0;
43601
+ const oneByOneDelay = isNumber$1(oneByOne) ? oneByOne : !0 === oneByOne ? loopTime : 0;
43527
43602
  return {
43528
43603
  initialDelay: startTime,
43529
- loopCount: isNumber$2(loop) ? loop : !0 === loop ? 1 / 0 : 1,
43604
+ loopCount: isNumber$1(loop) ? loop : !0 === loop ? 1 / 0 : 1,
43530
43605
  loopDelay: oneByOneDelay * index,
43531
43606
  loopDelayAfter: oneByOneDelay * (elementCount - index - 1),
43532
43607
  loopAnimateDuration: loopTime,
@@ -43626,7 +43701,7 @@
43626
43701
  if (this.markType === GrammarMarkType.group) return;
43627
43702
  const res = groupData(null != data ? data : DefaultMarkData, this.spec.groupBy, this.spec.groupSort),
43628
43703
  groupKeys = res.keys;
43629
- this._groupKeys = groupKeys, this.differ.setCurrentData(res);
43704
+ this._groupKeys = groupKeys, this._groupEncodeResult = null, this.differ.setCurrentData(res);
43630
43705
  }
43631
43706
  _getTransformsAfterEncodeItems() {
43632
43707
  return this.transforms && this.transforms.filter(entry => "afterEncodeItems" === entry.markPhase);
@@ -43697,7 +43772,7 @@
43697
43772
  return nextTransforms && (this.attach(nextTransforms.refs), this.transforms = nextTransforms.transforms), this.spec.transform = transforms, this.commit(), this;
43698
43773
  }
43699
43774
  configure(config) {
43700
- const keys = ["clip", "zIndex", "interactive", "context", "setCustomizedShape", "large", "largeThreshold", "progressiveStep", "progressiveThreshold", "support3d", "morph", "morphKey", "morphElementKey", "attributeTransforms", "skipTheme", "enableSegments", "stateSort"];
43775
+ const keys = ["clip", "clipPath", "zIndex", "interactive", "context", "setCustomizedShape", "large", "largeThreshold", "progressiveStep", "progressiveThreshold", "support3d", "morph", "morphKey", "morphElementKey", "attributeTransforms", "skipTheme", "enableSegments", "stateSort"];
43701
43776
  return null === config ? (keys.forEach(key => {
43702
43777
  isNil$1(this.spec[key]) || (this.spec[key] = void 0);
43703
43778
  }), this) : (keys.forEach(key => {
@@ -43777,7 +43852,7 @@
43777
43852
  this.graphicIndex = markIndex;
43778
43853
  }
43779
43854
  update(spec) {
43780
- this._context = this.spec.context, this.isUpdated = !0, this.renderContext.progressive || (spec.animation && this.animate.updateConfig(spec.animation), this.animate.updateState(spec.animationState)), this.markType !== GrammarMarkType.group ? (isNil$1(spec.zIndex) || this.graphicItem.setAttribute("zIndex", spec.zIndex), isNil$1(spec.clip) || this.graphicItem.setAttribute("clip", spec.clip), this.elementMap.forEach(element => {
43855
+ this._context = this.spec.context, this.isUpdated = !0, this.renderContext.progressive || (spec.animation && this.animate.updateConfig(spec.animation), this.animate.updateState(spec.animationState)), this.markType !== GrammarMarkType.group ? (isNil$1(spec.zIndex) || this.graphicItem.setAttribute("zIndex", spec.zIndex), isNil$1(spec.clip) || this.graphicItem.setAttribute("clip", spec.clip), isNil$1(spec.clipPath) || this.graphicItem.setAttribute("path", isArray$1(spec.clipPath) ? spec.clipPath : spec.clipPath(this.elements)), this.elementMap.forEach(element => {
43781
43856
  element.updateGraphicItem({
43782
43857
  interactive: spec.interactive
43783
43858
  });
@@ -43785,7 +43860,8 @@
43785
43860
  element.updateGraphicItem({
43786
43861
  clip: spec.clip,
43787
43862
  zIndex: spec.zIndex,
43788
- interactive: spec.interactive
43863
+ interactive: spec.interactive,
43864
+ clipPath: spec.clipPath
43789
43865
  });
43790
43866
  });
43791
43867
  }
@@ -43834,25 +43910,27 @@
43834
43910
  items = [Object.assign({}, null === (_a = el.items) || void 0 === _a ? void 0 : _a[0], {
43835
43911
  nextAttrs: nextAttrs
43836
43912
  })];
43837
- return invokeEncoderToItems(el, items, groupEncode, parameters), nextAttrs;
43913
+ return invokeEncoderToItems(el, items, groupEncode, parameters), this._groupEncodeResult = nextAttrs, nextAttrs;
43838
43914
  }
43839
43915
  if (!this._groupKeys || !groupEncode) return;
43840
43916
  const res = {};
43841
43917
  return this._groupKeys.forEach(key => {
43842
43918
  const el = elements.find(el => el.groupKey === key);
43843
43919
  el && (res[key] = invokeEncoder(groupEncode, el.items && el.items[0] && el.items[0].datum, el, parameters));
43844
- }), res;
43920
+ }), this._groupEncodeResult = res, res;
43845
43921
  }
43846
- evaluateEncode(elements, encoders, parameters) {
43922
+ evaluateEncode(elements, encoders, parameters, noGroupEncode) {
43847
43923
  if (encoders) {
43848
43924
  this.emit(exports.VGRAMMAR_HOOK_EVENT.BEFORE_ELEMENT_ENCODE, {
43849
43925
  encoders: encoders,
43850
43926
  parameters: parameters
43851
43927
  }, this);
43852
- const groupEncodeAttrs = this.evaluateGroupEncode(elements, encoders[BuiltInEncodeNames.group], parameters);
43928
+ const groupEncodeAttrs = noGroupEncode ? null : this.evaluateGroupEncode(elements, encoders[BuiltInEncodeNames.group], parameters);
43853
43929
  elements.forEach(element => {
43854
43930
  this.markType === GrammarMarkType.group && groupEncodeAttrs ? element.items.forEach(item => {
43855
43931
  item.nextAttrs = Object.assign(item.nextAttrs, groupEncodeAttrs);
43932
+ }) : this.markType === GrammarMarkType.glyph && this._groupEncodeResult ? element.items.forEach(item => {
43933
+ item.nextAttrs = Object.assign(item.nextAttrs, this._groupEncodeResult[element.groupKey]);
43856
43934
  }) : (null == groupEncodeAttrs ? void 0 : groupEncodeAttrs[element.groupKey]) && !this.isCollectionMark() && element.items.forEach(item => {
43857
43935
  item.nextAttrs = Object.assign(item.nextAttrs, groupEncodeAttrs[element.groupKey]);
43858
43936
  }), element.encodeItems(element.items, encoders, this._isReentered, parameters);
@@ -43951,41 +44029,17 @@
43951
44029
  };
43952
44030
  }
43953
44031
  evaluateEncodeProgressive(elements, encoders, parameters) {
43954
- if (!encoders) return void elements.forEach(element => {
43955
- element.initGraphicItem();
43956
- });
43957
- const positionEncoders = Object.keys(encoders).reduce((res, state) => (!encoders[state] || state !== BuiltInEncodeNames.enter && state !== BuiltInEncodeNames.exit && state !== BuiltInEncodeNames.update || (res[state] = splitEncoderInLarge(this.markType, encoders[state], this.glyphType).positionEncoder), res), {}),
43958
- progressiveIndex = this.renderContext.progressive.currentIndex,
43959
- isCollection = this.isCollectionMark();
43960
- this.emit(exports.VGRAMMAR_HOOK_EVENT.BEFORE_ELEMENT_ENCODE, {
43961
- encoders: encoders,
43962
- parameters: parameters
43963
- }, this);
43964
- const groupEncodeAttrs = this.evaluateGroupEncode(elements, encoders[BuiltInEncodeNames.group], parameters);
43965
- if (elements.forEach((element, index) => {
43966
- const onlyPos = progressiveIndex > 0 || !isCollection && index > 0;
43967
- !onlyPos && (null == groupEncodeAttrs ? void 0 : groupEncodeAttrs[element.groupKey]) && element.items.forEach(item => {
43968
- item.nextAttrs = Object.assign(item.nextAttrs, groupEncodeAttrs[element.groupKey]);
43969
- }), element.encodeItems(element.items, onlyPos ? positionEncoders : encoders, this._isReentered, parameters);
43970
- }), this._isReentered = !1, this.evaluateTransform(this._getTransformsAfterEncodeItems(), elements, parameters), elements.forEach(element => {
43971
- element.encodeGraphic();
43972
- }), this.emit(exports.VGRAMMAR_HOOK_EVENT.AFTER_ELEMENT_ENCODE, {
43973
- encoders: encoders,
43974
- parameters: parameters
43975
- }, this), 0 === progressiveIndex && !isCollection) {
43976
- const firstChild = elements[0].getGraphicItem(),
43977
- group = null == firstChild ? void 0 : firstChild.parent;
43978
- if (group) {
43979
- const attrs = firstChild.attribute,
43980
- theme = {},
43981
- itemAttrs = {};
43982
- Object.keys(attrs).forEach(key => {
43983
- ["pickable", "zIndex"].includes(key) || (isPositionOrSizeChannel(this.markType, key) ? itemAttrs[key] = attrs[key] : theme[key] = attrs[key]);
43984
- }), group.setTheme({
43985
- common: theme
43986
- }), firstChild.initAttributes(itemAttrs);
44032
+ const progressiveIndex = this.renderContext.progressive.currentIndex;
44033
+ if (0 === progressiveIndex) {
44034
+ if (this.evaluateEncode(elements, encoders, parameters), 0 === progressiveIndex && this._groupEncodeResult && !this.isCollectionMark() && this.markType !== GrammarMarkType.glyph) {
44035
+ const firstElement = elements[0],
44036
+ firstChild = firstElement.getGraphicItem(),
44037
+ group = null == firstChild ? void 0 : firstChild.parent;
44038
+ group && this._groupEncodeResult[firstElement.groupKey] && group.setTheme({
44039
+ common: this._groupEncodeResult[firstElement.groupKey]
44040
+ });
43987
44041
  }
43988
- }
44042
+ } else this.evaluateEncode(elements, encoders, parameters, !0);
43989
44043
  }
43990
44044
  evaluateProgressive() {
43991
44045
  var _a, _b, _c;
@@ -44455,7 +44509,7 @@
44455
44509
  duration = invokeFunctionType(runningConfig.animation.duration, parameters, morphData, morphElements),
44456
44510
  oneByOne = invokeFunctionType(runningConfig.animation.oneByOne, parameters, morphData, morphElements),
44457
44511
  splitPath = invokeFunctionType(runningConfig.animation.splitPath, parameters, morphData, morphElements),
44458
- individualDelay = isValidNumber$1(oneByOne) && oneByOne > 0 ? index => isNumber$2(oneByOne) ? index * oneByOne : !0 === oneByOne ? index * duration : 0 : void 0;
44512
+ individualDelay = isValidNumber$1(oneByOne) && oneByOne > 0 ? index => isNumber$1(oneByOne) ? index * oneByOne : !0 === oneByOne ? index * duration : 0 : void 0;
44459
44513
  1 !== prev.length && 0 !== prev.length || 1 !== next.length ? 1 === prev.length && next.length > 1 ? oneToMultiMorph(prev[0].getGraphicItem(), next.map(element => element.getGraphicItem()), {
44460
44514
  delay: delay,
44461
44515
  duration: duration,
@@ -45830,9 +45884,9 @@
45830
45884
  grammarWillDetach && (this.reuseCachedGrammars(normalizedRunningConfig), this.detachCachedGrammar());
45831
45885
  const hasResize = this._resizeRenderer(),
45832
45886
  hasUpdate = this._dataflow.hasCommitted();
45833
- return grammarWillDetach || hasUpdate || this._layoutState || hasResize ? (this.clearProgressive(), this._dataflow.evaluate(), this._needBuildLayoutTree && (this.buildLayoutTree(), this._needBuildLayoutTree = !1), this._layoutState && (this._layoutState = LayoutState.layouting, this.doLayout(), this._dataflow.hasCommitted() && (this._layoutState = LayoutState.reevaluate, this._dataflow.evaluate()), this._layoutState = LayoutState.after, (null === (_a = this._layoutMarks) || void 0 === _a ? void 0 : _a.length) && this.handleLayoutEnd()), this._layoutState = null, this.findProgressiveMarks(), this._resizeRenderer(), this.doRender(!0), null === (_b = this._willMorphMarks) || void 0 === _b || _b.forEach(morphMarks => {
45887
+ return grammarWillDetach || hasUpdate || this._layoutState || hasResize ? (this.clearProgressive(), this._dataflow.evaluate(), this._needBuildLayoutTree && (this.buildLayoutTree(), this._needBuildLayoutTree = !1), this._layoutState && (this._layoutState = LayoutState.layouting, this.doLayout(), this._dataflow.hasCommitted() && (this._layoutState = LayoutState.reevaluate, this._dataflow.evaluate()), this._layoutState = LayoutState.after, (null === (_a = this._layoutMarks) || void 0 === _a ? void 0 : _a.length) && this.handleLayoutEnd()), this._layoutState = null, this.findProgressiveMarks(), this._resizeRenderer(), null === (_b = this._willMorphMarks) || void 0 === _b || _b.forEach(morphMarks => {
45834
45888
  this._morph.morph(morphMarks.prev, morphMarks.next, normalizedRunningConfig);
45835
- }), this._willMorphMarks = null, this.releaseCachedGrammars(normalizedRunningConfig), this.doPreProgressive(), this) : this;
45889
+ }), this._willMorphMarks = null, this.releaseCachedGrammars(normalizedRunningConfig), this.doRender(!0), this.doPreProgressive(), this) : this;
45836
45890
  }
45837
45891
  reuseCachedGrammars(runningConfig) {
45838
45892
  if (this._willMorphMarks || (this._willMorphMarks = []), runningConfig.reuse) {
@@ -47773,7 +47827,7 @@
47773
47827
  x1 = element.getGraphicAttribute("x1", !1),
47774
47828
  width = element.getGraphicAttribute("width", !1);
47775
47829
  let overallValue;
47776
- return options && "negative" === options.orient ? isNumber$2(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupWidth) && void 0 !== _a ? _a : animationParameters.group.getBounds().width(), animationParameters.groupWidth = overallValue) : overallValue = animationParameters.width : overallValue = isNumber$2(null == options ? void 0 : options.overall) ? null == options ? void 0 : options.overall : 0, {
47830
+ return options && "negative" === options.orient ? isNumber$1(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupWidth) && void 0 !== _a ? _a : animationParameters.group.getBounds().width(), animationParameters.groupWidth = overallValue) : overallValue = animationParameters.width : overallValue = isNumber$1(null == options ? void 0 : options.overall) ? null == options ? void 0 : options.overall : 0, {
47777
47831
  from: {
47778
47832
  x: overallValue,
47779
47833
  x1: isNil$1(x1) ? void 0 : overallValue,
@@ -47818,7 +47872,7 @@
47818
47872
  const x1 = element.getGraphicAttribute("x1", !1),
47819
47873
  width = element.getGraphicAttribute("width", !1);
47820
47874
  let overallValue;
47821
- return options && "negative" === options.orient ? isNumber$2(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupWidth) && void 0 !== _a ? _a : animationParameters.group.getBounds().width(), animationParameters.groupWidth = overallValue) : overallValue = animationParameters.width : overallValue = isNumber$2(null == options ? void 0 : options.overall) ? options.overall : 0, {
47875
+ return options && "negative" === options.orient ? isNumber$1(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupWidth) && void 0 !== _a ? _a : animationParameters.group.getBounds().width(), animationParameters.groupWidth = overallValue) : overallValue = animationParameters.width : overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0, {
47822
47876
  to: {
47823
47877
  x: overallValue,
47824
47878
  x1: isNil$1(x1) ? void 0 : overallValue,
@@ -47869,7 +47923,7 @@
47869
47923
  y1 = element.getGraphicAttribute("y1", !1),
47870
47924
  height = element.getGraphicAttribute("height", !1);
47871
47925
  let overallValue;
47872
- return options && "negative" === options.orient ? isNumber$2(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : animationParameters.group.getBounds().height(), animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = isNumber$2(null == options ? void 0 : options.overall) ? options.overall : 0, {
47926
+ return options && "negative" === options.orient ? isNumber$1(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : animationParameters.group.getBounds().height(), animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0, {
47873
47927
  from: {
47874
47928
  y: overallValue,
47875
47929
  y1: isNil$1(y1) ? void 0 : overallValue,
@@ -47914,7 +47968,7 @@
47914
47968
  const y1 = element.getGraphicAttribute("y1", !1),
47915
47969
  height = element.getGraphicAttribute("height", !1);
47916
47970
  let overallValue;
47917
- return options && "negative" === options.orient ? isNumber$2(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : animationParameters.group.getBounds().height(), animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = isNumber$2(null == options ? void 0 : options.overall) ? options.overall : 0, {
47971
+ return options && "negative" === options.orient ? isNumber$1(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : animationParameters.group.getBounds().height(), animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0, {
47918
47972
  to: {
47919
47973
  y: overallValue,
47920
47974
  y1: isNil$1(y1) ? void 0 : overallValue,
@@ -47944,7 +47998,7 @@
47944
47998
  },
47945
47999
  growAngleInOverall = (element, options, animationParameters) => {
47946
48000
  if (options && "anticlockwise" === options.orient) {
47947
- const overallValue = isNumber$2(options.overall) ? options.overall : 2 * Math.PI;
48001
+ const overallValue = isNumber$1(options.overall) ? options.overall : 2 * Math.PI;
47948
48002
  return {
47949
48003
  from: {
47950
48004
  startAngle: overallValue,
@@ -47956,7 +48010,7 @@
47956
48010
  }
47957
48011
  };
47958
48012
  }
47959
- const overallValue = isNumber$2(null == options ? void 0 : options.overall) ? options.overall : 0;
48013
+ const overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0;
47960
48014
  return {
47961
48015
  from: {
47962
48016
  startAngle: overallValue,
@@ -47989,7 +48043,7 @@
47989
48043
  },
47990
48044
  growAngleOutOverall = (element, options, animationParameters) => {
47991
48045
  if (options && "anticlockwise" === options.orient) {
47992
- const overallValue = isNumber$2(options.overall) ? options.overall : 2 * Math.PI;
48046
+ const overallValue = isNumber$1(options.overall) ? options.overall : 2 * Math.PI;
47993
48047
  return {
47994
48048
  from: {
47995
48049
  startAngle: element.getGraphicAttribute("startAngle", !0),
@@ -48001,7 +48055,7 @@
48001
48055
  }
48002
48056
  };
48003
48057
  }
48004
- const overallValue = isNumber$2(null == options ? void 0 : options.overall) ? options.overall : 0;
48058
+ const overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0;
48005
48059
  return {
48006
48060
  from: {
48007
48061
  startAngle: element.getGraphicAttribute("startAngle", !0),
@@ -48033,7 +48087,7 @@
48033
48087
  }
48034
48088
  },
48035
48089
  growRadiusInOverall = (element, options, animationParameters) => {
48036
- const overallValue = isNumber$2(null == options ? void 0 : options.overall) ? options.overall : 0;
48090
+ const overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0;
48037
48091
  return {
48038
48092
  from: {
48039
48093
  innerRadius: overallValue,
@@ -48065,7 +48119,7 @@
48065
48119
  }
48066
48120
  },
48067
48121
  growRadiusOutOverall = (element, options, animationParameters) => {
48068
- const overallValue = isNumber$2(null == options ? void 0 : options.overall) ? options.overall : 0;
48122
+ const overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0;
48069
48123
  return {
48070
48124
  from: {
48071
48125
  innerRadius: element.getGraphicAttribute("innerRadius", !0),
@@ -48504,7 +48558,7 @@
48504
48558
  return [{
48505
48559
  channels: ["size", "padding"],
48506
48560
  transform: (graphicAttributes, nextAttrs, storedAttrs) => {
48507
- if (isNumber$2(storedAttrs.padding) && storedAttrs.padding > 0) graphicAttributes.size = isArray$1(storedAttrs.size) ? storedAttrs.size.map(entry => Math.max(entry - storedAttrs.padding, 1)) : Math.max(storedAttrs.size - storedAttrs.padding, 1);else if (isArray$1(storedAttrs.padding) && 2 === storedAttrs.padding.length) {
48561
+ if (isNumber$1(storedAttrs.padding) && storedAttrs.padding > 0) graphicAttributes.size = isArray$1(storedAttrs.size) ? storedAttrs.size.map(entry => Math.max(entry - storedAttrs.padding, 1)) : Math.max(storedAttrs.size - storedAttrs.padding, 1);else if (isArray$1(storedAttrs.padding) && 2 === storedAttrs.padding.length) {
48508
48562
  const arraySize = isArray$1(storedAttrs.size) ? storedAttrs.size : [storedAttrs.size, storedAttrs.size];
48509
48563
  graphicAttributes.size = [Math.max(arraySize[0] - storedAttrs.padding[0], 1), Math.max(arraySize[1] - storedAttrs.padding[1], 1)];
48510
48564
  } else graphicAttributes.size = storedAttrs.size;
@@ -49146,7 +49200,7 @@
49146
49200
  }
49147
49201
  function calcLayoutNumber(v, size, callOp) {
49148
49202
  var _a, _b;
49149
- if (isNumber$2(v)) {
49203
+ if (isNumber$1(v)) {
49150
49204
  return v;
49151
49205
  }
49152
49206
  if (isPercent(v)) {
@@ -49168,7 +49222,7 @@
49168
49222
  left: 0,
49169
49223
  right: 0
49170
49224
  };
49171
- if (Object.values(paddingSpec).every(value => isNumber$2(value))) {
49225
+ if (Object.values(paddingSpec).every(value => isNumber$1(value))) {
49172
49226
  result.top = (_a = paddingSpec.top) !== null && _a !== void 0 ? _a : 0;
49173
49227
  result.right = (_b = paddingSpec.right) !== null && _b !== void 0 ? _b : 0;
49174
49228
  result.bottom = (_c = paddingSpec.bottom) !== null && _c !== void 0 ? _c : 0;
@@ -49218,7 +49272,7 @@
49218
49272
  }
49219
49273
  return result;
49220
49274
  }
49221
- if (isNumber$2(spec) || isPercent(spec) || isFunction$1(spec) || isPercentOffset(spec)) {
49275
+ if (isNumber$1(spec) || isPercent(spec) || isFunction$1(spec) || isPercentOffset(spec)) {
49222
49276
  result.top = result.left = result.bottom = result.right = spec;
49223
49277
  return result;
49224
49278
  }
@@ -51371,7 +51425,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
51371
51425
  else if (typeof value === 'object') {
51372
51426
  result = {};
51373
51427
  }
51374
- else if (isBoolean$1(value) || isNumber$2(value) || isString$1(value)) {
51428
+ else if (isBoolean$1(value) || isNumber$1(value) || isString$1(value)) {
51375
51429
  result = value;
51376
51430
  }
51377
51431
  else if (isDate$1(value)) {
@@ -56558,7 +56612,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
56558
56612
  this._initSpecStyle(spec, this.stateStyle, key);
56559
56613
  }
56560
56614
  convertAngleToRadian(styleConverter) {
56561
- if (isNumber$2(styleConverter)) {
56615
+ if (isNumber$1(styleConverter)) {
56562
56616
  return degreeToRadian(styleConverter);
56563
56617
  }
56564
56618
  else if (styleConverter.scale) {
@@ -57419,11 +57473,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
57419
57473
  this._specInfo = (_a = this._chartSpecTransformer) === null || _a === void 0 ? void 0 : _a.createSpecInfo(this._spec);
57420
57474
  }
57421
57475
  _initChart(spec) {
57422
- var _a, _b;
57476
+ var _a, _b, _c;
57423
57477
  if (!this._compiler) {
57424
57478
  (_a = this._option) === null || _a === void 0 ? void 0 : _a.onError('compiler is not initialized');
57425
57479
  return;
57426
57480
  }
57481
+ if (this._chart) {
57482
+ (_b = this._option) === null || _b === void 0 ? void 0 : _b.onError('chart is already initialized');
57483
+ return;
57484
+ }
57427
57485
  const chart = Factory.createChart(spec.type, spec, {
57428
57486
  type: spec.type,
57429
57487
  globalInstance: this,
@@ -57445,7 +57503,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
57445
57503
  disableTriggerEvent: this._option.disableTriggerEvent === true
57446
57504
  });
57447
57505
  if (!chart) {
57448
- (_b = this._option) === null || _b === void 0 ? void 0 : _b.onError('init chart fail');
57506
+ (_c = this._option) === null || _c === void 0 ? void 0 : _c.onError('init chart fail');
57449
57507
  return;
57450
57508
  }
57451
57509
  this._chart = chart;
@@ -58736,7 +58794,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
58736
58794
  registerChartPlugin(MediaQuery);
58737
58795
  };
58738
58796
 
58739
- const version = "1.9.1";
58797
+ const version = "1.9.2";
58740
58798
 
58741
58799
  const addVChartProperty = (data, op) => {
58742
58800
  const context = op.beforeCall();
@@ -59360,13 +59418,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59360
59418
  _getDefaultSpecFromChart(chartSpec) {
59361
59419
  var _a;
59362
59420
  const spec = (_a = super._getDefaultSpecFromChart(chartSpec)) !== null && _a !== void 0 ? _a : {};
59363
- const { outerRadius, innerRadius } = chartSpec;
59421
+ const { outerRadius, innerRadius, direction } = chartSpec;
59364
59422
  if (isValid$1(outerRadius)) {
59365
59423
  spec.outerRadius = outerRadius;
59366
59424
  }
59367
59425
  if (isValid$1(innerRadius)) {
59368
59426
  spec.innerRadius = innerRadius;
59369
59427
  }
59428
+ if (isValid$1(direction)) {
59429
+ spec.direction = direction;
59430
+ }
59370
59431
  return Object.keys(spec).length > 0 ? spec : undefined;
59371
59432
  }
59372
59433
  }
@@ -60612,41 +60673,46 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60612
60673
  getStackGroupFields() {
60613
60674
  return this.getGroupFields();
60614
60675
  }
60676
+ getStackValue() {
60677
+ var _a, _b;
60678
+ const axisId = (_a = (this.direction === "horizontal" ? this.getXAxisHelper() : this.getYAxisHelper())) === null || _a === void 0 ? void 0 : _a.getAxisId();
60679
+ return (_b = this._spec.stackValue) !== null && _b !== void 0 ? _b : `${PREFIX}_series_${this.type}_${axisId}`;
60680
+ }
60615
60681
  getStackValueField() {
60616
- if (this.direction === "vertical") {
60617
- return array(this._spec.yField)[0];
60682
+ if (this.direction === "horizontal") {
60683
+ return array(this._spec.xField)[0];
60618
60684
  }
60619
- return array(this._spec.xField)[0];
60685
+ return array(this._spec.yField)[0];
60620
60686
  }
60621
60687
  setValueFieldToStack() {
60622
- if (this.direction === "vertical") {
60623
- this.setFieldY(STACK_FIELD_END);
60624
- this.setFieldY2(STACK_FIELD_START);
60625
- }
60626
- else {
60688
+ if (this.direction === "horizontal") {
60627
60689
  this.setFieldX(STACK_FIELD_END);
60628
60690
  this.setFieldX2(STACK_FIELD_START);
60629
60691
  }
60692
+ else {
60693
+ this.setFieldY(STACK_FIELD_END);
60694
+ this.setFieldY2(STACK_FIELD_START);
60695
+ }
60630
60696
  }
60631
60697
  setValueFieldToPercent() {
60632
- if (this.direction === "vertical") {
60633
- this.setFieldY(STACK_FIELD_END_PERCENT);
60634
- this.setFieldY2(STACK_FIELD_START_PERCENT);
60635
- }
60636
- else {
60698
+ if (this.direction === "horizontal") {
60637
60699
  this.setFieldX(STACK_FIELD_END_PERCENT);
60638
60700
  this.setFieldX2(STACK_FIELD_START_PERCENT);
60639
60701
  }
60702
+ else {
60703
+ this.setFieldY(STACK_FIELD_END_PERCENT);
60704
+ this.setFieldY2(STACK_FIELD_START_PERCENT);
60705
+ }
60640
60706
  }
60641
60707
  setValueFieldToStackOffsetSilhouette() {
60642
- if (this.direction === "vertical") {
60643
- this.setFieldY(STACK_FIELD_END_OffsetSilhouette);
60644
- this.setFieldY2(STACK_FIELD_START_OffsetSilhouette);
60645
- }
60646
- else {
60708
+ if (this.direction === "horizontal") {
60647
60709
  this.setFieldX(STACK_FIELD_END_OffsetSilhouette);
60648
60710
  this.setFieldX2(STACK_FIELD_START_OffsetSilhouette);
60649
60711
  }
60712
+ else {
60713
+ this.setFieldY(STACK_FIELD_END_OffsetSilhouette);
60714
+ this.setFieldY2(STACK_FIELD_START_OffsetSilhouette);
60715
+ }
60650
60716
  }
60651
60717
  onXAxisHelperUpdate() {
60652
60718
  this.onMarkPositionUpdate();
@@ -60820,22 +60886,22 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60820
60886
  this._buildScaleConfig();
60821
60887
  }
60822
60888
  getDimensionField() {
60823
- if (this._direction === "vertical") {
60824
- return this._specXField;
60889
+ if (this._direction === "horizontal") {
60890
+ return this._specYField;
60825
60891
  }
60826
- return this._specYField;
60892
+ return this._specXField;
60827
60893
  }
60828
60894
  getDimensionContinuousField() {
60829
- if (this._direction === "vertical") {
60830
- return [this.fieldX[0], this.fieldX2];
60895
+ if (this._direction === "horizontal") {
60896
+ return [this.fieldY[0], this.fieldY2];
60831
60897
  }
60832
- return [this.fieldY[0], this.fieldY2];
60898
+ return [this.fieldX[0], this.fieldX2];
60833
60899
  }
60834
60900
  getMeasureField() {
60835
- if (this._direction === "vertical") {
60836
- return this._specYField;
60901
+ if (this._direction === "horizontal") {
60902
+ return this._specXField;
60837
60903
  }
60838
- return this._specXField;
60904
+ return this._specYField;
60839
60905
  }
60840
60906
  viewDataUpdate(d) {
60841
60907
  super.viewDataUpdate(d);
@@ -60875,9 +60941,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60875
60941
  const fieldsX = this._fieldX;
60876
60942
  samplingTrans.push({
60877
60943
  type: 'sampling',
60878
- size: this._direction === "vertical" ? width : height,
60944
+ size: this._direction === "horizontal" ? height : width,
60879
60945
  factor: this._spec.samplingFactor,
60880
- yfield: this._direction === "vertical" ? fieldsY[0] : fieldsX[0],
60946
+ yfield: this._direction === "horizontal" ? fieldsX[0] : fieldsY[0],
60881
60947
  groupBy: this._seriesField,
60882
60948
  mode: this._spec.sampling
60883
60949
  });
@@ -60941,9 +61007,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60941
61007
  else {
60942
61008
  const userCurveType = areaCurveType !== null && areaCurveType !== void 0 ? areaCurveType : (_b = (_a = this.getSpec().line) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.curveType;
60943
61009
  const curveType = userCurveType === DEFAULT_SMOOTH_INTERPOLATE
60944
- ? direction === "vertical"
60945
- ? 'monotoneX'
60946
- : 'monotoneY'
61010
+ ? direction === "horizontal"
61011
+ ? 'monotoneY'
61012
+ : 'monotoneX'
60947
61013
  : userCurveType;
60948
61014
  this.setMarkStyle(lineMark, {
60949
61015
  curveType
@@ -63198,33 +63264,33 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
63198
63264
  var _a, _b, _c, _d, _e;
63199
63265
  const userCurveType = ((_c = (_b = (_a = this.getSpec().area) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.curveType) !== null && _c !== void 0 ? _c : (_e = (_d = this.getSpec().line) === null || _d === void 0 ? void 0 : _d.style) === null || _e === void 0 ? void 0 : _e.curveType);
63200
63266
  const curveType = userCurveType === DEFAULT_SMOOTH_INTERPOLATE
63201
- ? this._direction === "vertical"
63202
- ? 'monotoneX'
63203
- : 'monotoneY'
63267
+ ? this._direction === "horizontal"
63268
+ ? 'monotoneY'
63269
+ : 'monotoneX'
63204
63270
  : userCurveType;
63205
63271
  const areaMark = this._areaMark;
63206
63272
  if (areaMark) {
63207
- if (this._direction === "vertical") {
63273
+ if (this._direction === "horizontal") {
63208
63274
  this.setMarkStyle(this._areaMark, {
63209
63275
  x: this.dataToPositionX.bind(this),
63210
- y1: (datum) => {
63276
+ x1: (datum) => {
63211
63277
  var _a, _b;
63212
- return valueInScaleRange(this.dataToPositionY1(datum), (_b = (_a = this._yAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0));
63278
+ return valueInScaleRange(this.dataToPositionX1(datum), (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0));
63213
63279
  },
63214
63280
  y: this.dataToPositionY.bind(this),
63215
- z: this._fieldZ ? this.dataToPositionZ.bind(this) : null
63281
+ z: this._fieldZ ? this.dataToPositionZ.bind(this) : null,
63282
+ orient: this._direction
63216
63283
  }, 'normal', exports.AttributeLevel.Series);
63217
63284
  }
63218
63285
  else {
63219
63286
  this.setMarkStyle(this._areaMark, {
63220
63287
  x: this.dataToPositionX.bind(this),
63221
- x1: (datum) => {
63288
+ y1: (datum) => {
63222
63289
  var _a, _b;
63223
- return valueInScaleRange(this.dataToPositionX1(datum), (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0));
63290
+ return valueInScaleRange(this.dataToPositionY1(datum), (_b = (_a = this._yAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0));
63224
63291
  },
63225
63292
  y: this.dataToPositionY.bind(this),
63226
- z: this._fieldZ ? this.dataToPositionZ.bind(this) : null,
63227
- orient: this._direction
63293
+ z: this._fieldZ ? this.dataToPositionZ.bind(this) : null
63228
63294
  }, 'normal', exports.AttributeLevel.Series);
63229
63295
  }
63230
63296
  this.setMarkStyle(areaMark, {
@@ -63844,30 +63910,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
63844
63910
  var _a, _b, _c, _d;
63845
63911
  const xScale = (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
63846
63912
  const yScale = (_d = (_c = this._yAxisHelper) === null || _c === void 0 ? void 0 : _c.getScale) === null || _d === void 0 ? void 0 : _d.call(_c, 0);
63847
- if (this.direction === "vertical") {
63848
- this.setMarkStyle(this._barMark, {
63849
- x: (datum) => valueInScaleRange(this.dataToPositionX(datum), xScale),
63850
- x1: (datum) => valueInScaleRange(this.dataToPositionX1(datum), xScale),
63851
- y: (datum, ctx, opt, dataView) => {
63852
- if (this._shouldDoPreCalculate()) {
63853
- this._calculateStackRectPosition(true);
63854
- return datum[RECT_Y];
63855
- }
63856
- if (this._spec.barMinHeight) {
63857
- return this._calculateRectPosition(datum, true);
63858
- }
63859
- return valueInScaleRange(this.dataToPositionY(datum), yScale);
63860
- },
63861
- y1: (datum) => {
63862
- if (this._shouldDoPreCalculate()) {
63863
- this._calculateStackRectPosition(true);
63864
- return datum[RECT_Y1];
63865
- }
63866
- return valueInScaleRange(this.dataToPositionY1(datum), yScale);
63867
- }
63868
- }, 'normal', exports.AttributeLevel.Series);
63869
- }
63870
- else {
63913
+ if (this.direction === "horizontal") {
63871
63914
  this.setMarkStyle(this._barMark, {
63872
63915
  x: (datum) => {
63873
63916
  if (this._shouldDoPreCalculate()) {
@@ -63890,42 +63933,65 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
63890
63933
  y1: (datum) => valueInScaleRange(this.dataToPositionY1(datum), yScale)
63891
63934
  }, 'normal', exports.AttributeLevel.Series);
63892
63935
  }
63936
+ else {
63937
+ this.setMarkStyle(this._barMark, {
63938
+ x: (datum) => valueInScaleRange(this.dataToPositionX(datum), xScale),
63939
+ x1: (datum) => valueInScaleRange(this.dataToPositionX1(datum), xScale),
63940
+ y: (datum, ctx, opt, dataView) => {
63941
+ if (this._shouldDoPreCalculate()) {
63942
+ this._calculateStackRectPosition(true);
63943
+ return datum[RECT_Y];
63944
+ }
63945
+ if (this._spec.barMinHeight) {
63946
+ return this._calculateRectPosition(datum, true);
63947
+ }
63948
+ return valueInScaleRange(this.dataToPositionY(datum), yScale);
63949
+ },
63950
+ y1: (datum) => {
63951
+ if (this._shouldDoPreCalculate()) {
63952
+ this._calculateStackRectPosition(true);
63953
+ return datum[RECT_Y1];
63954
+ }
63955
+ return valueInScaleRange(this.dataToPositionY1(datum), yScale);
63956
+ }
63957
+ }, 'normal', exports.AttributeLevel.Series);
63958
+ }
63893
63959
  this._initLinearBarBackgroundMarkStyle();
63894
63960
  }
63895
63961
  _initLinearBarBackgroundMarkStyle() {
63896
63962
  var _a, _b, _c, _d;
63897
63963
  const xScale = (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
63898
63964
  const yScale = (_d = (_c = this._yAxisHelper) === null || _c === void 0 ? void 0 : _c.getScale) === null || _d === void 0 ? void 0 : _d.call(_c, 0);
63899
- if (this.direction === "vertical") {
63965
+ if (this.direction === "horizontal") {
63900
63966
  this.setMarkStyle(this._barBackgroundMark, {
63901
- x: (datum) => valueInScaleRange(this.dataToPositionX(datum), xScale),
63902
- x1: (datum) => valueInScaleRange(this.dataToPositionX1(datum), xScale),
63903
- y: () => {
63904
- const range = yScale.range();
63967
+ x: () => {
63968
+ const range = xScale.range();
63905
63969
  const min = Math.min(range[0], range[range.length - 1]);
63906
63970
  return min;
63907
63971
  },
63908
- y1: () => {
63909
- const range = yScale.range();
63972
+ x1: () => {
63973
+ const range = xScale.range();
63910
63974
  const max = Math.max(range[0], range[range.length - 1]);
63911
63975
  return max;
63912
- }
63976
+ },
63977
+ y: (datum) => valueInScaleRange(this.dataToPositionY(datum), yScale),
63978
+ y1: (datum) => valueInScaleRange(this.dataToPositionY1(datum), yScale)
63913
63979
  }, 'normal', exports.AttributeLevel.Series);
63914
63980
  }
63915
63981
  else {
63916
63982
  this.setMarkStyle(this._barBackgroundMark, {
63917
- x: () => {
63918
- const range = xScale.range();
63983
+ x: (datum) => valueInScaleRange(this.dataToPositionX(datum), xScale),
63984
+ x1: (datum) => valueInScaleRange(this.dataToPositionX1(datum), xScale),
63985
+ y: () => {
63986
+ const range = yScale.range();
63919
63987
  const min = Math.min(range[0], range[range.length - 1]);
63920
63988
  return min;
63921
63989
  },
63922
- x1: () => {
63923
- const range = xScale.range();
63990
+ y1: () => {
63991
+ const range = yScale.range();
63924
63992
  const max = Math.max(range[0], range[range.length - 1]);
63925
63993
  return max;
63926
- },
63927
- y: (datum) => valueInScaleRange(this.dataToPositionY(datum), yScale),
63928
- y1: (datum) => valueInScaleRange(this.dataToPositionY1(datum), yScale)
63994
+ }
63929
63995
  }, 'normal', exports.AttributeLevel.Series);
63930
63996
  }
63931
63997
  }
@@ -64042,9 +64108,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64042
64108
  const fieldsX = this._fieldX;
64043
64109
  samplingTrans.push({
64044
64110
  type: 'sampling',
64045
- size: this._direction === "vertical" ? width : height,
64111
+ size: this._direction === "horizontal" ? height : width,
64046
64112
  factor: this._spec.samplingFactor,
64047
- yfield: this._direction === "vertical" ? fieldsY[0] : fieldsX[0],
64113
+ yfield: this._direction === "horizontal" ? fieldsX[0] : fieldsY[0],
64048
64114
  groupBy: this._seriesField,
64049
64115
  mode: this._spec.sampling
64050
64116
  });
@@ -64280,7 +64346,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64280
64346
  if (isNil$1(sizeSpec)) {
64281
64347
  return SCATTER_DEFAULT_SIZE;
64282
64348
  }
64283
- if (isNumber$2(sizeSpec)) {
64349
+ if (isNumber$1(sizeSpec)) {
64284
64350
  return sizeSpec;
64285
64351
  }
64286
64352
  if (isString$1(sizeSpec) && isNumeric$1(sizeSpec)) {
@@ -64345,7 +64411,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64345
64411
  y: this.dataToPositionY.bind(this),
64346
64412
  z: this._fieldZ ? this.dataToPositionZ.bind(this) : null,
64347
64413
  fill: this.getColorAttribute(),
64348
- size: isNumber$2(this._size) || isFunction$1(this._size) ? this._size : SCATTER_DEFAULT_SIZE,
64414
+ size: isNumber$1(this._size) || isFunction$1(this._size) ? this._size : SCATTER_DEFAULT_SIZE,
64349
64415
  symbolType: isString$1(this._shape) || isFunction$1(this._shape) ? this._shape : SCATTER_DEFAULT_SHAPE
64350
64416
  }, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
64351
64417
  if (isValid$1(this._sizeField) || isValid$1(this._size)) {
@@ -66718,59 +66784,59 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66718
66784
  }
66719
66785
  totalPositionX(datum, field, pos = 0.5) {
66720
66786
  const { dataToPosition, getBandwidth } = this._xAxisHelper;
66721
- if (this._direction === "vertical") {
66722
- return (dataToPosition([datum[field]], {
66787
+ if (this._direction === "horizontal") {
66788
+ return valueInScaleRange(dataToPosition([datum[field]], {
66723
66789
  bandPosition: this._bandPosition
66724
- }) +
66725
- getBandwidth(0) * 0.5 -
66726
- this._barMark.getAttribute('width', datum) * (0.5 - pos));
66790
+ }));
66727
66791
  }
66728
- return valueInScaleRange(dataToPosition([datum[field]], {
66792
+ return (dataToPosition([datum[field]], {
66729
66793
  bandPosition: this._bandPosition
66730
- }));
66794
+ }) +
66795
+ getBandwidth(0) * 0.5 -
66796
+ this._barMark.getAttribute('width', datum) * (0.5 - pos));
66731
66797
  }
66732
66798
  totalPositionY(datum, field, pos = 0.5) {
66733
66799
  const { dataToPosition, getBandwidth } = this._yAxisHelper;
66734
- if (this._direction === "vertical") {
66735
- return valueInScaleRange(dataToPosition([datum[field]], {
66800
+ if (this._direction === "horizontal") {
66801
+ return (dataToPosition([datum[field]], {
66736
66802
  bandPosition: this._bandPosition
66737
- }));
66803
+ }) +
66804
+ getBandwidth(0) * 0.5 -
66805
+ this._barMark.getAttribute('height', datum) * (0.5 - pos));
66738
66806
  }
66739
- return (dataToPosition([datum[field]], {
66807
+ return valueInScaleRange(dataToPosition([datum[field]], {
66740
66808
  bandPosition: this._bandPosition
66741
- }) +
66742
- getBandwidth(0) * 0.5 -
66743
- this._barMark.getAttribute('height', datum) * (0.5 - pos));
66809
+ }));
66744
66810
  }
66745
66811
  initMarkStyle() {
66746
66812
  super.initMarkStyle();
66747
66813
  if (this._leaderLineMark) {
66748
- if (this._direction === "vertical") {
66814
+ if (this._direction === "horizontal") {
66749
66815
  this.setMarkStyle(this._leaderLineMark, {
66750
66816
  visible: (datum) => !isNil$1(datum.lastIndex),
66751
- x: (datum) => {
66817
+ x: (datum) => this.totalPositionX(datum, 'lastEnd', 0),
66818
+ x1: (datum) => this.totalPositionX(datum, datum.isTotal ? 'end' : 'start', 0),
66819
+ y: (datum) => {
66752
66820
  if (!datum.lastIndex) {
66753
66821
  return 0;
66754
66822
  }
66755
- return this.totalPositionX(datum, 'lastIndex', 1);
66823
+ return this.totalPositionY(datum, 'lastIndex', 1);
66756
66824
  },
66757
- x1: (datum) => this.totalPositionX(datum, 'index', 0),
66758
- y: (datum) => this.totalPositionY(datum, 'lastEnd', 0),
66759
- y1: (datum) => this.totalPositionY(datum, datum.isTotal ? 'end' : 'start', 0)
66825
+ y1: (datum) => this.totalPositionY(datum, 'index', 0)
66760
66826
  }, 'normal', exports.AttributeLevel.Series);
66761
66827
  }
66762
66828
  else {
66763
66829
  this.setMarkStyle(this._leaderLineMark, {
66764
66830
  visible: (datum) => !isNil$1(datum.lastIndex),
66765
- x: (datum) => this.totalPositionX(datum, 'lastEnd', 0),
66766
- x1: (datum) => this.totalPositionX(datum, datum.isTotal ? 'end' : 'start', 0),
66767
- y: (datum) => {
66831
+ x: (datum) => {
66768
66832
  if (!datum.lastIndex) {
66769
66833
  return 0;
66770
66834
  }
66771
- return this.totalPositionY(datum, 'lastIndex', 1);
66835
+ return this.totalPositionX(datum, 'lastIndex', 1);
66772
66836
  },
66773
- y1: (datum) => this.totalPositionY(datum, 'index', 0)
66837
+ x1: (datum) => this.totalPositionX(datum, 'index', 0),
66838
+ y: (datum) => this.totalPositionY(datum, 'lastEnd', 0),
66839
+ y1: (datum) => this.totalPositionY(datum, datum.isTotal ? 'end' : 'start', 0)
66774
66840
  }, 'normal', exports.AttributeLevel.Series);
66775
66841
  }
66776
66842
  }
@@ -67117,15 +67183,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67117
67183
  minMaxFillOpacity: this._shaftFillOpacity,
67118
67184
  stroke: (_b = this._strokeColor) !== null && _b !== void 0 ? _b : (this._shaftShape === 'line' ? this.getColorAttribute() : DEFAULT_STROKE_COLOR)
67119
67185
  };
67120
- const boxPlotMarkStyles = this._direction === "vertical"
67121
- ? Object.assign(Object.assign({ x: this.dataToPositionX.bind(this) }, commonBoxplotStyles), { boxWidth: () => { var _a; return (_a = this._boxWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, ruleWidth: () => { var _a; return (_a = this._shaftWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, q1q3Width: () => { var _a; return (_a = this._boxWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, minMaxWidth: () => { var _a; return (_a = this._shaftWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); } }) : Object.assign(Object.assign({ y: this.dataToPositionY.bind(this) }, commonBoxplotStyles), { boxHeight: () => { var _a; return (_a = this._boxWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, ruleHeight: () => { var _a; return (_a = this._shaftWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, q1q3Height: () => { var _a; return (_a = this._boxWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, minMaxHeight: () => { var _a; return (_a = this._shaftWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); } });
67186
+ const boxPlotMarkStyles = this._direction === "horizontal"
67187
+ ? Object.assign(Object.assign({ y: this.dataToPositionY.bind(this) }, commonBoxplotStyles), { boxHeight: () => { var _a; return (_a = this._boxWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, ruleHeight: () => { var _a; return (_a = this._shaftWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, q1q3Height: () => { var _a; return (_a = this._boxWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, minMaxHeight: () => { var _a; return (_a = this._shaftWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); } }) : Object.assign(Object.assign({ x: this.dataToPositionX.bind(this) }, commonBoxplotStyles), { boxWidth: () => { var _a; return (_a = this._boxWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, ruleWidth: () => { var _a; return (_a = this._shaftWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, q1q3Width: () => { var _a; return (_a = this._boxWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, minMaxWidth: () => { var _a; return (_a = this._shaftWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); } });
67122
67188
  this.setMarkStyle(boxPlotMark, boxPlotMarkStyles, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
67123
67189
  }
67124
67190
  const outlierMark = this._outlierMark;
67125
67191
  if (outlierMark) {
67126
67192
  this.setMarkStyle(outlierMark, {
67127
67193
  fill: (_d = (_c = this._outliersStyle) === null || _c === void 0 ? void 0 : _c.fill) !== null && _d !== void 0 ? _d : this.getColorAttribute(),
67128
- size: isNumber$2((_e = this._outliersStyle) === null || _e === void 0 ? void 0 : _e.size) ? this._outliersStyle.size : DEFAULT_OUTLIER_SIZE,
67194
+ size: isNumber$1((_e = this._outliersStyle) === null || _e === void 0 ? void 0 : _e.size) ? this._outliersStyle.size : DEFAULT_OUTLIER_SIZE,
67129
67195
  symbolType: 'circle'
67130
67196
  }, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
67131
67197
  }
@@ -67133,7 +67199,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67133
67199
  initBoxPlotMarkStyle() {
67134
67200
  var _a, _b;
67135
67201
  const boxPlotMark = this._boxPlotMark;
67136
- const axisHelper = this._direction === "vertical" ? this._yAxisHelper : this._xAxisHelper;
67202
+ const axisHelper = this._direction === "horizontal" ? this._xAxisHelper : this._yAxisHelper;
67137
67203
  if (boxPlotMark && axisHelper) {
67138
67204
  const { dataToPosition } = axisHelper;
67139
67205
  const scale = (_a = axisHelper === null || axisHelper === void 0 ? void 0 : axisHelper.getScale) === null || _a === void 0 ? void 0 : _a.call(axisHelper, 0);
@@ -67159,16 +67225,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67159
67225
  if (outlierMark && axisHelper) {
67160
67226
  const { dataToPosition } = axisHelper;
67161
67227
  const scale = (_b = axisHelper === null || axisHelper === void 0 ? void 0 : axisHelper.getScale) === null || _b === void 0 ? void 0 : _b.call(axisHelper, 0);
67162
- const outlierMarkPositionChannel = this._direction === "vertical"
67228
+ const outlierMarkPositionChannel = this._direction === "horizontal"
67163
67229
  ? {
67164
- x: this.dataToPositionX.bind(this),
67165
- y: (datum) => valueInScaleRange(dataToPosition(this.getDatumPositionValues(datum, BOX_PLOT_OUTLIER_VALUE_FIELD), {
67230
+ y: this.dataToPositionY.bind(this),
67231
+ x: (datum) => valueInScaleRange(dataToPosition(this.getDatumPositionValues(datum, BOX_PLOT_OUTLIER_VALUE_FIELD), {
67166
67232
  bandPosition: this._bandPosition
67167
67233
  }), scale)
67168
67234
  }
67169
67235
  : {
67170
- y: this.dataToPositionY.bind(this),
67171
- x: (datum) => valueInScaleRange(dataToPosition(this.getDatumPositionValues(datum, BOX_PLOT_OUTLIER_VALUE_FIELD), {
67236
+ x: this.dataToPositionX.bind(this),
67237
+ y: (datum) => valueInScaleRange(dataToPosition(this.getDatumPositionValues(datum, BOX_PLOT_OUTLIER_VALUE_FIELD), {
67172
67238
  bandPosition: this._bandPosition
67173
67239
  }), scale)
67174
67240
  };
@@ -67190,7 +67256,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67190
67256
  outlierDataView.transform({
67191
67257
  type: 'foldOutlierData',
67192
67258
  options: {
67193
- dimensionField: this._direction === "vertical" ? this._fieldX : this._fieldY,
67259
+ dimensionField: this._direction === "horizontal" ? this._fieldY : this._fieldX,
67194
67260
  outliersField: this._outliersField
67195
67261
  }
67196
67262
  });
@@ -67211,8 +67277,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67211
67277
  if (this._autoBoxWidth) {
67212
67278
  return this._autoBoxWidth;
67213
67279
  }
67214
- const bandAxisHelper = this._direction === "vertical" ? this._xAxisHelper : this._yAxisHelper;
67215
- const xField = this._direction === "vertical" ? this._fieldX : this._fieldY;
67280
+ const bandAxisHelper = this._direction === "horizontal" ? this._yAxisHelper : this._xAxisHelper;
67281
+ const xField = this._direction === "horizontal" ? this._fieldY : this._fieldX;
67216
67282
  const innerBandWidth = bandAxisHelper.getBandwidth(xField.length - 1);
67217
67283
  const autoBoxWidth = innerBandWidth / xField.length;
67218
67284
  this._autoBoxWidth = autoBoxWidth;
@@ -67790,41 +67856,41 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67790
67856
  var _a, _b, _c, _d, _e;
67791
67857
  const userCurveType = (_c = (_b = (_a = this.getSpec().area) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.curveType) !== null && _c !== void 0 ? _c : (_e = (_d = this.getSpec().line) === null || _d === void 0 ? void 0 : _d.style) === null || _e === void 0 ? void 0 : _e.curveType;
67792
67858
  const curveType = userCurveType === DEFAULT_SMOOTH_INTERPOLATE
67793
- ? this._direction === "vertical"
67794
- ? 'monotoneX'
67795
- : 'monotoneY'
67859
+ ? this._direction === "horizontal"
67860
+ ? 'monotoneY'
67861
+ : 'monotoneX'
67796
67862
  : userCurveType;
67797
67863
  const areaMark = this._areaMark;
67798
67864
  if (areaMark) {
67799
- if (this._direction === "vertical") {
67865
+ if (this._direction === "horizontal") {
67800
67866
  this.setMarkStyle(this._areaMark, {
67801
67867
  x: this.dataToPositionX.bind(this),
67802
- y1: (datum) => {
67803
- if (!this._yAxisHelper) {
67868
+ x1: (datum) => {
67869
+ if (!this._xAxisHelper) {
67804
67870
  return Number.NaN;
67805
67871
  }
67806
- const { dataToPosition } = this._yAxisHelper;
67807
- return dataToPosition(this.getDatumPositionValues(datum, this._spec.yField[1]), {
67872
+ const { dataToPosition } = this._xAxisHelper;
67873
+ return dataToPosition(this.getDatumPositionValues(datum, this._spec.xField[1]), {
67808
67874
  bandPosition: this._bandPosition
67809
67875
  });
67810
67876
  },
67811
- y: this.dataToPositionY.bind(this)
67877
+ y: this.dataToPositionY.bind(this),
67878
+ orient: this._direction
67812
67879
  }, 'normal', exports.AttributeLevel.Series);
67813
67880
  }
67814
67881
  else {
67815
67882
  this.setMarkStyle(this._areaMark, {
67816
67883
  x: this.dataToPositionX.bind(this),
67817
- x1: (datum) => {
67818
- if (!this._xAxisHelper) {
67884
+ y1: (datum) => {
67885
+ if (!this._yAxisHelper) {
67819
67886
  return Number.NaN;
67820
67887
  }
67821
- const { dataToPosition } = this._xAxisHelper;
67822
- return dataToPosition(this.getDatumPositionValues(datum, this._spec.xField[1]), {
67888
+ const { dataToPosition } = this._yAxisHelper;
67889
+ return dataToPosition(this.getDatumPositionValues(datum, this._spec.yField[1]), {
67823
67890
  bandPosition: this._bandPosition
67824
67891
  });
67825
67892
  },
67826
- y: this.dataToPositionY.bind(this),
67827
- orient: this._direction
67893
+ y: this.dataToPositionY.bind(this)
67828
67894
  }, 'normal', exports.AttributeLevel.Series);
67829
67895
  }
67830
67896
  this.setMarkStyle(areaMark, {
@@ -69041,11 +69107,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
69041
69107
  polarPointInterpolation(pointA, pointB, ratio) {
69042
69108
  const polarPointA0 = this._pointToCoord(pointA);
69043
69109
  const polarPointA1 = this._pointToCoord({ x: pointA.x1, y: pointA.y1 });
69110
+ const angleA0 = normalizeAngle$1(polarPointA0.angle);
69111
+ const angleA1 = normalizeAngle$1(polarPointA1.angle);
69044
69112
  const polarPointB0 = this._pointToCoord(pointB);
69045
69113
  const polarPointB1 = this._pointToCoord({ x: pointB.x1, y: pointB.y1 });
69046
- const angle0 = polarPointA0.angle + (polarPointB0.angle - polarPointA0.angle) * ratio;
69114
+ const angleB0 = normalizeAngle$1(polarPointB0.angle);
69115
+ const angleB1 = normalizeAngle$1(polarPointB1.angle);
69116
+ const angle0 = angleA0 + (angleB0 - angleA0) * ratio;
69047
69117
  const radius0 = polarPointA0.radius + (polarPointB0.radius - polarPointA0.radius) * ratio;
69048
- const angle1 = polarPointA1.angle + (polarPointB1.angle - polarPointA1.angle) * ratio;
69118
+ const angle1 = angleA1 + (angleB1 - angleA1) * ratio;
69049
69119
  const radius1 = polarPointA1.radius + (polarPointB1.radius - polarPointA1.radius) * ratio;
69050
69120
  const { x, y } = this._coordToPoint({ angle: angle0, radius: radius0 });
69051
69121
  const { x: x1, y: y1 } = this._coordToPoint({ angle: angle1, radius: radius1 });
@@ -72071,7 +72141,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
72071
72141
  postProjection = options.postProjection;
72072
72142
  let fontSize = options.fontSize ? field$1(options.fontSize) : 14;
72073
72143
  const fontSizeRange = options.fontSizeRange;
72074
- if (fontSizeRange && !isNumber$2(fontSize)) {
72144
+ if (fontSizeRange && !isNumber$1(fontSize)) {
72075
72145
  const fsize = fontSize,
72076
72146
  fontSizeSqrtScale = generateSqrtScale(extent$1(fsize, data), fontSizeRange);
72077
72147
  fontSize = datum => fontSizeSqrtScale(fsize(datum));
@@ -72109,7 +72179,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
72109
72179
  progressive: layout
72110
72180
  } : layout.output();
72111
72181
  };
72112
- const field$1 = option => isString$1(option) || isNumber$2(option) || isFunction$1(option) ? option : datum => datum[option.field],
72182
+ const field$1 = option => isString$1(option) || isNumber$1(option) || isFunction$1(option) ? option : datum => datum[option.field],
72113
72183
  sqrt = x => x < 0 ? -Math.sqrt(-x) : Math.sqrt(x),
72114
72184
  generateSqrtScale = (domain, range) => {
72115
72185
  if (domain[0] === domain[1]) return datum => range[0];
@@ -73832,7 +73902,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73832
73902
  }
73833
73903
  _computeLabelLimit(datum, labelSpec) {
73834
73904
  const limit = labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.limit;
73835
- if (isNumber$2(limit)) {
73905
+ if (isNumber$1(limit)) {
73836
73906
  return limit;
73837
73907
  }
73838
73908
  const points = this.getPoints(datum);
@@ -74510,11 +74580,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
74510
74580
  }
74511
74581
  _filterChildren(node) {
74512
74582
  const maxDepth = this.options.maxDepth;
74513
- if (isNumber$2(maxDepth) && maxDepth >= 0 && node.depth >= maxDepth) return !1;
74583
+ if (isNumber$1(maxDepth) && maxDepth >= 0 && node.depth >= maxDepth) return !1;
74514
74584
  const minChildrenVisibleArea = this.options.minChildrenVisibleArea;
74515
- if (isNumber$2(minChildrenVisibleArea) && Math.abs((node.x1 - node.x0) * (node.y1 - node.y0)) < minChildrenVisibleArea) return !1;
74585
+ if (isNumber$1(minChildrenVisibleArea) && Math.abs((node.x1 - node.x0) * (node.y1 - node.y0)) < minChildrenVisibleArea) return !1;
74516
74586
  const minChildrenVisibleSize = this.options.minChildrenVisibleSize;
74517
- return !isNumber$2(minChildrenVisibleSize) || !(Math.abs(node.x1 - node.x0) < minChildrenVisibleSize || Math.abs(node.y1 - node.y0) < minChildrenVisibleSize);
74587
+ return !isNumber$1(minChildrenVisibleSize) || !(Math.abs(node.x1 - node.x0) < minChildrenVisibleSize || Math.abs(node.y1 - node.y0) < minChildrenVisibleSize);
74518
74588
  }
74519
74589
  _layout(parent) {
74520
74590
  var _a;
@@ -74874,7 +74944,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
74874
74944
  this.options = options;
74875
74945
  const keyOption = null == options ? void 0 : options.nodeKey,
74876
74946
  keyFunc = isFunction$1(keyOption) ? keyOption : keyOption ? field$3(keyOption) : null;
74877
- this._getNodeKey = keyFunc, this._getPadding = isNumber$2(null == options ? void 0 : options.padding) ? node => options.padding : isArray$1(null == options ? void 0 : options.padding) ? node => {
74947
+ this._getNodeKey = keyFunc, this._getPadding = isNumber$1(null == options ? void 0 : options.padding) ? node => options.padding : isArray$1(null == options ? void 0 : options.padding) ? node => {
74878
74948
  var _a;
74879
74949
  return null !== (_a = options.padding[node.depth + 1]) && void 0 !== _a ? _a : 0;
74880
74950
  } : () => 0, this._maxDepth = -1;
@@ -75908,13 +75978,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75908
75978
  const ratio = clamp$1(parseFloat(nodeWidthOption.replace("%", "")) / 100, 0, 1);
75909
75979
  let stepWidth = width / (this._maxDepth - 1 + ratio);
75910
75980
  minStepWidth > 0 && (stepWidth = Math.max(minStepWidth, stepWidth)), nodeWidth = stepWidth * ratio, linkWidth = stepWidth * (1 - ratio), isEvenWidth = !0;
75911
- } else if (isNumber$2(nodeWidthOption)) {
75912
- if (nodeWidth = nodeWidthOption, isNumber$2(linkWidthOption)) linkWidth = linkWidthOption;else if (isNil$1(linkWidthOption)) {
75981
+ } else if (isNumber$1(nodeWidthOption)) {
75982
+ if (nodeWidth = nodeWidthOption, isNumber$1(linkWidthOption)) linkWidth = linkWidthOption;else if (isNil$1(linkWidthOption)) {
75913
75983
  let stepWidth = (width - nodeWidthOption) / (this._maxDepth - 1);
75914
75984
  minStepWidth > 0 && (stepWidth = Math.max(minStepWidth, stepWidth)), linkWidth = stepWidth - nodeWidthOption;
75915
75985
  }
75916
75986
  isEvenWidth = !0;
75917
- } else isFunction$1(nodeWidthOption) && isNumber$2(linkWidthOption) && (linkWidth = linkWidthOption);
75987
+ } else isFunction$1(nodeWidthOption) && isNumber$1(linkWidthOption) && (linkWidth = linkWidthOption);
75918
75988
  const columns = [];
75919
75989
  for (let i = 0, len = nodes.length; i < len; i++) {
75920
75990
  const node = nodes[i];
@@ -76285,7 +76355,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
76285
76355
  key: undefined,
76286
76356
  value: (datum) => {
76287
76357
  if (datum.source) {
76288
- if (isNumber$2(datum.source)) {
76358
+ if (isNumber$1(datum.source)) {
76289
76359
  const seriesKeys = this.series.getSeriesKeys();
76290
76360
  return seriesKeys[datum.source] + ' => ' + seriesKeys[datum.target];
76291
76361
  }
@@ -78538,10 +78608,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78538
78608
  const innerRadius = toPercent((_c = options.innerRadius) !== null && _c !== void 0 ? _c : 0, maxRadius);
78539
78609
  const outerRadius = toPercent(options.outerRadius, maxRadius);
78540
78610
  const center = [
78541
- isNumber$2((_d = options.center) === null || _d === void 0 ? void 0 : _d[0])
78611
+ isNumber$1((_d = options.center) === null || _d === void 0 ? void 0 : _d[0])
78542
78612
  ? options.center[0]
78543
78613
  : viewBox.x0 + toPercent((_f = (_e = options.center) === null || _e === void 0 ? void 0 : _e[0]) !== null && _f !== void 0 ? _f : '50%', viewBox.x1 - viewBox.x0),
78544
- isNumber$2((_g = options.center) === null || _g === void 0 ? void 0 : _g[1])
78614
+ isNumber$1((_g = options.center) === null || _g === void 0 ? void 0 : _g[1])
78545
78615
  ? options.center[1]
78546
78616
  : viewBox.y0 + toPercent((_j = (_h = options.center) === null || _h === void 0 ? void 0 : _h[1]) !== null && _j !== void 0 ? _j : '50%', viewBox.y1 - viewBox.y0)
78547
78617
  ];
@@ -80316,7 +80386,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
80316
80386
  var _a;
80317
80387
  const dataFields = [spec.maxField, spec.medianField, spec.q1Field, spec.q3Field, spec.minField, spec.outliersField];
80318
80388
  const seriesSpec = Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { boxPlot: spec.boxPlot, direction: (_a = spec.direction) !== null && _a !== void 0 ? _a : "vertical", minField: spec.minField, maxField: spec.maxField, q1Field: spec.q1Field, medianField: spec.medianField, q3Field: spec.q3Field, outliersField: spec.outliersField, outliersStyle: spec.outliersStyle });
80319
- seriesSpec[seriesSpec.direction === "vertical" ? 'yField' : 'xField'] = dataFields;
80389
+ seriesSpec[seriesSpec.direction === "horizontal" ? 'xField' : 'yField'] = dataFields;
80320
80390
  return seriesSpec;
80321
80391
  }
80322
80392
  transformSpec(spec) {
@@ -81657,6 +81727,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
81657
81727
  });
81658
81728
  }
81659
81729
  getBoundsInRect(rect) {
81730
+ var _a;
81660
81731
  let result = { x1: 0, y1: 0, x2: 0, y2: 0 };
81661
81732
  if (!this._visible) {
81662
81733
  return result;
@@ -81664,7 +81735,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
81664
81735
  this._verticalLimitSize = isXAxis(this.getOrient()) ? rect.height : rect.width;
81665
81736
  this.setLayoutRect(rect);
81666
81737
  const isChanged = this.updateScaleRange();
81667
- if (isChanged || !isArray$1(this.getTickData().getLatestData())) {
81738
+ if (isChanged || !isArray$1((_a = this.getTickData()) === null || _a === void 0 ? void 0 : _a.getLatestData())) {
81668
81739
  this.computeData('range');
81669
81740
  }
81670
81741
  const context = { skipLayout: false };
@@ -81836,8 +81907,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
81836
81907
  return attrs;
81837
81908
  }
81838
81909
  getLabelItems(length) {
81839
- const tickData = this.getTickData();
81840
- const tickLatestData = tickData.getLatestData();
81910
+ var _a;
81911
+ const tickLatestData = (_a = this.getTickData()) === null || _a === void 0 ? void 0 : _a.getLatestData();
81841
81912
  if (tickLatestData && tickLatestData.length) {
81842
81913
  return [
81843
81914
  tickLatestData
@@ -82236,14 +82307,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82236
82307
  if (layerConfig.visible !== false && layerConfig.tickCount !== 0 && layerConfig.forceTickCount !== 0) {
82237
82308
  const tickData = this._initTickDataSet(Object.assign(Object.assign({}, this._tickTransformOption()), layerConfig), layer);
82238
82309
  tickData.target.addListener('change', this._forceLayout.bind(this));
82239
- this._tickData.push(new CompilableData(this._option, tickData));
82310
+ const compilableData = new CompilableData(this._option, tickData);
82311
+ this._tickData.push(compilableData);
82312
+ if (!this._tickDataMap) {
82313
+ this._tickDataMap = {};
82314
+ }
82315
+ this._tickDataMap[layer] = compilableData;
82240
82316
  }
82241
82317
  }
82242
82318
  }
82243
82319
  else {
82244
82320
  const tickData = this._initTickDataSet(this._tickTransformOption());
82245
82321
  tickData.target.addListener('change', this._forceLayout.bind(this));
82246
- this._tickData = [new CompilableData(this._option, tickData)];
82322
+ const compilableData = new CompilableData(this._option, tickData);
82323
+ this._tickData = [compilableData];
82324
+ this._tickDataMap = {
82325
+ 0: compilableData
82326
+ };
82247
82327
  }
82248
82328
  }
82249
82329
  dataToPosition(values, cfg = {}) {
@@ -82338,30 +82418,44 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82338
82418
  getLabelItems(length) {
82339
82419
  const labelItems = [];
82340
82420
  let preData = [];
82341
- this._tickData.forEach((eachTickData, index) => {
82342
- const latestData = eachTickData.getLatestData();
82343
- if (latestData && latestData.length) {
82421
+ this._scales.forEach((scale, index) => {
82422
+ var _a;
82423
+ const tickData = this._tickDataMap[index];
82424
+ const isTickDataHaveData = (_a = tickData === null || tickData === void 0 ? void 0 : tickData.getLatestData()) === null || _a === void 0 ? void 0 : _a.length;
82425
+ const ticks = isTickDataHaveData
82426
+ ? tickData.getLatestData().map((obj) => obj.value)
82427
+ : scale.domain();
82428
+ if (ticks && ticks.length) {
82344
82429
  if (preData && preData.length) {
82345
82430
  const currentLabelItems = [];
82346
82431
  const curData = [];
82347
82432
  preData.forEach(value => {
82348
- latestData.forEach((obj) => {
82349
- const values = array(value).concat(obj.value);
82433
+ ticks.forEach(tick => {
82434
+ const values = array(value).concat(tick);
82350
82435
  curData.push(values);
82351
- const axisItem = getAxisItem(obj.value, this._getNormalizedValue(values, length));
82352
- currentLabelItems.push(axisItem);
82436
+ if (isTickDataHaveData) {
82437
+ const axisItem = getAxisItem(tick, this._getNormalizedValue(values, length));
82438
+ currentLabelItems.push(axisItem);
82439
+ }
82353
82440
  });
82354
82441
  });
82355
- labelItems.push(currentLabelItems.filter((entry) => entry.value >= 0 && entry.value <= 1));
82442
+ if (isTickDataHaveData) {
82443
+ labelItems.push(currentLabelItems.filter((entry) => entry.value >= 0 && entry.value <= 1));
82444
+ }
82356
82445
  preData = curData;
82357
82446
  }
82358
82447
  else {
82359
- labelItems.push(latestData
82360
- .map((obj) => {
82361
- preData.push(obj.value);
82362
- return getAxisItem(obj.value, this._getNormalizedValue([obj.value], length));
82363
- })
82364
- .filter((entry) => entry.value >= 0 && entry.value <= 1));
82448
+ ticks.forEach(tick => {
82449
+ preData.push(tick);
82450
+ });
82451
+ if (isTickDataHaveData) {
82452
+ labelItems.push(tickData
82453
+ .getLatestData()
82454
+ .map((obj) => {
82455
+ return getAxisItem(obj.value, this._getNormalizedValue([obj.value], length));
82456
+ })
82457
+ .filter((entry) => entry.value >= 0 && entry.value <= 1));
82458
+ }
82365
82459
  }
82366
82460
  }
82367
82461
  });
@@ -82531,16 +82625,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82531
82625
  };
82532
82626
  }
82533
82627
  getLabelItems(length) {
82534
- var _a;
82628
+ var _a, _b;
82535
82629
  const items = [];
82536
- const tickData = this.getTickData();
82537
- const tickLatestData = tickData.getLatestData();
82630
+ const tickLatestData = (_a = this.getTickData()) === null || _a === void 0 ? void 0 : _a.getLatestData();
82538
82631
  if (tickLatestData && tickLatestData.length) {
82539
82632
  items.push(tickLatestData.map((obj) => {
82540
82633
  return getAxisItem(obj.value, this._getNormalizedValue([obj.value], length));
82541
82634
  }));
82542
82635
  }
82543
- const layerLatestData = (_a = this._layerTickData) === null || _a === void 0 ? void 0 : _a.getLatestData();
82636
+ const layerLatestData = (_b = this._layerTickData) === null || _b === void 0 ? void 0 : _b.getLatestData();
82544
82637
  if (layerLatestData && layerLatestData.length) {
82545
82638
  items.push(layerLatestData.map((obj) => {
82546
82639
  return getAxisItem(obj.value, this._getNormalizedValue([obj.value], length));
@@ -82940,8 +83033,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82940
83033
  return length === 0 ? 0 : (this.dataToPosition(values) - this._getStartValue()) / length;
82941
83034
  }
82942
83035
  getLabelItems(length) {
82943
- const tickData = this.getTickData();
82944
- const tickLatestData = tickData.getLatestData();
83036
+ var _a;
83037
+ const tickLatestData = (_a = this.getTickData()) === null || _a === void 0 ? void 0 : _a.getLatestData();
82945
83038
  if (tickLatestData && tickLatestData.length) {
82946
83039
  return [
82947
83040
  tickLatestData.map((obj) => {
@@ -84995,7 +85088,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
84995
85088
  this._handleClickInEvent = (params) => {
84996
85089
  this._handleIn(params);
84997
85090
  this._clickLock = this._hasActive && this._spec.lockAfterClick;
84998
- if (this._clickLock && isNumber$2(this.triggerOff)) {
85091
+ if (this._clickLock && isNumber$1(this.triggerOff)) {
84999
85092
  if (this._timer) {
85000
85093
  clearTimeout(this._timer);
85001
85094
  }
@@ -85210,7 +85303,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
85210
85303
  if (trigger) {
85211
85304
  this.trigger = trigger;
85212
85305
  }
85213
- if (triggerOff === 'none' || (isNumber$2(triggerOff) && triggerOff > 0)) {
85306
+ if (triggerOff === 'none' || (isNumber$1(triggerOff) && triggerOff > 0)) {
85214
85307
  this.triggerOff = triggerOff;
85215
85308
  }
85216
85309
  if (labelZIndex !== undefined) {
@@ -85234,7 +85327,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
85234
85327
  const _d = style, { strokeOpacity, fillOpacity, opacity, stroke, fill, lineWidth } = _d, restStyle = __rest$7(_d, ["strokeOpacity", "fillOpacity", "opacity", "stroke", "fill", "lineWidth"]);
85235
85328
  const isLineType = hair.type === 'line';
85236
85329
  let finalOpacity = isLineType ? strokeOpacity : fillOpacity;
85237
- if (isNumber$2(opacity)) {
85330
+ if (isNumber$1(opacity)) {
85238
85331
  finalOpacity = (finalOpacity !== null && finalOpacity !== void 0 ? finalOpacity : 1) * opacity;
85239
85332
  }
85240
85333
  hair.style = Object.assign({ opacity: finalOpacity, pickable: false, visible: true }, restStyle);
@@ -86275,7 +86368,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
86275
86368
  var _a, _b;
86276
86369
  const zoomLock = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.zoomLock) !== null && _b !== void 0 ? _b : false;
86277
86370
  if (zoomLock || end - start < this._minSpan || end - start > this._maxSpan) {
86278
- return;
86371
+ this._shouldChange = false;
86279
86372
  }
86280
86373
  }
86281
86374
  _isReverse() {
@@ -86335,6 +86428,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
86335
86428
  this.layoutType = 'none';
86336
86429
  this._orient = 'left';
86337
86430
  this._cacheVisibility = undefined;
86431
+ this._shouldChange = true;
86338
86432
  this._stateField = 'x';
86339
86433
  this._activeRoam = true;
86340
86434
  this._zoomAttr = {
@@ -87150,7 +87244,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87150
87244
  if (this._visible === false) {
87151
87245
  return 0;
87152
87246
  }
87153
- if (isNumber$2(this._spec.width)) {
87247
+ if (isNumber$1(this._spec.width)) {
87154
87248
  return this._spec.width;
87155
87249
  }
87156
87250
  if (this._isHorizontal) {
@@ -87162,7 +87256,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87162
87256
  if (this._visible === false) {
87163
87257
  return 0;
87164
87258
  }
87165
- if (isNumber$2(this._spec.height)) {
87259
+ if (isNumber$1(this._spec.height)) {
87166
87260
  return this._spec.height;
87167
87261
  }
87168
87262
  if (this._isHorizontal) {
@@ -87224,24 +87318,26 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87224
87318
  }
87225
87319
  _handleChange(start, end, updateComponent, tag) {
87226
87320
  super._handleChange(start, end, updateComponent);
87227
- if (updateComponent && this._component) {
87228
- this._component.setStartAndEnd(start, end);
87229
- }
87230
- this._start = start;
87231
- this._end = end;
87232
- const hasChange = this._handleStateChange(this._statePointToData(start), this._statePointToData(end), tag);
87233
- if (hasChange) {
87234
- this.event.emit(exports.ChartEvent.dataZoomChange, {
87235
- model: this,
87236
- value: {
87237
- filterData: this._filterMode !== "axis",
87238
- start,
87239
- end,
87240
- startValue: this._startValue,
87241
- endValue: this._endValue,
87242
- newDomain: this._newDomain
87243
- }
87244
- });
87321
+ if (this._shouldChange) {
87322
+ if (updateComponent && this._component) {
87323
+ this._component.setStartAndEnd(start, end);
87324
+ }
87325
+ this._start = start;
87326
+ this._end = end;
87327
+ const hasChange = this._handleStateChange(this._statePointToData(start), this._statePointToData(end), tag);
87328
+ if (hasChange) {
87329
+ this.event.emit(exports.ChartEvent.dataZoomChange, {
87330
+ model: this,
87331
+ value: {
87332
+ filterData: this._filterMode !== "axis",
87333
+ start,
87334
+ end,
87335
+ startValue: this._startValue,
87336
+ endValue: this._endValue,
87337
+ newDomain: this._newDomain
87338
+ }
87339
+ });
87340
+ }
87245
87341
  }
87246
87342
  }
87247
87343
  _handleDataCollectionChange() {
@@ -87373,7 +87469,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87373
87469
  }
87374
87470
  }
87375
87471
  _computeWidth() {
87376
- if (isNumber$2(this._spec.width)) {
87472
+ if (isNumber$1(this._spec.width)) {
87377
87473
  return this._spec.width;
87378
87474
  }
87379
87475
  if (this._isHorizontal) {
@@ -87382,7 +87478,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87382
87478
  return SCROLL_BAR_DEFAULT_SIZE;
87383
87479
  }
87384
87480
  _computeHeight() {
87385
- if (isNumber$2(this._spec.height)) {
87481
+ if (isNumber$1(this._spec.height)) {
87386
87482
  return this._spec.height;
87387
87483
  }
87388
87484
  if (!this._isHorizontal) {
@@ -87411,24 +87507,26 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87411
87507
  }
87412
87508
  _handleChange(start, end, updateComponent) {
87413
87509
  super._handleChange(start, end, updateComponent);
87414
- if (updateComponent && this._component) {
87415
- this._component.setAttribute('range', [start, end]);
87416
- }
87417
- this._start = start;
87418
- this._end = end;
87419
- const hasChange = this._handleStateChange(this._statePointToData(start), this._statePointToData(end));
87420
- if (hasChange) {
87421
- this.event.emit(exports.ChartEvent.scrollBarChange, {
87422
- model: this,
87423
- value: {
87424
- filterData: this._filterMode !== "axis",
87425
- start: this._start,
87426
- end: this._end,
87427
- startValue: this._startValue,
87428
- endValue: this._endValue,
87429
- newDomain: this._newDomain
87430
- }
87431
- });
87510
+ if (this._shouldChange) {
87511
+ if (updateComponent && this._component) {
87512
+ this._component.setAttribute('range', [start, end]);
87513
+ }
87514
+ this._start = start;
87515
+ this._end = end;
87516
+ const hasChange = this._handleStateChange(this._statePointToData(start), this._statePointToData(end));
87517
+ if (hasChange) {
87518
+ this.event.emit(exports.ChartEvent.scrollBarChange, {
87519
+ model: this,
87520
+ value: {
87521
+ filterData: this._filterMode !== "axis",
87522
+ start: this._start,
87523
+ end: this._end,
87524
+ startValue: this._startValue,
87525
+ endValue: this._endValue,
87526
+ newDomain: this._newDomain
87527
+ }
87528
+ });
87529
+ }
87432
87530
  }
87433
87531
  }
87434
87532
  _handleDataCollectionChange() {
@@ -87807,7 +87905,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87807
87905
  function getXValue(datum, xDomain, autoRange, refSeries, regionWidth, regionStartLayoutStartPoint) {
87808
87906
  var _a, _b;
87809
87907
  const { relativeSeries } = refSeries;
87810
- isNumber$2(datum.x) &&
87908
+ isNumber$1(datum.x) &&
87811
87909
  isNeedExtendDomain(xDomain, datum.x, autoRange) &&
87812
87910
  ((_b = relativeSeries === null || relativeSeries === void 0 ? void 0 : (_a = relativeSeries.getXAxisHelper()).setExtendDomain) === null || _b === void 0 ? void 0 : _b.call(_a, 'marker_xAxis_extend', datum.x));
87813
87911
  let x;
@@ -87822,7 +87920,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87822
87920
  function getYValue(datum, yDomain, autoRange, refSeries, regionHeight, regionStartLayoutStartPoint) {
87823
87921
  var _a, _b;
87824
87922
  const { relativeSeries } = refSeries;
87825
- isNumber$2(datum.y) &&
87923
+ isNumber$1(datum.y) &&
87826
87924
  isNeedExtendDomain(yDomain, datum.y, autoRange) &&
87827
87925
  ((_b = (_a = relativeSeries.getYAxisHelper()) === null || _a === void 0 ? void 0 : _a.setExtendDomain) === null || _b === void 0 ? void 0 : _b.call(_a, 'marker_yAxis_extend', datum.y));
87828
87926
  let y;
@@ -87927,11 +88025,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87927
88025
  const xValue = array(datum.x);
87928
88026
  const yValue = array(datum.y);
87929
88027
  xValue.length === 1 &&
87930
- isNumber$2(xValue[0]) &&
88028
+ isNumber$1(xValue[0]) &&
87931
88029
  isNeedExtendDomain(xDomain, xValue[0], autoRange) &&
87932
88030
  ((_b = (_a = refRelativeSeries.getXAxisHelper()) === null || _a === void 0 ? void 0 : _a.setExtendDomain) === null || _b === void 0 ? void 0 : _b.call(_a, 'marker_xAxis_extend', xValue[0]));
87933
88031
  yValue.length === 1 &&
87934
- isNumber$2(yValue[0]) &&
88032
+ isNumber$1(yValue[0]) &&
87935
88033
  isNeedExtendDomain(yDomain, yValue[0], autoRange) &&
87936
88034
  ((_d = (_c = refRelativeSeries.getYAxisHelper()) === null || _c === void 0 ? void 0 : _c.setExtendDomain) === null || _d === void 0 ? void 0 : _d.call(_c, 'marker_yAxis_extend', yValue[0]));
87937
88035
  points.push({
@@ -89137,7 +89235,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89137
89235
  }
89138
89236
  }
89139
89237
  _computeWidth(rect) {
89140
- if (isNumber$2(this._spec.width)) {
89238
+ if (isNumber$1(this._spec.width)) {
89141
89239
  return Math.min(rect.width, Number(this._spec.width));
89142
89240
  }
89143
89241
  if (isVertical(this._orient)) {
@@ -89146,7 +89244,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89146
89244
  return rect.width;
89147
89245
  }
89148
89246
  _computeHeight(rect) {
89149
- if (isNumber$2(this._spec.height)) {
89247
+ if (isNumber$1(this._spec.height)) {
89150
89248
  this._height = this._spec.height;
89151
89249
  return Math.min(rect.height, Number(this._spec.height));
89152
89250
  }
@@ -89282,22 +89380,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89282
89380
  ? (_c = series.getXAxisHelper()) === null || _c === void 0 ? void 0 : _c.isInverse()
89283
89381
  : (_d = series.getYAxisHelper()) === null || _d === void 0 ? void 0 : _d.isInverse();
89284
89382
  let position = originPosition;
89285
- if (isString$1(originPosition) && position !== 'inside') {
89383
+ if (isString$1(originPosition) && originPosition === 'outside') {
89286
89384
  position = (data) => {
89287
89385
  const { data: datum } = data;
89288
89386
  const dataField = series.getMeasureField()[0];
89289
- if (originPosition === 'outside') {
89290
- const positionMap = { vertical: ['top', 'bottom'], horizontal: ['right', 'left'] };
89291
- const index = ((datum === null || datum === void 0 ? void 0 : datum[dataField]) >= 0 && isInverse) || ((datum === null || datum === void 0 ? void 0 : datum[dataField]) < 0 && !isInverse) ? 1 : 0;
89292
- return positionMap[direction][index];
89293
- }
89294
- if (originPosition === 'inside-bottom') {
89295
- return series.direction === 'horizontal' ? 'inside-left' : 'inside-bottom';
89296
- }
89297
- if (originPosition === 'inside-top') {
89298
- return series.direction === 'horizontal' ? 'inside-right' : 'inside-top';
89299
- }
89300
- return originPosition;
89387
+ const positionMap = { vertical: ['top', 'bottom'], horizontal: ['right', 'left'] };
89388
+ const index = ((datum === null || datum === void 0 ? void 0 : datum[dataField]) >= 0 && isInverse) || ((datum === null || datum === void 0 ? void 0 : datum[dataField]) < 0 && !isInverse) ? 1 : 0;
89389
+ return positionMap[direction][index];
89301
89390
  };
89302
89391
  }
89303
89392
  let overlap;
@@ -89380,46 +89469,38 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89380
89469
  const datum = label.data;
89381
89470
  const attribute = textAttribute(labelInfo, datum, labelSpec.formatMethod);
89382
89471
  const x = (datum) => {
89383
- if (series.direction === "vertical") {
89384
- return series.totalPositionX(datum, 'index', 0.5);
89385
- }
89386
- if (pos === 'middle') {
89387
- return (series.totalPositionX(datum, 'end') + series.totalPositionY(datum, 'start')) * 0.5;
89388
- }
89389
- else if (pos === 'max') {
89390
- return series.totalPositionX(datum, datum.end >= datum.start ? 'end' : 'start') + offset;
89391
- }
89392
- else if (pos === 'min') {
89393
- return series.totalPositionX(datum, datum.end >= datum.start ? 'start' : 'end') - offset;
89394
- }
89395
- return series.totalPositionX(datum, 'end') + (datum.end >= datum.start ? offset : -offset);
89396
- };
89397
- const y = (datum) => {
89398
- if (series.direction === "vertical") {
89472
+ if (series.direction === "horizontal") {
89399
89473
  if (pos === 'middle') {
89400
- return (series.totalPositionY(datum, 'end') + series.totalPositionY(datum, 'start')) * 0.5;
89474
+ return (series.totalPositionX(datum, 'end') + series.totalPositionY(datum, 'start')) * 0.5;
89401
89475
  }
89402
89476
  else if (pos === 'max') {
89403
- return series.totalPositionY(datum, datum.end >= datum.start ? 'end' : 'start') - offset;
89477
+ return series.totalPositionX(datum, datum.end >= datum.start ? 'end' : 'start') + offset;
89404
89478
  }
89405
89479
  else if (pos === 'min') {
89406
- return series.totalPositionY(datum, datum.end >= datum.start ? 'start' : 'end') + offset;
89480
+ return series.totalPositionX(datum, datum.end >= datum.start ? 'start' : 'end') - offset;
89407
89481
  }
89408
- return series.totalPositionY(datum, 'end') + (datum.end >= datum.start ? -offset : offset);
89482
+ return series.totalPositionX(datum, 'end') + (datum.end >= datum.start ? offset : -offset);
89483
+ }
89484
+ return series.totalPositionX(datum, 'index', 0.5);
89485
+ };
89486
+ const y = (datum) => {
89487
+ if (series.direction === "horizontal") {
89488
+ return series.totalPositionY(datum, 'index', 0.5);
89489
+ }
89490
+ if (pos === 'middle') {
89491
+ return (series.totalPositionY(datum, 'end') + series.totalPositionY(datum, 'start')) * 0.5;
89492
+ }
89493
+ else if (pos === 'max') {
89494
+ return series.totalPositionY(datum, datum.end >= datum.start ? 'end' : 'start') - offset;
89409
89495
  }
89410
- return series.totalPositionY(datum, 'index', 0.5);
89496
+ else if (pos === 'min') {
89497
+ return series.totalPositionY(datum, datum.end >= datum.start ? 'start' : 'end') + offset;
89498
+ }
89499
+ return series.totalPositionY(datum, 'end') + (datum.end >= datum.start ? -offset : offset);
89411
89500
  };
89412
89501
  attribute.x = x(datum);
89413
89502
  attribute.y = y(datum);
89414
- if (series.direction === "vertical") {
89415
- attribute.textBaseline =
89416
- pos === 'middle'
89417
- ? pos
89418
- : (pos === 'withChange' && datum.end - datum.start >= 0) || pos === 'max'
89419
- ? 'bottom'
89420
- : 'top';
89421
- }
89422
- else {
89503
+ if (series.direction === "horizontal") {
89423
89504
  attribute.textAlign =
89424
89505
  pos === 'middle'
89425
89506
  ? 'center'
@@ -89427,6 +89508,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89427
89508
  ? 'left'
89428
89509
  : 'right';
89429
89510
  }
89511
+ else {
89512
+ attribute.textBaseline =
89513
+ pos === 'middle'
89514
+ ? pos
89515
+ : (pos === 'withChange' && datum.end - datum.start >= 0) || pos === 'max'
89516
+ ? 'bottom'
89517
+ : 'top';
89518
+ }
89430
89519
  return createText(Object.assign(Object.assign({}, attribute), { id: label.id }));
89431
89520
  });
89432
89521
  },
@@ -91635,12 +91724,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91635
91724
  const getActualTooltipPositionValue = (position, event) => {
91636
91725
  let result;
91637
91726
  if (isValid$1(position)) {
91638
- if (isNumber$2(position)) {
91727
+ if (isNumber$1(position)) {
91639
91728
  result = position;
91640
91729
  }
91641
91730
  else if (isFunction$1(position)) {
91642
91731
  const tooltipPosition = position(event);
91643
- if (isNumber$2(tooltipPosition)) {
91732
+ if (isNumber$1(tooltipPosition)) {
91644
91733
  result = tooltipPosition;
91645
91734
  }
91646
91735
  }
@@ -92637,7 +92726,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
92637
92726
  _throttle(callback) {
92638
92727
  const tooltipSpec = this._component.getSpec();
92639
92728
  let wait;
92640
- if (isNumber$2(tooltipSpec.throttleInterval)) {
92729
+ if (isNumber$1(tooltipSpec.throttleInterval)) {
92641
92730
  wait = tooltipSpec.throttleInterval;
92642
92731
  }
92643
92732
  else {
@@ -92656,14 +92745,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
92656
92745
  return Object.assign(Object.assign({}, DEFAULT_OPTIONS), { offsetX: (_a = offset === null || offset === void 0 ? void 0 : offset.x) !== null && _a !== void 0 ? _a : DEFAULT_OPTIONS.offsetX, offsetY: (_b = offset === null || offset === void 0 ? void 0 : offset.y) !== null && _b !== void 0 ? _b : DEFAULT_OPTIONS.offsetY });
92657
92746
  }
92658
92747
  _getTooltipBoxSize(actualTooltip, changePositionOnly) {
92659
- var _a, _b, _c, _d, _e, _f;
92748
+ var _a, _b, _c;
92660
92749
  if (!changePositionOnly || isNil$1(this._attributes)) {
92661
92750
  const chartTheme = (_b = (_a = this._chartOption) === null || _a === void 0 ? void 0 : _a.getTheme()) !== null && _b !== void 0 ? _b : {};
92662
92751
  this._attributes = getTooltipAttributes(actualTooltip, this._component.getSpec(), chartTheme);
92663
92752
  }
92753
+ const { panel, panelDomHeight } = (_c = this._attributes) !== null && _c !== void 0 ? _c : {};
92664
92754
  return {
92665
- width: (_d = (_c = this._attributes) === null || _c === void 0 ? void 0 : _c.panel) === null || _d === void 0 ? void 0 : _d.width,
92666
- height: (_f = (_e = this._attributes) === null || _e === void 0 ? void 0 : _e.panel) === null || _f === void 0 ? void 0 : _f.height
92755
+ width: panel === null || panel === void 0 ? void 0 : panel.width,
92756
+ height: panelDomHeight !== null && panelDomHeight !== void 0 ? panelDomHeight : panel === null || panel === void 0 ? void 0 : panel.height
92667
92757
  };
92668
92758
  }
92669
92759
  _getPointerPositionRelativeToTooltipParent(params) {
@@ -92819,7 +92909,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
92819
92909
  content: {},
92820
92910
  shapeColumn: {
92821
92911
  common: shapeStyle,
92822
- items: [],
92912
+ items: contentAttribute === null || contentAttribute === void 0 ? void 0 : contentAttribute.map(({ spaceRow }, i) => ({
92913
+ marginTop: '0px',
92914
+ marginBottom: i < contentAttribute.length - 1 ? getPixelPropertyStr(spaceRow) : '0px'
92915
+ })),
92823
92916
  width: getPixelPropertyStr(shape.size),
92824
92917
  marginRight: getPixelPropertyStr((_a = shape.spacing) !== null && _a !== void 0 ? _a : DEFAULT_SHAPE_SPACING)
92825
92918
  },
@@ -93010,7 +93103,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93010
93103
  fontWeight: 'normal'
93011
93104
  };
93012
93105
  const defaultShapeStyle = {
93013
- lineHeight: 'normal'
93106
+ lineHeight: 'normal',
93107
+ boxSizing: 'border-box'
93014
93108
  };
93015
93109
 
93016
93110
  class ShapeModel extends BaseTooltipModel {
@@ -93049,7 +93143,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93049
93143
  }
93050
93144
  const { symbolType, fill, stroke, hollow = false } = option;
93051
93145
  const size = option.size ? valueToHtml(option.size) : '8px';
93052
- const marginTop = option.marginTop ? valueToHtml(option.marginTop) : '0px';
93053
93146
  const lineWidth = option.lineWidth ? valueToHtml(option.lineWidth) + 'px' : '0px';
93054
93147
  let fillString = 'currentColor';
93055
93148
  const getStroke = () => (stroke ? valueToHtml(stroke) : fillString);
@@ -93073,7 +93166,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93073
93166
  fillString = hollow ? 'none' : fill ? valueToHtml(fill) : 'currentColor';
93074
93167
  return `
93075
93168
  <svg width="${size}" height="${size}" viewBox="${viewBox}"
93076
- style="display: inline-block; vertical-align: middle; margin-top: ${marginTop};">
93169
+ style="display: block;">
93077
93170
  <path
93078
93171
  d="${path}"
93079
93172
  style="fill: ${fillString}; stroke: ${getStroke()}; stroke-width: ${lineWidth}"
@@ -93099,7 +93192,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93099
93192
  }
93100
93193
  return `
93101
93194
  <svg width="${size}" height="${size}" viewBox="-0.5 -0.5 1 1"
93102
- style="display: inline-block; vertical-align: middle; margin-top: ${marginTop};">
93195
+ style="display: block;">
93103
93196
  ${gradient}
93104
93197
  <path
93105
93198
  d="${path}"
@@ -93183,29 +93276,47 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93183
93276
  super.setStyle(mergeSpec({}, defaultContentColumnStyle, tooltipStyle.content, this._getContentColumnStyle()));
93184
93277
  const renderContent = (_b = (_a = this._option.getTooltipActual()) === null || _a === void 0 ? void 0 : _a.content) !== null && _b !== void 0 ? _b : [];
93185
93278
  const contentAttributes = (_d = (_c = this._option.getTooltipAttributes()) === null || _c === void 0 ? void 0 : _c.content) !== null && _d !== void 0 ? _d : [];
93279
+ const getKeyItemStyle = (line, i) => {
93280
+ var _a, _b;
93281
+ const { key, isKeyAdaptive } = line;
93282
+ const { height } = contentAttributes[i];
93283
+ const { keyColumn } = tooltipStyle;
93284
+ const style = mergeSpec({}, isKeyAdaptive ? defaultAdaptiveKeyStyle : defaultKeyStyle, Object.assign(Object.assign(Object.assign({ height: getPixelPropertyStr(height) }, defaultLabelStyle), keyColumn.common), (_a = keyColumn.items) === null || _a === void 0 ? void 0 : _a[i]));
93285
+ const hasContent = (isString$1(key) && ((_b = key === null || key === void 0 ? void 0 : key.trim) === null || _b === void 0 ? void 0 : _b.call(key)) !== '') || isNumber$1(key);
93286
+ if (!hasContent && !style.visibility) {
93287
+ style.visibility = 'hidden';
93288
+ }
93289
+ else {
93290
+ style.visibility = 'visible';
93291
+ }
93292
+ return style;
93293
+ };
93294
+ const getValueItemStyle = (line, i) => {
93295
+ var _a;
93296
+ const { height } = contentAttributes[i];
93297
+ const { valueColumn } = tooltipStyle;
93298
+ const style = mergeSpec({}, defaultValueStyle, Object.assign(Object.assign(Object.assign({ height: getPixelPropertyStr(height) }, defaultLabelStyle), valueColumn.common), (_a = valueColumn.items) === null || _a === void 0 ? void 0 : _a[i]));
93299
+ return style;
93300
+ };
93301
+ const getShapeItemStyle = (line, i) => {
93302
+ var _a, _b, _c, _d;
93303
+ const { height } = contentAttributes[i];
93304
+ const { shapeColumn } = tooltipStyle;
93305
+ const keyStyle = getKeyItemStyle(line, i);
93306
+ const paddingTop = `calc((${(_b = (_a = keyStyle.lineHeight) !== null && _a !== void 0 ? _a : keyStyle.fontSize) !== null && _b !== void 0 ? _b : '18px'} - ${(_c = shapeColumn.width) !== null && _c !== void 0 ? _c : '8px'}) / 2)`;
93307
+ const style = mergeSpec({}, defaultShapeStyle, Object.assign(Object.assign({ height: getPixelPropertyStr(height), paddingTop }, shapeColumn.common), (_d = shapeColumn.items) === null || _d === void 0 ? void 0 : _d[i]));
93308
+ return style;
93309
+ };
93186
93310
  renderContent.forEach((line, i) => {
93187
- var _a, _b, _c, _d, _e;
93188
- let childStyle = {};
93189
- const { height, spaceRow = 0 } = contentAttributes[i];
93311
+ var _a;
93190
93312
  if (this.className === 'key-box') {
93191
- const { key, isKeyAdaptive } = line;
93192
- childStyle = mergeSpec({}, isKeyAdaptive ? defaultAdaptiveKeyStyle : defaultKeyStyle, Object.assign(Object.assign(Object.assign({ height: getPixelPropertyStr(height) }, defaultLabelStyle), tooltipStyle.keyColumn.common), (_a = tooltipStyle.keyColumn.items) === null || _a === void 0 ? void 0 : _a[i]));
93193
- const hasContent = (isString$1(key) && ((_b = key === null || key === void 0 ? void 0 : key.trim) === null || _b === void 0 ? void 0 : _b.call(key)) !== '') || isNumber$2(key);
93194
- if (!hasContent && !childStyle.visibility) {
93195
- childStyle.visibility = 'hidden';
93196
- }
93197
- else {
93198
- childStyle.visibility = 'visible';
93199
- }
93200
- this.children[i].setStyle(childStyle);
93313
+ this.children[i].setStyle(getKeyItemStyle(line, i));
93201
93314
  }
93202
93315
  else if (this.className === 'value-box') {
93203
- childStyle = mergeSpec({}, defaultValueStyle, Object.assign(Object.assign(Object.assign({ height: getPixelPropertyStr(height) }, defaultLabelStyle), tooltipStyle.valueColumn.common), (_c = tooltipStyle.valueColumn.items) === null || _c === void 0 ? void 0 : _c[i]));
93204
- this.children[i].setStyle(childStyle);
93316
+ this.children[i].setStyle(getValueItemStyle(line, i));
93205
93317
  }
93206
93318
  else if (this.className === 'shape-box') {
93207
- childStyle = mergeSpec({}, defaultShapeStyle, Object.assign(Object.assign({ height: getPixelPropertyStr(height + (i < renderContent.length - 1 ? spaceRow : 0)) }, tooltipStyle.shapeColumn.common), (_d = tooltipStyle.shapeColumn.items) === null || _d === void 0 ? void 0 : _d[i]));
93208
- (_e = this.children[i]) === null || _e === void 0 ? void 0 : _e.setStyle(childStyle, this._getShapeSvgOption(line, i));
93319
+ (_a = this.children[i]) === null || _a === void 0 ? void 0 : _a.setStyle(getShapeItemStyle(line, i), this._getShapeSvgOption(line, i));
93209
93320
  }
93210
93321
  });
93211
93322
  }
@@ -93218,7 +93329,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93218
93329
  let childContent;
93219
93330
  if (this.className === 'key-box') {
93220
93331
  const keyContent = line.key;
93221
- if ((isString$1(keyContent) && ((_a = keyContent === null || keyContent === void 0 ? void 0 : keyContent.trim) === null || _a === void 0 ? void 0 : _a.call(keyContent)) !== '') || isNumber$2(keyContent)) {
93332
+ if ((isString$1(keyContent) && ((_a = keyContent === null || keyContent === void 0 ? void 0 : keyContent.trim) === null || _a === void 0 ? void 0 : _a.call(keyContent)) !== '') || isNumber$1(keyContent)) {
93222
93333
  childContent = keyContent;
93223
93334
  }
93224
93335
  else {
@@ -93228,7 +93339,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93228
93339
  }
93229
93340
  else if (this.className === 'value-box') {
93230
93341
  const valueContent = line.value;
93231
- if ((isString$1(valueContent) && ((_d = valueContent === null || valueContent === void 0 ? void 0 : valueContent.trim) === null || _d === void 0 ? void 0 : _d.call(valueContent)) !== '') || isNumber$2(valueContent)) {
93342
+ if ((isString$1(valueContent) && ((_d = valueContent === null || valueContent === void 0 ? void 0 : valueContent.trim) === null || _d === void 0 ? void 0 : _d.call(valueContent)) !== '') || isNumber$1(valueContent)) {
93232
93343
  childContent = valueContent;
93233
93344
  }
93234
93345
  else {
@@ -93258,10 +93369,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93258
93369
  }
93259
93370
  }
93260
93371
  _getShapeSvgOption(line, index) {
93261
- var _a, _b, _c, _d, _e, _f;
93372
+ var _a, _b, _c;
93262
93373
  const tooltipStyle = this._option.getTooltipStyle();
93263
93374
  const shapeColumn = Object.assign(Object.assign({}, tooltipStyle.shapeColumn), (_a = tooltipStyle.shapeColumn.items) === null || _a === void 0 ? void 0 : _a[index]);
93264
- const keyColumn = Object.assign(Object.assign({}, tooltipStyle.keyColumn), (_b = tooltipStyle.keyColumn.items) === null || _b === void 0 ? void 0 : _b[index]);
93375
+ Object.assign(Object.assign({}, tooltipStyle.keyColumn), (_b = tooltipStyle.keyColumn.items) === null || _b === void 0 ? void 0 : _b[index]);
93265
93376
  return {
93266
93377
  hasShape: line.hasShape,
93267
93378
  symbolType: line.shapeType,
@@ -93270,7 +93381,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93270
93381
  stroke: line.shapeStroke,
93271
93382
  lineWidth: line.shapeLineWidth,
93272
93383
  hollow: line.shapeHollow,
93273
- marginTop: `calc((${(_e = (_d = keyColumn.lineHeight) !== null && _d !== void 0 ? _d : keyColumn.fontSize) !== null && _e !== void 0 ? _e : '18px'} - ${(_f = shapeColumn.width) !== null && _f !== void 0 ? _f : '8px'}) / 2)`,
93274
93384
  index
93275
93385
  };
93276
93386
  }