@visactor/vchart 1.12.10 → 1.12.12-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +385 -132
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/index.js +2 -1
  6. package/cjs/compile/compilable-base.js +1 -2
  7. package/cjs/compile/compiler.js +2 -1
  8. package/cjs/compile/compiler.js.map +1 -1
  9. package/cjs/compile/interface/compiler.d.ts +14 -0
  10. package/cjs/compile/interface/compiler.js.map +1 -1
  11. package/cjs/compile/util.js +2 -1
  12. package/cjs/component/axis/interface/spec.d.ts +1 -0
  13. package/cjs/component/axis/interface/spec.js.map +1 -1
  14. package/cjs/component/axis/mixin/linear-axis-mixin.js +1 -1
  15. package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  16. package/cjs/component/axis/mixin/util/break-data.d.ts +1 -1
  17. package/cjs/component/axis/mixin/util/break-data.js +35 -12
  18. package/cjs/component/axis/mixin/util/break-data.js.map +1 -1
  19. package/cjs/component/title/title.js +20 -16
  20. package/cjs/component/title/title.js.map +1 -1
  21. package/cjs/component/tooltip/interface/spec.d.ts +12 -2
  22. package/cjs/component/tooltip/interface/spec.js.map +1 -1
  23. package/cjs/component/tooltip/tooltip-transformer.js +2 -3
  24. package/cjs/component/tooltip/tooltip-transformer.js.map +1 -1
  25. package/cjs/component/tooltip/tooltip.js +42 -24
  26. package/cjs/component/tooltip/tooltip.js.map +1 -1
  27. package/cjs/constant/layout.js +1 -2
  28. package/cjs/constant/scatter.js +2 -1
  29. package/cjs/core/index.d.ts +1 -1
  30. package/cjs/core/index.js +1 -1
  31. package/cjs/core/index.js.map +1 -1
  32. package/cjs/data/register.js +1 -2
  33. package/cjs/interaction/zoom/zoomable.js +2 -1
  34. package/cjs/interaction/zoom/zoomable.js.map +1 -1
  35. package/cjs/plugin/components/axis-sync/zero-align-transform.d.ts +1 -0
  36. package/cjs/plugin/components/axis-sync/zero-align-transform.js +17 -4
  37. package/cjs/plugin/components/axis-sync/zero-align-transform.js.map +1 -1
  38. package/cjs/plugin/components/tooltip-handler/base.js +1 -1
  39. package/cjs/plugin/components/tooltip-handler/base.js.map +1 -1
  40. package/cjs/plugin/components/tooltip-handler/dom/model/shape-model.js +7 -2
  41. package/cjs/plugin/components/tooltip-handler/dom/model/shape-model.js.map +1 -1
  42. package/cjs/series/base/base-series.js +2 -2
  43. package/cjs/series/base/base-series.js.map +1 -1
  44. package/cjs/series/word-cloud/base.js +9 -6
  45. package/cjs/series/word-cloud/base.js.map +1 -1
  46. package/cjs/typings/spec/common.d.ts +1 -0
  47. package/cjs/typings/spec/common.js.map +1 -1
  48. package/cjs/util/array.js +2 -1
  49. package/cjs/util/array.js.map +1 -1
  50. package/esm/chart/index.js +2 -1
  51. package/esm/compile/compilable-base.js +1 -2
  52. package/esm/compile/compiler.js +1 -1
  53. package/esm/compile/compiler.js.map +1 -1
  54. package/esm/compile/interface/compiler.d.ts +14 -0
  55. package/esm/compile/interface/compiler.js.map +1 -1
  56. package/esm/compile/util.js +2 -1
  57. package/esm/component/axis/interface/spec.d.ts +1 -0
  58. package/esm/component/axis/interface/spec.js.map +1 -1
  59. package/esm/component/axis/mixin/linear-axis-mixin.js +1 -1
  60. package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  61. package/esm/component/axis/mixin/util/break-data.d.ts +1 -1
  62. package/esm/component/axis/mixin/util/break-data.js +35 -12
  63. package/esm/component/axis/mixin/util/break-data.js.map +1 -1
  64. package/esm/component/title/title.js +20 -18
  65. package/esm/component/title/title.js.map +1 -1
  66. package/esm/component/tooltip/interface/spec.d.ts +12 -2
  67. package/esm/component/tooltip/interface/spec.js.map +1 -1
  68. package/esm/component/tooltip/tooltip-transformer.js +2 -3
  69. package/esm/component/tooltip/tooltip-transformer.js.map +1 -1
  70. package/esm/component/tooltip/tooltip.js +42 -25
  71. package/esm/component/tooltip/tooltip.js.map +1 -1
  72. package/esm/constant/layout.js +1 -2
  73. package/esm/constant/scatter.js +2 -1
  74. package/esm/core/index.d.ts +1 -1
  75. package/esm/core/index.js +1 -1
  76. package/esm/core/index.js.map +1 -1
  77. package/esm/data/register.js +1 -2
  78. package/esm/interaction/zoom/zoomable.js +2 -1
  79. package/esm/interaction/zoom/zoomable.js.map +1 -1
  80. package/esm/plugin/components/axis-sync/zero-align-transform.d.ts +1 -0
  81. package/esm/plugin/components/axis-sync/zero-align-transform.js +17 -4
  82. package/esm/plugin/components/axis-sync/zero-align-transform.js.map +1 -1
  83. package/esm/plugin/components/tooltip-handler/base.js +1 -1
  84. package/esm/plugin/components/tooltip-handler/base.js.map +1 -1
  85. package/esm/plugin/components/tooltip-handler/dom/model/shape-model.js +8 -3
  86. package/esm/plugin/components/tooltip-handler/dom/model/shape-model.js.map +1 -1
  87. package/esm/series/base/base-series.js +2 -2
  88. package/esm/series/base/base-series.js.map +1 -1
  89. package/esm/series/word-cloud/base.js +9 -6
  90. package/esm/series/word-cloud/base.js.map +1 -1
  91. package/esm/typings/spec/common.d.ts +1 -0
  92. package/esm/typings/spec/common.js.map +1 -1
  93. package/esm/util/array.js +2 -1
  94. package/esm/util/array.js.map +1 -1
  95. package/package.json +15 -15
package/build/index.js CHANGED
@@ -9579,6 +9579,14 @@
9579
9579
  return data;
9580
9580
  }
9581
9581
  _clipTextEnd(text, options, width, leftIdx, rightIdx) {
9582
+ if (leftIdx === rightIdx) {
9583
+ Logger.getInstance().warn(`【_clipTextEnd】不应该走到这里${text}, ${leftIdx}, ${rightIdx}`);
9584
+ const subText = text.substring(0, rightIdx + 1);
9585
+ return {
9586
+ str: subText,
9587
+ width: this.measureTextWidth(subText, options)
9588
+ };
9589
+ }
9582
9590
  const middleIdx = Math.floor((leftIdx + rightIdx) / 2),
9583
9591
  subText = text.substring(0, middleIdx + 1),
9584
9592
  strWidth = this.measureTextWidth(subText, options);
@@ -9612,7 +9620,7 @@
9612
9620
  }
9613
9621
  _clipTextStart(text, options, width, leftIdx, rightIdx) {
9614
9622
  const middleIdx = Math.ceil((leftIdx + rightIdx) / 2),
9615
- subText = text.substring(middleIdx - 1, text.length - 1),
9623
+ subText = text.substring(middleIdx - 1, text.length),
9616
9624
  strWidth = this.measureTextWidth(subText, options);
9617
9625
  let length;
9618
9626
  if (strWidth > width) {
@@ -9620,18 +9628,18 @@
9620
9628
  str: "",
9621
9629
  width: 0
9622
9630
  };
9623
- const str = text.substring(middleIdx, text.length - 1);
9631
+ const str = text.substring(middleIdx, text.length);
9624
9632
  return length = this.measureTextWidth(str, options), length <= width ? {
9625
9633
  str: str,
9626
9634
  width: length
9627
- } : this._clipTextStart(text, options, width, middleIdx, text.length - 1);
9635
+ } : this._clipTextStart(text, options, width, middleIdx, text.length);
9628
9636
  }
9629
9637
  if (strWidth < width) {
9630
9638
  if (middleIdx <= 0) return {
9631
9639
  str: text,
9632
9640
  width: this.measureTextWidth(text, options)
9633
9641
  };
9634
- const str = text.substring(middleIdx - 2, text.length - 1);
9642
+ const str = text.substring(middleIdx - 2, text.length);
9635
9643
  return length = this.measureTextWidth(str, options), length >= width ? {
9636
9644
  str: subText,
9637
9645
  width: strWidth
@@ -11213,7 +11221,7 @@
11213
11221
  timeStamp: now
11214
11222
  });
11215
11223
  const clickHistory = trackingData.clicksByButton[from.button];
11216
- clickHistory.target === clickEvent.target && now - clickHistory.timeStamp < (null !== (_a = this._config.clickInterval) && void 0 !== _a ? _a : 200) ? ++clickHistory.clickCount : clickHistory.clickCount = 1, clickHistory.target = clickEvent.target, clickHistory.timeStamp = now, clickEvent.detail = clickHistory.clickCount, isMouseLike(clickEvent.pointerType) ? (this.dispatchEvent(clickEvent, "click"), 2 === clickHistory.clickCount && this.dispatchEvent(clickEvent, "dblclick")) : "touch" === clickEvent.pointerType && (this.dispatchEvent(clickEvent, "tap"), 2 === clickHistory.clickCount && this.dispatchEvent(clickEvent, "dbltap")), this.dispatchEvent(clickEvent, "pointertap"), this.freeEvent(clickEvent);
11224
+ clickHistory.target === clickEvent.target && now - clickHistory.timeStamp < (null !== (_a = this._config.clickInterval) && void 0 !== _a ? _a : 200) ? ++clickHistory.clickCount : clickHistory.clickCount = 1, clickHistory.target = clickEvent.target, clickHistory.timeStamp = now, clickEvent.detail = clickHistory.clickCount, isMouseLike(clickEvent.pointerType) ? (this.dispatchEvent(clickEvent, "click"), 2 === clickHistory.clickCount && this.dispatchEvent(clickEvent, "dblclick")) : "touch" === clickEvent.pointerType && this._config.supportsTouchEvents && (this.dispatchEvent(clickEvent, "tap"), 2 === clickHistory.clickCount && this.dispatchEvent(clickEvent, "dbltap")), this.dispatchEvent(clickEvent, "pointertap"), this.freeEvent(clickEvent);
11217
11225
  }
11218
11226
  this.freeEvent(e);
11219
11227
  }, this.onPointerUpOutside = (from, target) => {
@@ -11430,7 +11438,8 @@
11430
11438
  supportsPointerEvents = global.supportsPointerEvents
11431
11439
  } = params;
11432
11440
  this.manager = new EventManager(rootNode, {
11433
- clickInterval: clickInterval
11441
+ clickInterval: clickInterval,
11442
+ supportsTouchEvents: supportsTouchEvents
11434
11443
  }), this.globalObj = global, this.supportsPointerEvents = supportsPointerEvents, this.supportsTouchEvents = supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
11435
11444
  default: "inherit",
11436
11445
  pointer: "pointer"
@@ -22750,6 +22759,42 @@
22750
22759
  }
22751
22760
  }
22752
22761
 
22762
+ class AutoRefreshPlugin {
22763
+ constructor() {
22764
+ this.name = "AutoRefreshPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid, this.handleChange = graphic => {
22765
+ graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage === this.pluginService.stage && null != graphic.stage && graphic.stage.renderNextFrame();
22766
+ };
22767
+ }
22768
+ activate(context) {
22769
+ this.pluginService = context, this.dpr = application.global.devicePixelRatio, this.refresh();
22770
+ }
22771
+ refresh() {
22772
+ this._refreshByMediaQuery() || this._refreshByRaf();
22773
+ }
22774
+ _refreshByRaf() {
22775
+ const raf = application.global.getRequestAnimationFrame();
22776
+ this.rafId = raf(() => {
22777
+ application.global.devicePixelRatio !== this.dpr && (this.dpr = application.global.devicePixelRatio, this.pluginService.stage.setDpr(this.dpr, !0)), this.refresh();
22778
+ });
22779
+ }
22780
+ _refreshByMediaQuery() {
22781
+ try {
22782
+ const mqString = `(resolution: ${window.devicePixelRatio}dppx)`,
22783
+ updatePixelRatio = () => {
22784
+ window.devicePixelRatio !== this.dpr && (this.dpr = window.devicePixelRatio, this.pluginService.stage.setDpr(this.dpr, !0));
22785
+ };
22786
+ matchMedia(mqString).addEventListener("change", updatePixelRatio);
22787
+ } catch (err) {
22788
+ return !1;
22789
+ }
22790
+ return !0;
22791
+ }
22792
+ deactivate(context) {
22793
+ const craf = application.global.getCancelAnimationFrame();
22794
+ craf && this.rafId && craf(this.rafId);
22795
+ }
22796
+ }
22797
+
22753
22798
  class IncrementalAutoRenderPlugin {
22754
22799
  constructor() {
22755
22800
  this.name = "IncrementalAutoRenderPlugin", this.activeEvent = "onRegister", this.nextFrameRenderGroupSet = new Set(), this.willNextFrameRender = !1, this.nextUserParams = {}, this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid;
@@ -22942,7 +22987,7 @@
22942
22987
  canvas: params.canvas
22943
22988
  }), 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, {
22944
22989
  main: !0
22945
- })), 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({
22990
+ })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !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({
22946
22991
  background: this._background
22947
22992
  });
22948
22993
  }
@@ -23077,6 +23122,14 @@
23077
23122
  this.pluginService.unRegister(plugin);
23078
23123
  }));
23079
23124
  }
23125
+ enableAutoRefresh() {
23126
+ this.autoRefresh || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
23127
+ }
23128
+ disableAutoRefresh() {
23129
+ this.autoRefresh && (this.autoRefresh = !1, this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach(plugin => {
23130
+ this.pluginService.unRegister(plugin);
23131
+ }));
23132
+ }
23080
23133
  enableIncrementalAutoRender() {
23081
23134
  this.increaseAutoRender || (this.increaseAutoRender = !0, this.pluginService.register(new IncrementalAutoRenderPlugin()));
23082
23135
  }
@@ -24830,7 +24883,7 @@
24830
24883
  const result = [];
24831
24884
  for (let index = 0; index < domains.length; index++) {
24832
24885
  const domain = domains[index];
24833
- if (index === 0) {
24886
+ if (index === 0 || domain[0] !== result[result.length - 1]) {
24834
24887
  result.push(domain[0]);
24835
24888
  }
24836
24889
  result.push(domain[1]);
@@ -25375,7 +25428,7 @@
25375
25428
  let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25376
25429
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
25377
25430
  super(), this.cachedEvents = [], this.startPoints = [], this.processEvent = {}, this.throttleTimer = 0, this.emitThrottles = [], this.lastTapTarget = null, this.onStart = ev => {
25378
- this.reset(), this.startTime = clock.now();
25431
+ this.cachedEvents = [], this.startPoints = [], this.reset(), this.startTime = clock.now();
25379
25432
  const {
25380
25433
  cachedEvents: cachedEvents,
25381
25434
  startPoints: startPoints
@@ -25395,7 +25448,7 @@
25395
25448
  if (1 !== startPoints.length) this.startDistance = calcDistance(startPoints[0], startPoints[1]), this.center = getCenter([startPoints[0], startPoints[1]]);else {
25396
25449
  const event = cachedEvents[0];
25397
25450
  this.pressTimeout = setTimeout(() => {
25398
- event.direction = "none", event.deltaX = 0, event.deltaY = 0, event.points = startPoints, this.triggerStartEvent("press", event), this.triggerEvent("press", event), this.eventType = "press", this.direction = "none";
25451
+ event.direction = "none", event.deltaX = 0, event.deltaY = 0, event.points = startPoints, this.triggerStartEvent("press", event), this.triggerEvent("press", event), this.eventType = "press", this.direction = "none", this.pressTimeout = null;
25399
25452
  }, this.config.press.time);
25400
25453
  }
25401
25454
  }, this.onMove = ev => {
@@ -25458,10 +25511,10 @@
25458
25511
  lastMovePoint = this.lastMovePoint || startPoints[0],
25459
25512
  distance = calcDistance(prevMovePoint, lastMovePoint),
25460
25513
  velocity = distance / intervalTime;
25461
- velocity > this.config.swipe.velocity && distance > this.config.swipe.threshold && (endEvent.velocity = velocity, endEvent.direction = calcDirection(prevMovePoint, lastMovePoint), this.triggerEvent("swipe", endEvent));
25514
+ if (velocity > this.config.swipe.velocity && distance > this.config.swipe.threshold) return endEvent.velocity = velocity, endEvent.direction = calcDirection(prevMovePoint, lastMovePoint), this.triggerEvent("swipe", endEvent), this.cachedEvents = [], this.startPoints = [], void this.reset();
25462
25515
  }
25463
25516
  }
25464
- now - this.lastTapTime < this.config.tap.interval && ev.target === this.lastTapTarget ? this.tapCount++ : this.tapCount = 1, this.lastTapTime = now, this.lastTapTarget = ev.target, 1 === this.tapCount ? this.triggerEvent("tap", endEvent) : 2 === this.tapCount && (this.triggerEvent("doubletap", endEvent), this.tapCount = 0);
25517
+ now - this.startTime < this.config.press.time && (now - this.lastTapTime < this.config.tap.interval && ev.target === this.lastTapTarget ? this.tapCount++ : this.tapCount = 1, this.lastTapTime = now, this.lastTapTarget = ev.target, 1 === this.tapCount ? this.triggerEvent("tap", endEvent) : 2 === this.tapCount && (this.triggerEvent("doubletap", endEvent), this.tapCount = 0));
25465
25518
  }
25466
25519
  for (let i = 0, len = cachedEvents.length; i < len; i++) if (cachedEvents[i].pointerId === endEvent.pointerId) {
25467
25520
  cachedEvents.splice(i, 1), startPoints.splice(i, 1);
@@ -25537,6 +25590,7 @@
25537
25590
  emitThrottles: emitThrottles
25538
25591
  } = this;
25539
25592
  throttleTimer || (this.throttleTimer = application.global.getRequestAnimationFrame()(() => {
25593
+ application.global.getCancelAnimationFrame()(this.throttleTimer), this.throttleTimer = null;
25540
25594
  for (let i = 0, len = emitThrottles.length; i < len; i++) {
25541
25595
  const {
25542
25596
  type: type,
@@ -25544,7 +25598,7 @@
25544
25598
  } = emitThrottles[i];
25545
25599
  this.emitEvent(type, ev);
25546
25600
  }
25547
- this.throttleTimer = 0, this.emitThrottles.length = 0;
25601
+ this.emitThrottles.length = 0;
25548
25602
  }));
25549
25603
  }
25550
25604
  triggerStartEvent(type, ev) {
@@ -32576,7 +32630,7 @@
32576
32630
  return listener;
32577
32631
  }
32578
32632
  _smartInvert(labels) {
32579
- var _a, _b, _c, _d, _e;
32633
+ var _a, _b, _c, _d, _e, _f, _g;
32580
32634
  const option = isObject$2(this.attribute.smartInvert) ? this.attribute.smartInvert : {},
32581
32635
  {
32582
32636
  textType: textType,
@@ -32593,10 +32647,14 @@
32593
32647
  if ("null" !== fillStrategy || "null" !== strokeStrategy) for (let i = 0; i < labels.length; i++) {
32594
32648
  const label = labels[i];
32595
32649
  if (!label) continue;
32596
- const baseMark = this.getRelatedGraphic(label.attribute),
32597
- backgroundColor = baseMark.attribute.fill,
32598
- foregroundColor = label.attribute.fill,
32599
- invertColor = labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors, mode),
32650
+ const baseMark = this.getRelatedGraphic(label.attribute);
32651
+ let backgroundColor = baseMark.attribute.fill,
32652
+ foregroundColor = label.attribute.fill;
32653
+ if (isObject$2(backgroundColor) && backgroundColor.gradient) {
32654
+ const firstStopColor = null === (_g = null === (_f = backgroundColor.stops) || void 0 === _f ? void 0 : _f[0]) || void 0 === _g ? void 0 : _g.color;
32655
+ firstStopColor && (backgroundColor = firstStopColor, foregroundColor = firstStopColor);
32656
+ }
32657
+ const invertColor = labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors, mode),
32600
32658
  similarColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor,
32601
32659
  isInside = this._canPlaceInside(label.AABBBounds, baseMark.AABBBounds),
32602
32660
  isIntersect = !isInside && label.AABBBounds && baseMark.AABBBounds && baseMark.AABBBounds.intersects(label.AABBBounds);
@@ -39852,20 +39910,20 @@
39852
39910
  render() {
39853
39911
  this.removeAllChild(!0);
39854
39912
  const {
39855
- interactive = !0,
39856
- title: title,
39857
- padding = 0
39858
- } = this.attribute,
39859
- parsedPadding = normalizePadding$1(padding),
39860
- innerView = graphicCreator.group({
39861
- x: parsedPadding[3],
39862
- y: parsedPadding[0],
39863
- pickable: interactive,
39864
- childrenPickable: interactive
39865
- });
39913
+ interactive = !0,
39914
+ title: title,
39915
+ padding = 0
39916
+ } = this.attribute;
39917
+ this._parsedPadding = normalizePadding$1(padding);
39918
+ const innerView = graphicCreator.group({
39919
+ x: this._parsedPadding[3],
39920
+ y: this._parsedPadding[0],
39921
+ pickable: interactive,
39922
+ childrenPickable: interactive
39923
+ });
39866
39924
  innerView.name = LEGEND_ELEMENT_NAME.innerView, this.add(innerView), this._innerView = innerView, (null == title ? void 0 : title.visible) && this._renderTitle(title), this._renderContent(), this._adjustLayout(), interactive && this._bindEvents();
39867
39925
  const viewBounds = this._innerView.AABBBounds;
39868
- this.attribute.width = viewBounds.width() + parsedPadding[1] + parsedPadding[3], this.attribute.height = viewBounds.height() + parsedPadding[0] + parsedPadding[2];
39926
+ this.attribute.width = viewBounds.width() + this._parsedPadding[1] + this._parsedPadding[3], this.attribute.height = viewBounds.height() + this._parsedPadding[0] + this._parsedPadding[2];
39869
39927
  }
39870
39928
  _renderTitle(title) {
39871
39929
  const {
@@ -39941,7 +39999,7 @@
39941
39999
  loadDiscreteLegendComponent();
39942
40000
  let DiscreteLegend$1 = class DiscreteLegend extends LegendBase {
39943
40001
  constructor(attributes, options) {
39944
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, DiscreteLegend.defaultAttributes, attributes)), this.name = "discreteLegend", this._itemsContainer = null, this._itemHeightByUser = void 0, this._itemHeight = 0, this._itemMaxWidth = 0, this._onHover = e => {
40002
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, DiscreteLegend.defaultAttributes, attributes)), this.name = "discreteLegend", this._itemsContainer = null, this._itemHeightByUser = void 0, this._itemHeight = 0, this._itemMaxWidth = 0, this._contentMaxHeight = 0, this._onHover = e => {
39945
40003
  const target = e.target;
39946
40004
  if (target && target.name && target.name.startsWith(LEGEND_ELEMENT_NAME.item)) {
39947
40005
  const legendItem = target.delegate;
@@ -40004,7 +40062,6 @@
40004
40062
  maxCol = 1,
40005
40063
  maxRow = 2,
40006
40064
  maxWidth: maxWidth,
40007
- maxHeight: maxHeight,
40008
40065
  defaultSelected: defaultSelected,
40009
40066
  lazyload: lazyload,
40010
40067
  autoPage: autoPage
@@ -40020,7 +40077,8 @@
40020
40077
  startIndex: startIndex,
40021
40078
  isScrollbar: isScrollbar
40022
40079
  } = this._itemContext,
40023
- maxPages = isScrollbar ? 1 : isHorizontal ? maxRow : maxCol;
40080
+ maxPages = isScrollbar ? 1 : isHorizontal ? maxRow : maxCol,
40081
+ maxHeight = this._contentMaxHeight;
40024
40082
  let item,
40025
40083
  {
40026
40084
  doWrap: doWrap,
@@ -40052,11 +40110,12 @@
40052
40110
  item = {},
40053
40111
  items: items,
40054
40112
  reversed: reversed,
40055
- maxWidth: maxWidth
40113
+ maxWidth: maxWidth,
40114
+ maxHeight: maxHeight
40056
40115
  } = this.attribute;
40057
40116
  if (!1 === item.visible || isEmpty(items)) return;
40058
40117
  let legendItems = items;
40059
- reversed && (legendItems = null == items ? void 0 : items.reverse());
40118
+ reversed && (legendItems = null == items ? void 0 : items.reverse()), this._contentMaxHeight = Math.max(0, maxHeight - this._parsedPadding[0] - this._parsedPadding[2]);
40060
40119
  const itemsContainer = graphicCreator.group({
40061
40120
  x: 0,
40062
40121
  y: 0
@@ -40087,7 +40146,8 @@
40087
40146
  items: legendItems,
40088
40147
  isHorizontal: isHorizontal,
40089
40148
  totalPage: 1 / 0,
40090
- isScrollbar: pager && "scrollbar" === pager.type
40149
+ isScrollbar: pager && "scrollbar" === pager.type,
40150
+ clipContainer: void 0
40091
40151
  }, this._itemContext = this._renderItems();
40092
40152
  let pagerRendered = !1;
40093
40153
  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));
@@ -40099,7 +40159,15 @@
40099
40159
  hover = !0,
40100
40160
  select = !0
40101
40161
  } = this.attribute;
40102
- hover && (this._itemsContainer.addEventListener("pointermove", this._onHover), this._itemsContainer.addEventListener("pointerleave", this._onUnHover)), select && this._itemsContainer.addEventListener("pointerdown", this._onClick);
40162
+ if (hover) {
40163
+ let trigger = "pointermove",
40164
+ triggerOff = "pointerleave";
40165
+ isObject$2(hover) && (hover.trigger && (trigger = hover.trigger), hover.triggerOff && (triggerOff = hover.triggerOff)), this._itemsContainer.addEventListener(trigger, this._onHover), this._itemsContainer.addEventListener(triggerOff, this._onUnHover);
40166
+ }
40167
+ if (select) {
40168
+ let trigger = "pointerdown";
40169
+ isObject$2(select) && select.trigger && (trigger = select.trigger), this._itemsContainer.addEventListener(trigger, this._onClick);
40170
+ }
40103
40171
  }
40104
40172
  _autoEllipsis(autoEllipsisStrategy, layoutWidth, labelShape, valueShape) {
40105
40173
  var _a, _b;
@@ -40274,12 +40342,12 @@
40274
40342
  direction: "horizontal",
40275
40343
  disableTriggerEvent: disableTriggerEvent,
40276
40344
  range: [0, .5],
40277
- height: 12
40345
+ height: !1 === compStyle.visible ? 0 : 12
40278
40346
  }, compStyle), {
40279
40347
  width: compSize
40280
40348
  })) : new ScrollBar$1(Object.assign(Object.assign({
40281
40349
  direction: "vertical",
40282
- width: 12,
40350
+ width: !1 === compStyle.visible ? 0 : 12,
40283
40351
  range: [0, .5]
40284
40352
  }, compStyle), {
40285
40353
  height: compSize,
@@ -40309,13 +40377,24 @@
40309
40377
  });
40310
40378
  }
40311
40379
  }
40380
+ _computeScrollbarDelta() {
40381
+ const {
40382
+ isHorizontal: isHorizontal,
40383
+ clipContainer: clipContainer
40384
+ } = this._itemContext,
40385
+ itemContainerBounds = this._itemsContainer.AABBBounds,
40386
+ clipContainerBounds = clipContainer.AABBBounds;
40387
+ let delta, innerViewSize;
40388
+ return isHorizontal ? (innerViewSize = clipContainerBounds.width(), delta = innerViewSize / itemContainerBounds.width()) : (innerViewSize = clipContainerBounds.height(), delta = innerViewSize / itemContainerBounds.height()), delta;
40389
+ }
40312
40390
  _updatePositionOfScrollbar(contentWidth, contentHeight, renderStartY) {
40313
40391
  const {
40314
- currentPage: currentPage,
40315
- totalPage: totalPage,
40316
- isHorizontal: isHorizontal
40317
- } = this._itemContext;
40318
- this._pagerComponent.setScrollRange([(currentPage - 1) / totalPage, currentPage / totalPage]), isHorizontal ? this._pagerComponent.setAttributes({
40392
+ isHorizontal: isHorizontal,
40393
+ currentPage: currentPage,
40394
+ totalPage: totalPage
40395
+ } = this._itemContext,
40396
+ start = (currentPage - 1) / totalPage;
40397
+ this._pagerComponent.setScrollRange([start, start + this._computeScrollbarDelta()]), isHorizontal ? this._pagerComponent.setAttributes({
40319
40398
  x: 0,
40320
40399
  y: renderStartY + contentHeight
40321
40400
  }) : this._pagerComponent.setAttributes({
@@ -40335,7 +40414,7 @@
40335
40414
  value: value
40336
40415
  } = e.detail;
40337
40416
  let newPage;
40338
- return 0 === value[0] ? newPage = 1 : 1 === value[1] ? newPage = this._itemContext.totalPage : (newPage = value[0] * this._itemContext.totalPage, pager.scrollByPosition ? newPage += 1 : newPage = Math.floor(newPage) + 1), newPage;
40417
+ return newPage = 0 === value[0] ? 1 : 1 === value[1] ? this._itemContext.totalPage : value[0] * this._itemContext.totalPage + 1, newPage;
40339
40418
  } : e => e.detail.current,
40340
40419
  onScroll = e => {
40341
40420
  const scrollComponent = this._pagerComponent,
@@ -40348,7 +40427,7 @@
40348
40427
  height: height
40349
40428
  } = scrollComponent.getSliderRenderBounds(),
40350
40429
  currentScrollValue = "vertical" === direction ? e.deltaY / height : e.deltaX / width;
40351
- scrollComponent.setScrollRange([preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue], !0);
40430
+ scrollComponent.setScrollRange([preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue], !0), this.updateScrollMask();
40352
40431
  },
40353
40432
  onPaging = e => {
40354
40433
  const newPage = pageParser(e);
@@ -40356,9 +40435,21 @@
40356
40435
  if (this._itemContext.currentPage = newPage, this._itemContext && this._itemContext.startIndex < this._itemContext.items.length) {
40357
40436
  this._renderItems();
40358
40437
  const newTotalPage = Math.ceil(this._itemContext.pages / this._itemContext.maxPages);
40359
- this._itemContext.totalPage = newTotalPage, this._pagerComponent.setScrollRange([(newPage - 1) / newTotalPage, newPage / newTotalPage]);
40438
+ if (this._itemContext.totalPage = newTotalPage, this._itemContext.isScrollbar && this._pagerComponent) {
40439
+ const newDelta = this._computeScrollbarDelta(),
40440
+ [start] = this._pagerComponent.getScrollRange();
40441
+ this._pagerComponent.setScrollRange([start, start + newDelta]);
40442
+ }
40360
40443
  }
40361
- animation ? this._itemsContainer.animate().to({
40444
+ if (this._itemContext.isScrollbar) {
40445
+ const [start] = this._pagerComponent.getScrollRange();
40446
+ let containerSize;
40447
+ containerSize = this._itemContext.isHorizontal ? this._itemsContainer.AABBBounds.width() : this._itemsContainer.AABBBounds.height();
40448
+ const startOffset = containerSize * start;
40449
+ this.updateScrollMask(), animation ? this._itemsContainer.animate().to({
40450
+ [channel]: -startOffset
40451
+ }, animationDuration, animationEasing) : this._itemsContainer.setAttribute(channel, -startOffset);
40452
+ } else animation ? this._itemsContainer.animate().to({
40362
40453
  [channel]: -(newPage - 1) * pageSize
40363
40454
  }, animationDuration, animationEasing) : this._itemsContainer.setAttribute(channel, -(newPage - 1) * pageSize);
40364
40455
  }
@@ -40374,7 +40465,6 @@
40374
40465
  const renderStartY = this._title ? this._title.AABBBounds.height() + get$1(this.attribute, "title.space", 8) : 0,
40375
40466
  {
40376
40467
  maxWidth: maxWidth,
40377
- maxHeight: maxHeight,
40378
40468
  maxCol = 1,
40379
40469
  maxRow = 2,
40380
40470
  item = {},
@@ -40392,7 +40482,8 @@
40392
40482
  compStyle = __rest$1(pager, ["space", "defaultCurrent"]),
40393
40483
  {
40394
40484
  isHorizontal: isHorizontal
40395
- } = this._itemContext;
40485
+ } = this._itemContext,
40486
+ maxHeight = this._contentMaxHeight;
40396
40487
  let comp,
40397
40488
  compWidth = 0,
40398
40489
  compHeight = 0,
@@ -40438,13 +40529,13 @@
40438
40529
  clip: !0,
40439
40530
  pickable: !1
40440
40531
  });
40441
- return clipGroup.add(itemsContainer), this._innerView.add(clipGroup), this._bindEventsOfPager(isHorizontal ? compHeight + spaceRow : compWidth + spaceCol, isHorizontal ? "y" : "x"), !0;
40532
+ return clipGroup.add(itemsContainer), this._innerView.add(clipGroup), this._itemContext.clipContainer = clipGroup, this._bindEventsOfPager(isHorizontal ? compHeight + spaceRow : compWidth + spaceCol, isHorizontal ? "y" : "x"), !0;
40442
40533
  }
40443
40534
  _renderScrollbar() {
40535
+ var _a;
40444
40536
  const renderStartY = this._title ? this._title.AABBBounds.height() + get$1(this.attribute, "title.space", 8) : 0,
40445
40537
  {
40446
40538
  maxWidth: maxWidth,
40447
- maxHeight: maxHeight,
40448
40539
  item = {},
40449
40540
  pager = {}
40450
40541
  } = this.attribute,
@@ -40460,15 +40551,15 @@
40460
40551
  compStyle = __rest$1(pager, ["space", "defaultCurrent"]),
40461
40552
  {
40462
40553
  isHorizontal: isHorizontal
40463
- } = this._itemContext;
40554
+ } = this._itemContext,
40555
+ maxHeight = this._contentMaxHeight;
40464
40556
  let comp,
40465
- compSize = 0,
40466
40557
  contentWidth = 0,
40467
40558
  contentHeight = 0,
40468
40559
  startY = 0,
40469
40560
  pages = 1;
40470
- 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 {
40471
- 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;
40561
+ if (isHorizontal) contentWidth = maxWidth, contentHeight = this._itemHeight, comp = this._createScrollbar(compStyle, contentWidth), this._pagerComponent = comp, this._innerView.add(comp);else {
40562
+ if (contentHeight = maxHeight - renderStartY, contentWidth = this._itemMaxWidth, comp = this._createScrollbar(compStyle, contentHeight), this._pagerComponent = comp, this._innerView.add(comp), contentHeight <= 0) return this._innerView.removeChild(comp), !1;
40472
40563
  const items = itemsContainer.getChildren(),
40473
40564
  itemsHeightArr = items.map(item => item.attribute.height);
40474
40565
  if (1 === itemsHeightArr.length || itemsHeightArr.every(entry => entry === itemsHeightArr[0])) {
@@ -40484,9 +40575,15 @@
40484
40575
  preStartY = startY;
40485
40576
  pages = Math.floor((startY + height) / contentHeight) + 1, startY += spaceRow + height, prePages !== pages && index === itemsContainer.getChildren().length - 1 && startY - contentHeight >= 1 / 3 * height && (contentHeight = preStartY + height, pages -= 1);
40486
40577
  });
40487
- this._itemContext.totalPage = pages, this._itemContext.pages = pages, this._updatePositionOfScrollbar(contentWidth, contentHeight, renderStartY);
40578
+ this._itemContext.totalPage = pages, this._itemContext.pages = pages;
40579
+ }
40580
+ if (defaultCurrent > 1) if (isHorizontal) {
40581
+ const maxOffset = this._itemsContainer.AABBBounds.width() - contentWidth;
40582
+ itemsContainer.setAttribute("x", -Math.min((defaultCurrent - 1) * (contentWidth + spaceCol), maxOffset));
40583
+ } else {
40584
+ const maxOffset = this._itemsContainer.AABBBounds.height() - contentHeight;
40585
+ itemsContainer.setAttribute("y", -Math.min((defaultCurrent - 1) * (contentHeight + spaceRow), maxOffset));
40488
40586
  }
40489
- defaultCurrent > 1 && (isHorizontal ? itemsContainer.setAttribute("x", -(defaultCurrent - 1) * (contentWidth + spaceCol)) : itemsContainer.setAttribute("y", -(defaultCurrent - 1) * (contentHeight + spaceRow)));
40490
40587
  const clipGroup = graphicCreator.group({
40491
40588
  x: 0,
40492
40589
  y: renderStartY,
@@ -40495,7 +40592,64 @@
40495
40592
  clip: !0,
40496
40593
  pickable: !1
40497
40594
  });
40498
- return clipGroup.add(itemsContainer), this._innerView.add(clipGroup), this._bindEventsOfPager(isHorizontal ? contentWidth : contentHeight, isHorizontal ? "x" : "y"), !0;
40595
+ return clipGroup.add(itemsContainer), this._innerView.add(clipGroup), this._itemContext.clipContainer = clipGroup, this._updatePositionOfScrollbar(contentWidth, contentHeight, renderStartY), (null === (_a = pager.scrollMask) || void 0 === _a ? void 0 : _a.visible) && this.renderScrollMask(clipGroup), this._bindEventsOfPager(isHorizontal ? contentWidth : contentHeight, isHorizontal ? "x" : "y"), !0;
40596
+ }
40597
+ renderScrollMask(clipGroup) {
40598
+ const {
40599
+ scrollMask = {}
40600
+ } = this.attribute.pager,
40601
+ {
40602
+ visible = !0,
40603
+ gradientLength = 16,
40604
+ gradientStops: gradientStops
40605
+ } = scrollMask;
40606
+ if (!visible || !gradientStops) return;
40607
+ const width = clipGroup.AABBBounds.width(),
40608
+ height = clipGroup.AABBBounds.height(),
40609
+ totalLength = this._itemContext.isHorizontal ? width : height,
40610
+ startStops = gradientStops.map(stop => ({
40611
+ offset: gradientLength * stop.offset / totalLength,
40612
+ color: stop.color
40613
+ })),
40614
+ endStops = gradientStops.map(stop => ({
40615
+ offset: (totalLength - gradientLength * stop.offset) / totalLength,
40616
+ color: stop.color
40617
+ })),
40618
+ mask = graphicCreator.rect({
40619
+ x: 0,
40620
+ y: 0,
40621
+ width: width,
40622
+ height: height
40623
+ });
40624
+ this._scrollMask = mask, this._scrollMaskContext = {
40625
+ startStops: startStops,
40626
+ endStops: endStops
40627
+ }, this.updateScrollMask(), clipGroup.add(mask);
40628
+ }
40629
+ updateScrollMask() {
40630
+ if (!this._scrollMask || !this._pagerComponent) return;
40631
+ if (!this._itemContext.isScrollbar) return;
40632
+ const [start, end] = this._pagerComponent.getScrollRange(),
40633
+ stops = [];
40634
+ isNumberClose(clamp$1(end, 0, 1), 1) || stops.push(...this._scrollMaskContext.endStops), isNumberClose(clamp$1(start, 0, 1), 0) || stops.push(...this._scrollMaskContext.startStops), stops.length && (this._itemContext.isHorizontal ? this._scrollMask.setAttributes({
40635
+ fill: {
40636
+ gradient: "linear",
40637
+ x0: 0,
40638
+ y0: 0,
40639
+ x1: 1,
40640
+ y1: 0,
40641
+ stops: stops
40642
+ }
40643
+ }) : this._scrollMask.setAttributes({
40644
+ fill: {
40645
+ gradient: "linear",
40646
+ x0: 0,
40647
+ y0: 0,
40648
+ x1: 0,
40649
+ y1: 1,
40650
+ stops: stops
40651
+ }
40652
+ }));
40499
40653
  }
40500
40654
  _renderPagerComponent() {
40501
40655
  return this._itemContext.isScrollbar ? this._renderScrollbar() : this._renderPager(), !0;
@@ -56237,7 +56391,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
56237
56391
  });
56238
56392
  }
56239
56393
  this._view = new View(Object.assign(Object.assign({ width: this._width, height: this._height, container: (_c = this._container.dom) !== null && _c !== void 0 ? _c : null, renderCanvas: (_d = this._container.canvas) !== null && _d !== void 0 ? _d : null, hooks: this._option.performanceHook }, this._option), { mode: toRenderMode(this._option.mode), autoFit: false, eventConfig: {
56240
- gesture: isMobileLikeMode(this._option.mode),
56394
+ gesture: isValid$1(this._option.gestureConfig)
56395
+ ? this._option.gestureConfig
56396
+ : isMobileLikeMode(this._option.mode),
56241
56397
  disable: this._option.interactive === false
56242
56398
  }, doLayout: () => {
56243
56399
  var _a;
@@ -61579,7 +61735,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61579
61735
  };
61580
61736
  registerVChartCore();
61581
61737
 
61582
- const version = "1.12.10";
61738
+ const version = "1.12.12-alpha.0";
61583
61739
 
61584
61740
  const addVChartProperty = (data, op) => {
61585
61741
  const context = op.beforeCall();
@@ -63158,12 +63314,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
63158
63314
  setValueFieldToStackOffsetSilhouette() {
63159
63315
  }
63160
63316
  initRootMark() {
63161
- var _a, _b;
63317
+ var _a, _b, _c;
63162
63318
  this._rootMark = this._createMark({ type: "group", name: `seriesGroup_${this.type}_${this.id}` }, {
63163
63319
  parent: (_b = (_a = this._region).getGroupMark) === null || _b === void 0 ? void 0 : _b.call(_a),
63164
63320
  dataView: false
63165
63321
  });
63166
- this._rootMark.setMarkConfig({ zIndex: this.layoutZIndex });
63322
+ this._rootMark.setMarkConfig({ zIndex: (_c = this._spec.zIndex) !== null && _c !== void 0 ? _c : this.layoutZIndex });
63167
63323
  }
63168
63324
  _getExtensionMarkNamePrefix() {
63169
63325
  return `${this.type}_${this.id}_extensionMark`;
@@ -64660,9 +64816,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64660
64816
  }
64661
64817
 
64662
64818
  function isValidAlignDomain(domain) {
64663
- return domain.length === 2 && isValidNumber$1(domain[0]) && isValidNumber$1(last(domain)) && last(domain) >= domain[0];
64819
+ return domain.length >= 2 && isValidNumber$1(domain[0]) && isValidNumber$1(last(domain)) && last(domain) >= domain[0];
64664
64820
  }
64665
64821
  function getScaleInfo(axis, domain) {
64822
+ var _a;
64666
64823
  const total = last(domain) - domain[0];
64667
64824
  const includeZero = last(domain) * domain[0] < 0;
64668
64825
  let negative = domain[0] <= 0 ? 0 - domain[0] : 0;
@@ -64682,7 +64839,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64682
64839
  positive = positive / total;
64683
64840
  }
64684
64841
  const domainSpec = axis.getDomainSpec();
64685
- return {
64842
+ const result = {
64686
64843
  total,
64687
64844
  negative,
64688
64845
  positive,
@@ -64691,6 +64848,35 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64691
64848
  extendable_min: !isValidNumber$1(domainSpec.min),
64692
64849
  extendable_max: !isValidNumber$1(domainSpec.max)
64693
64850
  };
64851
+ if ((_a = axis._break) === null || _a === void 0 ? void 0 : _a.scope) {
64852
+ const index = domain.findIndex(value => value >= 0);
64853
+ let scope;
64854
+ let domainTemp;
64855
+ if (index === 0) {
64856
+ scope = axis._break.scope[index];
64857
+ domainTemp = [domain[0], domain[1]];
64858
+ result.positive = 1;
64859
+ result.negative = 0;
64860
+ }
64861
+ else {
64862
+ if (last(domain) <= 0) {
64863
+ result.positive = 0;
64864
+ result.negative = 1;
64865
+ domainTemp = [domain[domain.length - 2], domain[domain.length - 1]];
64866
+ }
64867
+ else {
64868
+ scope = axis._break.scope[index - 1];
64869
+ domainTemp = [domain[index - 1], domain[index]];
64870
+ result.negative = scope[0] + ((0 - domainTemp[0]) / (domainTemp[1] - domainTemp[0])) * (scope[1] - scope[0]);
64871
+ result.positive = 1 - result.negative;
64872
+ }
64873
+ }
64874
+ result.break = true;
64875
+ result.extendable_max = false;
64876
+ result.extendable_min = false;
64877
+ result.domain = domainTemp;
64878
+ }
64879
+ return result;
64694
64880
  }
64695
64881
  function inDifferentCrossZero(info1, info2) {
64696
64882
  const { positive: positive1, negative: negative1, extendable_min: s1Extendable_min, extendable_max: s1Extendable_max, domain: domain1 } = info1;
@@ -64780,6 +64966,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64780
64966
  }
64781
64967
  const info1 = getScaleInfo(targetAxis, domain1);
64782
64968
  const info2 = getScaleInfo(currentAxis, domain2);
64969
+ if (info1.break === true && info2.break === true) {
64970
+ return;
64971
+ }
64783
64972
  const { positive: positive1, negative: negative1, extendable_min: s1Extendable_min, extendable_max: s1Extendable_max, includeZero: includeZero1 } = info1;
64784
64973
  const { positive: positive2, negative: negative2, extendable_min: s2Extendable_min, extendable_max: s2Extendable_max, includeZero: includeZero2 } = info2;
64785
64974
  if (positive1 === 0 && negative1 === 0) {
@@ -66698,42 +66887,58 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66698
66887
  }
66699
66888
  const sorter = (a, b) => a - b;
66700
66889
  const fillBins = (data, points) => {
66701
- const bins = [0];
66890
+ const bins = [
66891
+ { count: 0, sub: [], max: points[0], min: points[0] }
66892
+ ];
66702
66893
  let i = 0;
66703
66894
  let j = 0;
66704
66895
  while (i < points.length) {
66705
66896
  if (data[j] <= points[i]) {
66706
- bins[i] += 1;
66897
+ bins[i].count += 1;
66898
+ bins[i].sub.push(data[j]);
66707
66899
  j += 1;
66708
66900
  }
66709
66901
  else {
66710
66902
  i += 1;
66711
- bins[i] = 0;
66903
+ bins[i] = { count: 0, sub: [], max: points[i], min: points[i] };
66712
66904
  }
66713
66905
  }
66714
- bins[i] = data.slice(j).length;
66906
+ bins.forEach(bin => {
66907
+ if (bin.count) {
66908
+ bin.min = Math.min.apply(null, bin.sub);
66909
+ }
66910
+ });
66911
+ const remain = data.slice(j);
66912
+ bins[i] = { count: remain.length, sub: remain, min: points[points.length - 1], max: Math.max.apply(null, remain) };
66715
66913
  return bins;
66716
66914
  };
66717
- function breakScope(data, points) {
66915
+ function breakScope(data, points, scopeType = 'length') {
66718
66916
  const bins = fillBins(data, points);
66719
- const count = data.length;
66720
- return bins
66721
- .reduce((res, bin, i) => {
66722
- const last = res[i - 1] ? res[i - 1][1] : 0;
66723
- const next = (last * 100 + +(bin / count).toFixed(2) * 100) / 100;
66724
- res.push([last, next > 1 ? 1 : next > 0.95 ? 1 : next]);
66725
- return res;
66726
- }, [])
66727
- .filter(s => {
66728
- return !(s[0] === 0 && s[1] === 0) && !(s[0] === 1 && s[1] === 1);
66917
+ const totalLength = scopeType === 'count'
66918
+ ? data.length
66919
+ : bins.reduce((res, bin, i) => {
66920
+ return bin.count > 0 ? res + bin.max - bin.min : res;
66921
+ }, 0);
66922
+ const res = [];
66923
+ let acc = 0;
66924
+ bins.forEach((bin, i) => {
66925
+ if (totalLength === 0) {
66926
+ res.push([0, i / bins.length - 1]);
66927
+ }
66928
+ else {
66929
+ const length = scopeType === 'count' ? bin.count : bin.max - bin.min;
66930
+ res.push([res[i - 1] ? res[i - 1][1] : 0, i === bins.length - 1 ? 1 : Math.min((acc + length) / totalLength, 1)]);
66931
+ acc += length;
66932
+ }
66729
66933
  });
66934
+ return res;
66730
66935
  }
66731
- function breakData(data, points) {
66936
+ function breakData(data, points, scopeType) {
66732
66937
  data.sort(sorter);
66733
66938
  points.sort(sorter);
66734
66939
  return {
66735
66940
  domain: breakDomain(data, points),
66736
- scope: breakScope(data, points)
66941
+ scope: breakScope(data, points, scopeType)
66737
66942
  };
66738
66943
  }
66739
66944
 
@@ -66854,7 +67059,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66854
67059
  }
66855
67060
  breakRanges.sort((a, b) => a[0] - b[0]);
66856
67061
  if (breakRanges.length) {
66857
- const { domain: breakDomains, scope: breakScopes } = breakData(values, combineDomains(breakRanges));
67062
+ const { domain: breakDomains, scope: breakScopes } = breakData(values, combineDomains(breakRanges), this._spec.breaks[0].scopeType);
66858
67063
  domain = combineDomains(breakDomains);
66859
67064
  this._break = {
66860
67065
  domain: breakDomains,
@@ -71644,7 +71849,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
71644
71849
  }
71645
71850
  const event = this._isGestureListener ? params : params.event.clone();
71646
71851
  this._zoomableTrigger.parserZoomEvent(event);
71647
- const { zoomDelta, zoomX, zoomY } = event;
71852
+ const { zoomDelta, zoomX, zoomY, path } = event;
71853
+ if (!path.some((node) => node.name && node.name.includes('region'))) {
71854
+ return;
71855
+ }
71648
71856
  if (isNil$1(zoomDelta)) {
71649
71857
  return;
71650
71858
  }
@@ -78214,14 +78422,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78214
78422
  if (!isValidNumber$1(width) || !isValidNumber$1(height) || !(height > 0 && width > 0)) {
78215
78423
  return;
78216
78424
  }
78217
- const wordCloudTransforms = [];
78218
- if (!this._isWordCloudShape) {
78219
- wordCloudTransforms.push(Object.assign({ type: 'wordcloud' }, this._wordCloudTransformOption()));
78220
- }
78221
- else {
78222
- wordCloudTransforms.push(Object.assign({ type: 'wordcloudShape' }, this._wordCloudShapeTransformOption()));
78425
+ const product = this._wordMark.getProduct();
78426
+ if (product) {
78427
+ const wordCloudTransforms = [];
78428
+ if (!this._isWordCloudShape) {
78429
+ wordCloudTransforms.push(Object.assign({ type: 'wordcloud' }, this._wordCloudTransformOption()));
78430
+ }
78431
+ else {
78432
+ wordCloudTransforms.push(Object.assign({ type: 'wordcloudShape' }, this._wordCloudShapeTransformOption()));
78433
+ }
78434
+ product.transform(wordCloudTransforms);
78223
78435
  }
78224
- this._wordMark.getProduct().transform(wordCloudTransforms);
78225
78436
  }
78226
78437
  _getCommonTransformOptions() {
78227
78438
  var _a, _b, _c, _d, _e, _f;
@@ -78589,7 +78800,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78589
78800
  });
78590
78801
  if (this.originalData = data, this.data = data, this.progressiveRun(), !this.options.clip && this.options.enlarge && this._bounds && this.shrinkBoard(this._bounds), this._bounds && ["cardioid", "triangle", "triangle-upright"].includes(this.options.shape)) {
78591
78802
  const currentCenterY = (this._bounds[0].y + this._bounds[1].y) / 2;
78592
- this._dy = -(currentCenterY - this._size[1] / 2);
78803
+ this._dy = -(currentCenterY - this._originSize[1] / 2);
78593
78804
  }
78594
78805
  return this.result;
78595
78806
  }
@@ -78648,10 +78859,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78648
78859
  }
78649
78860
  getContext(canvas) {
78650
78861
  canvas.width = 1, canvas.height = 1;
78651
- const imageData = canvas.getContext("2d").getImageData(0, 0, 1, 1),
78862
+ const imageData = canvas.getContext("2d", {
78863
+ willReadFrequently: !0
78864
+ }).getImageData(0, 0, 1, 1),
78652
78865
  ratio = Math.sqrt(imageData.data.length >> 2);
78653
78866
  canvas.width = (this.cw << 5) / ratio, canvas.height = this.ch / ratio;
78654
- const context = canvas.getContext("2d");
78867
+ const context = canvas.getContext("2d", {
78868
+ willReadFrequently: !0
78869
+ });
78655
78870
  return context.fillStyle = context.strokeStyle = "red", context.textAlign = "center", {
78656
78871
  context: context,
78657
78872
  ratio: ratio,
@@ -90613,7 +90828,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90613
90828
  return { spec: newSpec, theme };
90614
90829
  }
90615
90830
  _transformSpecAfterMergingTheme(spec, chartSpec, chartSpecInfo) {
90616
- var _a, _b, _c, _d, _e, _f, _g, _h;
90831
+ var _a, _b, _c, _d, _e, _f, _g;
90617
90832
  super._transformSpecAfterMergingTheme(spec, chartSpec, chartSpecInfo);
90618
90833
  spec.visible = (_a = spec.visible) !== null && _a !== void 0 ? _a : true;
90619
90834
  spec.activeType = getTooltipActualActiveType(spec);
@@ -90623,8 +90838,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90623
90838
  spec.className = (_d = spec.className) !== null && _d !== void 0 ? _d : TOOLTIP_EL_CLASS_NAME;
90624
90839
  spec.enterable = (_e = spec.enterable) !== null && _e !== void 0 ? _e : false;
90625
90840
  spec.transitionDuration = (_f = spec.transitionDuration) !== null && _f !== void 0 ? _f : 150;
90626
- spec.triggerOff = (_g = spec.triggerOff) !== null && _g !== void 0 ? _g : spec.trigger;
90627
- spec.confine = (_h = spec.confine) !== null && _h !== void 0 ? _h : spec.renderMode === 'canvas';
90841
+ spec.confine = (_g = spec.confine) !== null && _g !== void 0 ? _g : spec.renderMode === 'canvas';
90628
90842
  if (isValid$1(spec.parentElement)) {
90629
90843
  if (isString$1(spec.parentElement)) {
90630
90844
  spec.parentElement = vglobal.getElementById(spec.parentElement);
@@ -90925,7 +91139,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90925
91139
  }
90926
91140
  _initEventOfTooltipContent() {
90927
91141
  var _a, _b;
90928
- if (!this._needInitEventOfTooltip || !this._enterable) {
91142
+ if (!this._needInitEventOfTooltip) {
90929
91143
  return;
90930
91144
  }
90931
91145
  const container = (_b = (_a = this.tooltipHandler).getTooltipContainer) === null || _b === void 0 ? void 0 : _b.call(_a);
@@ -90933,6 +91147,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90933
91147
  if (element) {
90934
91148
  element.addEventListener('pointerenter', () => {
90935
91149
  var _a;
91150
+ if (!this._enterable) {
91151
+ return;
91152
+ }
90936
91153
  const rect = (_a = element.getBoundingClientRect) === null || _a === void 0 ? void 0 : _a.call(element);
90937
91154
  if (rect) {
90938
91155
  this._cacheEnterableRect = { x: rect.x, y: rect.y, width: rect.width, height: rect.height };
@@ -90948,6 +91165,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90948
91165
  });
90949
91166
  element.addEventListener('pointerleave', () => {
90950
91167
  var _a, _b;
91168
+ if (!this._enterable) {
91169
+ return;
91170
+ }
90951
91171
  if (this._cacheEnterableRect) {
90952
91172
  const newRect = (_a = element.getBoundingClientRect) === null || _a === void 0 ? void 0 : _a.call(element);
90953
91173
  if (newRect &&
@@ -90979,21 +91199,33 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90979
91199
  return;
90980
91200
  }
90981
91201
  const trigger = array((_a = this._spec.trigger) !== null && _a !== void 0 ? _a : 'hover');
91202
+ const triggerOff = array(this._spec.triggerOff);
90982
91203
  const mode = this._option.mode;
90983
- if (trigger.includes('hover')) {
90984
- this._handleMouseMove = this._throttle(this._getMouseMoveHandler(false));
90985
- this._mountEvent('pointermove', { source: 'chart' }, this._handleMouseMove);
90986
- if (isMobileLikeMode(mode) || isMiniAppLikeMode(mode)) {
90987
- this._mountEvent('pointerdown', { source: 'chart' }, this._getMouseMoveHandler(false));
91204
+ trigger.forEach(triggerType => {
91205
+ var _a;
91206
+ if (triggerType === 'hover') {
91207
+ this._handleMouseMove = this._throttle(this._getMouseMoveHandler(false));
91208
+ this._mountEvent('pointermove', { source: 'chart' }, this._handleMouseMove);
91209
+ if (isMobileLikeMode(mode) || isMiniAppLikeMode(mode)) {
91210
+ this._mountEvent('pointerdown', { source: 'chart' }, this._getMouseMoveHandler(false));
91211
+ this._mountEvent('pointerup', { source: 'window' }, this._getMouseOutHandler(true));
91212
+ }
91213
+ this._mountEvent('pointerleave', { source: 'chart' }, this._getMouseOutHandler(false));
91214
+ }
91215
+ else if (triggerType === 'click') {
91216
+ this._mountEvent('pointertap', { source: 'chart' }, this._getMouseMoveHandler(true));
90988
91217
  this._mountEvent('pointerup', { source: 'window' }, this._getMouseOutHandler(true));
90989
91218
  }
90990
- this._mountEvent('pointerleave', { source: 'chart' }, this._getMouseOutHandler(false));
90991
- }
90992
- if (trigger.includes('click')) {
90993
- this._mountEvent('pointertap', { source: 'chart' }, this._getMouseMoveHandler(true));
90994
- this._mountEvent('pointerup', { source: 'window' }, this._getMouseOutHandler(true));
90995
- }
90996
- else if (this._spec.lockAfterClick) {
91219
+ else if (isObject$2(triggerType)) {
91220
+ this._mountEvent(triggerType.eventType, { source: (_a = triggerType.source) !== null && _a !== void 0 ? _a : 'chart', consume: triggerType.consume }, this._getMouseMoveHandler(true));
91221
+ }
91222
+ });
91223
+ const offEvents = triggerOff.filter(entry => isObject$2(entry));
91224
+ offEvents.forEach(entry => {
91225
+ var _a, _b;
91226
+ this._mountEvent(entry.eventType, { source: (_a = entry.source) !== null && _a !== void 0 ? _a : 'chart', consume: entry.consume }, this._getMouseOutHandler((_b = entry.checkOutside) !== null && _b !== void 0 ? _b : false));
91227
+ });
91228
+ if (!trigger.includes('click') && this._spec.lockAfterClick) {
90997
91229
  this._mountEvent('pointertap', { source: 'chart' }, this._handleClickToLock);
90998
91230
  }
90999
91231
  }
@@ -91013,10 +91245,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91013
91245
  return throttle(callback, wait);
91014
91246
  }
91015
91247
  reInit(spec) {
91016
- var _a, _b;
91248
+ var _a, _b, _c;
91017
91249
  super.reInit(spec);
91018
91250
  if (this.tooltipHandler) {
91019
- (_b = (_a = this.tooltipHandler).reInit) === null || _b === void 0 ? void 0 : _b.call(_a);
91251
+ const renderMode = (_a = this._spec.renderMode) !== null && _a !== void 0 ? _a : 'html';
91252
+ const newEnterable = this._spec.enterable && renderMode === 'html';
91253
+ if (newEnterable && !this._enterable) {
91254
+ this._needInitEventOfTooltip = true;
91255
+ }
91256
+ this._enterable = newEnterable;
91257
+ (_c = (_b = this.tooltipHandler).reInit) === null || _c === void 0 ? void 0 : _c.call(_b);
91020
91258
  }
91021
91259
  else {
91022
91260
  this._initHandler();
@@ -91055,19 +91293,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91055
91293
  }
91056
91294
  const prevInfo = this._cacheInfo;
91057
91295
  const isSameAsCacheInfo = prevInfo.length === nextInfo.length && nextInfo.every((info, i) => isSameDimensionInfo(info, prevInfo[i]));
91058
- if (!isSameAsCacheInfo) {
91059
- return false;
91060
- }
91296
+ return isSameAsCacheInfo;
91061
91297
  }
91062
- else {
91063
- if (isDimensionInfo(this._cacheInfo)) {
91064
- return false;
91065
- }
91066
- const prevInfo = this._cacheInfo;
91067
- const isSameAsCacheInfo = (nextInfo === null || nextInfo === void 0 ? void 0 : nextInfo.datum) === prevInfo.datum && (nextInfo === null || nextInfo === void 0 ? void 0 : nextInfo.mark) === prevInfo.mark && (nextInfo === null || nextInfo === void 0 ? void 0 : nextInfo.series) === prevInfo.series;
91068
- if (!isSameAsCacheInfo) {
91069
- return false;
91070
- }
91298
+ if (isDimensionInfo(this._cacheInfo)) {
91299
+ return false;
91300
+ }
91301
+ const prevInfo = this._cacheInfo;
91302
+ const isSameAsCacheInfo = (nextInfo === null || nextInfo === void 0 ? void 0 : nextInfo.datum) === prevInfo.datum && (nextInfo === null || nextInfo === void 0 ? void 0 : nextInfo.mark) === prevInfo.mark && (nextInfo === null || nextInfo === void 0 ? void 0 : nextInfo.series) === prevInfo.series;
91303
+ if (!isSameAsCacheInfo) {
91304
+ return false;
91071
91305
  }
91072
91306
  const prevParams = this._cacheParams;
91073
91307
  if (isNil$1(prevParams) || isNil$1(nextParams)) {
@@ -95581,12 +95815,20 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
95581
95815
  };
95582
95816
  }
95583
95817
  _getTitleAttrs() {
95584
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
95585
- const realWidth = Math.max(0, (_a = this._spec.width) !== null && _a !== void 0 ? _a : this.getLayoutRect().width);
95818
+ var _a, _b, _c, _d, _e, _f, _g, _h;
95586
95819
  if (this._spec.visible === false) {
95587
95820
  return { visible: false };
95588
95821
  }
95589
- return Object.assign(Object.assign({}, pickWithout(this._spec, ['padding'])), { textType: (_b = this._spec.textType) !== null && _b !== void 0 ? _b : 'text', text: (_c = this._spec.text) !== null && _c !== void 0 ? _c : '', subtextType: (_d = this._spec.subtextType) !== null && _d !== void 0 ? _d : 'text', subtext: (_e = this._spec.subtext) !== null && _e !== void 0 ? _e : '', x: (_f = this._spec.x) !== null && _f !== void 0 ? _f : 0, y: (_g = this._spec.y) !== null && _g !== void 0 ? _g : 0, width: realWidth, height: this._spec.height, minWidth: this._spec.minWidth, maxWidth: this._spec.maxWidth, minHeight: this._spec.minHeight, maxHeight: this._spec.maxHeight, padding: this._spec.innerPadding, align: (_h = this._spec.align) !== null && _h !== void 0 ? _h : 'left', verticalAlign: (_j = this._spec.verticalAlign) !== null && _j !== void 0 ? _j : 'top', textStyle: Object.assign({ width: realWidth }, this._spec.textStyle), subtextStyle: Object.assign({ width: realWidth }, this._spec.subtextStyle) });
95822
+ const layoutRect = this.getLayoutRect();
95823
+ const titleWidth = calcLayoutNumber(this._spec.width, layoutRect.width, null, layoutRect.width);
95824
+ const titleMaxWidth = calcLayoutNumber(this._spec.maxWidth, layoutRect.width, null, layoutRect.width);
95825
+ const maxWidth = Math.max(Math.min(titleWidth, titleMaxWidth, layoutRect.width), 0);
95826
+ const attrs = Object.assign(Object.assign({}, pickWithout(this._spec, ['padding'])), { textType: (_a = this._spec.textType) !== null && _a !== void 0 ? _a : 'text', text: (_b = this._spec.text) !== null && _b !== void 0 ? _b : '', subtextType: (_c = this._spec.subtextType) !== null && _c !== void 0 ? _c : 'text', subtext: (_d = this._spec.subtext) !== null && _d !== void 0 ? _d : '', x: (_e = this._spec.x) !== null && _e !== void 0 ? _e : 0, y: (_f = this._spec.y) !== null && _f !== void 0 ? _f : 0, height: this._spec.height, minWidth: this._spec.minWidth, maxWidth, minHeight: this._spec.minHeight, maxHeight: this._spec.maxHeight, padding: this._spec.innerPadding, align: (_g = this._spec.align) !== null && _g !== void 0 ? _g : 'left', verticalAlign: (_h = this._spec.verticalAlign) !== null && _h !== void 0 ? _h : 'top', textStyle: Object.assign({ width: maxWidth, maxLineWidth: maxWidth }, this._spec.textStyle), subtextStyle: Object.assign({ maxLineWidth: maxWidth }, this._spec.subtextStyle) });
95827
+ if (isValid$1(this._spec.width)) {
95828
+ attrs.textStyle.width = Math.max(titleWidth, layoutRect.width);
95829
+ attrs.subtextStyle.width = attrs.textStyle.width;
95830
+ }
95831
+ return attrs;
95590
95832
  }
95591
95833
  _createOrUpdateTitleComponent(attrs) {
95592
95834
  if (this._titleComponent) {
@@ -99243,8 +99485,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99243
99485
  if (posType > 0) {
99244
99486
  result[dim] = value0 + offset;
99245
99487
  }
99488
+ else if (posType === 0) {
99489
+ result[dim] = value0 - (boxSize * tooltipSizeScale) / 2;
99490
+ }
99246
99491
  else {
99247
- result[dim] = value0 - (boxSize * tooltipSizeScale) / 2 + (posType < 0 ? -1 : 0) * offset;
99492
+ result[dim] = value0 - boxSize * tooltipSizeScale - offset;
99248
99493
  }
99249
99494
  }
99250
99495
  result[dim] *= chartElementScale;
@@ -99664,12 +99909,20 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99664
99909
  const createSymbol = (symbolType) => new Symbol$1({ symbolType, size: sizeNumber, fill: true });
99665
99910
  let symbol = createSymbol(symbolType);
99666
99911
  const parsedPath = symbol.getParsedPath();
99667
- if (!parsedPath.path) {
99912
+ if (!parsedPath.path && parsedPath.pathStr) {
99668
99913
  symbol = createSymbol(parsedPath.pathStr);
99669
99914
  }
99670
- const pathModel = symbol.getParsedPath().path;
99671
- const path = pathModel.toString();
99672
- const bounds = pathModel.bounds;
99915
+ let bounds;
99916
+ let path;
99917
+ if (symbol.getParsedPath().path) {
99918
+ const pathModel = symbol.getParsedPath().path;
99919
+ path = pathModel.toString();
99920
+ bounds = pathModel.bounds;
99921
+ }
99922
+ else if (parsedPath.isSvg && parsedPath.svgCache) {
99923
+ path = parsedPath.svgCache.map(s => s.path.toString()).join();
99924
+ bounds = parsedPath.svgCache.reduce((acc, cur) => acc.union(cur.path.bounds), new Bounds());
99925
+ }
99673
99926
  let viewBox = `${bounds.x1} ${bounds.y1} ${bounds.width()} ${bounds.height()}`;
99674
99927
  if (lineWidth !== '0px') {
99675
99928
  const [x, y, w, h] = viewBox.split(' ').map(n => Number(n));