@visactor/vchart 1.10.2-alpha.3 → 1.10.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 (65) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +623 -265
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/animation/utils.d.ts +3 -3
  6. package/cjs/animation/utils.js.map +1 -1
  7. package/cjs/compile/compiler.js +1 -1
  8. package/cjs/compile/compiler.js.map +1 -1
  9. package/cjs/compile/mark/compilable-mark.js +3 -3
  10. package/cjs/compile/mark/compilable-mark.js.map +1 -1
  11. package/cjs/component/custom-mark/custom-mark.d.ts +4 -0
  12. package/cjs/component/custom-mark/custom-mark.js +32 -13
  13. package/cjs/component/custom-mark/custom-mark.js.map +1 -1
  14. package/cjs/component/label/total-label.js +1 -1
  15. package/cjs/component/label/total-label.js.map +1 -1
  16. package/cjs/core/index.d.ts +1 -1
  17. package/cjs/core/index.js +1 -1
  18. package/cjs/core/index.js.map +1 -1
  19. package/cjs/event/event-dispatcher.d.ts +2 -0
  20. package/cjs/event/event-dispatcher.js +21 -2
  21. package/cjs/event/event-dispatcher.js.map +1 -1
  22. package/cjs/event/interface.d.ts +8 -0
  23. package/cjs/event/interface.js.map +1 -1
  24. package/cjs/interaction/interaction.js +1 -1
  25. package/cjs/interaction/interaction.js.map +1 -1
  26. package/cjs/interaction/interface.d.ts +8 -8
  27. package/cjs/interaction/interface.js.map +1 -1
  28. package/cjs/mark/group.js +1 -3
  29. package/cjs/mark/group.js.map +1 -1
  30. package/cjs/series/base/base-series.d.ts +2 -2
  31. package/cjs/series/base/base-series.js +41 -30
  32. package/cjs/series/base/base-series.js.map +1 -1
  33. package/cjs/theme/builtin/common/component/crosshair.js +2 -8
  34. package/cjs/theme/builtin/common/component/crosshair.js.map +1 -1
  35. package/esm/animation/utils.d.ts +3 -3
  36. package/esm/animation/utils.js.map +1 -1
  37. package/esm/compile/compiler.js +1 -1
  38. package/esm/compile/compiler.js.map +1 -1
  39. package/esm/compile/mark/compilable-mark.js +3 -3
  40. package/esm/compile/mark/compilable-mark.js.map +1 -1
  41. package/esm/component/custom-mark/custom-mark.d.ts +4 -0
  42. package/esm/component/custom-mark/custom-mark.js +33 -12
  43. package/esm/component/custom-mark/custom-mark.js.map +1 -1
  44. package/esm/component/label/total-label.js +1 -1
  45. package/esm/component/label/total-label.js.map +1 -1
  46. package/esm/core/index.d.ts +1 -1
  47. package/esm/core/index.js +1 -1
  48. package/esm/core/index.js.map +1 -1
  49. package/esm/event/event-dispatcher.d.ts +2 -0
  50. package/esm/event/event-dispatcher.js +22 -1
  51. package/esm/event/event-dispatcher.js.map +1 -1
  52. package/esm/event/interface.d.ts +8 -0
  53. package/esm/event/interface.js.map +1 -1
  54. package/esm/interaction/interaction.js +1 -1
  55. package/esm/interaction/interaction.js.map +1 -1
  56. package/esm/interaction/interface.d.ts +8 -8
  57. package/esm/interaction/interface.js.map +1 -1
  58. package/esm/mark/group.js +1 -3
  59. package/esm/mark/group.js.map +1 -1
  60. package/esm/series/base/base-series.d.ts +2 -2
  61. package/esm/series/base/base-series.js +41 -30
  62. package/esm/series/base/base-series.js.map +1 -1
  63. package/esm/theme/builtin/common/component/crosshair.js +2 -8
  64. package/esm/theme/builtin/common/component/crosshair.js.map +1 -1
  65. package/package.json +15 -15
package/build/index.js CHANGED
@@ -8661,7 +8661,8 @@
8661
8661
  backgroundFit: !0,
8662
8662
  blur: 0,
8663
8663
  cursor: null,
8664
- html: null
8664
+ html: null,
8665
+ react: null
8665
8666
  }, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout), DefaultPickStyle);
8666
8667
  const DefaultConnectAttribute = {
8667
8668
  connectedType: "none",
@@ -8885,7 +8886,7 @@
8885
8886
  function applyStrokeStyle(ctx, character) {
8886
8887
  const strokeStyle = character && character.stroke || defaultFormatting.stroke;
8887
8888
  if (!strokeStyle) return void (ctx.globalAlpha = 0);
8888
- ctx.globalAlpha = 1, ctx.lineWidth = character && "number" == typeof character.lineHeight ? character.lineHeight : 1, ctx.strokeStyle = strokeStyle;
8889
+ ctx.globalAlpha = 1, ctx.lineWidth = character && "number" == typeof character.lineWidth ? character.lineWidth : 1, ctx.strokeStyle = strokeStyle;
8889
8890
  let fontSize = character.fontSize || 16;
8890
8891
  switch (character.script) {
8891
8892
  case "super":
@@ -9671,17 +9672,14 @@
9671
9672
  constructor() {
9672
9673
  this.hooks = {
9673
9674
  onChange: new SyncHook(["x", "y", "width", "height"])
9675
+ }, this.active = () => {
9676
+ const global = this.global;
9677
+ if (!global.env || this.actived) return;
9678
+ container.getNamed(WindowHandlerContribution, global.env).configure(this, global), this.actived = !0;
9674
9679
  }, this._uid = Generator.GenAutoIncrementId(), this.global = application.global, this.postInit();
9675
9680
  }
9676
9681
  postInit() {
9677
- this.global.hooks.onSetEnv.tap("window", () => {
9678
- this.active();
9679
- }), this.active();
9680
- }
9681
- active() {
9682
- const global = this.global;
9683
- if (!global.env || this.actived) return;
9684
- container.getNamed(WindowHandlerContribution, global.env).configure(this, global), this.actived = !0;
9682
+ this.global.hooks.onSetEnv.tap("window", this.active), this.active();
9685
9683
  }
9686
9684
  get style() {
9687
9685
  var _a;
@@ -9719,7 +9717,7 @@
9719
9717
  throw new Error("暂不支持");
9720
9718
  }
9721
9719
  release() {
9722
- return this._handler.releaseWindow();
9720
+ return this.global.hooks.onSetEnv.unTap("window", this.active), this._handler.releaseWindow();
9723
9721
  }
9724
9722
  getContext() {
9725
9723
  return this._handler.getContext();
@@ -10803,6 +10801,9 @@
10803
10801
  const pickResult = this.rootTarget.pick(x, y);
10804
10802
  return target = pickResult && pickResult.graphic ? pickResult.graphic : pickResult && pickResult.group ? pickResult.group : this.rootTarget.AABBBounds.contains(x, y) ? this.rootTarget : null, e && (e.pickParams = pickResult.params), target;
10805
10803
  }
10804
+ release() {
10805
+ this.dispatch.removeAllListeners(), this.eventPool.clear(), this.rootTarget = null, this.mappingTable = null, this.mappingState = null, this.cursorTarget = null;
10806
+ }
10806
10807
  }
10807
10808
 
10808
10809
  const EventTarget = {
@@ -10887,7 +10888,7 @@
10887
10888
  }, this.resolution = resolution, this.setTargetElement(targetElement);
10888
10889
  }
10889
10890
  release() {
10890
- this.setTargetElement(null);
10891
+ this.removeEvents(), this.manager && this.manager.release(), this.domElement = null, this.manager = null, this.globalObj = null;
10891
10892
  }
10892
10893
  setCursor(mode, target) {
10893
10894
  if (!target && !this.manager.rootTarget.window._handler.canvas.controled) return;
@@ -13188,9 +13189,9 @@
13188
13189
  promises.push(end);
13189
13190
  } else data.loadState = "fail", marks.forEach(mark => mark.imageLoadFail(url));
13190
13191
  }), Promise.all(promises).then(() => {
13191
- ResourceLoader.isLoading = !1, ResourceLoader.loading();
13192
+ ResourceLoader.isLoading = !1, this.onLoadSuccessCb.forEach(cb => cb()), ResourceLoader.loading();
13192
13193
  }).catch(error => {
13193
- console.error(error), ResourceLoader.isLoading = !1, ResourceLoader.loading();
13194
+ console.error(error), ResourceLoader.isLoading = !1, this.onLoadSuccessCb.forEach(cb => cb()), ResourceLoader.loading();
13194
13195
  });
13195
13196
  }
13196
13197
  }, 0);
@@ -13210,12 +13211,15 @@
13210
13211
  ResourceLoader.toLoadAueue.unshift(elememt[0]);
13211
13212
  }
13212
13213
  }
13214
+ static onLoadSuccess(cb) {
13215
+ this.onLoadSuccessCb.push(cb);
13216
+ }
13213
13217
  }
13214
13218
  function getIndex(url, arr) {
13215
13219
  for (let i = 0; i < arr.length; i++) if (arr[i].url === url) return i;
13216
13220
  return -1;
13217
13221
  }
13218
- ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
13222
+ ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [], ResourceLoader.onLoadSuccessCb = [];
13219
13223
 
13220
13224
  const tempMatrix = new Matrix(),
13221
13225
  tempBounds$1 = new AABBBounds();
@@ -14540,6 +14544,9 @@
14540
14544
  restLayerCount(stage) {
14541
14545
  return "browser" === this.global.env ? 10 : 0;
14542
14546
  }
14547
+ releaseStage(stage) {
14548
+ this.layerMap.delete(stage);
14549
+ }
14543
14550
  };
14544
14551
  DefaultLayerService.idprefix = "visactor_layer", DefaultLayerService.prefix_count = 0, DefaultLayerService = DefaultLayerService_1 = __decorate$1r([injectable(), __metadata$15("design:paramtypes", [])], DefaultLayerService);
14545
14552
 
@@ -14576,7 +14583,9 @@
14576
14583
  fillOpacity = themeAttributes.fillOpacity,
14577
14584
  lineWidth = themeAttributes.lineWidth,
14578
14585
  strokeOpacity = themeAttributes.strokeOpacity,
14579
- visible = themeAttributes.visible
14586
+ visible = themeAttributes.visible,
14587
+ x: originX = themeAttributes.x,
14588
+ y: originY = themeAttributes.y
14580
14589
  } = graphic.attribute,
14581
14590
  fVisible = fillVisible(opacity, fillOpacity, fill),
14582
14591
  sVisible = strokeVisible(opacity, strokeOpacity),
@@ -14587,7 +14596,7 @@
14587
14596
  if (!(fVisible || sVisible || fillCb || strokeCb)) return !0;
14588
14597
  context.beginPath();
14589
14598
  const path = "function" == typeof graphic.pathProxy ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;
14590
- return renderCommandList(path.commandList, context, x, y), context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes), doStroke && (strokeCb ? strokeCb(context, graphic.attribute, themeAttributes) : sVisible && (context.setStrokeStyle(graphic, graphic.attribute, x, y, themeAttributes), context.stroke())), doFill && (fillCb ? fillCb(context, graphic.attribute, themeAttributes) : fVisible && (context.setCommonStyle(graphic, graphic.attribute, x, y, themeAttributes), context.fill())), !0;
14599
+ return renderCommandList(path.commandList, context, x, y), context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes), doStroke && (strokeCb ? strokeCb(context, graphic.attribute, themeAttributes) : sVisible && (context.setStrokeStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes), context.stroke())), doFill && (fillCb ? fillCb(context, graphic.attribute, themeAttributes) : fVisible && (context.setCommonStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes), context.fill())), !0;
14591
14600
  }
14592
14601
  function intersect$2(x0, y0, x1, y1, x2, y2, x3, y3) {
14593
14602
  const x10 = x1 - x0,
@@ -17076,7 +17085,8 @@
17076
17085
  fontSize: fontSize,
17077
17086
  fontFamily: fontFamily,
17078
17087
  fontStyle: fontStyle,
17079
- fontWeight: fontWeight
17088
+ fontWeight: fontWeight,
17089
+ lineWidth: lineWidth
17080
17090
  } = this.attribute;
17081
17091
  return Object.assign({
17082
17092
  fill: fill,
@@ -17084,7 +17094,8 @@
17084
17094
  fontSize: fontSize,
17085
17095
  fontFamily: fontFamily,
17086
17096
  fontStyle: fontStyle,
17087
- fontWeight: fontWeight
17097
+ fontWeight: fontWeight,
17098
+ lineWidth: lineWidth
17088
17099
  }, config);
17089
17100
  }
17090
17101
  doUpdateFrameCache() {
@@ -20386,7 +20397,9 @@
20386
20397
  const endSeg = segments[segments.length - 1];
20387
20398
  startP = segments[0].points[0], endP = endSeg.points[endSeg.points.length - 1];
20388
20399
  } else startP = points[0], endP = points[points.length - 1];
20389
- direction = abs$1(endP.x - startP.x) > abs$1(endP.y - startP.y) ? Direction$1.ROW : Direction$1.COLUMN, drawAreaSegments(context.camera ? context : context.nativeContext, cache, clipRange, {
20400
+ const xTotalLength = abs$1(endP.x - startP.x),
20401
+ yTotalLength = abs$1(endP.y - startP.y);
20402
+ direction = Number.isFinite(xTotalLength + yTotalLength) ? xTotalLength > yTotalLength ? Direction$1.ROW : Direction$1.COLUMN : Direction$1.ROW, drawAreaSegments(context.camera ? context : context.nativeContext, cache, clipRange, {
20390
20403
  offsetX: offsetX,
20391
20404
  offsetY: offsetY,
20392
20405
  offsetZ: offsetZ,
@@ -22476,7 +22489,7 @@
22476
22489
 
22477
22490
  class HtmlAttributePlugin {
22478
22491
  constructor() {
22479
- this.name = "HtmlAttributePlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid;
22492
+ this.name = "HtmlAttributePlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid, this.lastDomContainerSet = new Set(), this.currentDomContainerSet = new Set();
22480
22493
  }
22481
22494
  activate(context) {
22482
22495
  this.pluginService = context, context.stage.hooks.afterRender.tap(this.key, stage => {
@@ -22488,15 +22501,17 @@
22488
22501
  });
22489
22502
  }
22490
22503
  deactivate(context) {
22491
- context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter(item => item.name !== this.key);
22504
+ context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter(item => item.name !== this.key), application.graphicService.hooks.onRemove.unTap(this.key), application.graphicService.hooks.onRelease.unTap(this.key), this.release();
22492
22505
  }
22493
22506
  drawHTML(renderService) {
22494
- "browser" === application.global.env && renderService.renderTreeRoots.sort((a, b) => {
22507
+ "browser" === application.global.env && (renderService.renderTreeRoots.sort((a, b) => {
22495
22508
  var _a, _b;
22496
22509
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
22497
22510
  }).forEach(group => {
22498
22511
  this.renderGroupHTML(group);
22499
- });
22512
+ }), this.lastDomContainerSet.forEach(item => {
22513
+ this.currentDomContainerSet.has(item) || item.parentElement && item.parentElement.removeChild(item);
22514
+ }), this.lastDomContainerSet = new Set(this.currentDomContainerSet), this.currentDomContainerSet.clear());
22500
22515
  }
22501
22516
  renderGroupHTML(group) {
22502
22517
  this.renderGraphicHTML(group), group.forEachChildren(g => {
@@ -22523,7 +22538,8 @@
22523
22538
  width: width,
22524
22539
  height: height,
22525
22540
  style: style,
22526
- anchorType = "boundsLeftTop"
22541
+ anchorType = "boundsLeftTop",
22542
+ pointerEvents: pointerEvents
22527
22543
  } = html;
22528
22544
  graphic.bindDom || (graphic.bindDom = new Map());
22529
22545
  const lastDom = graphic.bindDom.get(dom);
@@ -22549,7 +22565,7 @@
22549
22565
  wrapGroup: wrapGroup
22550
22566
  }));
22551
22567
  } else wrapGroup = lastDom.wrapGroup, nativeContainer = wrapGroup.parentNode;
22552
- wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
22568
+ wrapGroup.style.pointerEvents = pointerEvents || "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
22553
22569
  let left = 0,
22554
22570
  top = 0;
22555
22571
  const b = graphic.globalAABBBounds;
@@ -22561,7 +22577,15 @@
22561
22577
  windowTL = stage.window.getTopLeft(!1),
22562
22578
  offsetX = left + windowTL.left - containerTL.left,
22563
22579
  offsetTop = top + windowTL.top - containerTL.top;
22564
- wrapGroup.style.left = `${offsetX}px`, wrapGroup.style.top = `${offsetTop}px`;
22580
+ wrapGroup.style.left = `${offsetX}px`, wrapGroup.style.top = `${offsetTop}px`, this.currentDomContainerSet.add(wrapGroup);
22581
+ }
22582
+ release() {
22583
+ "browser" === application.global.env && (this.removeAllDom(this.pluginService.stage.defaultLayer), this.lastDomContainerSet.clear(), this.currentDomContainerSet.clear());
22584
+ }
22585
+ removeAllDom(g) {
22586
+ this.removeDom(g), g.forEachChildren(item => {
22587
+ item.isContainer && this.removeAllDom(g);
22588
+ });
22565
22589
  }
22566
22590
  }
22567
22591
 
@@ -23003,6 +23027,78 @@
23003
23027
  return env ? "browser" === env : _isBrowserEnv;
23004
23028
  }
23005
23029
 
23030
+ class ReactAttributePlugin extends HtmlAttributePlugin {
23031
+ constructor() {
23032
+ super(...arguments), this.name = "ReactAttributePlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid;
23033
+ }
23034
+ removeDom(graphic) {
23035
+ graphic.bindDom && graphic.bindDom.size && (graphic.bindDom.forEach(item => {
23036
+ item.root && item.root.unmount();
23037
+ }), graphic.bindDom.clear());
23038
+ }
23039
+ renderGraphicHTML(graphic) {
23040
+ const {
23041
+ react: react
23042
+ } = graphic.attribute;
23043
+ if (!react) return void (graphic.bindDom && graphic.bindDom.size && (graphic.bindDom.forEach(item => {
23044
+ item.root && item.root.unmount();
23045
+ }), graphic.bindDom.clear()));
23046
+ const stage = graphic.stage;
23047
+ if (!stage) return;
23048
+ const ReactDOM = stage.params.ReactDOM,
23049
+ {
23050
+ element: element,
23051
+ container: container,
23052
+ width: width,
23053
+ height: height,
23054
+ style: style,
23055
+ anchorType = "boundsLeftTop",
23056
+ pointerEvents: pointerEvents
23057
+ } = react;
23058
+ if (!(element && ReactDOM && ReactDOM.createRoot)) return;
23059
+ graphic.bindDom || (graphic.bindDom = new Map());
23060
+ const lastDom = graphic.bindDom.get(element);
23061
+ let wrapGroup, nativeContainer;
23062
+ if (!lastDom || container && container !== lastDom.container) {
23063
+ graphic.bindDom.forEach(_ref => {
23064
+ let {
23065
+ wrapGroup: wrapGroup
23066
+ } = _ref;
23067
+ application.global.removeDom(wrapGroup);
23068
+ });
23069
+ const _container = container;
23070
+ if (nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer(), wrapGroup = application.global.createDom({
23071
+ tagName: "div",
23072
+ width: width,
23073
+ height: height,
23074
+ style: style,
23075
+ parent: nativeContainer
23076
+ }), wrapGroup) {
23077
+ const root = ReactDOM.createRoot(wrapGroup);
23078
+ root.render(element), graphic.bindDom.set(element, {
23079
+ dom: element,
23080
+ container: container,
23081
+ wrapGroup: wrapGroup,
23082
+ root: root
23083
+ });
23084
+ }
23085
+ } else wrapGroup = lastDom.wrapGroup, nativeContainer = wrapGroup.parentNode;
23086
+ wrapGroup.style.pointerEvents = pointerEvents || "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
23087
+ let left = 0,
23088
+ top = 0;
23089
+ const b = graphic.globalAABBBounds;
23090
+ if ("position" === anchorType || b.empty()) {
23091
+ const matrix = graphic.globalTransMatrix;
23092
+ left = matrix.e, top = matrix.f;
23093
+ } else left = b.x1, top = b.y1;
23094
+ const containerTL = application.global.getElementTopLeft(nativeContainer, !1),
23095
+ windowTL = stage.window.getTopLeft(!1),
23096
+ offsetX = left + windowTL.left - containerTL.left,
23097
+ offsetTop = top + windowTL.top - containerTL.top;
23098
+ wrapGroup.style.left = `${offsetX}px`, wrapGroup.style.top = `${offsetTop}px`;
23099
+ }
23100
+ }
23101
+
23006
23102
  const DefaultConfig$1 = {
23007
23103
  WIDTH: 500,
23008
23104
  HEIGHT: 500,
@@ -23103,7 +23199,7 @@
23103
23199
  canvas: params.canvas
23104
23200
  }), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
23105
23201
  main: !0
23106
- })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), params.optimize || (params.optimize = {}), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
23202
+ })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), params.optimize || (params.optimize = {}), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
23107
23203
  background: this._background
23108
23204
  });
23109
23205
  }
@@ -23263,6 +23359,14 @@
23263
23359
  this.pluginService.unRegister(plugin);
23264
23360
  }));
23265
23361
  }
23362
+ enableReactAttribute(container) {
23363
+ this.reactAttribute || (this.reactAttribute = container, this.pluginService.register(new ReactAttributePlugin()));
23364
+ }
23365
+ disableReactAttribute() {
23366
+ this.reactAttribute && (this.reactAttribute = !1, this.pluginService.findPluginsByName("ReactAttributePlugin").forEach(plugin => {
23367
+ this.pluginService.unRegister(plugin);
23368
+ }));
23369
+ }
23266
23370
  getPluginsByName(name) {
23267
23371
  return this.pluginService.findPluginsByName(name);
23268
23372
  }
@@ -23390,7 +23494,7 @@
23390
23494
  throw new Error("暂不支持");
23391
23495
  }
23392
23496
  release() {
23393
- super.release(), this.eventSystem && this.eventSystem.release(), this.pluginService.release(), this.forEach(layer => {
23497
+ super.release(), this.hooks.beforeRender.unTap("constructor", this.beforeRender), this.hooks.afterRender.unTap("constructor", this.afterRender), this.eventSystem && this.eventSystem.release(), this.layerService.releaseStage(this), this.pluginService.release(), this.forEach(layer => {
23394
23498
  layer.release();
23395
23499
  }), this.interactiveLayer && this.interactiveLayer.release(), this.window.release();
23396
23500
  }
@@ -27064,6 +27168,9 @@
27064
27168
  const Ctor = Factory._interactions[interactionType];
27065
27169
  return Ctor ? new Ctor(view, options) : null;
27066
27170
  }
27171
+ static hasInteraction(interactionType) {
27172
+ return !!Factory._interactions[interactionType];
27173
+ }
27067
27174
  };
27068
27175
  Factory$1._plotMarks = {}, Factory$1._marks = {}, Factory$1._components = {}, Factory$1._graphicComponents = {}, Factory$1._transforms = {}, Factory$1._grammars = {}, Factory$1._glyphs = {}, Factory$1._animations = {}, Factory$1._interactions = {}, Factory$1._graphics = {}, Factory$1.registerGlyph = (glyphType, marks, encoders, defaultEncoder, progressiveChannels) => (Factory$1._glyphs[glyphType] = new GlyphMeta(marks, encoders, defaultEncoder, progressiveChannels), Factory$1._glyphs[glyphType]), Factory$1.registerAnimationType = (animationType, animation) => {
27069
27176
  Factory$1._animations[animationType] = animation;
@@ -27303,9 +27410,9 @@
27303
27410
  return transformAttributes(attrTransforms, attributes, this);
27304
27411
  }), this.clearGraphicAttributes(), this.mark.needAnimate() && (this.setPrevGraphicAttributes(null), this.setNextGraphicAttributes(attributes), this.setFinalGraphicAttributes(attributes)));
27305
27412
  }
27306
- updateGraphicItem(config) {
27413
+ updateGraphicItem() {
27307
27414
  if (!this.graphicItem) return;
27308
- isNil$3(config.clip) || this.graphicItem.setAttribute("clip", config.clip), isNil$3(config.zIndex) || this.graphicItem.setAttribute("zIndex", config.zIndex), isNil$3(config.clipPath) || this.graphicItem.setAttribute("path", isArray$3(config.clipPath) ? config.clipPath : config.clipPath([this])), isNil$3(config.interactive) || this.graphicItem.setAttribute("pickable", config.interactive), isNil$3(config.zIndex) || this.graphicItem.setAttribute("zIndex", config.zIndex), this.diffState === DiffState.exit ? this.graphicItem.releaseStatus = "willRelease" : this.graphicItem.releaseStatus = void 0;
27415
+ this.diffState === DiffState.exit ? this.graphicItem.releaseStatus = "willRelease" : this.graphicItem.releaseStatus = void 0;
27309
27416
  const stateAnimation = this.mark.animate.getAnimationConfigs("state");
27310
27417
  0 !== stateAnimation.length && (this.graphicItem.stateAnimateConfig = stateAnimation[0].originConfig);
27311
27418
  }
@@ -27574,6 +27681,9 @@
27574
27681
  constructor(view, options) {
27575
27682
  this.references = new Map(), this.view = view, this.depend(null == options ? void 0 : options.dependency);
27576
27683
  }
27684
+ getStartState() {
27685
+ return null;
27686
+ }
27577
27687
  depend(grammar) {
27578
27688
  this.references.clear(), array(grammar).map(grammar => isString$1(grammar) ? this.view.getGrammarById(grammar) : grammar).filter(ref => !isNil$3(ref)).forEach(ref => {
27579
27689
  var _a;
@@ -27590,16 +27700,16 @@
27590
27700
  const events = this.getEvents();
27591
27701
  (null != events ? events : []).forEach(evt => {
27592
27702
  evt.type && evt.handler && (isArray$3(evt.type) ? evt.type.forEach(evtType => {
27593
- evtType && this.view.addEventListener(evtType, evt.handler);
27594
- }) : this.view.addEventListener(evt.type, evt.handler));
27703
+ evtType && "none" !== evtType && this.view.addEventListener(evtType, evt.handler);
27704
+ }) : "none" !== evt.type && this.view.addEventListener(evt.type, evt.handler));
27595
27705
  });
27596
27706
  }
27597
27707
  unbind() {
27598
27708
  const events = this.getEvents();
27599
27709
  (null != events ? events : []).forEach(evt => {
27600
27710
  evt.type && evt.handler && (isArray$3(evt.type) ? evt.type.forEach(evtType => {
27601
- evtType && this.view.removeEventListener(evtType, evt.handler);
27602
- }) : this.view.removeEventListener(evt.type, evt.handler));
27711
+ evtType && "none" !== evtType && this.view.removeEventListener(evtType, evt.handler);
27712
+ }) : "none" !== evt.type && this.view.removeEventListener(evt.type, evt.handler));
27603
27713
  });
27604
27714
  }
27605
27715
  start(element) {}
@@ -27626,6 +27736,9 @@
27626
27736
  handler: this.handleReset
27627
27737
  }];
27628
27738
  }
27739
+ getStartState() {
27740
+ return this.options.state;
27741
+ }
27629
27742
  start(element) {
27630
27743
  element && this._marks && this._marks.includes(element.mark) && element.addState(this.options.state);
27631
27744
  }
@@ -27672,6 +27785,9 @@
27672
27785
  this.reset(e.element);
27673
27786
  }, this.options = Object.assign({}, ElementSelect.defaultOptions, options), this._marks = view.getMarksBySelector(this.options.selector), this._stateMarks = groupMarksByState(this._marks, [this.options.state, this.options.reverseState]);
27674
27787
  }
27788
+ getStartState() {
27789
+ return this.options.state;
27790
+ }
27675
27791
  getEvents() {
27676
27792
  const triggerOff = this.options.triggerOff,
27677
27793
  trigger = this.options.trigger,
@@ -27680,7 +27796,7 @@
27680
27796
  handler: this.handleStart
27681
27797
  }];
27682
27798
  let eventName = triggerOff;
27683
- 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$3(triggerOff) ? (eventName = null, this._resetType = "timeout") : this._resetType = null, eventName && eventName !== trigger && events.push({
27799
+ return "empty" === triggerOff ? (eventName = trigger, this._resetType = "view") : "none" === triggerOff ? (eventName = null, this._resetType = null) : isString$1(triggerOff) ? triggerOff.includes("view:") ? (eventName = triggerOff.replace("view:", ""), this._resetType = "view") : (eventName = triggerOff, this._resetType = "self") : isNumber$3(triggerOff) ? (eventName = null, this._resetType = "timeout") : this._resetType = null, eventName && eventName !== trigger && events.push({
27684
27800
  type: eventName,
27685
27801
  handler: this.handleReset
27686
27802
  }), events;
@@ -27717,6 +27833,9 @@
27717
27833
  this.reset(e.element);
27718
27834
  }, this.options = Object.assign({}, ElementHighlight.defaultOptions, options), this._marks = view.getMarksBySelector(this.options.selector), this._stateMarks = groupMarksByState(this._marks, [this.options.highlightState, this.options.blurState]);
27719
27835
  }
27836
+ getStartState() {
27837
+ return this.options.highlightState;
27838
+ }
27720
27839
  getEvents() {
27721
27840
  const triggerOff = this.options.triggerOff,
27722
27841
  events = [{
@@ -27773,6 +27892,9 @@
27773
27892
  e.element && this._marks && this._marks.includes(e.element.mark) && this.clearPrevElements();
27774
27893
  }, this.options = Object.assign({}, ElementHighlightByKey.defaultOptions, options), this._marks = view.getMarksBySelector(this.options.selector);
27775
27894
  }
27895
+ getStartState() {
27896
+ return this.options.highlightState;
27897
+ }
27776
27898
  getEvents() {
27777
27899
  return [{
27778
27900
  type: this.options.trigger,
@@ -27827,6 +27949,9 @@
27827
27949
  this.reset(e.element);
27828
27950
  }, this.options = Object.assign({}, ElementHighlightByGroup.defaultOptions, options), this._marks = view.getMarksBySelector(this.options.selector);
27829
27951
  }
27952
+ getStartState() {
27953
+ return this.options.highlightState;
27954
+ }
27830
27955
  getEvents() {
27831
27956
  return [{
27832
27957
  type: this.options.trigger,
@@ -29008,7 +29133,8 @@
29008
29133
  return this.canvas.nativeCanvas.dispatchEvent(event);
29009
29134
  }
29010
29135
  getStyle() {
29011
- return this.canvas.nativeCanvas.style;
29136
+ var _a;
29137
+ return null !== (_a = this.canvas.nativeCanvas.style) && void 0 !== _a ? _a : {};
29012
29138
  }
29013
29139
  setStyle(style) {
29014
29140
  this.canvas.nativeCanvas.style = style;
@@ -35497,7 +35623,9 @@
35497
35623
  line.name = `${this.name}-line`, line.id = this._getNodeId("line" + index), isEmpty(null == state ? void 0 : state.line) || (line.states = isArray$3(state.line) ? null !== (_b = state.line[index]) && void 0 !== _b ? _b : state.line[state.line.length - 1] : state.line), this.add(line);
35498
35624
  });
35499
35625
  } else {
35500
- const line = graphicCreator.polygon(Object.assign(Object.assign({
35626
+ let lineCreator = graphicCreator.line;
35627
+ array(lineStyle)[0].cornerRadius && (lineCreator = graphicCreator.polygon);
35628
+ const line = lineCreator(Object.assign(Object.assign({
35501
35629
  points: this._clipPoints(this.attribute.points)
35502
35630
  }, array(lineStyle)[0]), {
35503
35631
  fill: !1,
@@ -35699,6 +35827,43 @@
35699
35827
  }
35700
35828
  };
35701
35829
 
35830
+ const clampRadian = function () {
35831
+ let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
35832
+ if (angle < 0) for (; angle < 0;) angle += tau$1;else if (angle > 0) for (; angle > tau$1;) angle -= tau$1;
35833
+ return angle;
35834
+ };
35835
+ function isInRange(a, min, max) {
35836
+ return !isLess(a, min, 0, 1e-6) && !isGreater(a, max, 0, 1e-6);
35837
+ }
35838
+ function getLabelPosition(tickPosition, tickVector, text, style) {
35839
+ const labelBounds = getTextBounds(Object.assign({
35840
+ text: text
35841
+ }, style)),
35842
+ width = labelBounds.width(),
35843
+ height = labelBounds.height(),
35844
+ angle = clampRadian(Math.atan2(tickVector[1], tickVector[0])) - Math.PI,
35845
+ PI_3_4 = 3 * Math.PI / 4,
35846
+ PI_1_4 = Math.PI / 4,
35847
+ PI_1_2 = Math.PI / 2,
35848
+ baseX = tickPosition.x;
35849
+ let dx = 0;
35850
+ dx = isInRange(angle, -PI_3_4, -PI_1_4) ? ((angle + PI_3_4) / PI_1_2 - .5) * width : isInRange(angle, PI_1_4, PI_3_4) ? (.5 - (angle - PI_1_4) / PI_1_2) * width : Math.cos(angle) >= 0 ? .5 * width : .5 * -width;
35851
+ const x = baseX - dx,
35852
+ baseY = tickPosition.y;
35853
+ let dy = 0;
35854
+ dy = isInRange(angle, -PI_3_4, -PI_1_4) ? .5 * -height : isInRange(angle, PI_1_4, PI_3_4) ? .5 * height : Math.cos(angle) >= 0 ? (.5 - (PI_1_4 - angle) / PI_1_2) * height : (.5 - clampRadian(angle - PI_3_4) / PI_1_2) * height;
35855
+ return {
35856
+ x: x,
35857
+ y: baseY - dy
35858
+ };
35859
+ }
35860
+ function getElMap(g) {
35861
+ const elMap = {};
35862
+ return traverseGroup(g, el => {
35863
+ "group" !== el.type && el.id && (elMap[el.id] = el);
35864
+ }), elMap;
35865
+ }
35866
+
35702
35867
  class AxisBase extends AbstractComponent {
35703
35868
  constructor() {
35704
35869
  super(...arguments), this.name = "axis", this.data = [], this.tickLineItems = [], this.subTickLineItems = [], this.axisLabelLayerSize = {}, this.axisLabelsContainer = null, this._onHover = e => {
@@ -35736,7 +35901,7 @@
35736
35901
  return this.add(offscreenGroup), this._renderInner(offscreenGroup), this.removeChild(offscreenGroup), this.attribute = currentAttribute, offscreenGroup.AABBBounds;
35737
35902
  }
35738
35903
  render() {
35739
- this.removeAllChild(!0), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
35904
+ this._prevInnerView = this._innerView && getElMap(this._innerView), this.removeAllChild(!0), this._innerView = graphicCreator.group({
35740
35905
  x: 0,
35741
35906
  y: 0,
35742
35907
  pickable: !1
@@ -36008,6 +36173,9 @@
36008
36173
  }));
36009
36174
  }), data;
36010
36175
  }
36176
+ release() {
36177
+ super.release(), this._prevInnerView = null, this._innerView = null;
36178
+ }
36011
36179
  }
36012
36180
 
36013
36181
  function rotate(x, y, deg, originX, originY) {
@@ -36170,17 +36338,42 @@
36170
36338
  limitLength: limitLength,
36171
36339
  verticalLimitLength: verticalLimitLength,
36172
36340
  ellipsis = "...",
36173
- orient: orient
36341
+ orient: orient,
36342
+ axisLength: axisLength
36174
36343
  } = config;
36175
- !isEmpty(labels) && isValidNumber$1(limitLength) && labels.forEach(label => {
36344
+ if (isEmpty(labels) || !isValidNumber$1(limitLength)) return;
36345
+ const DELTA = Math.sin(Math.PI / 10);
36346
+ labels.forEach(label => {
36176
36347
  var _a;
36177
36348
  const angle = label.attribute.angle,
36178
- isRotated = !isNil$3(angle) && 0 !== angle;
36179
- if (("top" === orient || "bottom" === orient) && (isRotated && Math.floor(label.AABBBounds.height()) <= limitLength || !isRotated && Math.floor(label.AABBBounds.width()) <= verticalLimitLength)) return;
36349
+ hasAngle = !isNil$3(angle),
36350
+ cos = hasAngle ? Math.cos(angle) : 1,
36351
+ sin = hasAngle ? Math.sin(angle) : 0,
36352
+ isHorizontal = !hasAngle || Math.abs(sin) <= DELTA,
36353
+ isVertical = hasAngle && Math.abs(cos) <= DELTA,
36354
+ isX = "top" === orient || "bottom" === orient;
36355
+ if (isX) {
36356
+ if (isVertical && Math.floor(label.AABBBounds.height()) <= limitLength) return;
36357
+ if (isHorizontal && Math.floor(label.AABBBounds.width()) <= verticalLimitLength) return;
36358
+ }
36180
36359
  const direction = label.attribute.direction;
36181
- if (("left" === orient || "right" === orient) && ("vertical" === direction && Math.floor(label.AABBBounds.height()) <= verticalLimitLength || "vertical" !== direction && Math.floor(label.AABBBounds.width()) <= limitLength)) return;
36360
+ if (!isX) {
36361
+ if ("vertical" === direction && Math.floor(label.AABBBounds.height()) <= verticalLimitLength) return;
36362
+ if ("vertical" !== direction) {
36363
+ if (isHorizontal && Math.floor(label.AABBBounds.width()) <= limitLength) return;
36364
+ if (isVertical && Math.floor(label.AABBBounds.height()) <= verticalLimitLength) return;
36365
+ }
36366
+ }
36182
36367
  let limitLabelLength = null;
36183
- limitLabelLength = isRotated ? Math.abs(limitLength / Math.sin(angle)) : "top" === orient || "bottom" === orient || "vertical" === direction ? verticalLimitLength : limitLength, isValidNumber$1(label.attribute.maxLineWidth) && (limitLabelLength = isValidNumber$1(limitLabelLength) ? Math.min(label.attribute.maxLineWidth, limitLabelLength) : label.attribute.maxLineWidth), label.setAttributes({
36368
+ if (isHorizontal || isVertical) limitLabelLength = isX ? isHorizontal ? verticalLimitLength : limitLength : "vertical" === direction || isVertical ? verticalLimitLength : limitLength;else if (isX) {
36369
+ const {
36370
+ x1: x1,
36371
+ x2: x2
36372
+ } = label.AABBBounds,
36373
+ tan = sin / cos;
36374
+ limitLabelLength = tan > 0 && x1 <= axisLength && limitLength / tan + x1 > axisLength ? (axisLength - x1) / Math.abs(cos) : tan < 0 && x2 >= 0 && limitLength / tan + x2 < 0 ? x2 / Math.abs(cos) : Math.abs(limitLength / sin);
36375
+ } else limitLabelLength = Math.abs(limitLength / cos);
36376
+ isValidNumber$1(label.attribute.maxLineWidth) && (limitLabelLength = isValidNumber$1(limitLabelLength) ? Math.min(label.attribute.maxLineWidth, limitLabelLength) : label.attribute.maxLineWidth), label.setAttributes({
36184
36377
  maxLineWidth: limitLabelLength,
36185
36378
  ellipsis: null !== (_a = label.attribute.ellipsis) && void 0 !== _a ? _a : ellipsis
36186
36379
  });
@@ -36362,9 +36555,10 @@
36362
36555
  autoRotate = !0,
36363
36556
  shape: shape,
36364
36557
  background: background,
36365
- state = {}
36558
+ state = {},
36559
+ maxWidth: maxWidth
36366
36560
  } = _d,
36367
- restAttrs = __rest$4(_d, ["position", "space", "textStyle", "autoRotate", "shape", "background", "state"]);
36561
+ restAttrs = __rest$4(_d, ["position", "space", "textStyle", "autoRotate", "shape", "background", "state", "maxWidth"]);
36368
36562
  let percent = .5;
36369
36563
  "start" === position ? percent = 0 : "end" === position && (percent = 1);
36370
36564
  const {
@@ -36415,7 +36609,28 @@
36415
36609
  } = this.attribute;
36416
36610
  textBaseline = 1 === -1 * verticalFactor ? "bottom" : "top";
36417
36611
  } else textAlign = this.getTextAlign(vector), textBaseline = this.getTextBaseline(vector, !1);
36612
+ let maxTagWidth = maxWidth;
36613
+ if (isNil$3(maxTagWidth)) {
36614
+ const {
36615
+ verticalLimitSize: verticalLimitSize,
36616
+ verticalMinSize: verticalMinSize,
36617
+ orient: orient
36618
+ } = this.attribute,
36619
+ limitSize = Math.min(verticalLimitSize || 1 / 0, verticalMinSize || 1 / 0);
36620
+ if (isValidNumber$1(limitSize)) {
36621
+ if ("bottom" === orient || "top" === orient) {
36622
+ if (angle !== Math.PI / 2) {
36623
+ const cosValue = Math.abs(Math.cos(null != angle ? angle : 0));
36624
+ maxTagWidth = cosValue < 1e-6 ? 1 / 0 : this.attribute.end.x / cosValue;
36625
+ } else maxTagWidth = limitSize - offset;
36626
+ } else if (angle && 0 !== angle) {
36627
+ const sinValue = Math.abs(Math.sin(angle));
36628
+ maxTagWidth = sinValue < 1e-6 ? 1 / 0 : this.attribute.end.y / sinValue;
36629
+ } else maxTagWidth = limitSize - offset;
36630
+ }
36631
+ }
36418
36632
  const attrs = Object.assign(Object.assign(Object.assign({}, titlePoint), restAttrs), {
36633
+ maxWidth: maxTagWidth,
36419
36634
  textStyle: Object.assign({
36420
36635
  textAlign: textAlign,
36421
36636
  textBaseline: textBaseline
@@ -36539,12 +36754,15 @@
36539
36754
  labelRotateAngle: autoRotateAngle,
36540
36755
  orient: orient
36541
36756
  }), autoLimit$1 && isValidNumber$1(limitLength) && limitLength > 0) {
36542
- const verticalLimitLength = "left" === orient || "right" === orient ? Math.abs(this.attribute.start.y - this.attribute.end.y) / labelShapes.length : autoHide$1 || autoRotate$1 ? 1 / 0 : Math.abs(this.attribute.start.x - this.attribute.end.x) / labelShapes.length;
36757
+ const isVertical = "left" === orient || "right" === orient,
36758
+ axisLength = isVertical ? Math.abs(this.attribute.start.y - this.attribute.end.y) : Math.abs(this.attribute.start.x - this.attribute.end.x),
36759
+ verticalLimitLength = isVertical ? axisLength / labelShapes.length : autoHide$1 || autoRotate$1 ? 1 / 0 : axisLength / labelShapes.length;
36543
36760
  autoLimit(labelShapes, {
36544
36761
  limitLength: limitLength,
36545
36762
  verticalLimitLength: verticalLimitLength,
36546
36763
  ellipsis: limitEllipsis,
36547
- orient: orient
36764
+ orient: orient,
36765
+ axisLength: axisLength
36548
36766
  });
36549
36767
  }
36550
36768
  autoHide$1 && autoHide(labelShapes, {
@@ -36647,37 +36865,6 @@
36647
36865
  }
36648
36866
  }
36649
36867
 
36650
- const clampRadian = function () {
36651
- let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
36652
- if (angle < 0) for (; angle < 0;) angle += tau$1;else if (angle > 0) for (; angle > tau$1;) angle -= tau$1;
36653
- return angle;
36654
- };
36655
- function isInRange(a, min, max) {
36656
- return !isLess(a, min, 0, 1e-6) && !isGreater(a, max, 0, 1e-6);
36657
- }
36658
- function getLabelPosition(tickPosition, tickVector, text, style) {
36659
- const labelBounds = getTextBounds(Object.assign({
36660
- text: text
36661
- }, style)),
36662
- width = labelBounds.width(),
36663
- height = labelBounds.height(),
36664
- angle = clampRadian(Math.atan2(tickVector[1], tickVector[0])) - Math.PI,
36665
- PI_3_4 = 3 * Math.PI / 4,
36666
- PI_1_4 = Math.PI / 4,
36667
- PI_1_2 = Math.PI / 2,
36668
- baseX = tickPosition.x;
36669
- let dx = 0;
36670
- dx = isInRange(angle, -PI_3_4, -PI_1_4) ? ((angle + PI_3_4) / PI_1_2 - .5) * width : isInRange(angle, PI_1_4, PI_3_4) ? (.5 - (angle - PI_1_4) / PI_1_2) * width : Math.cos(angle) >= 0 ? .5 * width : .5 * -width;
36671
- const x = baseX - dx,
36672
- baseY = tickPosition.y;
36673
- let dy = 0;
36674
- dy = isInRange(angle, -PI_3_4, -PI_1_4) ? .5 * -height : isInRange(angle, PI_1_4, PI_3_4) ? .5 * height : Math.cos(angle) >= 0 ? (.5 - (PI_1_4 - angle) / PI_1_2) * height : (.5 - clampRadian(angle - PI_3_4) / PI_1_2) * height;
36675
- return {
36676
- x: x,
36677
- y: baseY - dy
36678
- };
36679
- }
36680
-
36681
36868
  var __rest$3 = undefined && undefined.__rest || function (s, e) {
36682
36869
  var t = {};
36683
36870
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
@@ -36820,12 +37007,6 @@
36820
37007
  }
36821
37008
  CircleAxis.defaultAttributes = DEFAULT_AXIS_THEME, mixin(CircleAxis, CircleAxisMixin);
36822
37009
 
36823
- function getElMap(g) {
36824
- const elMap = {};
36825
- return traverseGroup(g, el => {
36826
- "group" !== el.type && el.id && (elMap[el.id] = el);
36827
- }), elMap;
36828
- }
36829
37010
  class GroupTransition extends ACustomAnimate {
36830
37011
  constructor() {
36831
37012
  super(...arguments), this.mode = AnimateMode.NORMAL;
@@ -36833,10 +37014,10 @@
36833
37014
  onBind() {
36834
37015
  const currentInnerView = this.target.getInnerView(),
36835
37016
  prevInnerView = this.target.getPrevInnerView();
36836
- prevInnerView && (this._oldElementMap = getElMap(prevInnerView), this._newElementAttrMap = {}, traverseGroup(currentInnerView, el => {
37017
+ prevInnerView && (this._newElementAttrMap = {}, traverseGroup(currentInnerView, el => {
36837
37018
  var _a, _b, _c, _d, _e, _f;
36838
37019
  if ("group" !== el.type && el.id) {
36839
- const oldEl = this._oldElementMap[el.id];
37020
+ const oldEl = prevInnerView[el.id];
36840
37021
  if (oldEl) {
36841
37022
  if (!isEqual$1(el.attribute, oldEl.attribute)) {
36842
37023
  const newProps = cloneDeep(el.attribute);
@@ -36974,7 +37155,7 @@
36974
37155
  return this._prevInnerView;
36975
37156
  }
36976
37157
  render() {
36977
- this.removeAllChild(!0), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
37158
+ this._prevInnerView = this._innerView && getElMap(this._innerView), this.removeAllChild(!0), this._innerView = graphicCreator.group({
36978
37159
  x: 0,
36979
37160
  y: 0,
36980
37161
  pickable: !1
@@ -37079,6 +37260,9 @@
37079
37260
  _getNodeId(id) {
37080
37261
  return `${this.id}-${id}`;
37081
37262
  }
37263
+ release() {
37264
+ super.release(), this._prevInnerView = null, this._innerView = null;
37265
+ }
37082
37266
  }
37083
37267
  BaseGrid.defaultAttributes = {
37084
37268
  style: {
@@ -39214,7 +39398,8 @@
39214
39398
  maxWidth: maxWidth,
39215
39399
  maxHeight: maxHeight,
39216
39400
  defaultSelected = [],
39217
- lazyload: lazyload
39401
+ lazyload: lazyload,
39402
+ autoPage: autoPage
39218
39403
  } = this.attribute,
39219
39404
  {
39220
39405
  spaceCol = DEFAULT_ITEM_SPACE_COL,
@@ -39224,9 +39409,10 @@
39224
39409
  {
39225
39410
  items: legendItems,
39226
39411
  isHorizontal: isHorizontal,
39227
- startIndex: startIndex
39412
+ startIndex: startIndex,
39413
+ isScrollbar: isScrollbar
39228
39414
  } = this._itemContext,
39229
- maxPages = isHorizontal ? maxRow : maxCol;
39415
+ maxPages = isScrollbar ? 1 : isHorizontal ? maxRow : maxCol;
39230
39416
  let item,
39231
39417
  {
39232
39418
  doWrap: doWrap,
@@ -39235,24 +39421,20 @@
39235
39421
  startY: startY,
39236
39422
  pages: pages
39237
39423
  } = this._itemContext;
39238
- for (let index = startIndex, len = legendItems.length; index < len; index++) {
39239
- if (lazyload && pages > this._itemContext.currentPage * maxPages) {
39240
- this._itemContext.startIndex = index;
39241
- break;
39242
- }
39243
- item = legendItems[index], item.id || (item.id = item.label), item.index = index;
39424
+ for (let index = startIndex, len = legendItems.length; index < len && !(lazyload && pages > this._itemContext.currentPage * maxPages); index++) {
39425
+ lazyload && (this._itemContext.startIndex = index + 1), item = legendItems[index], item.id || (item.id = item.label), item.index = index;
39244
39426
  const itemGroup = this._renderEachItem(item, !!isEmpty(defaultSelected) || (null == defaultSelected ? void 0 : defaultSelected.includes(item.label)), index, legendItems),
39245
39427
  itemWidth = itemGroup.attribute.width,
39246
39428
  itemHeight = itemGroup.attribute.height;
39247
- this._itemHeight = Math.max(this._itemHeight, itemHeight), maxWidthInCol = Math.max(itemWidth, maxWidthInCol), this._itemMaxWidth = Math.max(itemWidth, this._itemMaxWidth), isHorizontal ? (isValid$3(maxWidth) && (itemWidth >= maxWidth ? (doWrap = !0, index > 0 && (startX = 0, startY += itemHeight + spaceRow, pages += 1)) : maxWidth < startX + itemWidth && (doWrap = !0, startX = 0, startY += itemHeight + spaceRow, pages += 1)), index > 0 && itemGroup.setAttributes({
39429
+ this._itemHeight = Math.max(this._itemHeight, itemHeight), maxWidthInCol = Math.max(itemWidth, maxWidthInCol), this._itemMaxWidth = Math.max(itemWidth, this._itemMaxWidth), isHorizontal ? (isValid$3(maxWidth) && (isScrollbar && autoPage ? (pages = Math.ceil((startX + itemWidth) / maxWidth), doWrap = pages > 1) : startX + itemWidth > maxWidth && (doWrap = !0, startX > 0 && (pages += 1, startX = 0, startY += itemHeight + spaceRow))), 0 === startX && 0 === startY || itemGroup.setAttributes({
39248
39430
  x: startX,
39249
39431
  y: startY
39250
- }), startX += spaceCol + itemWidth) : (isValid$3(maxHeight) && maxHeight < startY + itemHeight && (doWrap = !0, startY = 0, startX += maxWidthInCol + spaceCol, maxWidthInCol = 0, pages += 1), index > 0 && itemGroup.setAttributes({
39432
+ }), startX += spaceCol + itemWidth) : (isValid$3(maxHeight) && (isScrollbar && autoPage ? (pages = Math.ceil((startY + itemHeight) / maxHeight), doWrap = pages > 1) : maxHeight < startY + itemHeight && (pages += 1, doWrap = !0, startY = 0, startX += maxWidthInCol + spaceCol, maxWidthInCol = 0)), 0 === startX && 0 === startY || itemGroup.setAttributes({
39251
39433
  x: startX,
39252
39434
  y: startY
39253
39435
  }), startY += spaceRow + itemHeight), itemsContainer.add(itemGroup);
39254
39436
  }
39255
- return this._itemContext.doWrap = doWrap, this._itemContext.startX = startX, this._itemContext.startY = startY, this._itemContext.maxWidthInCol = maxWidthInCol, this._itemContext.pages = pages, this._itemContext.maxPages = maxPages, lazyload || (this._itemContext.startIndex = legendItems.length), this._itemContext;
39437
+ return this._itemContext.doWrap = doWrap, this._itemContext.startX = startX, this._itemContext.startY = startY, this._itemContext.maxWidthInCol = maxWidthInCol, this._itemContext.pages = pages, this._itemContext.maxPages = maxPages, isScrollbar && (this._itemContext.totalPage = pages), lazyload || (this._itemContext.startIndex = legendItems.length), this._itemContext;
39256
39438
  }
39257
39439
  _renderContent() {
39258
39440
  const {
@@ -39280,8 +39462,10 @@
39280
39462
  height: itemHeight
39281
39463
  } = item,
39282
39464
  widthsOptions = [];
39283
- isValid$3(maxItemWidth) && widthsOptions.push(maxItemWidth), isValid$3(itemWidth) && widthsOptions.push(itemWidth), widthsOptions.length && (isValid$3(maxWidth) && widthsOptions.push(maxWidth), this._itemWidthByUser = minInArray(widthsOptions)), isValid$3(itemHeight) && (this._itemHeightByUser = itemHeight), this._itemContext = {
39284
- currentPage: this.attribute.pager && this.attribute.pager.defaultCurrent || 1,
39465
+ isValid$3(maxItemWidth) && widthsOptions.push(maxItemWidth), isValid$3(itemWidth) && widthsOptions.push(itemWidth), widthsOptions.length && (isValid$3(maxWidth) && widthsOptions.push(maxWidth), this._itemWidthByUser = minInArray(widthsOptions)), isValid$3(itemHeight) && (this._itemHeightByUser = itemHeight);
39466
+ const pager = this.attribute.pager;
39467
+ this._itemContext = {
39468
+ currentPage: pager && pager.defaultCurrent || 1,
39285
39469
  doWrap: !1,
39286
39470
  maxWidthInCol: 0,
39287
39471
  maxPages: 1,
@@ -39291,10 +39475,11 @@
39291
39475
  startIndex: 0,
39292
39476
  items: legendItems,
39293
39477
  isHorizontal: isHorizontal,
39294
- totalPage: 1 / 0
39478
+ totalPage: 1 / 0,
39479
+ isScrollbar: pager && "scrollbar" === pager.type
39295
39480
  }, this._itemContext = this._renderItems();
39296
39481
  let pagerRendered = !1;
39297
- this._itemContext.doWrap && autoPage && this._itemContext.pages > this._itemContext.maxPages && (pagerRendered = this._renderPagerComponent(isHorizontal)), pagerRendered || (itemsContainer.setAttribute("y", this._title ? this._title.AABBBounds.height() + get$1(this.attribute, "title.space", 8) : 0), this._innerView.add(itemsContainer));
39482
+ this._itemContext.doWrap && autoPage && this._itemContext.pages > this._itemContext.maxPages && (pagerRendered = this._renderPagerComponent()), pagerRendered || (itemsContainer.setAttribute("y", this._title ? this._title.AABBBounds.height() + get$1(this.attribute, "title.space", 8) : 0), this._innerView.add(itemsContainer));
39298
39483
  }
39299
39484
  _bindEvents() {
39300
39485
  if (this.attribute.disableTriggerEvent) return;
@@ -39443,27 +39628,13 @@
39443
39628
  itemGroupHeight = this._itemHeightByUser || innerGroupHeight + parsedPadding[0] + parsedPadding[2];
39444
39629
  return itemGroup.attribute.width = itemGroupWidth, itemGroup.attribute.height = itemGroupHeight, focusShape && focusShape.setAttribute("visible", !1), innerGroup.translateTo(-innerGroupBounds.x1 + parsedPadding[3], -innerGroupBounds.y1 + parsedPadding[0]), itemGroup;
39445
39630
  }
39446
- _createPager(isScrollbar, isHorizontal, compStyle, compSize) {
39631
+ _createPager(compStyle) {
39447
39632
  var _a, _b;
39448
39633
  const {
39449
39634
  disableTriggerEvent: disableTriggerEvent,
39450
39635
  maxRow: maxRow
39451
39636
  } = this.attribute;
39452
- return isScrollbar ? new ScrollBar$1(isHorizontal ? Object.assign(Object.assign({
39453
- direction: "vertical",
39454
- width: 12,
39455
- range: [0, .5]
39456
- }, compStyle), {
39457
- height: compSize,
39458
- disableTriggerEvent: disableTriggerEvent
39459
- }) : Object.assign(Object.assign({
39460
- direction: "horizontal",
39461
- disableTriggerEvent: disableTriggerEvent,
39462
- range: [0, .5],
39463
- height: 12
39464
- }, compStyle), {
39465
- width: compSize
39466
- })) : new Pager(isHorizontal ? Object.assign(Object.assign({
39637
+ return this._itemContext.isHorizontal ? new Pager(Object.assign(Object.assign({
39467
39638
  layout: 1 === maxRow ? "horizontal" : "vertical",
39468
39639
  total: 99
39469
39640
  }, merge$2({
@@ -39474,53 +39645,79 @@
39474
39645
  }, compStyle)), {
39475
39646
  defaultCurrent: null === (_a = this.attribute.pager) || void 0 === _a ? void 0 : _a.defaultCurrent,
39476
39647
  disableTriggerEvent: disableTriggerEvent
39477
- }) : Object.assign({
39648
+ })) : new Pager(Object.assign({
39478
39649
  layout: "horizontal",
39479
39650
  total: 99,
39480
39651
  disableTriggerEvent: disableTriggerEvent,
39481
39652
  defaultCurrent: null === (_b = this.attribute.pager) || void 0 === _b ? void 0 : _b.defaultCurrent
39482
39653
  }, compStyle));
39483
39654
  }
39484
- _updatePositionOfPager(isScrollbar, isHorizontal, contentSize, renderStartY, compSize) {
39655
+ _createScrollbar(compStyle, compSize) {
39656
+ const {
39657
+ disableTriggerEvent: disableTriggerEvent
39658
+ } = this.attribute;
39659
+ return this._itemContext.isHorizontal ? new ScrollBar$1(Object.assign(Object.assign({
39660
+ direction: "horizontal",
39661
+ disableTriggerEvent: disableTriggerEvent,
39662
+ range: [0, .5],
39663
+ height: 12
39664
+ }, compStyle), {
39665
+ width: compSize
39666
+ })) : new ScrollBar$1(Object.assign(Object.assign({
39667
+ direction: "vertical",
39668
+ width: 12,
39669
+ range: [0, .5]
39670
+ }, compStyle), {
39671
+ height: compSize,
39672
+ disableTriggerEvent: disableTriggerEvent
39673
+ }));
39674
+ }
39675
+ _updatePositionOfPager(contentWidth, contentHeight, renderStartY, compWidth, compHeight) {
39485
39676
  const {
39486
39677
  maxHeight: maxHeight,
39487
39678
  pager: pager
39488
39679
  } = this.attribute,
39489
39680
  {
39490
- currentPage: currentPage,
39491
- totalPage: totalPage
39492
- } = this._itemContext;
39493
- if (isScrollbar) this._pagerComponent.setScrollRange([(currentPage - 1) / totalPage, currentPage / totalPage]), isHorizontal ? this._pagerComponent.setAttributes({
39494
- x: contentSize,
39495
- y: renderStartY
39496
- }) : this._pagerComponent.setAttributes({
39497
- x: 0,
39498
- y: maxHeight - this._pagerComponent.AABBBounds.height()
39499
- });else {
39500
- const position = pager && pager.position || "middle";
39501
- if (this._pagerComponent.setTotal(totalPage), isHorizontal) {
39502
- let y;
39503
- y = "start" === position ? renderStartY : "end" === position ? renderStartY + compSize - this._pagerComponent.AABBBounds.height() / 2 : renderStartY + compSize / 2 - this._pagerComponent.AABBBounds.height() / 2, this._pagerComponent.setAttributes({
39504
- x: contentSize,
39505
- y: y
39506
- });
39507
- } else {
39508
- let x;
39509
- x = "start" === position ? 0 : "end" === position ? compSize - this._pagerComponent.AABBBounds.width() : (compSize - this._pagerComponent.AABBBounds.width()) / 2, this._pagerComponent.setAttributes({
39510
- x: x,
39511
- y: maxHeight - this._pagerComponent.AABBBounds.height()
39512
- });
39513
- }
39681
+ totalPage: totalPage,
39682
+ isHorizontal: isHorizontal
39683
+ } = this._itemContext,
39684
+ position = pager && pager.position || "middle";
39685
+ if (this._pagerComponent.setTotal(totalPage), isHorizontal) {
39686
+ let y;
39687
+ y = "start" === position ? renderStartY : "end" === position ? renderStartY + compHeight - this._pagerComponent.AABBBounds.height() / 2 : renderStartY + compHeight / 2 - this._pagerComponent.AABBBounds.height() / 2, this._pagerComponent.setAttributes({
39688
+ x: contentWidth,
39689
+ y: y
39690
+ });
39691
+ } else {
39692
+ let x;
39693
+ x = "start" === position ? 0 : "end" === position ? compWidth - this._pagerComponent.AABBBounds.width() : (compWidth - this._pagerComponent.AABBBounds.width()) / 2, this._pagerComponent.setAttributes({
39694
+ x: x,
39695
+ y: maxHeight - this._pagerComponent.AABBBounds.height()
39696
+ });
39514
39697
  }
39515
39698
  }
39516
- _bindEventsOfPager(isScrollbar, isHorizontal, compSize, spaceSize) {
39699
+ _updatePositionOfScrollbar(contentWidth, contentHeight, renderStartY) {
39700
+ const {
39701
+ currentPage: currentPage,
39702
+ totalPage: totalPage,
39703
+ isHorizontal: isHorizontal
39704
+ } = this._itemContext;
39705
+ this._pagerComponent.setScrollRange([(currentPage - 1) / totalPage, currentPage / totalPage]), isHorizontal ? this._pagerComponent.setAttributes({
39706
+ x: 0,
39707
+ y: renderStartY + contentHeight
39708
+ }) : this._pagerComponent.setAttributes({
39709
+ x: contentWidth,
39710
+ y: renderStartY
39711
+ });
39712
+ }
39713
+ _bindEventsOfPager(pageSize, channel) {
39517
39714
  const pager = this.attribute.pager || {},
39518
39715
  {
39519
39716
  animation = !0,
39520
39717
  animationDuration = 450,
39521
39718
  animationEasing = "quadIn"
39522
39719
  } = pager,
39523
- pageParser = isScrollbar ? e => {
39720
+ pageParser = this._itemContext.isScrollbar ? e => {
39524
39721
  const {
39525
39722
  value: value
39526
39723
  } = e.detail;
@@ -39535,16 +39732,14 @@
39535
39732
  const newTotalPage = Math.ceil(this._itemContext.pages / this._itemContext.maxPages);
39536
39733
  this._itemContext.totalPage = newTotalPage, this._pagerComponent.setScrollRange([(newPage - 1) / newTotalPage, newPage / newTotalPage]);
39537
39734
  }
39538
- animation ? this._itemsContainer.animate().to(isHorizontal ? {
39539
- y: -(newPage - 1) * (compSize + spaceSize)
39540
- } : {
39541
- x: -(newPage - 1) * (compSize + spaceSize)
39542
- }, animationDuration, animationEasing) : isHorizontal ? this._itemsContainer.setAttribute("y", -(newPage - 1) * (compSize + spaceSize)) : this._itemsContainer.setAttribute("x", -(newPage - 1) * (compSize + spaceSize));
39735
+ animation ? this._itemsContainer.animate().to({
39736
+ [channel]: -(newPage - 1) * pageSize
39737
+ }, animationDuration, animationEasing) : this._itemsContainer.setAttribute(channel, -(newPage - 1) * pageSize);
39543
39738
  }
39544
39739
  };
39545
- isScrollbar ? (this._pagerComponent.addEventListener("scrollDrag", onPaging), this._pagerComponent.addEventListener("scrollUp", onPaging)) : (this._pagerComponent.addEventListener("toPrev", onPaging), this._pagerComponent.addEventListener("toNext", onPaging));
39740
+ this._itemContext.isScrollbar ? (this._pagerComponent.addEventListener("scrollDrag", onPaging), this._pagerComponent.addEventListener("scrollUp", onPaging)) : (this._pagerComponent.addEventListener("toPrev", onPaging), this._pagerComponent.addEventListener("toNext", onPaging));
39546
39741
  }
39547
- _renderPagerComponent(isHorizontal) {
39742
+ _renderPager() {
39548
39743
  const renderStartY = this._title ? this._title.AABBBounds.height() + get$1(this.attribute, "title.space", 8) : 0,
39549
39744
  {
39550
39745
  maxWidth: maxWidth,
@@ -39564,51 +39759,105 @@
39564
39759
  defaultCurrent = 1
39565
39760
  } = pager,
39566
39761
  compStyle = __rest(pager, ["space", "defaultCurrent"]),
39567
- isScrollbar = "scrollbar" === pager.type;
39762
+ {
39763
+ isHorizontal: isHorizontal
39764
+ } = this._itemContext;
39568
39765
  let comp,
39569
- compSize = 0,
39570
- contentSize = 0,
39766
+ compWidth = 0,
39767
+ compHeight = 0,
39768
+ contentWidth = 0,
39769
+ contentHeight = 0,
39571
39770
  startX = 0,
39572
39771
  startY = 0,
39573
39772
  pages = 1;
39574
39773
  if (isHorizontal) {
39575
- if (compSize = (maxRow - 1) * spaceRow + this._itemHeight * maxRow, comp = this._createPager(isScrollbar, isHorizontal, compStyle, compSize), this._pagerComponent = comp, this._innerView.add(comp), contentSize = maxWidth - comp.AABBBounds.width() - pagerSpace, contentSize <= 0) return this._innerView.removeChild(comp), !1;
39774
+ if (compHeight = (maxRow - 1) * spaceRow + this._itemHeight * maxRow, compWidth = maxWidth, comp = this._createPager(compStyle), this._pagerComponent = comp, this._innerView.add(comp), contentWidth = maxWidth - comp.AABBBounds.width() - pagerSpace, contentWidth <= 0) return this._innerView.removeChild(comp), !1;
39576
39775
  itemsContainer.getChildren().forEach((item, index) => {
39577
39776
  const {
39578
39777
  width: width,
39579
39778
  height: height
39580
39779
  } = item.attribute;
39581
- contentSize < startX + width && (startX = 0, startY += height + spaceRow, pages += 1), index > 0 && item.setAttributes({
39780
+ contentWidth < startX + width && (startX = 0, startY += height + spaceRow, pages += 1), index > 0 && item.setAttributes({
39582
39781
  x: startX,
39583
39782
  y: startY
39584
39783
  }), startX += spaceCol + width;
39585
39784
  }), this._itemContext.startX = startX, this._itemContext.startY = startY, this._itemContext.pages = pages;
39586
39785
  const total = Math.ceil(pages / maxRow);
39587
- this._itemContext.totalPage = total, this._updatePositionOfPager(isScrollbar, isHorizontal, contentSize, renderStartY, compSize);
39786
+ this._itemContext.totalPage = total, this._updatePositionOfPager(contentWidth, contentHeight, renderStartY, compWidth, compHeight);
39588
39787
  } else {
39589
- if (compSize = this._itemMaxWidth * maxCol + (maxCol - 1) * spaceCol, comp = this._createPager(isScrollbar, isHorizontal, compStyle, compSize), this._pagerComponent = comp, this._innerView.add(comp), contentSize = maxHeight - comp.AABBBounds.height() - pagerSpace - renderStartY, contentSize <= 0) return this._innerView.removeChild(comp), !1;
39788
+ if (compWidth = this._itemMaxWidth * maxCol + (maxCol - 1) * spaceCol, compHeight = maxHeight, contentWidth = compWidth, comp = this._createPager(compStyle), this._pagerComponent = comp, this._innerView.add(comp), contentHeight = maxHeight - comp.AABBBounds.height() - pagerSpace - renderStartY, contentHeight <= 0) return this._innerView.removeChild(comp), !1;
39590
39789
  itemsContainer.getChildren().forEach((item, index) => {
39591
39790
  const {
39592
39791
  height: height
39593
39792
  } = item.attribute;
39594
- contentSize < startY + height && (startY = 0, startX += this._itemMaxWidth + spaceCol, pages += 1), index > 0 && item.setAttributes({
39793
+ contentHeight < startY + height && (startY = 0, startX += this._itemMaxWidth + spaceCol, pages += 1), index > 0 && item.setAttributes({
39595
39794
  x: startX,
39596
39795
  y: startY
39597
39796
  }), startY += spaceRow + height;
39598
39797
  });
39599
39798
  const total = Math.ceil(pages / maxCol);
39600
- this._itemContext.totalPage = total, this._updatePositionOfPager(isScrollbar, isHorizontal, contentSize, renderStartY, compSize);
39799
+ this._itemContext.totalPage = total, this._updatePositionOfPager(contentWidth, contentHeight, renderStartY, compWidth, compHeight);
39800
+ }
39801
+ defaultCurrent > 1 && (isHorizontal ? itemsContainer.setAttribute("y", -(defaultCurrent - 1) * (compHeight + spaceRow)) : itemsContainer.setAttribute("x", -(defaultCurrent - 1) * (compWidth + spaceCol)));
39802
+ const clipGroup = graphicCreator.group({
39803
+ x: 0,
39804
+ y: renderStartY,
39805
+ width: isHorizontal ? contentWidth : compWidth,
39806
+ height: isHorizontal ? compHeight : contentHeight,
39807
+ clip: !0,
39808
+ pickable: !1
39809
+ });
39810
+ return clipGroup.add(itemsContainer), this._innerView.add(clipGroup), this._bindEventsOfPager(isHorizontal ? compHeight + spaceRow : compWidth + spaceCol, isHorizontal ? "y" : "x"), !0;
39811
+ }
39812
+ _renderScrollbar() {
39813
+ const renderStartY = this._title ? this._title.AABBBounds.height() + get$1(this.attribute, "title.space", 8) : 0,
39814
+ {
39815
+ maxWidth: maxWidth,
39816
+ maxHeight: maxHeight,
39817
+ item = {},
39818
+ pager = {}
39819
+ } = this.attribute,
39820
+ {
39821
+ spaceCol = DEFAULT_ITEM_SPACE_COL,
39822
+ spaceRow = DEFAULT_ITEM_SPACE_ROW
39823
+ } = item,
39824
+ itemsContainer = this._itemsContainer,
39825
+ {
39826
+ space: pagerSpace = DEFAULT_PAGER_SPACE,
39827
+ defaultCurrent = 1
39828
+ } = pager,
39829
+ compStyle = __rest(pager, ["space", "defaultCurrent"]),
39830
+ {
39831
+ isHorizontal: isHorizontal
39832
+ } = this._itemContext;
39833
+ let comp,
39834
+ compSize = 0,
39835
+ contentWidth = 0,
39836
+ contentHeight = 0,
39837
+ startY = 0,
39838
+ pages = 1;
39839
+ if (isHorizontal) compSize = maxWidth, contentWidth = maxWidth, contentHeight = this._itemHeight, comp = this._createScrollbar(compStyle, compSize), this._pagerComponent = comp, this._innerView.add(comp), this._updatePositionOfScrollbar(contentWidth, contentHeight, renderStartY);else {
39840
+ if (compSize = maxHeight, comp = this._createScrollbar(compStyle, compSize), this._pagerComponent = comp, this._innerView.add(comp), contentHeight = maxHeight - renderStartY, contentWidth = this._itemMaxWidth, contentHeight <= 0) return this._innerView.removeChild(comp), !1;
39841
+ itemsContainer.getChildren().forEach((item, index) => {
39842
+ const {
39843
+ height: height
39844
+ } = item.attribute;
39845
+ pages = Math.floor((startY + height) / contentHeight) + 1, startY += spaceRow + height;
39846
+ }), this._itemContext.totalPage = pages, this._itemContext.pages = pages, this._updatePositionOfScrollbar(contentWidth, contentHeight, renderStartY);
39601
39847
  }
39602
- defaultCurrent > 1 && (isHorizontal ? itemsContainer.setAttribute("y", -(defaultCurrent - 1) * (compSize + spaceRow)) : itemsContainer.setAttribute("x", -(defaultCurrent - 1) * (compSize + spaceCol)));
39848
+ defaultCurrent > 1 && (isHorizontal ? itemsContainer.setAttribute("x", -(defaultCurrent - 1) * (contentWidth + spaceCol)) : itemsContainer.setAttribute("y", -(defaultCurrent - 1) * (contentHeight + spaceRow)));
39603
39849
  const clipGroup = graphicCreator.group({
39604
39850
  x: 0,
39605
39851
  y: renderStartY,
39606
- width: isHorizontal ? contentSize : compSize,
39607
- height: isHorizontal ? compSize : contentSize,
39852
+ width: contentWidth,
39853
+ height: contentHeight,
39608
39854
  clip: !0,
39609
39855
  pickable: !1
39610
39856
  });
39611
- return clipGroup.add(itemsContainer), this._innerView.add(clipGroup), this._bindEventsOfPager(isScrollbar, isHorizontal, compSize, isHorizontal ? spaceRow : spaceCol), !0;
39857
+ return clipGroup.add(itemsContainer), this._innerView.add(clipGroup), this._bindEventsOfPager(isHorizontal ? contentWidth : contentHeight, isHorizontal ? "x" : "y"), !0;
39858
+ }
39859
+ _renderPagerComponent() {
39860
+ return this._itemContext.isScrollbar ? this._renderScrollbar() : this._renderPager(), !0;
39612
39861
  }
39613
39862
  _hover(legendItem, e) {
39614
39863
  this._lastActiveItem = legendItem;
@@ -43132,6 +43381,9 @@
43132
43381
  handler: this.handleReset
43133
43382
  }];
43134
43383
  }
43384
+ getStartState() {
43385
+ return this.options.state;
43386
+ }
43135
43387
  start(element) {
43136
43388
  const itemKey = element;
43137
43389
  if (isNil$3(itemKey)) return;
@@ -43164,6 +43416,9 @@
43164
43416
  this.reset();
43165
43417
  }, this.options = Object.assign({}, ElementHighlightByLegend.defaultOptions, options), this._marks = view.getMarksBySelector(this.options.selector);
43166
43418
  }
43419
+ getStartState() {
43420
+ return this.options.highlightState;
43421
+ }
43167
43422
  getEvents() {
43168
43423
  return [{
43169
43424
  type: LegendEvent.legendItemHover,
@@ -43207,6 +43462,9 @@
43207
43462
  (this.options.shouldReset ? this.options.shouldReset(e) : this._filterByName(e)) && this.reset();
43208
43463
  }, this.options = Object.assign({}, ElementHighlightByName.defaultOptions, options), this._marks = view.getMarksBySelector(this.options.selector);
43209
43464
  }
43465
+ getStartState() {
43466
+ return this.options.highlightState;
43467
+ }
43210
43468
  getEvents() {
43211
43469
  return [{
43212
43470
  type: this.options.trigger,
@@ -43988,7 +44246,8 @@
43988
44246
  optimize: viewOptions.optimize,
43989
44247
  ticker: viewOptions.ticker,
43990
44248
  supportsTouchEvents: viewOptions.supportsTouchEvents,
43991
- supportsPointerEvents: viewOptions.supportsPointerEvents
44249
+ supportsPointerEvents: viewOptions.supportsPointerEvents,
44250
+ ReactDOM: viewOptions.ReactDOM
43992
44251
  });
43993
44252
  (null === (_b = viewOptions.options3d) || void 0 === _b ? void 0 : _b.enable) && stage.set3dOptions(viewOptions.options3d), stage.enableIncrementalAutoRender(), this._viewBox = viewOptions.viewBox, this._view.emit(exports.VGRAMMAR_HOOK_EVENT.AFTER_CREATE_VRENDER_STAGE), this._view.emit(exports.VGRAMMAR_HOOK_EVENT.BEFORE_CREATE_VRENDER_LAYER);
43994
44253
  const layer = null !== (_c = viewOptions.layer) && void 0 !== _c ? _c : stage.defaultLayer;
@@ -44609,10 +44868,6 @@
44609
44868
  return this.to;
44610
44869
  }
44611
44870
  onBind() {
44612
- var _a, _b;
44613
- this.from = null !== (_a = this.from) && void 0 !== _a ? _a : {}, this.to = null !== (_b = this.to) && void 0 !== _b ? _b : {};
44614
- }
44615
- onStart() {
44616
44871
  var _a;
44617
44872
  const excludedChannelMap = null !== (_a = this.target.constructor.NOWORK_ANIMATE_ATTR) && void 0 !== _a ? _a : NOWORK_ANIMATE_ATTR,
44618
44873
  excludedChannels = Object.keys(excludedChannelMap).filter(channel => 0 !== excludedChannelMap[channel]);
@@ -44624,14 +44879,22 @@
44624
44879
  excludedChannels.includes(k) ? (from[k] = to[k], this.from[k] = to[k]) : isNil$3(from[k]) ? from[k] = this.target.getComputedAttribute(k) : animatedChannels.push(k);
44625
44880
  }), this.target.animates.forEach(a => {
44626
44881
  a !== this.subAnimate.animate && a.preventAttrs(animatedChannels);
44627
- }), this.target.setAttributes(from, !1, {
44628
- type: AttributeUpdateType.ANIMATE_UPDATE,
44629
- animationState: {
44630
- ratio: 0,
44631
- end: !1
44632
- }
44633
44882
  }), this._fromAttribute = from, this._toAttribute = to;
44634
44883
  }
44884
+ onStart() {
44885
+ if (this._fromAttribute) {
44886
+ const from = {};
44887
+ Object.keys(this._fromAttribute).forEach(key => {
44888
+ this.subAnimate.animate.validAttr(key) && (from[key] = this._fromAttribute[key]);
44889
+ }), this.target.setAttributes(from, !1, {
44890
+ type: AttributeUpdateType.ANIMATE_UPDATE,
44891
+ animationState: {
44892
+ ratio: 0,
44893
+ end: !1
44894
+ }
44895
+ });
44896
+ }
44897
+ }
44635
44898
  onEnd() {
44636
44899
  if (this._toAttribute) {
44637
44900
  const out = {};
@@ -45304,16 +45567,9 @@
45304
45567
  }
45305
45568
  update(spec) {
45306
45569
  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$3(spec.zIndex) || this.graphicItem.setAttribute("zIndex", spec.zIndex), isNil$3(spec.clip) || this.graphicItem.setAttribute("clip", spec.clip), isNil$3(spec.clipPath) || this.graphicItem.setAttribute("path", isArray$3(spec.clipPath) ? spec.clipPath : spec.clipPath(this.elements)), this.elementMap.forEach(element => {
45307
- element.updateGraphicItem({
45308
- interactive: spec.interactive
45309
- });
45570
+ element.updateGraphicItem();
45310
45571
  })) : this.elementMap.forEach(element => {
45311
- element.updateGraphicItem({
45312
- clip: spec.clip,
45313
- zIndex: spec.zIndex,
45314
- interactive: spec.interactive,
45315
- clipPath: spec.clipPath
45316
- });
45572
+ element.updateGraphicItem();
45317
45573
  });
45318
45574
  }
45319
45575
  evaluateJoin(data) {
@@ -45354,15 +45610,6 @@
45354
45610
  });
45355
45611
  }
45356
45612
  evaluateGroupEncode(elements, groupEncode, parameters) {
45357
- var _a;
45358
- if (this.markType === GrammarMarkType.group) {
45359
- const el = this.elements[0],
45360
- nextAttrs = {},
45361
- items = [Object.assign({}, null === (_a = el.items) || void 0 === _a ? void 0 : _a[0], {
45362
- nextAttrs: nextAttrs
45363
- })];
45364
- return invokeEncoderToItems(el, items, groupEncode, parameters), this._groupEncodeResult = nextAttrs, nextAttrs;
45365
- }
45366
45613
  if (!this._groupKeys || !groupEncode) return;
45367
45614
  const res = {};
45368
45615
  return this._groupKeys.forEach(key => {
@@ -45370,7 +45617,14 @@
45370
45617
  el && (res[key] = invokeEncoder(groupEncode, el.items && el.items[0] && el.items[0].datum, el, parameters));
45371
45618
  }), this._groupEncodeResult = res, res;
45372
45619
  }
45620
+ getChannelsFromConfig(element) {
45621
+ const spec = this.spec;
45622
+ return isNil$3(spec.interactive) ? null : {
45623
+ pickable: spec.interactive
45624
+ };
45625
+ }
45373
45626
  evaluateEncode(elements, encoders, parameters, noGroupEncode) {
45627
+ const initAttrs = this.getChannelsFromConfig();
45374
45628
  if (encoders) {
45375
45629
  this.emit(exports.VGRAMMAR_HOOK_EVENT.BEFORE_ELEMENT_ENCODE, {
45376
45630
  encoders: encoders,
@@ -45378,12 +45632,12 @@
45378
45632
  }, this);
45379
45633
  const groupEncodeAttrs = noGroupEncode ? null : this.evaluateGroupEncode(elements, encoders[BuiltInEncodeNames.group], parameters);
45380
45634
  elements.forEach(element => {
45381
- this.markType === GrammarMarkType.group && groupEncodeAttrs ? element.items.forEach(item => {
45382
- item.nextAttrs = Object.assign(item.nextAttrs, groupEncodeAttrs);
45383
- }) : this.markType === GrammarMarkType.glyph && this._groupEncodeResult ? element.items.forEach(item => {
45384
- item.nextAttrs = Object.assign(item.nextAttrs, this._groupEncodeResult[element.groupKey]);
45385
- }) : (null == groupEncodeAttrs ? void 0 : groupEncodeAttrs[element.groupKey]) && !this.isCollectionMark() && element.items.forEach(item => {
45386
- item.nextAttrs = Object.assign(item.nextAttrs, groupEncodeAttrs[element.groupKey]);
45635
+ this.markType === GrammarMarkType.glyph && this._groupEncodeResult ? element.items.forEach(item => {
45636
+ item.nextAttrs = Object.assign(item.nextAttrs, initAttrs, this._groupEncodeResult[element.groupKey]);
45637
+ }) : (null == groupEncodeAttrs ? void 0 : groupEncodeAttrs[element.groupKey]) && !this.isCollectionMark() ? element.items.forEach(item => {
45638
+ item.nextAttrs = Object.assign(item.nextAttrs, initAttrs, groupEncodeAttrs[element.groupKey]);
45639
+ }) : initAttrs && element.items.forEach(item => {
45640
+ item.nextAttrs = Object.assign(item.nextAttrs, initAttrs);
45387
45641
  }), element.encodeItems(element.items, encoders, this._isReentered, parameters);
45388
45642
  }), this._isReentered = !1, this.evaluateTransform(this._getTransformsAfterEncodeItems(), elements, parameters), elements.forEach(element => {
45389
45643
  element.encodeGraphic(this.isCollectionMark() ? null == groupEncodeAttrs ? void 0 : groupEncodeAttrs[element.groupKey] : null);
@@ -45392,7 +45646,7 @@
45392
45646
  parameters: parameters
45393
45647
  }, this);
45394
45648
  } else elements.forEach(element => {
45395
- element.initGraphicItem();
45649
+ element.initGraphicItem(initAttrs);
45396
45650
  });
45397
45651
  }
45398
45652
  addGraphicItem(attrs, groupKey, newGraphicItem) {
@@ -45562,7 +45816,8 @@
45562
45816
  }
45563
45817
  initEvent() {
45564
45818
  if (this._delegateEvent) {
45565
- this.view.renderer.stage().on("*", this._delegateEvent);
45819
+ const stage = this.view.renderer.stage();
45820
+ stage && stage.on("*", this._delegateEvent);
45566
45821
  }
45567
45822
  }
45568
45823
  releaseEvent() {
@@ -45573,7 +45828,7 @@
45573
45828
  }
45574
45829
  clear() {
45575
45830
  var _a;
45576
- super.clear(), this.transforms = null, this.elementMap = null, this.elements = null, this.graphicItem = null, this.animate = null, null === (_a = this.group) || void 0 === _a || _a.removeChild(this), this.group = null;
45831
+ this.releaseEvent(), this.transforms = null, this.elementMap = null, this.elements = null, this.graphicItem = null, this.animate = null, null === (_a = this.group) || void 0 === _a || _a.removeChild(this), this.group = null, super.clear();
45577
45832
  }
45578
45833
  prepareRelease() {
45579
45834
  this.animate.stop(), this.elementMap.forEach(element => element.diffState = DiffState.exit), this._finalParameters = this.parameters();
@@ -45614,9 +45869,49 @@
45614
45869
  el.updateData(DefaultKey, DefaultMarkData, () => "", this.view), this.elements = [el], this.elementMap.set(DefaultKey, el);
45615
45870
  }
45616
45871
  }
45872
+ getChannelsFromConfig(element) {
45873
+ const spec = this.spec,
45874
+ initAttrs = {};
45875
+ return isNil$3(spec.clip) || (initAttrs.clip = spec.clip), isNil$3(spec.zIndex) || (initAttrs.zIndex = spec.zIndex), isNil$3(spec.clipPath) || (initAttrs.path = isFunction$1(spec.clipPath) ? spec.clipPath([element]) : spec.clipPath), isNil$3(spec.interactive) || (initAttrs.pickable = spec.interactive), initAttrs;
45876
+ }
45877
+ evaluateGroupEncode(elements, groupEncode, parameters) {
45878
+ var _a;
45879
+ const el = this.elements[0],
45880
+ nextAttrs = {},
45881
+ items = [Object.assign({}, null === (_a = el.items) || void 0 === _a ? void 0 : _a[0], {
45882
+ nextAttrs: nextAttrs
45883
+ })];
45884
+ return invokeEncoderToItems(el, items, groupEncode, parameters), this._groupEncodeResult = nextAttrs, nextAttrs;
45885
+ }
45886
+ evaluateEncode(elements, encoders, parameters, noGroupEncode) {
45887
+ const initAttrs = this.getChannelsFromConfig();
45888
+ if (encoders) {
45889
+ this.emit(exports.VGRAMMAR_HOOK_EVENT.BEFORE_ELEMENT_ENCODE, {
45890
+ encoders: encoders,
45891
+ parameters: parameters
45892
+ }, this);
45893
+ const groupEncodeAttrs = noGroupEncode ? null : this.evaluateGroupEncode(elements, encoders[BuiltInEncodeNames.group], parameters);
45894
+ elements.forEach(element => {
45895
+ element.items.forEach(item => {
45896
+ item.nextAttrs = Object.assign(item.nextAttrs, initAttrs, groupEncodeAttrs);
45897
+ }), element.encodeItems(element.items, encoders, this._isReentered, parameters);
45898
+ }), this._isReentered = !1, this.evaluateTransform(this._getTransformsAfterEncodeItems(), elements, parameters), elements.forEach(element => {
45899
+ element.encodeGraphic();
45900
+ }), this.emit(exports.VGRAMMAR_HOOK_EVENT.AFTER_ELEMENT_ENCODE, {
45901
+ encoders: encoders,
45902
+ parameters: parameters
45903
+ }, this);
45904
+ } else elements.forEach(element => {
45905
+ element.initGraphicItem(initAttrs);
45906
+ });
45907
+ }
45617
45908
  addGraphicItem(attrs, groupKey, newGraphicItem) {
45618
45909
  const graphicItem = null != newGraphicItem ? newGraphicItem : createGraphicItem(this, this.markType, attrs);
45619
- if (graphicItem) return this.emit(exports.VGRAMMAR_HOOK_EVENT.BEFORE_ADD_VRENDER_MARK), graphicItem.name = `${this.id() || this.markType}`, this.graphicParent.insertIntoKeepIdx(graphicItem, this.graphicIndex), this.emit(exports.VGRAMMAR_HOOK_EVENT.AFTER_ADD_VRENDER_MARK), graphicItem;
45910
+ if (graphicItem) return this.emit(exports.VGRAMMAR_HOOK_EVENT.BEFORE_ADD_VRENDER_MARK, {
45911
+ graphicItem: graphicItem
45912
+ }), graphicItem.name = `${this.id() || this.markType}`, this.graphicParent.insertIntoKeepIdx(graphicItem, this.graphicIndex), this.emit(exports.VGRAMMAR_HOOK_EVENT.AFTER_ADD_VRENDER_MARK, {
45913
+ graphicItem: graphicItem
45914
+ }), graphicItem;
45620
45915
  }
45621
45916
  };
45622
45917
 
@@ -46226,10 +46521,11 @@
46226
46521
  }, null, !0), this) : this;
46227
46522
  }
46228
46523
  animateAddition(additionMark) {
46229
- return additionMark.animate.animate(), this._additionalAnimateMarks.push(additionMark), this;
46524
+ const animate = additionMark.animate.animate();
46525
+ return animate && animate.isAnimating() && this._additionalAnimateMarks.push(additionMark), this;
46230
46526
  }
46231
46527
  release() {
46232
- this._additionalAnimateMarks = [], this._view.removeEventListener(exports.VGRAMMAR_HOOK_EVENT.ALL_ANIMATION_START, this._onAnimationStart), this._view.removeEventListener(exports.VGRAMMAR_HOOK_EVENT.ALL_ANIMATION_END, this._onAnimationEnd);
46528
+ this._additionalAnimateMarks = [], this._animations = [], this._view.removeEventListener(exports.VGRAMMAR_HOOK_EVENT.ALL_ANIMATION_START, this._onAnimationStart), this._view.removeEventListener(exports.VGRAMMAR_HOOK_EVENT.ALL_ANIMATION_END, this._onAnimationEnd), this._view = null;
46233
46529
  }
46234
46530
  }
46235
46531
 
@@ -46924,7 +47220,11 @@
46924
47220
  mode: this.mode,
46925
47221
  skipDefault: this.spec.skipTheme
46926
47222
  });
46927
- return this.emit(exports.VGRAMMAR_HOOK_EVENT.BEFORE_ADD_VRENDER_MARK), this.graphicParent.appendChild(graphicItem), this.emit(exports.VGRAMMAR_HOOK_EVENT.AFTER_ADD_VRENDER_MARK), graphicItem;
47223
+ return graphicItem && (this.emit(exports.VGRAMMAR_HOOK_EVENT.BEFORE_ADD_VRENDER_MARK, {
47224
+ graphicItem: graphicItem
47225
+ }), this.graphicParent.appendChild(graphicItem), this.emit(exports.VGRAMMAR_HOOK_EVENT.AFTER_ADD_VRENDER_MARK, {
47226
+ graphicItem: graphicItem
47227
+ })), graphicItem;
46928
47228
  }
46929
47229
  join(data) {
46930
47230
  return super.join(data, DefaultKey);
@@ -47613,7 +47913,7 @@
47613
47913
  }
47614
47914
  release() {
47615
47915
  var _a, _b, _c;
47616
- this.releaseStageEvent(), this._unBindResizeEvent(), this.clearProgressive(), Factory$1.unregisterRuntimeTransforms(), this.animate.stop(), this.grammars.release(), this._cachedGrammars.release(), this._dataflow.release(), this._dataflow = null, null === (_b = null === (_a = this.renderer) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a), this.renderer = null, this._boundInteractions = null, this.removeAllListeners(), null === (_c = this._eventListeners) || void 0 === _c || _c.forEach(listener => {
47916
+ this.removeAllInteractions(), this.releaseStageEvent(), this._unBindResizeEvent(), this.clearProgressive(), Factory$1.unregisterRuntimeTransforms(), this.animate.stop(), this.grammars.release(), this._cachedGrammars.release(), this._dataflow.release(), this._dataflow = null, null === (_b = null === (_a = this.renderer) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a), this.renderer = null, this._boundInteractions = null, this.removeAllListeners(), null === (_c = this._eventListeners) || void 0 === _c || _c.forEach(listener => {
47617
47917
  listener.source.removeEventListener(listener.type, listener.handler);
47618
47918
  }), this._eventListeners = null;
47619
47919
  }
@@ -52358,7 +52658,7 @@
52358
52658
  visible: true,
52359
52659
  style: {
52360
52660
  stroke: { type: 'palette', key: 'markLineStrokeColor' },
52361
- fill: { type: 'palette', key: 'axisGridColor' },
52661
+ fill: 'transparent',
52362
52662
  opacity: 0.7,
52363
52663
  lineDash: [2, 3]
52364
52664
  }
@@ -54132,11 +54432,29 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54132
54432
  };
54133
54433
  this.dispatch(listenerParams.type, params);
54134
54434
  };
54435
+ this._onDelegateInteractionEvent = (listenerParams) => {
54436
+ const chart = this.globalInstance.getChart();
54437
+ const event = listenerParams.event;
54438
+ let items = null;
54439
+ if (event.elements) {
54440
+ items = event.elements;
54441
+ }
54442
+ const params = {
54443
+ event: listenerParams.event,
54444
+ chart,
54445
+ items,
54446
+ datums: items &&
54447
+ items.map(item => {
54448
+ return item.getDatum();
54449
+ })
54450
+ };
54451
+ this.dispatch(listenerParams.type, params);
54452
+ };
54135
54453
  this.globalInstance = vchart;
54136
54454
  this._compiler = compiler;
54137
54455
  }
54138
54456
  register(eType, handler) {
54139
- var _a, _b, _c, _d;
54457
+ var _a, _b, _c, _d, _e;
54140
54458
  this._parseQuery(handler);
54141
54459
  const bubbles = this.getEventBubble(((_a = handler.filter) === null || _a === void 0 ? void 0 : _a.source) || exports.Event_Source_Type.chart);
54142
54460
  const listeners = this.getEventListeners(((_b = handler.filter) === null || _b === void 0 ? void 0 : _b.source) || exports.Event_Source_Type.chart);
@@ -54150,6 +54468,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54150
54468
  this._compiler.addEventListener((_d = handler.filter) === null || _d === void 0 ? void 0 : _d.source, eType, callback);
54151
54469
  listeners.set(eType, callback);
54152
54470
  }
54471
+ else if (this._isInteractionEvent(eType) && !listeners.has(eType)) {
54472
+ const callback = this._onDelegateInteractionEvent.bind(this);
54473
+ this._compiler.addEventListener((_e = handler.filter) === null || _e === void 0 ? void 0 : _e.source, eType, callback);
54474
+ listeners.set(eType, callback);
54475
+ }
54153
54476
  return this;
54154
54477
  }
54155
54478
  unregister(eType, handler) {
@@ -54378,6 +54701,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54378
54701
  _isValidEvent(eType) {
54379
54702
  return BASE_EVENTS.includes(eType) || Object.values(exports.VGRAMMAR_HOOK_EVENT).includes(eType);
54380
54703
  }
54704
+ _isInteractionEvent(eType) {
54705
+ let interactionType;
54706
+ return (eType &&
54707
+ ((interactionType = eType.split(':')[0]), interactionType) &&
54708
+ Factory$1.hasInteraction(interactionType));
54709
+ }
54381
54710
  }
54382
54711
 
54383
54712
  function registerDataSetInstanceTransform(dataSet, name, transform) {
@@ -54745,7 +55074,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54745
55074
  if (this._compileChart) {
54746
55075
  const region = this._compileChart.getRegionsInIds([regionCombindInteractions[key].regionId])[0];
54747
55076
  if (region) {
54748
- region.interaction.addVgrammarInteraction(regionCombindInteractions[key].vchartState, interaction);
55077
+ region.interaction.addVgrammarInteraction(interaction.getStartState(), interaction);
54749
55078
  }
54750
55079
  }
54751
55080
  });
@@ -55354,6 +55683,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
55354
55683
  this._disableTriggerEvent = false;
55355
55684
  }
55356
55685
  addVgrammarInteraction(state, i) {
55686
+ if (!state) {
55687
+ return;
55688
+ }
55357
55689
  if (!this._vgrammarInteractions.get(state)) {
55358
55690
  !this._vgrammarInteractions.set(state, [i]);
55359
55691
  }
@@ -57949,15 +58281,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
57949
58281
  this.state.compileState(this._product, this._stateSort);
57950
58282
  }
57951
58283
  compileAnimation() {
57952
- var _a, _b;
58284
+ var _a, _b, _c, _d;
57953
58285
  if (this._animationConfig) {
57954
58286
  let stateSignal;
57955
58287
  if (this.type === 'component') {
57956
58288
  stateSignal = (_a = this.model.animate) === null || _a === void 0 ? void 0 : _a.getAnimationStateSignalName();
57957
58289
  }
57958
58290
  else {
57959
- const region = this.model.getRegion();
57960
- stateSignal = (_b = region.animate) === null || _b === void 0 ? void 0 : _b.getAnimationStateSignalName();
58291
+ const region = (_c = (_b = this.model).getRegion) === null || _c === void 0 ? void 0 : _c.call(_b);
58292
+ stateSignal = (_d = region === null || region === void 0 ? void 0 : region.animate) === null || _d === void 0 ? void 0 : _d.getAnimationStateSignalName();
57961
58293
  }
57962
58294
  this._product.animation(this._animationConfig);
57963
58295
  this._product.animationState({
@@ -58434,7 +58766,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
58434
58766
  return this._marks;
58435
58767
  }
58436
58768
  _getDefaultStyle() {
58437
- const defaultStyle = Object.assign(Object.assign({}, super._getDefaultStyle()), { clip: false });
58769
+ const defaultStyle = Object.assign({}, super._getDefaultStyle());
58438
58770
  return defaultStyle;
58439
58771
  }
58440
58772
  isMarkExist(mark) {
@@ -64190,7 +64522,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64190
64522
  registerComponentPlugin(CanvasTooltipHandler);
64191
64523
  };
64192
64524
 
64193
- const version = "1.10.2-alpha.3";
64525
+ const version = "1.10.2";
64194
64526
 
64195
64527
  const addVChartProperty = (data, op) => {
64196
64528
  const context = op.beforeCall();
@@ -65209,6 +65541,32 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65209
65541
  var _a;
65210
65542
  return (_a = this._viewStackData) === null || _a === void 0 ? void 0 : _a.latestData;
65211
65543
  }
65544
+ _parseSelectorOfInteraction(interactionSpec, marks) {
65545
+ if (!marks || !marks.length) {
65546
+ return [];
65547
+ }
65548
+ const selector = [];
65549
+ if (interactionSpec.markIds) {
65550
+ marks.filter(mark => {
65551
+ if (interactionSpec.markIds.includes(mark.getProductId())) {
65552
+ selector.push(`#${mark.getProductId()}`);
65553
+ }
65554
+ });
65555
+ }
65556
+ else if (interactionSpec.markNames) {
65557
+ marks.forEach(mark => {
65558
+ if (interactionSpec.markNames.includes(mark.name)) {
65559
+ selector.push(`#${mark.getProductId()}`);
65560
+ }
65561
+ });
65562
+ }
65563
+ else {
65564
+ marks.forEach(mark => {
65565
+ selector.push(`#${mark.getProductId()}`);
65566
+ });
65567
+ }
65568
+ return selector;
65569
+ }
65212
65570
  _parseDefaultInteractionConfig(mainMarks) {
65213
65571
  var _a;
65214
65572
  if (!(mainMarks === null || mainMarks === void 0 ? void 0 : mainMarks.length)) {
@@ -65235,31 +65593,33 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65235
65593
  }
65236
65594
  const res = [];
65237
65595
  if (finalHoverSpec.enable) {
65238
- res.push({
65239
- vchartState: STATE_VALUE_ENUM.STATE_HOVER,
65240
- seriesId: this.id,
65241
- regionId: this._region.id,
65242
- selector: mainMarks.map(mark => `#${mark.getProductId()}`),
65243
- type: 'element-highlight',
65244
- trigger: finalHoverSpec.trigger,
65245
- triggerOff: finalHoverSpec.triggerOff,
65246
- blurState: STATE_VALUE_ENUM.STATE_HOVER_REVERSE,
65247
- highlightState: STATE_VALUE_ENUM.STATE_HOVER
65248
- });
65596
+ const selector = this._parseSelectorOfInteraction(finalHoverSpec, mainMarks);
65597
+ selector.length &&
65598
+ res.push({
65599
+ seriesId: this.id,
65600
+ regionId: this._region.id,
65601
+ selector,
65602
+ type: 'element-highlight',
65603
+ trigger: finalHoverSpec.trigger,
65604
+ triggerOff: finalHoverSpec.triggerOff,
65605
+ blurState: STATE_VALUE_ENUM.STATE_HOVER_REVERSE,
65606
+ highlightState: STATE_VALUE_ENUM.STATE_HOVER
65607
+ });
65249
65608
  }
65250
65609
  if (finalSelectSpec.enable) {
65251
- res.push({
65252
- vchartState: STATE_VALUE_ENUM.STATE_SELECTED,
65253
- type: 'element-select',
65254
- seriesId: this.id,
65255
- regionId: this._region.id,
65256
- selector: mainMarks.map(mark => `#${mark.getProductId()}`),
65257
- trigger: finalSelectSpec.trigger,
65258
- triggerOff: ((_a = finalSelectSpec.triggerOff) !== null && _a !== void 0 ? _a : 'empty'),
65259
- reverseState: STATE_VALUE_ENUM.STATE_SELECTED_REVERSE,
65260
- state: STATE_VALUE_ENUM.STATE_SELECTED,
65261
- isMultiple: finalSelectSpec.mode === 'multiple'
65262
- });
65610
+ const selector = this._parseSelectorOfInteraction(finalSelectSpec, mainMarks);
65611
+ selector.length &&
65612
+ res.push({
65613
+ type: 'element-select',
65614
+ seriesId: this.id,
65615
+ regionId: this._region.id,
65616
+ selector,
65617
+ trigger: finalSelectSpec.trigger,
65618
+ triggerOff: ((_a = finalSelectSpec.triggerOff) !== null && _a !== void 0 ? _a : 'empty'),
65619
+ reverseState: STATE_VALUE_ENUM.STATE_SELECTED_REVERSE,
65620
+ state: STATE_VALUE_ENUM.STATE_SELECTED,
65621
+ isMultiple: finalSelectSpec.mode === 'multiple'
65622
+ });
65263
65623
  }
65264
65624
  return res;
65265
65625
  }
@@ -65277,26 +65637,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65277
65637
  }
65278
65638
  if (interactions && interactions.length) {
65279
65639
  interactions.forEach(interaction => {
65280
- const selectors = [];
65281
- if (interaction.markIds) {
65282
- this.getMarks().filter(mark => {
65283
- if (interaction.markIds.includes(mark.getProductId())) {
65284
- selectors.push(`#${mark.getProductId()}`);
65285
- }
65286
- });
65287
- }
65288
- else if (interaction.markNames) {
65289
- this.getMarks().forEach(mark => {
65290
- if (interaction.markNames.includes(mark.name)) {
65291
- selectors.push(`#${mark.getProductId()}`);
65292
- }
65293
- });
65294
- }
65295
- else if (mainMarks === null || mainMarks === void 0 ? void 0 : mainMarks.length) {
65296
- mainMarks.forEach(mark => {
65297
- selectors.push(`#${mark.getProductId()}`);
65298
- });
65299
- }
65640
+ const selectors = this._parseSelectorOfInteraction(interaction, this.getMarks());
65300
65641
  if (selectors.length) {
65301
65642
  compiler.addInteraction(Object.assign(Object.assign({}, interaction), { selector: selectors, seriesId: this.id, regionId: this._region.id }));
65302
65643
  }
@@ -94395,7 +94736,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
94395
94736
  var _a;
94396
94737
  const series = this._getSeries();
94397
94738
  if ((_a = series.getSpec().totalLabel) === null || _a === void 0 ? void 0 : _a.visible) {
94398
- const mark = series.getMarksInType(["rect", "symbol"])[0];
94739
+ const mark = series.getMarkInName(series.type);
94399
94740
  const textMark = this._createMark({ type: "label", name: `${mark.name}-total-label` });
94400
94741
  this._baseMark = mark;
94401
94742
  this._textMark = textMark;
@@ -95262,11 +95603,24 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
95262
95603
  this.initMarks();
95263
95604
  this.initEvent();
95264
95605
  }
95606
+ getMarkAttributeContext() {
95607
+ return this._markAttributeContext;
95608
+ }
95609
+ _buildMarkAttributeContext() {
95610
+ this._markAttributeContext = {
95611
+ vchart: this._option.globalInstance,
95612
+ globalScale: (key, value) => {
95613
+ var _a;
95614
+ return (_a = this._option.globalScale.getScale(key)) === null || _a === void 0 ? void 0 : _a.scale(value);
95615
+ }
95616
+ };
95617
+ }
95265
95618
  initMarks() {
95266
95619
  if (!this._spec) {
95267
95620
  return;
95268
95621
  }
95269
95622
  const series = this._option && this._option.getAllSeries();
95623
+ const hasAnimation = this._option.animation !== false;
95270
95624
  const depend = [];
95271
95625
  if (series && series.length) {
95272
95626
  series.forEach(s => {
@@ -95279,7 +95633,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
95279
95633
  });
95280
95634
  }
95281
95635
  this._spec.forEach((m, i) => {
95282
- this._createExtensionMark(m, null, `${PREFIX}_series_${this.id}_extensionMark`, i, { depend });
95636
+ this._createExtensionMark(m, null, `${PREFIX}_series_${this.id}_extensionMark`, i, { depend, hasAnimation });
95283
95637
  });
95284
95638
  }
95285
95639
  _createExtensionMark(spec, parentMark, namePrefix, index, options) {
@@ -95296,6 +95650,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
95296
95650
  if (!mark) {
95297
95651
  return;
95298
95652
  }
95653
+ if (options.hasAnimation) {
95654
+ const config = animationConfig({}, userAnimationConfig(spec.type, spec, this._markAttributeContext));
95655
+ mark.setAnimationConfig(config);
95656
+ }
95299
95657
  if (options.depend && options.depend.length) {
95300
95658
  mark.setDepend(...options.depend);
95301
95659
  }