@visactor/vchart 1.11.2 → 1.11.3

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 (86) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +243 -150
  3. package/build/index.js +243 -149
  4. package/build/index.min.js +1 -1
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/chart/base/base-chart.js +5 -0
  7. package/cjs/chart/base/base-chart.js.map +1 -1
  8. package/cjs/chart/sankey/sankey.js +5 -3
  9. package/cjs/chart/sankey/sankey.js.map +1 -1
  10. package/cjs/chart/stack.js +2 -1
  11. package/cjs/compile/grammar-item.js +1 -2
  12. package/cjs/component/data-zoom/data-filter-base-component.d.ts +0 -1
  13. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  14. package/cjs/component/data-zoom/data-zoom/data-zoom.d.ts +1 -1
  15. package/cjs/component/data-zoom/data-zoom/data-zoom.js +19 -5
  16. package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  17. package/cjs/component/data-zoom/data-zoom/interface.d.ts +1 -0
  18. package/cjs/component/data-zoom/data-zoom/interface.js.map +1 -1
  19. package/cjs/component/legend/continuous/legend.js +2 -1
  20. package/cjs/component/legend/continuous/legend.js.map +1 -1
  21. package/cjs/constant/scroll-bar.js +1 -2
  22. package/cjs/constant/waterfall.js +2 -1
  23. package/cjs/core/index.d.ts +1 -1
  24. package/cjs/core/index.js +1 -1
  25. package/cjs/core/index.js.map +1 -1
  26. package/cjs/core/instance-manager.js +2 -1
  27. package/cjs/data/transforms/legend-data/continuous/continuous.js +4 -3
  28. package/cjs/data/transforms/legend-data/continuous/continuous.js.map +1 -1
  29. package/cjs/data/transforms/legend-data/continuous/interface.d.ts +1 -0
  30. package/cjs/data/transforms/legend-data/continuous/interface.js.map +1 -1
  31. package/cjs/event/event-dispatcher.js +1 -2
  32. package/cjs/index.d.ts +1 -0
  33. package/cjs/index.js +5 -4
  34. package/cjs/index.js.map +1 -1
  35. package/cjs/series/bar/bar.d.ts +0 -1
  36. package/cjs/series/bar/bar.js +31 -26
  37. package/cjs/series/bar/bar.js.map +1 -1
  38. package/cjs/series/interface/series.d.ts +1 -0
  39. package/cjs/series/interface/series.js.map +1 -1
  40. package/cjs/series/treemap/treemap.d.ts +1 -0
  41. package/cjs/series/treemap/treemap.js +2 -1
  42. package/cjs/series/treemap/treemap.js.map +1 -1
  43. package/cjs/util/hierarchy.d.ts +2 -0
  44. package/cjs/util/hierarchy.js +16 -3
  45. package/cjs/util/hierarchy.js.map +1 -1
  46. package/esm/chart/base/base-chart.js +5 -0
  47. package/esm/chart/base/base-chart.js.map +1 -1
  48. package/esm/chart/sankey/sankey.js +5 -3
  49. package/esm/chart/sankey/sankey.js.map +1 -1
  50. package/esm/chart/stack.js +2 -1
  51. package/esm/compile/grammar-item.js +1 -2
  52. package/esm/component/data-zoom/data-filter-base-component.d.ts +0 -1
  53. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  54. package/esm/component/data-zoom/data-zoom/data-zoom.d.ts +1 -1
  55. package/esm/component/data-zoom/data-zoom/data-zoom.js +19 -5
  56. package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  57. package/esm/component/data-zoom/data-zoom/interface.d.ts +1 -0
  58. package/esm/component/data-zoom/data-zoom/interface.js.map +1 -1
  59. package/esm/component/legend/continuous/legend.js +2 -1
  60. package/esm/component/legend/continuous/legend.js.map +1 -1
  61. package/esm/constant/scroll-bar.js +1 -2
  62. package/esm/constant/waterfall.js +2 -1
  63. package/esm/core/index.d.ts +1 -1
  64. package/esm/core/index.js +1 -1
  65. package/esm/core/index.js.map +1 -1
  66. package/esm/core/instance-manager.js +2 -1
  67. package/esm/data/transforms/legend-data/continuous/continuous.js +4 -2
  68. package/esm/data/transforms/legend-data/continuous/continuous.js.map +1 -1
  69. package/esm/data/transforms/legend-data/continuous/interface.d.ts +1 -0
  70. package/esm/data/transforms/legend-data/continuous/interface.js.map +1 -1
  71. package/esm/event/event-dispatcher.js +1 -2
  72. package/esm/index.d.ts +1 -0
  73. package/esm/index.js +2 -0
  74. package/esm/index.js.map +1 -1
  75. package/esm/series/bar/bar.d.ts +0 -1
  76. package/esm/series/bar/bar.js +31 -26
  77. package/esm/series/bar/bar.js.map +1 -1
  78. package/esm/series/interface/series.d.ts +1 -0
  79. package/esm/series/interface/series.js.map +1 -1
  80. package/esm/series/treemap/treemap.d.ts +1 -0
  81. package/esm/series/treemap/treemap.js +2 -1
  82. package/esm/series/treemap/treemap.js.map +1 -1
  83. package/esm/util/hierarchy.d.ts +2 -0
  84. package/esm/util/hierarchy.js +14 -0
  85. package/esm/util/hierarchy.js.map +1 -1
  86. package/package.json +15 -15
package/build/index.js CHANGED
@@ -16858,6 +16858,7 @@
16858
16858
  var _a;
16859
16859
  if (!states.length) return void this.clearStates(hasAnimation);
16860
16860
  if (!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) !== states.length || states.some((stateName, index) => this.currentStates[index] !== stateName))) return;
16861
+ this.stopStateAnimates();
16861
16862
  const stateAttrs = {},
16862
16863
  subAttrs = this.subGraphic.map(() => ({}));
16863
16864
  states.forEach(stateName => {
@@ -16871,9 +16872,9 @@
16871
16872
  }), this.updateNormalAttrs(stateAttrs), this.currentStates = states, this.applyStateAttrs(stateAttrs, states, hasAnimation);
16872
16873
  }
16873
16874
  clearStates(hasAnimation) {
16874
- this.hasState() && this.normalAttrs && (this.subGraphic.forEach(graphic => {
16875
+ this.stopStateAnimates(), this.hasState() && this.normalAttrs ? (this.currentStates = [], this.subGraphic.forEach(graphic => {
16875
16876
  graphic.applyStateAttrs(graphic.normalAttrs, this.currentStates, hasAnimation, !0), graphic.normalAttrs = null;
16876
- }), this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0), this.normalAttrs = null, this.currentStates = []);
16877
+ }), this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [], this.normalAttrs = null;
16877
16878
  }
16878
16879
  clone() {
16879
16880
  const glyph = new Glyph(Object.assign({}, this.attribute));
@@ -18388,7 +18389,7 @@
18388
18389
  onClearIncremental: new SyncHook(["graphic", "group", "stage"]),
18389
18390
  beforeUpdateAABBBounds: new SyncHook(["graphic", "stage", "willUpdate", "aabbBounds"]),
18390
18391
  afterUpdateAABBBounds: new SyncHook(["graphic", "stage", "aabbBounds", "globalAABBBounds", "selfChange"])
18391
- }, this.tempAABBBounds1 = new AABBBounds(), this.tempAABBBounds2 = new AABBBounds(), this._rectBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._symbolBoundsContribitions = [new DefaultSymbolOuterBorderBoundsContribution()], this._circleBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._arcBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._pathBoundsContribitions = [new DefaultOuterBorderBoundsContribution()];
18392
+ }, this.tempAABBBounds1 = new AABBBounds(), this.tempAABBBounds2 = new AABBBounds(), this._rectBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._symbolBoundsContribitions = [new DefaultSymbolOuterBorderBoundsContribution()], this._imageBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._circleBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._arcBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._pathBoundsContribitions = [new DefaultOuterBorderBoundsContribution()];
18392
18393
  }
18393
18394
  onAttributeUpdate(graphic) {
18394
18395
  this.hooks.onAttributeUpdate.taps.length && this.hooks.onAttributeUpdate.call(graphic);
@@ -18789,7 +18790,9 @@
18789
18790
  }
18790
18791
  const tb1 = this.tempAABBBounds1,
18791
18792
  tb2 = this.tempAABBBounds2;
18792
- return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, imageTheme, !1, graphic), aabbBounds;
18793
+ return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this._imageBoundsContribitions.length && this._imageBoundsContribitions.forEach(c => {
18794
+ c.updateBounds(attribute, imageTheme, tb1, graphic), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
18795
+ }), this.transformAABBBounds(attribute, aabbBounds, imageTheme, !1, graphic), aabbBounds;
18793
18796
  }
18794
18797
  combindShadowAABBBounds(bounds, graphic) {
18795
18798
  if (graphic && graphic.shadowRoot) {
@@ -19720,70 +19723,6 @@
19720
19723
  return path.closePath(), path;
19721
19724
  }
19722
19725
 
19723
- class DefaultImageBackgroundRenderContribution extends DefaultBaseBackgroundRenderContribution {
19724
- constructor() {
19725
- super(...arguments), this.time = BaseRenderContributionTime.beforeFillStroke;
19726
- }
19727
- drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
19728
- const {
19729
- background: background,
19730
- backgroundMode = graphicAttribute.backgroundMode,
19731
- backgroundFit = graphicAttribute.backgroundFit
19732
- } = graphic.attribute;
19733
- if (background) if (graphic.backgroundImg) {
19734
- const res = graphic.resources.get(background);
19735
- if ("success" !== res.state || !res.data) return;
19736
- if (context.save(), graphic.parent && !graphic.transMatrix.onlyTranslate()) {
19737
- const groupAttribute = getTheme$1(graphic.parent).group,
19738
- {
19739
- scrollX = groupAttribute.scrollX,
19740
- scrollY = groupAttribute.scrollY
19741
- } = graphic.parent.attribute;
19742
- context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.translate(scrollX, scrollY);
19743
- }
19744
- const b = graphic.AABBBounds;
19745
- this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
19746
- } else if (isObject$2(background)) {
19747
- const {
19748
- stroke: stroke,
19749
- fill: fill,
19750
- lineWidth = 1,
19751
- cornerRadius = 0,
19752
- expandX = 0,
19753
- expandY = 0
19754
- } = background;
19755
- if (!stroke && !fill) return;
19756
- context.beginPath();
19757
- const {
19758
- x: x,
19759
- y: y,
19760
- width: width,
19761
- height: height
19762
- } = getActualPosition(graphic);
19763
- cornerRadius ? createRectPath(context, x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY, cornerRadius) : context.rect(x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY), context.globalAlpha = 1, fill && (context.fillStyle = fill, context.fill()), stroke && lineWidth > 0 && (context.lineWidth = lineWidth, context.strokeStyle = stroke, context.stroke());
19764
- } else {
19765
- context.beginPath();
19766
- const b = graphic.AABBBounds;
19767
- context.rect(x, y, b.width(), b.height()), context.fillStyle = background, context.globalAlpha = 1, context.fill();
19768
- }
19769
- }
19770
- }
19771
- function getActualPosition(graphic) {
19772
- const boundsPadding = parsePadding(graphic.attribute.boundsPadding),
19773
- bounds = graphic.AABBBounds;
19774
- let x = bounds.x1,
19775
- y = bounds.y1,
19776
- width = bounds.width(),
19777
- height = bounds.height();
19778
- return isNumber$1(boundsPadding) ? (x += boundsPadding, y += boundsPadding, width -= 2 * boundsPadding, height -= 2 * boundsPadding) : (x += boundsPadding[3], y += boundsPadding[0], width -= boundsPadding[1] + boundsPadding[3], height -= boundsPadding[0] + boundsPadding[2]), {
19779
- x: x,
19780
- y: y,
19781
- width: width,
19782
- height: height
19783
- };
19784
- }
19785
- const defaultImageBackgroundRenderContribution = new DefaultImageBackgroundRenderContribution();
19786
-
19787
19726
  var __decorate$1w = undefined && undefined.__decorate || function (decorators, target, key, desc) {
19788
19727
  var d,
19789
19728
  c = arguments.length,
@@ -19890,6 +19829,79 @@
19890
19829
  const defaultRectTextureRenderContribution = defaultBaseTextureRenderContribution;
19891
19830
  const defaultRectBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
19892
19831
 
19832
+ class DefaultImageBackgroundRenderContribution extends DefaultBaseBackgroundRenderContribution {
19833
+ constructor() {
19834
+ super(...arguments), this.time = BaseRenderContributionTime.beforeFillStroke;
19835
+ }
19836
+ drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
19837
+ const {
19838
+ background: background,
19839
+ backgroundMode = graphicAttribute.backgroundMode,
19840
+ backgroundFit = graphicAttribute.backgroundFit
19841
+ } = graphic.attribute;
19842
+ if (background) if (graphic.backgroundImg) {
19843
+ const res = graphic.resources.get(background);
19844
+ if ("success" !== res.state || !res.data) return;
19845
+ if (context.save(), graphic.parent && !graphic.transMatrix.onlyTranslate()) {
19846
+ const groupAttribute = getTheme$1(graphic.parent).group,
19847
+ {
19848
+ scrollX = groupAttribute.scrollX,
19849
+ scrollY = groupAttribute.scrollY
19850
+ } = graphic.parent.attribute;
19851
+ context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.translate(scrollX, scrollY);
19852
+ }
19853
+ const b = graphic.AABBBounds;
19854
+ this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
19855
+ } else if (isObject$2(background)) {
19856
+ const {
19857
+ stroke: stroke,
19858
+ fill: fill,
19859
+ lineWidth = 1,
19860
+ cornerRadius = 0,
19861
+ expandX = 0,
19862
+ expandY = 0
19863
+ } = background;
19864
+ if (!stroke && !fill) return;
19865
+ context.beginPath();
19866
+ const {
19867
+ x: x,
19868
+ y: y,
19869
+ width: width,
19870
+ height: height
19871
+ } = getActualPosition(graphic);
19872
+ cornerRadius ? createRectPath(context, x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY, cornerRadius) : context.rect(x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY), context.globalAlpha = 1, fill && (context.fillStyle = fill, context.fill()), stroke && lineWidth > 0 && (context.lineWidth = lineWidth, context.strokeStyle = stroke, context.stroke());
19873
+ } else {
19874
+ context.beginPath();
19875
+ const b = graphic.AABBBounds;
19876
+ context.rect(x, y, b.width(), b.height()), context.fillStyle = background, context.globalAlpha = 1, context.fill();
19877
+ }
19878
+ }
19879
+ }
19880
+ function getActualPosition(graphic) {
19881
+ const boundsPadding = parsePadding(graphic.attribute.boundsPadding),
19882
+ bounds = graphic.AABBBounds;
19883
+ let x = bounds.x1,
19884
+ y = bounds.y1,
19885
+ width = bounds.width(),
19886
+ height = bounds.height();
19887
+ return isNumber$1(boundsPadding) ? (x += boundsPadding, y += boundsPadding, width -= 2 * boundsPadding, height -= 2 * boundsPadding) : (x += boundsPadding[3], y += boundsPadding[0], width -= boundsPadding[1] + boundsPadding[3], height -= boundsPadding[0] + boundsPadding[2]), {
19888
+ x: x,
19889
+ y: y,
19890
+ width: width,
19891
+ height: height
19892
+ };
19893
+ }
19894
+ class DefaultImageRenderContribution extends DefaultRectRenderContribution {
19895
+ constructor() {
19896
+ super(...arguments), this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
19897
+ }
19898
+ drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
19899
+ return super.drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
19900
+ }
19901
+ }
19902
+ const defaultImageRenderContribution = new DefaultImageRenderContribution();
19903
+ const defaultImageBackgroundRenderContribution = new DefaultImageBackgroundRenderContribution();
19904
+
19893
19905
  class DefaultSymbolRenderContribution {
19894
19906
  constructor() {
19895
19907
  this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
@@ -21459,15 +21471,17 @@
21459
21471
  const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
21460
21472
  let DefaultCanvasImageRender = class extends BaseRender {
21461
21473
  constructor(imageRenderContribitions) {
21462
- super(), this.imageRenderContribitions = imageRenderContribitions, this.numberType = IMAGE_NUMBER_TYPE, this.builtinContributions = [defaultImageBackgroundRenderContribution], this.init(imageRenderContribitions);
21474
+ super(), this.imageRenderContribitions = imageRenderContribitions, this.numberType = IMAGE_NUMBER_TYPE, this.builtinContributions = [defaultImageRenderContribution, defaultImageBackgroundRenderContribution], this.init(imageRenderContribitions);
21463
21475
  }
21464
- drawShape(image, context, x, y, drawContext, params, fillCb) {
21476
+ drawShape(image, context, x, y, drawContext, params, fillCb, strokeCb) {
21465
21477
  const imageAttribute = getTheme$1(image).image,
21466
21478
  {
21467
21479
  width = imageAttribute.width,
21468
21480
  height = imageAttribute.height,
21469
21481
  repeatX = imageAttribute.repeatX,
21470
21482
  repeatY = imageAttribute.repeatY,
21483
+ x: originX = imageAttribute.x,
21484
+ y: originY = imageAttribute.y,
21471
21485
  cornerRadius = imageAttribute.cornerRadius,
21472
21486
  image: url
21473
21487
  } = image.attribute,
@@ -21492,7 +21506,7 @@
21492
21506
  } else context.drawImage(res.data, x, y, width, height);
21493
21507
  needRestore && context.restore();
21494
21508
  }
21495
- this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
21509
+ doStroke && (strokeCb ? strokeCb(context, image.attribute, imageAttribute) : sVisible && (context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute), context.stroke())), this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
21496
21510
  }
21497
21511
  draw(image, renderService, drawContext) {
21498
21512
  const {
@@ -23524,7 +23538,9 @@
23524
23538
  let _isBrowserEnv;
23525
23539
  function initIsBrowserEnv() {
23526
23540
  if (null == _isBrowserEnv) try {
23527
- _isBrowserEnv = globalThis === window, _isBrowserEnv && (_isBrowserEnv = !!document.createElement);
23541
+ const canvas = document.createElement("canvas"),
23542
+ ctx = canvas.getContext("2d");
23543
+ _isBrowserEnv = !!(window && canvas.getBoundingClientRect && requestAnimationFrame && window.devicePixelRatio && ctx && ctx.isPointInPath && ctx.isPointInStroke), _isBrowserEnv && (_isBrowserEnv = !!document.createElement);
23528
23544
  } catch (err) {
23529
23545
  _isBrowserEnv = !1;
23530
23546
  }
@@ -37404,11 +37420,11 @@
37404
37420
  start: start,
37405
37421
  end: end
37406
37422
  } = this.state;
37407
- this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || this.setStateAttr(start, end, !0), realTime && this._dispatchEvent("change", {
37423
+ this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || (this.setStateAttr(start, end, !0), realTime && this._dispatchEvent("change", {
37408
37424
  start: start,
37409
37425
  end: end,
37410
37426
  tag: this._activeTag
37411
- });
37427
+ }));
37412
37428
  }, this._onHandlerPointerMove = 0 === this.attribute.delayTime ? this._pointerMove : delayMap$2[this.attribute.delayType](this._pointerMove, this.attribute.delayTime), this._onHandlerPointerUp = e => {
37413
37429
  e.preventDefault();
37414
37430
  const {
@@ -37421,11 +37437,11 @@
37421
37437
  const pos = this.eventPosToStagePos(e);
37422
37438
  this.backgroundDragZoom(this._activeCache.startPos, pos);
37423
37439
  }
37424
- this._activeState = !1, brushSelect && this.renderDragMask(), start === this.state.start && end === this.state.end || this.setStateAttr(this.state.start, this.state.end, !0), this._dispatchEvent("change", {
37440
+ this._activeState = !1, brushSelect && this.renderDragMask(), start === this.state.start && end === this.state.end || (this.setStateAttr(this.state.start, this.state.end, !0), this._dispatchEvent("change", {
37425
37441
  start: this.state.start,
37426
37442
  end: this.state.end,
37427
37443
  tag: this._activeTag
37428
- }), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
37444
+ })), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
37429
37445
  capture: !0
37430
37446
  }), vglobal.removeEventListener("pointerup", this._onHandlerPointerUp)), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
37431
37447
  capture: !0
@@ -41515,6 +41531,7 @@
41515
41531
  return inverse && (isHorizontal ? (res.x0 = 1, res.x1 = 0) : (res.y0 = 1, res.y1 = 0)), res;
41516
41532
  }
41517
41533
  _updateColor() {
41534
+ var _a;
41518
41535
  const {
41519
41536
  layout = "horizontal",
41520
41537
  colors: colors,
@@ -41524,7 +41541,8 @@
41524
41541
  {
41525
41542
  startHandler: startHandler,
41526
41543
  endHandler: endHandler,
41527
- track: track
41544
+ track: track,
41545
+ attribute: attribute
41528
41546
  } = this._slider,
41529
41547
  {
41530
41548
  startValue: startValue,
@@ -41532,9 +41550,15 @@
41532
41550
  startPos: startPos,
41533
41551
  endPos: endPos
41534
41552
  } = this._slider.currentValue,
41535
- startHandlerColor = this._colorScale.scale(startValue),
41536
- endHandlerColor = this._colorScale.scale(endValue);
41537
- null == startHandler || startHandler.setAttribute("fill", startHandlerColor), null == endHandler || endHandler.setAttribute("fill", endHandlerColor);
41553
+ handlerColor = null === (_a = attribute.handlerStyle) || void 0 === _a ? void 0 : _a.fill;
41554
+ if (startHandler && !handlerColor) {
41555
+ const startHandlerColor = this._colorScale.scale(startValue);
41556
+ startHandler.setAttribute("fill", startHandlerColor);
41557
+ }
41558
+ if (endHandler && !handlerColor) {
41559
+ const endHandlerColor = this._colorScale.scale(endValue);
41560
+ endHandler.setAttribute("fill", endHandlerColor);
41561
+ }
41538
41562
  const railLen = "horizontal" === layout ? railWidth : railHeight;
41539
41563
  if (Math.abs(startPos - endPos) !== railLen && colors && colors.length > 1) {
41540
41564
  const stops = this._color.stops,
@@ -41579,6 +41603,7 @@
41579
41603
  },
41580
41604
  handlerSize: 10,
41581
41605
  handlerStyle: {
41606
+ fill: null,
41582
41607
  lineWidth: 4,
41583
41608
  stroke: "#fff",
41584
41609
  outerBorder: {
@@ -42671,6 +42696,7 @@
42671
42696
  this._outOfInteractiveRange(e) || ((this._activeDrawState || this._activeMoveState) && e.stopPropagation(), this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e));
42672
42697
  }, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
42673
42698
  var _a;
42699
+ if (!this._activeDrawState && !this._activeMoveState) return;
42674
42700
  e.preventDefault();
42675
42701
  const {
42676
42702
  removeOnClick = !0
@@ -44259,12 +44285,12 @@
44259
44285
  let Element$1 = class Element {
44260
44286
  constructor(mark) {
44261
44287
  this.data = null, this.states = [], this.diffState = DiffState.enter, this.isReserved = !1, this.runtimeStatesEncoder = null, this.items = [], this.getStateAttrs = (stateName, nextStates) => {
44262
- var _a, _b, _c;
44288
+ var _a, _b, _c, _d;
44263
44289
  const isRuntimeState = !isNil$1(null === (_a = this.runtimeStatesEncoder) || void 0 === _a ? void 0 : _a[stateName]),
44264
- encoder = isRuntimeState ? this.runtimeStatesEncoder[stateName] : null === (_b = this.mark.getSpec().encode) || void 0 === _b ? void 0 : _b[stateName];
44290
+ encoder = isRuntimeState ? Object.assign(Object.assign({}, null === (_b = this.mark.getSpec().encode) || void 0 === _b ? void 0 : _b[stateName]), this.runtimeStatesEncoder[stateName]) : null === (_c = this.mark.getSpec().encode) || void 0 === _c ? void 0 : _c[stateName];
44265
44291
  if (!encoder) return {};
44266
44292
  if (isFunction$1(encoder)) return encoder(this.getDatum(), this, stateName, nextStates);
44267
- if (!isRuntimeState && (null === (_c = this.graphicItem.states) || void 0 === _c ? void 0 : _c[stateName])) return this.graphicItem.states[stateName];
44293
+ if (!isRuntimeState && (null === (_d = this.graphicItem.states) || void 0 === _d ? void 0 : _d[stateName])) return this.graphicItem.states[stateName];
44268
44294
  const stateItems = this.items.map(item => Object.assign({}, item, {
44269
44295
  nextAttrs: {}
44270
44296
  }));
@@ -46060,13 +46086,13 @@
46060
46086
  class GlyphElement extends Element$1 {
46061
46087
  constructor(mark) {
46062
46088
  super(mark), this.getStateAttrs = (stateName, nextStates) => {
46063
- var _a, _b, _c;
46089
+ var _a, _b, _c, _d;
46064
46090
  const isRuntimeState = !isNil$1(null === (_a = this.runtimeStatesEncoder) || void 0 === _a ? void 0 : _a[stateName]),
46065
- encoder = isRuntimeState ? this.runtimeStatesEncoder[stateName] : null === (_b = this.mark.getSpec().encode) || void 0 === _b ? void 0 : _b[stateName],
46091
+ encoder = isRuntimeState ? Object.assign(Object.assign({}, null === (_b = this.mark.getSpec().encode) || void 0 === _b ? void 0 : _b[stateName]), this.runtimeStatesEncoder[stateName]) : null === (_c = this.mark.getSpec().encode) || void 0 === _c ? void 0 : _c[stateName],
46066
46092
  glyphStateAttributes = {};
46067
46093
  if (!encoder) return glyphStateAttributes;
46068
46094
  if (isFunction$1(encoder)) return glyphStateAttributes.attributes = encoder(this.getDatum(), this, stateName, nextStates), glyphStateAttributes;
46069
- if (!isRuntimeState && (null === (_c = this.graphicItem.glyphStates) || void 0 === _c ? void 0 : _c[stateName])) return this.graphicItem.glyphStates[stateName];
46095
+ if (!isRuntimeState && (null === (_d = this.graphicItem.glyphStates) || void 0 === _d ? void 0 : _d[stateName])) return this.graphicItem.glyphStates[stateName];
46070
46096
  if (encoder) {
46071
46097
  const item = this.items[0],
46072
46098
  targetItems = [Object.assign({}, item, {
@@ -47140,9 +47166,18 @@
47140
47166
  this.graphicIndex = markIndex;
47141
47167
  }
47142
47168
  update(spec) {
47143
- this._context = this.spec.context, this.isUpdated = !0, this.renderContext.progressive || (spec.animation && this.animate.updateConfig(spec.animation), this.animate.updateState(spec.animationState)), this.markType !== GrammarMarkType.group ? (isNil$1(spec.zIndex) || this.graphicItem.setAttribute("zIndex", spec.zIndex), isNil$1(spec.clip) || this.graphicItem.setAttribute("clip", spec.clip), isNil$1(spec.clipPath) || this.graphicItem.setAttribute("path", isArray$1(spec.clipPath) ? spec.clipPath : spec.clipPath(this.elements)), this.elementMap.forEach(element => {
47144
- element.updateGraphicItem();
47145
- })) : this.elementMap.forEach(element => {
47169
+ if (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) {
47170
+ if (isNil$1(spec.zIndex) || this.graphicItem.setAttribute("zIndex", spec.zIndex), isNil$1(spec.clip) || this.graphicItem.setAttribute("clip", spec.clip), !isNil$1(spec.clipPath)) {
47171
+ const paths = isArray$1(spec.clipPath) ? spec.clipPath : spec.clipPath(this.elements);
47172
+ paths && paths.length ? this.graphicItem.setAttribute("path", paths) : this.graphicItem.setAttributes({
47173
+ path: paths,
47174
+ clip: !1
47175
+ });
47176
+ }
47177
+ this.elementMap.forEach(element => {
47178
+ element.updateGraphicItem();
47179
+ });
47180
+ } else this.elementMap.forEach(element => {
47146
47181
  element.updateGraphicItem();
47147
47182
  });
47148
47183
  }
@@ -47446,7 +47481,11 @@
47446
47481
  getChannelsFromConfig(element) {
47447
47482
  const spec = this.spec,
47448
47483
  initAttrs = {};
47449
- return isNil$1(spec.clip) || (initAttrs.clip = spec.clip), isNil$1(spec.zIndex) || (initAttrs.zIndex = spec.zIndex), isNil$1(spec.clipPath) || (initAttrs.path = isFunction$1(spec.clipPath) ? spec.clipPath([element]) : spec.clipPath), isNil$1(spec.interactive) || (initAttrs.pickable = spec.interactive), initAttrs;
47484
+ if (isNil$1(spec.clip) || (initAttrs.clip = spec.clip), isNil$1(spec.zIndex) || (initAttrs.zIndex = spec.zIndex), !isNil$1(spec.clipPath)) {
47485
+ const paths = isFunction$1(spec.clipPath) ? spec.clipPath([element]) : spec.clipPath;
47486
+ paths && paths.length ? initAttrs.path = paths : (initAttrs.path = null, initAttrs.clip = !1);
47487
+ }
47488
+ return isNil$1(spec.interactive) || (initAttrs.pickable = spec.interactive), initAttrs;
47450
47489
  }
47451
47490
  evaluateGroupEncode(elements, groupEncode, parameters) {
47452
47491
  var _a;
@@ -55105,6 +55144,30 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
55105
55144
  dfs(hierarchyData, []);
55106
55145
  return result;
55107
55146
  };
55147
+ function isHierarchyItem(item, valueField = 'value', childrenField = 'children') {
55148
+ if (!isObject$2(item)) {
55149
+ return false;
55150
+ }
55151
+ if (item.hasOwnProperty(childrenField)) {
55152
+ return Array.isArray(item[childrenField]);
55153
+ }
55154
+ return false;
55155
+ }
55156
+ function filterHierarchyDataByRange(data, minValue, maxValue, valueField = 'value', childrenField = 'children') {
55157
+ if (!Array.isArray(data)) {
55158
+ return data;
55159
+ }
55160
+ return data
55161
+ .map(item => {
55162
+ const newItem = Object.assign({}, item);
55163
+ if (Array.isArray(newItem[childrenField])) {
55164
+ newItem[childrenField] = filterHierarchyDataByRange(newItem[childrenField], minValue, maxValue, valueField, childrenField);
55165
+ }
55166
+ return newItem;
55167
+ })
55168
+ .filter(item => (+item[valueField] >= minValue && +item[valueField] <= maxValue) ||
55169
+ (item[childrenField] && item[childrenField].length > 0));
55170
+ }
55108
55171
 
55109
55172
  function transformComponentStyle(cfg = {}) {
55110
55173
  const newConfig = Object.assign({}, cfg);
@@ -66280,7 +66343,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66280
66343
  registerComponentPlugin(CanvasTooltipHandler);
66281
66344
  };
66282
66345
 
66283
- const version = "1.11.2";
66346
+ const version = "1.11.3";
66284
66347
 
66285
66348
  const addVChartProperty = (data, op) => {
66286
66349
  const context = op.beforeCall();
@@ -71955,6 +72018,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
71955
72018
  result.reMake = true;
71956
72019
  return result;
71957
72020
  }
72021
+ for (let i = 0; i < currentKeys.length; i++) {
72022
+ const key = currentKeys[i];
72023
+ if (isArray$1(this._spec[key]) && this._spec[key].length !== spec[key].length) {
72024
+ result.reMake = true;
72025
+ return result;
72026
+ }
72027
+ }
71958
72028
  const oldSpec = this._spec;
71959
72029
  this._spec = spec;
71960
72030
  this.updateChartConfig(result, oldSpec);
@@ -73636,22 +73706,31 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73636
73706
  const xScale = (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
73637
73707
  const yScale = (_d = (_c = this._yAxisHelper) === null || _c === void 0 ? void 0 : _c.getScale) === null || _d === void 0 ? void 0 : _d.call(_c, 0);
73638
73708
  if (this.direction === "horizontal") {
73639
- this.setMarkStyle(this._barMark, {
73640
- x: datum => this._getBarXStart(datum, xScale),
73641
- x1: datum => this._getBarXEnd(datum, xScale),
73642
- y: datum => valueInScaleRange(this.dataToPositionY(datum), yScale),
73643
- y1: datum => valueInScaleRange(this.dataToPositionY1(datum), yScale)
73644
- }, 'normal', exports.AttributeLevel.Series);
73709
+ const yChannels = isValid$1(this._fieldY2)
73710
+ ? {
73711
+ y: (datum) => valueInScaleRange(this._dataToPosY(datum), yScale),
73712
+ y1: (datum) => valueInScaleRange(this._dataToPosY1(datum), yScale)
73713
+ }
73714
+ : {
73715
+ y: (datum) => valueInScaleRange(this._dataToPosY(datum) - this._getBarWidth(this._yAxisHelper) / 2, yScale),
73716
+ height: (datum) => this._getBarWidth(this._yAxisHelper)
73717
+ };
73718
+ this.setMarkStyle(this._barMark, Object.assign({ x: (datum) => this._getBarXStart(datum, xScale), x1: (datum) => this._getBarXEnd(datum, xScale) }, yChannels), 'normal', exports.AttributeLevel.Series);
73719
+ this.setMarkStyle(this._barBackgroundMark, Object.assign({ x: () => this._getBarBackgroundXStart(xScale), x1: () => this._getBarBackgroundXEnd(xScale) }, yChannels), 'normal', exports.AttributeLevel.Series);
73645
73720
  }
73646
73721
  else {
73647
- this.setMarkStyle(this._barMark, {
73648
- x: (datum) => valueInScaleRange(this.dataToPositionX(datum), xScale),
73649
- x1: (datum) => valueInScaleRange(this.dataToPositionX1(datum), xScale),
73650
- y: datum => this._getBarYStart(datum, yScale),
73651
- y1: datum => this._getBarYEnd(datum, yScale)
73652
- }, 'normal', exports.AttributeLevel.Series);
73722
+ const xChannels = isValid$1(this._fieldX2)
73723
+ ? {
73724
+ x: (datum) => valueInScaleRange(this._dataToPosX(datum), xScale),
73725
+ x1: (datum) => valueInScaleRange(this._dataToPosX1(datum), xScale)
73726
+ }
73727
+ : {
73728
+ x: (datum) => valueInScaleRange(this._dataToPosX(datum) - this._getBarWidth(this._xAxisHelper) / 2, xScale),
73729
+ width: (datum) => this._getBarWidth(this._xAxisHelper)
73730
+ };
73731
+ this.setMarkStyle(this._barMark, Object.assign(Object.assign({}, xChannels), { y: datum => this._getBarYStart(datum, yScale), y1: datum => this._getBarYEnd(datum, yScale) }), 'normal', exports.AttributeLevel.Series);
73732
+ this.setMarkStyle(this._barBackgroundMark, Object.assign(Object.assign({}, xChannels), { y: () => this._getBarBackgroundYStart(yScale), y1: () => this._getBarBackgroundYEnd(yScale) }), 'normal', exports.AttributeLevel.Series);
73653
73733
  }
73654
- this._initLinearBarBackgroundMarkStyle();
73655
73734
  }
73656
73735
  _initBandBarBackgroundMarkStyle() {
73657
73736
  var _a, _b, _c, _d, _e;
@@ -73683,27 +73762,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73683
73762
  }, 'normal', exports.AttributeLevel.Series);
73684
73763
  }
73685
73764
  }
73686
- _initLinearBarBackgroundMarkStyle() {
73687
- var _a, _b, _c, _d;
73688
- const xScale = (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
73689
- const yScale = (_d = (_c = this._yAxisHelper) === null || _c === void 0 ? void 0 : _c.getScale) === null || _d === void 0 ? void 0 : _d.call(_c, 0);
73690
- if (this.direction === "horizontal") {
73691
- this.setMarkStyle(this._barBackgroundMark, {
73692
- x: () => this._getBarBackgroundXStart(xScale),
73693
- x1: () => this._getBarBackgroundXEnd(xScale),
73694
- y: datum => valueInScaleRange(this.dataToPositionY(datum), yScale),
73695
- y1: datum => valueInScaleRange(this.dataToPositionY1(datum), yScale)
73696
- }, 'normal', exports.AttributeLevel.Series);
73697
- }
73698
- else {
73699
- this.setMarkStyle(this._barBackgroundMark, {
73700
- x: datum => valueInScaleRange(this.dataToPositionX(datum), xScale),
73701
- x1: datum => valueInScaleRange(this.dataToPositionX1(datum), xScale),
73702
- y: () => this._getBarBackgroundYStart(yScale),
73703
- y1: () => this._getBarBackgroundYEnd(yScale)
73704
- }, 'normal', exports.AttributeLevel.Series);
73705
- }
73706
- }
73707
73765
  initAnimation() {
73708
73766
  var _a, _b;
73709
73767
  const barAnimationParams = {
@@ -85929,7 +85987,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
85929
85987
  center: center,
85930
85988
  start: left,
85931
85989
  end: right
85932
- };
85990
+ },
85991
+ linkClampe = clamper(0, 1);
85933
85992
  class SankeyLayout {
85934
85993
  constructor(options) {
85935
85994
  this._ascendingSourceBreadth = (a, b) => ascendingNodeBreadth(this._nodeMap[a.source], this._nodeMap[b.source]) || a.index - b.index, this._ascendingTargetBreadth = (a, b) => ascendingNodeBreadth(this._nodeMap[a.target], this._nodeMap[b.target]) || a.index - b.index, this.options = Object.assign({}, SankeyLayout.defaultOptions, options);
@@ -86240,7 +86299,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
86240
86299
  const isStartGap = "start" === this.options.gapPosition,
86241
86300
  isMiddleGap = !isStartGap && "end" !== this.options.gapPosition,
86242
86301
  getNodeHeight = isNumber$1(this.options.nodeHeight) ? node => this.options.nodeHeight : isFunction$1(this.options.nodeHeight) ? this.options.nodeHeight : forceNodeHeight > 0 ? node => forceNodeHeight : node => Math.max(node.value * ky, minNodeHeight, 0),
86243
- getLinkHeight = isNumber$1(this.options.linkHeight) ? () => this.options.linkHeight : isFunction$1(this.options.linkHeight) ? this.options.linkHeight : (link, sourceNode, sourceNodeHeight) => Math.max(sourceNode.value ? sourceNodeHeight * link.value / sourceNode.value : 0, minLinkHeight, 0);
86302
+ getLinkHeight = isNumber$1(this.options.linkHeight) ? () => this.options.linkHeight : isFunction$1(this.options.linkHeight) ? this.options.linkHeight : (link, sourceNode, sourceNodeHeight) => Math.max(sourceNode.value ? sourceNodeHeight * linkClampe(link.value / sourceNode.value) : 0, minLinkHeight, 0);
86244
86303
  for (let i = 0, columnCount = columns.length; i < columnCount; i++) {
86245
86304
  const nodes = columns[i];
86246
86305
  if (!nodes || !nodes.length) continue;
@@ -86268,7 +86327,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
86268
86327
  }
86269
86328
  }
86270
86329
  } else if (deltaY < 0 && nodes.length > 1 && (deltaY /= nodes.length - 1, gapY + deltaY > 0)) {
86271
- gapY += deltaY;
86330
+ gapY += deltaY, this._gapY = Math.min(gapY);
86272
86331
  for (let j = 1, len = nodes.length; j < len; ++j) {
86273
86332
  const node = nodes[j];
86274
86333
  node.y0 += deltaY * j, node.y1 += deltaY * j;
@@ -86366,15 +86425,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
86366
86425
  computeLinkBreadthsNoOverlap(nodes) {
86367
86426
  for (let i = 0, len = nodes.length; i < len; i++) {
86368
86427
  const node = nodes[i];
86369
- let y0 = node.y0;
86428
+ let y0 = node.y0,
86429
+ reachBottom = !1;
86370
86430
  for (let j = 0, linkLen = node.sourceLinks.length; j < linkLen; j++) {
86371
86431
  const link = node.sourceLinks[j];
86372
- link.y0 = y0 + link.thickness / 2, link.x0 = node.x1, y0 += link.thickness;
86432
+ reachBottom || (link.y0 = y0 + link.thickness / 2), link.x0 = node.x1, y0 + link.thickness > node.y1 || reachBottom ? (link.y0 = node.y1 - link.thickness / 2, reachBottom = !0) : y0 += link.thickness;
86373
86433
  }
86374
86434
  let y1 = node.y0;
86435
+ reachBottom = !1;
86375
86436
  for (let j = 0, linkLen = node.targetLinks.length; j < linkLen; j++) {
86376
86437
  const link = node.targetLinks[j];
86377
- link.y1 = y1 + link.thickness / 2, link.x1 = node.x0, y1 += link.thickness;
86438
+ reachBottom || (link.y1 = y1 + link.thickness / 2), link.x1 = node.x0, y1 + link.thickness > node.y1 || reachBottom ? (link.y1 = node.y1 - link.thickness / 2, reachBottom = !0) : y1 += link.thickness;
86378
86439
  }
86379
86440
  }
86380
86441
  }
@@ -87806,6 +87867,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87806
87867
  this.transformerConstructor = TreemapSeriesSpecTransformer;
87807
87868
  this._viewBox = new Bounds();
87808
87869
  this._enableAnimationHook = this.enableMarkAnimation.bind(this);
87870
+ this.isHierarchyData = () => {
87871
+ return true;
87872
+ };
87809
87873
  }
87810
87874
  getCategoryField() {
87811
87875
  return this._categoryField;
@@ -92023,14 +92087,24 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
92023
92087
  r.getSeries().forEach(s => {
92024
92088
  var _a, _b;
92025
92089
  let activeNodeOrLink = null;
92026
- s.getMarks().forEach(m => {
92090
+ s.getMarksWithoutRoot().forEach(m => {
92091
+ if (m.type === 'text') {
92092
+ return;
92093
+ }
92027
92094
  let pickElement = null;
92028
92095
  const mark = m.getProduct();
92029
92096
  if (!mark) {
92030
92097
  return;
92031
92098
  }
92032
92099
  if (!filter || (isFunction$1(filter) && filter(s, m))) {
92033
- pickElement = mark.elements.find((e) => keys.every(k => { var _a, _b; return activeDatum[k] == ((_b = (_a = e.getDatum()) === null || _a === void 0 ? void 0 : _a.datum) === null || _b === void 0 ? void 0 : _b[k]); }));
92100
+ pickElement = mark.elements.find((e) => keys.every(k => {
92101
+ var _a;
92102
+ let datum = (_a = e.getDatum()) === null || _a === void 0 ? void 0 : _a.datum;
92103
+ if (isArray$1(datum)) {
92104
+ datum = datum[0];
92105
+ }
92106
+ return activeDatum[k] == (datum === null || datum === void 0 ? void 0 : datum[k]);
92107
+ }));
92034
92108
  }
92035
92109
  if (pickElement) {
92036
92110
  hasPick = true;
@@ -92753,18 +92827,26 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
92753
92827
  return [];
92754
92828
  };
92755
92829
  const continuousLegendFilter = (data, op) => {
92756
- const { selected, field, data: legendData } = op;
92830
+ const { selected, field, data: legendData, isHierarchyData } = op;
92757
92831
  const selectedRange = selected();
92758
92832
  const datumField = field();
92759
92833
  const dataRange = legendData();
92834
+ const isHierarchy = isHierarchyData
92835
+ ? isHierarchyData
92836
+ : (data) => data && data.some(d => d && isHierarchyItem(d));
92760
92837
  if (selectedRange === dataRange) {
92761
92838
  return data;
92762
92839
  }
92763
92840
  if (datumField && !isEmpty(selectedRange)) {
92764
92841
  const [min, max] = selectedRange;
92765
- return data.filter(datum => {
92766
- return datum[datumField] >= min && datum[datumField] <= max;
92767
- });
92842
+ if (isHierarchy(data)) {
92843
+ return filterHierarchyDataByRange(data, +min, +max);
92844
+ }
92845
+ else {
92846
+ return data.filter(datum => {
92847
+ return datum[datumField] >= min && datum[datumField] <= max;
92848
+ });
92849
+ }
92768
92850
  }
92769
92851
  return data;
92770
92852
  };
@@ -92868,7 +92950,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
92868
92950
  options: {
92869
92951
  selected: () => this._selectedData,
92870
92952
  field: () => this._field,
92871
- data: () => this._legendData.getLatestData()
92953
+ data: () => this._legendData.getLatestData(),
92954
+ isHierarchyData: s.isHierarchyData
92872
92955
  },
92873
92956
  level: TransformLevel.legendFilter
92874
92957
  });
@@ -95998,13 +96081,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
95998
96081
  }, orient: this._orient, size: {
95999
96082
  width: this.getLayoutRect().width,
96000
96083
  height: this.getLayoutRect().height
96001
- }, showDetail: spec.showDetail, brushSelect: (_b = spec.brushSelect) !== null && _b !== void 0 ? _b : false, zoomLock: (_c = spec.zoomLock) !== null && _c !== void 0 ? _c : false, minSpan: this._minSpan, maxSpan: this._maxSpan, delayType: spec.delayType, delayTime: isValid$1(spec.delayType) ? (_d = spec.delayTime) !== null && _d !== void 0 ? _d : 30 : 0, realTime: (_e = spec.realTime) !== null && _e !== void 0 ? _e : true, previewData: isNeedPreview && this._data.getLatestData(), previewPointsX: isNeedPreview && this._dataToPositionX, previewPointsY: isNeedPreview && this._dataToPositionY, tolerance: this._spec.tolerance }, this._getComponentAttrs());
96084
+ }, showDetail: spec.showDetail, brushSelect: (_b = spec.brushSelect) !== null && _b !== void 0 ? _b : false, zoomLock: (_c = spec.zoomLock) !== null && _c !== void 0 ? _c : false, minSpan: this._minSpan, maxSpan: this._maxSpan, delayType: spec.delayType, delayTime: isValid$1(spec.delayType) ? (_d = spec.delayTime) !== null && _d !== void 0 ? _d : 30 : 0, realTime: (_e = spec.realTime) !== null && _e !== void 0 ? _e : true, previewData: isNeedPreview && this._data.getLatestData(), previewPointsX: isNeedPreview && this._dataToPositionX, previewPointsY: isNeedPreview && this._dataToPositionY, tolerance: this._spec.tolerance }, this._getComponentAttrs(isNeedPreview));
96002
96085
  }
96003
96086
  _createOrUpdateComponent() {
96004
96087
  if (this._visible) {
96005
96088
  const xScale = this._isHorizontal ? this._stateScale : this._valueScale;
96006
96089
  const yScale = this._isHorizontal ? this._valueScale : this._stateScale;
96007
- const isNeedPreview = this._isScaleValid(xScale) && this._isScaleValid(yScale);
96090
+ const isNeedPreview = this._isScaleValid(xScale) && this._isScaleValid(yScale) && this._spec.showBackgroundChart !== false;
96008
96091
  const attrs = this._getAttrs(isNeedPreview);
96009
96092
  if (this._component) {
96010
96093
  this._component.setAttributes(attrs);
@@ -96068,7 +96151,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96068
96151
  }
96069
96152
  }
96070
96153
  }
96071
- _getComponentAttrs() {
96154
+ _getComponentAttrs(isNeedPreview) {
96072
96155
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
96073
96156
  const { middleHandler = {}, startText = {}, endText = {}, backgroundChart = {}, selectedBackgroundChart = {} } = this._spec;
96074
96157
  return {
@@ -96097,14 +96180,24 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96097
96180
  },
96098
96181
  selectedBackgroundStyle: transformToGraphic(this._spec.selectedBackground.style),
96099
96182
  dragMaskStyle: transformToGraphic((_g = this._spec.dragMask) === null || _g === void 0 ? void 0 : _g.style),
96100
- backgroundChartStyle: {
96101
- line: mergeSpec(transformToGraphic((_h = backgroundChart.line) === null || _h === void 0 ? void 0 : _h.style), { fill: false }),
96102
- area: Object.assign({ curveType: 'basis', visible: true }, transformToGraphic((_j = backgroundChart.area) === null || _j === void 0 ? void 0 : _j.style))
96103
- },
96104
- selectedBackgroundChartStyle: {
96105
- line: mergeSpec(transformToGraphic((_k = selectedBackgroundChart.line) === null || _k === void 0 ? void 0 : _k.style), { fill: false }),
96106
- area: Object.assign({ curveType: 'basis', visible: true }, transformToGraphic((_l = selectedBackgroundChart.area) === null || _l === void 0 ? void 0 : _l.style))
96107
- },
96183
+ backgroundChartStyle: isNeedPreview
96184
+ ? {
96185
+ line: mergeSpec(transformToGraphic((_h = backgroundChart.line) === null || _h === void 0 ? void 0 : _h.style), { fill: false }),
96186
+ area: Object.assign({ curveType: 'basis', visible: true }, transformToGraphic((_j = backgroundChart.area) === null || _j === void 0 ? void 0 : _j.style))
96187
+ }
96188
+ : {
96189
+ line: { visible: false },
96190
+ area: { visible: false }
96191
+ },
96192
+ selectedBackgroundChartStyle: isNeedPreview
96193
+ ? {
96194
+ line: mergeSpec(transformToGraphic((_k = selectedBackgroundChart.line) === null || _k === void 0 ? void 0 : _k.style), { fill: false }),
96195
+ area: Object.assign({ curveType: 'basis', visible: true }, transformToGraphic((_l = selectedBackgroundChart.area) === null || _l === void 0 ? void 0 : _l.style))
96196
+ }
96197
+ : {
96198
+ line: { visible: false },
96199
+ area: { visible: false }
96200
+ },
96108
96201
  disableTriggerEvent: this._option.disableTriggerEvent
96109
96202
  };
96110
96203
  }
@@ -101381,6 +101474,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
101381
101474
  exports.BarChart = BarChart;
101382
101475
  exports.BarSeries = BarSeries;
101383
101476
  exports.BaseChart = BaseChart;
101477
+ exports.BaseChartSpecTransformer = BaseChartSpecTransformer;
101384
101478
  exports.BaseMark = BaseMark;
101385
101479
  exports.BaseSeries = BaseSeries;
101386
101480
  exports.BoxPlotChart = BoxPlotChart;