@visactor/vchart 2.0.22-alpha.4 → 2.0.23-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 (46) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +190 -62
  3. package/build/index.js +190 -62
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/chart/util.js +1 -2
  7. package/cjs/component/interface/theme.d.ts +2 -2
  8. package/cjs/component/interface/theme.js.map +1 -1
  9. package/cjs/component/tooltip/tooltip-transformer.js +11 -9
  10. package/cjs/component/tooltip/tooltip-transformer.js.map +1 -1
  11. package/cjs/component/util.js +2 -1
  12. package/cjs/core/index.js +1 -1
  13. package/cjs/core/instance-manager.js +1 -1
  14. package/cjs/core/vchart.js +4 -3
  15. package/cjs/core/vchart.js.map +1 -1
  16. package/cjs/data/initialize.js +1 -1
  17. package/cjs/data/register.js +1 -1
  18. package/cjs/series/bar/bar.js +14 -9
  19. package/cjs/series/bar/bar.js.map +1 -1
  20. package/cjs/series/map/map.js +18 -6
  21. package/cjs/series/map/map.js.map +1 -1
  22. package/cjs/series/sankey/tooltip-helper.js +1 -1
  23. package/cjs/series/sankey/tooltip-helper.js.map +1 -1
  24. package/cjs/series/scatter/scatter.js +9 -3
  25. package/cjs/series/scatter/scatter.js.map +1 -1
  26. package/esm/chart/util.js +1 -2
  27. package/esm/component/interface/theme.d.ts +2 -2
  28. package/esm/component/interface/theme.js.map +1 -1
  29. package/esm/component/tooltip/tooltip-transformer.js +11 -8
  30. package/esm/component/tooltip/tooltip-transformer.js.map +1 -1
  31. package/esm/component/util.js +2 -1
  32. package/esm/core/index.js +1 -1
  33. package/esm/core/instance-manager.js +1 -1
  34. package/esm/core/vchart.js +4 -3
  35. package/esm/core/vchart.js.map +1 -1
  36. package/esm/data/initialize.js +1 -1
  37. package/esm/data/register.js +1 -1
  38. package/esm/series/bar/bar.js +14 -8
  39. package/esm/series/bar/bar.js.map +1 -1
  40. package/esm/series/map/map.js +18 -6
  41. package/esm/series/map/map.js.map +1 -1
  42. package/esm/series/sankey/tooltip-helper.js +2 -2
  43. package/esm/series/sankey/tooltip-helper.js.map +1 -1
  44. package/esm/series/scatter/scatter.js +10 -4
  45. package/esm/series/scatter/scatter.js.map +1 -1
  46. package/package.json +8 -8
package/build/index.js CHANGED
@@ -16071,6 +16071,7 @@
16071
16071
  const tempConstantXYKey = ["x", "y"],
16072
16072
  tempConstantScaleXYKey = ["scaleX", "scaleY"],
16073
16073
  tempConstantAngleKey = ["angle"],
16074
+ builtinTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave"]),
16074
16075
  point = new Point();
16075
16076
  const NOWORK_ANIMATE_ATTR = {
16076
16077
  strokeSeg: 1,
@@ -16127,7 +16128,7 @@
16127
16128
  }
16128
16129
  constructor(params = {}) {
16129
16130
  var _a;
16130
- super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background ? this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
16131
+ super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
16131
16132
  }
16132
16133
  getGraphicService() {
16133
16134
  var _a, _b;
@@ -16316,7 +16317,7 @@
16316
16317
  });
16317
16318
  }
16318
16319
  setAttributes(params, forceUpdateTag = !1, context) {
16319
- params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
16320
+ params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
16320
16321
  }
16321
16322
  _setAttributes(params, forceUpdateTag = !1, context) {
16322
16323
  const keys = Object.keys(params);
@@ -16331,7 +16332,7 @@
16331
16332
  const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
16332
16333
  [key]: value
16333
16334
  }, this.attribute, key, context);
16334
- params ? this._setAttributes(params, forceUpdateTag, context) : isNil$1(null === (_a = this.normalAttrs) || void 0 === _a ? void 0 : _a[key]) ? (this.attribute[key] = value, this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context)) : this.normalAttrs[key] = value, "background" === key ? this.loadImage(value, !0) : "shadowGraphic" === key && this.setShadowGraphic(value);
16335
+ params ? this._setAttributes(params, forceUpdateTag, context) : isNil$1(null === (_a = this.normalAttrs) || void 0 === _a ? void 0 : _a[key]) ? (this.attribute[key] = value, this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context)) : this.normalAttrs[key] = value, "background" === key ? this.loadImage(value, !0) : "texture" === key && isExternalTexture(value) ? this.loadImage(value, !1) : "shadowGraphic" === key && this.setShadowGraphic(value);
16335
16336
  }
16336
16337
  needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
16337
16338
  for (let i = 0; i < k.length; i++) {
@@ -16350,7 +16351,7 @@
16350
16351
  const context = {
16351
16352
  type: AttributeUpdateType.INIT
16352
16353
  };
16353
- params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._updateTag = UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
16354
+ params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background && this.loadImage(params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._updateTag = UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
16354
16355
  }
16355
16356
  translate(x, y) {
16356
16357
  var _a, _b;
@@ -16741,6 +16742,9 @@
16741
16742
  function backgroundNotImage(image) {
16742
16743
  return "string" == typeof image ? !(image.startsWith("<svg") || isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) : !(!image.fill && !image.stroke) || !("string" != typeof image.gradient || !Array.isArray(image.stops));
16743
16744
  }
16745
+ function isExternalTexture(texture) {
16746
+ return !!texture && ("string" == typeof texture ? !builtinTextureTypes.has(texture) && (texture.startsWith("<svg") || isValidUrl$1(texture) || texture.includes("/") || isBase64$1(texture)) : isObject$2(texture));
16747
+ }
16744
16748
  Graphic.userSymbolMap = {}, Graphic.mixin(EventTarget);
16745
16749
 
16746
16750
  var GroupUpdateAABBBoundsMode;
@@ -20392,6 +20396,7 @@
20392
20396
  }
20393
20397
  const defaultBaseClipRenderAfterContribution = new DefaultBaseClipRenderAfterContribution();
20394
20398
 
20399
+ const builtinProceduralTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid"]);
20395
20400
  function formatRatio(ratio) {
20396
20401
  return ratio <= .5 ? 4 * ratio - 1 : -4 * ratio + 3;
20397
20402
  }
@@ -20505,38 +20510,43 @@
20505
20510
  texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
20506
20511
  }
20507
20512
  drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
20508
- var _a;
20513
+ var _a, _b, _c, _d, _e, _f;
20509
20514
  const {
20510
20515
  textureRatio = graphicAttribute.textureRatio,
20511
20516
  textureOptions = null
20512
20517
  } = graphic.attribute;
20513
- let pattern = this.textureMap.get(texture);
20514
- if (!pattern) switch (texture) {
20515
- case "circle":
20516
- pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
20517
- break;
20518
- case "diamond":
20519
- pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
20520
- break;
20521
- case "rect":
20522
- pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
20523
- break;
20524
- case "vertical-line":
20525
- pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
20526
- break;
20527
- case "horizontal-line":
20528
- pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
20529
- break;
20530
- case "bias-lr":
20531
- pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
20532
- break;
20533
- case "bias-rl":
20534
- pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
20535
- break;
20536
- case "grid":
20537
- pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
20518
+ let pattern = null;
20519
+ const textureRadius = null !== (_a = null == textureOptions ? void 0 : textureOptions.radius) && void 0 !== _a ? _a : 0,
20520
+ patternKey = this.getPatternCacheKey(texture, textureSize, texturePadding, textureColor, context.dpr, textureRadius);
20521
+ if (null !== patternKey && (pattern = this.textureMap.get(patternKey)), !pattern) {
20522
+ if ("string" == typeof texture) switch (texture) {
20523
+ case "circle":
20524
+ pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
20525
+ break;
20526
+ case "diamond":
20527
+ pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
20528
+ break;
20529
+ case "rect":
20530
+ pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
20531
+ break;
20532
+ case "vertical-line":
20533
+ pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
20534
+ break;
20535
+ case "horizontal-line":
20536
+ pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
20537
+ break;
20538
+ case "bias-lr":
20539
+ pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
20540
+ break;
20541
+ case "bias-rl":
20542
+ pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
20543
+ break;
20544
+ case "grid":
20545
+ pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
20546
+ }
20547
+ pattern || (pattern = this.createResourcePattern(texture, graphic, context, texturePadding, textureRadius)), pattern && null !== patternKey && this.textureMap.set(patternKey, pattern);
20538
20548
  }
20539
- if (textureOptions && textureOptions.dynamicTexture) {
20549
+ if ("string" == typeof texture && textureOptions && textureOptions.dynamicTexture) {
20540
20550
  const {
20541
20551
  gridConfig = {},
20542
20552
  useNewCanvas: useNewCanvas
@@ -20581,10 +20591,24 @@
20581
20591
  for (let i = 0; i < gridRows; i++) for (let j = 0; j < gridColumns; j++) {
20582
20592
  const _x = x + cellSize / 2 + j * cellSize,
20583
20593
  _y = y + cellSize / 2 + i * cellSize;
20584
- null === (_a = textureOptions.beforeDynamicTexture) || void 0 === _a || _a.call(textureOptions, context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height()), context.beginPath(), !1 === parsedPath.draw(context, Math.min(sizeW - gutterColumn, sizeH - gutterRow), _x, _y, 0) && context.closePath(), context.fillStyle = textureColor, textureOptions.dynamicTexture(context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height());
20594
+ null === (_b = textureOptions.beforeDynamicTexture) || void 0 === _b || _b.call(textureOptions, context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height()), context.beginPath(), !1 === parsedPath.draw(context, Math.min(sizeW - gutterColumn, sizeH - gutterRow), _x, _y, 0) && context.closePath(), context.fillStyle = textureColor, textureOptions.dynamicTexture(context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height());
20585
20595
  }
20586
20596
  useNewCanvas && (originalContext.globalAlpha = 1, originalContext.drawImage(newCanvas.nativeCanvas, 0, 0, newCanvas.nativeCanvas.width, newCanvas.nativeCanvas.height, b.x1, b.y1, b.width() * originalContext.dpr, b.height() * originalContext.dpr)), originalContext.restore();
20587
- } else if (pattern) context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore();else if ("wave" === texture) {
20597
+ } else if (pattern) {
20598
+ if (pattern.setTransform) {
20599
+ const alignToGraphic = !!(null == textureOptions ? void 0 : textureOptions.alignToGraphic),
20600
+ alignOffsetX = null !== (_c = null == textureOptions ? void 0 : textureOptions.alignOffsetX) && void 0 !== _c ? _c : 0,
20601
+ alignOffsetY = null !== (_d = null == textureOptions ? void 0 : textureOptions.alignOffsetY) && void 0 !== _d ? _d : 0;
20602
+ let translateX = 0,
20603
+ translateY = 0;
20604
+ if (alignToGraphic) {
20605
+ const m = context.currentMatrix;
20606
+ translateX = (null !== (_e = null == m ? void 0 : m.e) && void 0 !== _e ? _e : 0) + x + alignOffsetX, translateY = (null !== (_f = null == m ? void 0 : m.f) && void 0 !== _f ? _f : 0) + y + alignOffsetY;
20607
+ } else (alignOffsetX || alignOffsetY) && (translateX = alignOffsetX, translateY = alignOffsetY);
20608
+ pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, translateX, translateY]));
20609
+ }
20610
+ context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore();
20611
+ } else if ("wave" === texture) {
20588
20612
  context.save(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.clip();
20589
20613
  const b = graphic.AABBBounds;
20590
20614
  drawWave(context, textureRatio, b.width(), b.height(), Object.assign(Object.assign({}, textureOptions || {}), {
@@ -20592,6 +20616,45 @@
20592
20616
  }), x + b.x1 - x, y + b.y1 - y), context.restore();
20593
20617
  }
20594
20618
  }
20619
+ getPatternCacheKey(texture, textureSize, texturePadding, textureColor, dpr, textureRadius) {
20620
+ return "string" != typeof texture ? texturePadding > 0 || textureRadius > 0 ? null : texture : "wave" === texture ? null : builtinProceduralTextureTypes.has(texture) ? `builtin:${texture}|size:${textureSize}|padding:${texturePadding}|color:${textureColor}|dpr:${dpr}` : `resource:${texture}|padding:${texturePadding}|radius:${textureRadius}|dpr:${dpr}`;
20621
+ }
20622
+ createResourcePattern(texture, graphic, context, texturePadding, textureRadius) {
20623
+ var _a;
20624
+ const resource = null === (_a = graphic.resources) || void 0 === _a ? void 0 : _a.get(texture),
20625
+ data = "success" === (null == resource ? void 0 : resource.state) ? resource.data : "object" == typeof texture ? texture : null;
20626
+ if (!data) return null;
20627
+ if (texturePadding > 0 || textureRadius > 0) {
20628
+ const w = data.naturalWidth || data.width,
20629
+ h = data.naturalHeight || data.height;
20630
+ if (w > 0 && h > 0) {
20631
+ const tileW = w + 2 * texturePadding,
20632
+ tileH = h + 2 * texturePadding,
20633
+ canvas = canvasAllocate.allocate({
20634
+ width: tileW,
20635
+ height: tileH,
20636
+ dpr: context.dpr
20637
+ }),
20638
+ ctx = canvas.getContext("2d");
20639
+ if (ctx) {
20640
+ if (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, tileW, tileH), textureRadius > 0) {
20641
+ const r = Math.max(0, Math.min(textureRadius, Math.min(w, h) / 2)),
20642
+ x0 = texturePadding,
20643
+ y0 = texturePadding,
20644
+ x1 = x0 + w,
20645
+ y1 = y0 + h;
20646
+ ctx.beginPath(), ctx.moveTo(x0 + r, y0), ctx.lineTo(x1 - r, y0), ctx.quadraticCurveTo(x1, y0, x1, y0 + r), ctx.lineTo(x1, y1 - r), ctx.quadraticCurveTo(x1, y1, x1 - r, y1), ctx.lineTo(x0 + r, y1), ctx.quadraticCurveTo(x0, y1, x0, y1 - r), ctx.lineTo(x0, y0 + r), ctx.quadraticCurveTo(x0, y0, x0 + r, y0), ctx.closePath(), ctx.clip();
20647
+ }
20648
+ ctx.drawImage(data, texturePadding, texturePadding, w, h);
20649
+ const pattern = context.createPattern(canvas.nativeCanvas, "repeat");
20650
+ return (null == pattern ? void 0 : pattern.setTransform) && pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, 0, 0])), canvasAllocate.free(canvas), pattern;
20651
+ }
20652
+ canvasAllocate.free(canvas);
20653
+ }
20654
+ }
20655
+ const pattern = context.createPattern(data, "repeat");
20656
+ return (null == pattern ? void 0 : pattern.setTransform) && pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, 0, 0])), pattern;
20657
+ }
20595
20658
  }
20596
20659
  const defaultBaseTextureRenderContribution = new DefaultBaseTextureRenderContribution();
20597
20660
 
@@ -60945,7 +61008,7 @@
60945
61008
  this._compiler.updateLayoutTag();
60946
61009
  this._setFontFamilyTheme(this.getTheme('fontFamily'));
60947
61010
  this._initDataSet(this._option.dataSet);
60948
- this._autoSize = isTrueBrowseEnv ? (_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true : false;
61011
+ this._autoSize = isTrueBrowseEnv ? ((_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true) : false;
60949
61012
  this._bindResizeEvent();
60950
61013
  this._bindViewEvent();
60951
61014
  this._initChartPlugin();
@@ -61130,7 +61193,7 @@
61130
61193
  (_b = this._compiler) === null || _b === void 0 ? void 0 : _b.setBackground(this._getBackground());
61131
61194
  }
61132
61195
  if (updateResult.reMake) {
61133
- (_c = this._compiler) === null || _c === void 0 ? void 0 : _c.releaseGrammar();
61196
+ (_c = this._compiler) === null || _c === void 0 ? void 0 : _c.releaseGrammar(true);
61134
61197
  this._userEvents.forEach(e => { var _a; return (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(e.eType, e.query, e.handler); });
61135
61198
  }
61136
61199
  else if (updateResult.reCompile) {
@@ -61595,7 +61658,7 @@
61595
61658
  resize = true;
61596
61659
  }
61597
61660
  const lasAutoSize = this._autoSize;
61598
- this._autoSize = isTrueBrowser(this._option.mode) ? (_b = (_a = this._spec.autoFit) !== null && _a !== void 0 ? _a : this._option.autoFit) !== null && _b !== void 0 ? _b : true : false;
61661
+ this._autoSize = isTrueBrowser(this._option.mode) ? ((_b = (_a = this._spec.autoFit) !== null && _a !== void 0 ? _a : this._option.autoFit) !== null && _b !== void 0 ? _b : true) : false;
61599
61662
  if (this._autoSize !== lasAutoSize) {
61600
61663
  resize = true;
61601
61664
  }
@@ -61790,9 +61853,10 @@
61790
61853
  (_a = this._chart) === null || _a === void 0 ? void 0 : _a.setLayout(layout);
61791
61854
  }
61792
61855
  reLayout() {
61793
- var _a;
61794
- this._chart.resetLayoutItemTag();
61795
- (_a = this._chart) === null || _a === void 0 ? void 0 : _a.setLayoutTag(true);
61856
+ var _a, _b, _c;
61857
+ (_a = this._chart) === null || _a === void 0 ? void 0 : _a.resetLayoutItemTag();
61858
+ (_b = this._chart) === null || _b === void 0 ? void 0 : _b.setLayoutTag(true, null, false);
61859
+ (_c = this._compiler) === null || _c === void 0 ? void 0 : _c.render();
61796
61860
  }
61797
61861
  getCompiler() {
61798
61862
  return this._compiler;
@@ -73427,13 +73491,20 @@
73427
73491
  }
73428
73492
  const xScale = (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
73429
73493
  const yScale = (_d = (_c = this._yAxisHelper) === null || _c === void 0 ? void 0 : _c.getScale) === null || _d === void 0 ? void 0 : _d.call(_c, 0);
73494
+ const isVertical = this.direction === "vertical";
73430
73495
  this._barMark.setMarkConfig({
73431
73496
  clip: true,
73432
73497
  clipPath: () => {
73498
+ const usePreCalculatedRect = !!this._shouldDoPreCalculate();
73499
+ if (usePreCalculatedRect) {
73500
+ this._calculateStackRectPosition(isVertical);
73501
+ }
73433
73502
  const rectPaths = [];
73434
73503
  this._forEachStackGroup(node => {
73435
73504
  let min = Infinity;
73436
73505
  let max = -Infinity;
73506
+ let rectMin = Infinity;
73507
+ let rectMax = -Infinity;
73437
73508
  let hasPercent = false;
73438
73509
  let minPercent = Infinity;
73439
73510
  let maxPercent = -Infinity;
@@ -73444,6 +73515,12 @@
73444
73515
  const endPercent = datum[STACK_FIELD_END_PERCENT];
73445
73516
  min = Math.min(min, start, end);
73446
73517
  max = Math.max(max, start, end);
73518
+ if (usePreCalculatedRect) {
73519
+ const rectStart = datum[isVertical ? RECT_Y : RECT_X];
73520
+ const rectEnd = datum[isVertical ? RECT_Y1 : RECT_X1];
73521
+ rectMin = Math.min(rectMin, rectStart, rectEnd);
73522
+ rectMax = Math.max(rectMax, rectStart, rectEnd);
73523
+ }
73447
73524
  if (isValid$1(startPercent) && isValid$1(endPercent)) {
73448
73525
  hasPercent = true;
73449
73526
  minPercent = Math.min(minPercent, startPercent, endPercent);
@@ -73458,14 +73535,14 @@
73458
73535
  : undefined));
73459
73536
  const rectAttr = this.direction === "horizontal"
73460
73537
  ? {
73461
- x: this._getBarXStart(mockDatum, xScale),
73462
- x1: this._getBarXEnd(mockDatum, xScale),
73538
+ x: usePreCalculatedRect ? rectMin : this._getBarXStart(mockDatum, xScale),
73539
+ x1: usePreCalculatedRect ? rectMax : this._getBarXEnd(mockDatum, xScale),
73463
73540
  y: this._getPosition(this.direction, mockDatum),
73464
73541
  height: this._getBarWidth(this._yAxisHelper)
73465
73542
  }
73466
73543
  : {
73467
- y: this._getBarYStart(mockDatum, yScale),
73468
- y1: this._getBarYEnd(mockDatum, yScale),
73544
+ y: usePreCalculatedRect ? rectMin : this._getBarYStart(mockDatum, yScale),
73545
+ y1: usePreCalculatedRect ? rectMax : this._getBarYEnd(mockDatum, yScale),
73469
73546
  x: this._getPosition(this.direction, mockDatum),
73470
73547
  width: this._getBarWidth(this._xAxisHelper)
73471
73548
  };
@@ -74016,7 +74093,7 @@
74016
74093
  }
74017
74094
  }
74018
74095
  handleZoom(e) {
74019
- var _a, _b;
74096
+ var _a, _b, _c, _d;
74020
74097
  this.getMarksWithoutRoot().forEach(mark => {
74021
74098
  if (!mark) {
74022
74099
  return;
@@ -74034,10 +74111,23 @@
74034
74111
  }
74035
74112
  });
74036
74113
  });
74037
- const vgrammarLabel = (_b = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent()) === null || _b === void 0 ? void 0 : _b.getProduct();
74038
- if (vgrammarLabel) {
74114
+ const labelComponent = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
74115
+ if (labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.renderInner) {
74116
+ labelComponent.renderInner();
74117
+ }
74118
+ const vgrammarLabel = (_b = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getComponent) === null || _b === void 0 ? void 0 : _b.call(labelComponent);
74119
+ if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.evaluate) {
74039
74120
  vgrammarLabel.evaluate(null, null);
74040
74121
  }
74122
+ const labelGroup = (_c = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getProduct) === null || _c === void 0 ? void 0 : _c.call(labelComponent);
74123
+ if (labelGroup && (e === null || e === void 0 ? void 0 : e.scale) && (e === null || e === void 0 ? void 0 : e.scaleCenter)) {
74124
+ if (!((_d = labelGroup.attribute) === null || _d === void 0 ? void 0 : _d.postMatrix)) {
74125
+ labelGroup.setAttributes({
74126
+ postMatrix: new Matrix()
74127
+ });
74128
+ }
74129
+ labelGroup.scale(e.scale, e.scale, e.scaleCenter);
74130
+ }
74041
74131
  }
74042
74132
  handlePan(e) {
74043
74133
  this.handleZoom(e);
@@ -75299,7 +75389,7 @@
75299
75389
  this._mapViewData = null;
75300
75390
  }
75301
75391
  handleZoom(e) {
75302
- var _a;
75392
+ var _a, _b, _c, _d;
75303
75393
  const { scale, scaleCenter } = e;
75304
75394
  if (scale === 1) {
75305
75395
  return;
@@ -75313,13 +75403,26 @@
75313
75403
  }
75314
75404
  pathGroup.scale(scale, scale, scaleCenter);
75315
75405
  }
75316
- const vgrammarLabel = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
75317
- if (vgrammarLabel) {
75318
- vgrammarLabel.renderInner();
75406
+ const labelComponent = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
75407
+ if (labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.renderInner) {
75408
+ labelComponent.renderInner();
75409
+ }
75410
+ const vgrammarLabel = (_b = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getComponent) === null || _b === void 0 ? void 0 : _b.call(labelComponent);
75411
+ if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.evaluate) {
75412
+ vgrammarLabel.evaluate(null, null);
75413
+ }
75414
+ const labelGroup = (_c = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getProduct) === null || _c === void 0 ? void 0 : _c.call(labelComponent);
75415
+ if (labelGroup && scale && scaleCenter) {
75416
+ if (!((_d = labelGroup.attribute) === null || _d === void 0 ? void 0 : _d.postMatrix)) {
75417
+ labelGroup.setAttributes({
75418
+ postMatrix: new Matrix()
75419
+ });
75420
+ }
75421
+ labelGroup.scale(scale, scale, scaleCenter);
75319
75422
  }
75320
75423
  }
75321
75424
  handlePan(e) {
75322
- var _a;
75425
+ var _a, _b, _c, _d;
75323
75426
  const { delta } = e;
75324
75427
  if (delta[0] === 0 && delta[1] === 0) {
75325
75428
  return;
@@ -75333,9 +75436,22 @@
75333
75436
  }
75334
75437
  pathGroup.translate(delta[0], delta[1]);
75335
75438
  }
75336
- const vgrammarLabel = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
75337
- if (vgrammarLabel) {
75338
- vgrammarLabel.renderInner();
75439
+ const labelComponent = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
75440
+ if (labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.renderInner) {
75441
+ labelComponent.renderInner();
75442
+ }
75443
+ const vgrammarLabel = (_b = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getComponent) === null || _b === void 0 ? void 0 : _b.call(labelComponent);
75444
+ if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.evaluate) {
75445
+ vgrammarLabel.evaluate(null, null);
75446
+ }
75447
+ const labelGroup = (_c = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getProduct) === null || _c === void 0 ? void 0 : _c.call(labelComponent);
75448
+ if (labelGroup && delta) {
75449
+ if (!((_d = labelGroup.attribute) === null || _d === void 0 ? void 0 : _d.postMatrix)) {
75450
+ labelGroup.setAttributes({
75451
+ postMatrix: new Matrix()
75452
+ });
75453
+ }
75454
+ labelGroup.translate(delta[0], delta[1]);
75339
75455
  }
75340
75456
  }
75341
75457
  getDatumCenter(datum) {
@@ -89383,7 +89499,7 @@
89383
89499
  constructor() {
89384
89500
  super(...arguments);
89385
89501
  this._getDimensionData = (datum) => {
89386
- if (datum.source) {
89502
+ if (!isNil$1(datum === null || datum === void 0 ? void 0 : datum.source) && !isNil$1(datum === null || datum === void 0 ? void 0 : datum.target)) {
89387
89503
  if (isNumber$1(datum.source)) {
89388
89504
  const seriesKeys = this.series.getSeriesKeys();
89389
89505
  return seriesKeys[datum.source] + ' => ' + seriesKeys[datum.target];
@@ -96610,19 +96726,31 @@
96610
96726
  const isMarkInfo = (info) => isValid$1(info) && !isArray$1(info);
96611
96727
  const isDimensionInfo = (info) => isValid$1(info) && isArray$1(info);
96612
96728
 
96729
+ const TOOLTIP_STYLE_THEME_KEYS = [
96730
+ 'panel',
96731
+ 'shape',
96732
+ 'titleLabel',
96733
+ 'keyLabel',
96734
+ 'valueLabel',
96735
+ 'spaceRow',
96736
+ 'maxContentHeight',
96737
+ 'align'
96738
+ ];
96613
96739
  class TooltipSpecTransformer extends BaseComponentSpecTransformer {
96614
96740
  _shouldMergeThemeToSpec() {
96615
96741
  return false;
96616
96742
  }
96617
96743
  _initTheme(spec, chartSpec) {
96618
- var _a, _b, _c;
96619
96744
  const { spec: newSpec, theme } = super._initTheme(spec, chartSpec);
96620
- newSpec.style = mergeSpec({}, this._theme, newSpec.style);
96621
- newSpec.offset = mergeSpec({}, theme.offset, spec.offset);
96622
- newSpec.transitionDuration = (_a = spec.transitionDuration) !== null && _a !== void 0 ? _a : theme.transitionDuration;
96623
- newSpec.trigger = (_b = spec.trigger) !== null && _b !== void 0 ? _b : theme.trigger;
96624
- newSpec.triggerOff = (_c = spec.triggerOff) !== null && _c !== void 0 ? _c : theme.triggerOff;
96625
- return { spec: newSpec, theme };
96745
+ const themeStyle = mergeSpec({}, ...TOOLTIP_STYLE_THEME_KEYS.map(key => ((theme === null || theme === void 0 ? void 0 : theme[key]) !== undefined ? { [key]: theme[key] } : undefined)), theme === null || theme === void 0 ? void 0 : theme.style);
96746
+ const themeSpec = mergeSpec({}, theme);
96747
+ TOOLTIP_STYLE_THEME_KEYS.forEach(key => {
96748
+ delete themeSpec[key];
96749
+ });
96750
+ delete themeSpec.style;
96751
+ const mergedSpec = mergeSpec({}, themeSpec, newSpec);
96752
+ mergedSpec.style = mergeSpec({}, themeStyle, mergedSpec.style);
96753
+ return { spec: mergedSpec, theme };
96626
96754
  }
96627
96755
  _transformSpecAfterMergingTheme(spec, chartSpec, chartSpecInfo) {
96628
96756
  var _a, _b, _c, _d, _e, _f, _g;