@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.
- package/build/es5/index.js +1 -1
- package/build/index.es.js +190 -62
- package/build/index.js +190 -62
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/util.js +1 -2
- package/cjs/component/interface/theme.d.ts +2 -2
- package/cjs/component/interface/theme.js.map +1 -1
- package/cjs/component/tooltip/tooltip-transformer.js +11 -9
- package/cjs/component/tooltip/tooltip-transformer.js.map +1 -1
- package/cjs/component/util.js +2 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/instance-manager.js +1 -1
- package/cjs/core/vchart.js +4 -3
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/initialize.js +1 -1
- package/cjs/data/register.js +1 -1
- package/cjs/series/bar/bar.js +14 -9
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/map/map.js +18 -6
- package/cjs/series/map/map.js.map +1 -1
- package/cjs/series/sankey/tooltip-helper.js +1 -1
- package/cjs/series/sankey/tooltip-helper.js.map +1 -1
- package/cjs/series/scatter/scatter.js +9 -3
- package/cjs/series/scatter/scatter.js.map +1 -1
- package/esm/chart/util.js +1 -2
- package/esm/component/interface/theme.d.ts +2 -2
- package/esm/component/interface/theme.js.map +1 -1
- package/esm/component/tooltip/tooltip-transformer.js +11 -8
- package/esm/component/tooltip/tooltip-transformer.js.map +1 -1
- package/esm/component/util.js +2 -1
- package/esm/core/index.js +1 -1
- package/esm/core/instance-manager.js +1 -1
- package/esm/core/vchart.js +4 -3
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/initialize.js +1 -1
- package/esm/data/register.js +1 -1
- package/esm/series/bar/bar.js +14 -8
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/map/map.js +18 -6
- package/esm/series/map/map.js.map +1 -1
- package/esm/series/sankey/tooltip-helper.js +2 -2
- package/esm/series/sankey/tooltip-helper.js.map +1 -1
- package/esm/series/scatter/scatter.js +10 -4
- package/esm/series/scatter/scatter.js.map +1 -1
- package/package.json +8 -8
package/build/index.es.js
CHANGED
|
@@ -16065,6 +16065,7 @@ const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "ancho
|
|
|
16065
16065
|
const tempConstantXYKey = ["x", "y"],
|
|
16066
16066
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
16067
16067
|
tempConstantAngleKey = ["angle"],
|
|
16068
|
+
builtinTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave"]),
|
|
16068
16069
|
point = new Point();
|
|
16069
16070
|
const NOWORK_ANIMATE_ATTR = {
|
|
16070
16071
|
strokeSeg: 1,
|
|
@@ -16121,7 +16122,7 @@ class Graphic extends Node {
|
|
|
16121
16122
|
}
|
|
16122
16123
|
constructor(params = {}) {
|
|
16123
16124
|
var _a;
|
|
16124
|
-
super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background
|
|
16125
|
+
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);
|
|
16125
16126
|
}
|
|
16126
16127
|
getGraphicService() {
|
|
16127
16128
|
var _a, _b;
|
|
@@ -16310,7 +16311,7 @@ class Graphic extends Node {
|
|
|
16310
16311
|
});
|
|
16311
16312
|
}
|
|
16312
16313
|
setAttributes(params, forceUpdateTag = !1, context) {
|
|
16313
|
-
params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background
|
|
16314
|
+
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));
|
|
16314
16315
|
}
|
|
16315
16316
|
_setAttributes(params, forceUpdateTag = !1, context) {
|
|
16316
16317
|
const keys = Object.keys(params);
|
|
@@ -16325,7 +16326,7 @@ class Graphic extends Node {
|
|
|
16325
16326
|
const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
|
|
16326
16327
|
[key]: value
|
|
16327
16328
|
}, this.attribute, key, context);
|
|
16328
|
-
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);
|
|
16329
|
+
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);
|
|
16329
16330
|
}
|
|
16330
16331
|
needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
16331
16332
|
for (let i = 0; i < k.length; i++) {
|
|
@@ -16344,7 +16345,7 @@ class Graphic extends Node {
|
|
|
16344
16345
|
const context = {
|
|
16345
16346
|
type: AttributeUpdateType.INIT
|
|
16346
16347
|
};
|
|
16347
|
-
params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background
|
|
16348
|
+
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);
|
|
16348
16349
|
}
|
|
16349
16350
|
translate(x, y) {
|
|
16350
16351
|
var _a, _b;
|
|
@@ -16735,6 +16736,9 @@ class Graphic extends Node {
|
|
|
16735
16736
|
function backgroundNotImage(image) {
|
|
16736
16737
|
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));
|
|
16737
16738
|
}
|
|
16739
|
+
function isExternalTexture(texture) {
|
|
16740
|
+
return !!texture && ("string" == typeof texture ? !builtinTextureTypes.has(texture) && (texture.startsWith("<svg") || isValidUrl$1(texture) || texture.includes("/") || isBase64$1(texture)) : isObject$2(texture));
|
|
16741
|
+
}
|
|
16738
16742
|
Graphic.userSymbolMap = {}, Graphic.mixin(EventTarget);
|
|
16739
16743
|
|
|
16740
16744
|
var GroupUpdateAABBBoundsMode;
|
|
@@ -20386,6 +20390,7 @@ class DefaultBaseClipRenderAfterContribution {
|
|
|
20386
20390
|
}
|
|
20387
20391
|
const defaultBaseClipRenderAfterContribution = new DefaultBaseClipRenderAfterContribution();
|
|
20388
20392
|
|
|
20393
|
+
const builtinProceduralTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid"]);
|
|
20389
20394
|
function formatRatio(ratio) {
|
|
20390
20395
|
return ratio <= .5 ? 4 * ratio - 1 : -4 * ratio + 3;
|
|
20391
20396
|
}
|
|
@@ -20499,38 +20504,43 @@ class DefaultBaseTextureRenderContribution {
|
|
|
20499
20504
|
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
20500
20505
|
}
|
|
20501
20506
|
drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
|
|
20502
|
-
var _a;
|
|
20507
|
+
var _a, _b, _c, _d, _e, _f;
|
|
20503
20508
|
const {
|
|
20504
20509
|
textureRatio = graphicAttribute.textureRatio,
|
|
20505
20510
|
textureOptions = null
|
|
20506
20511
|
} = graphic.attribute;
|
|
20507
|
-
let pattern =
|
|
20508
|
-
|
|
20509
|
-
|
|
20510
|
-
|
|
20511
|
-
|
|
20512
|
-
|
|
20513
|
-
|
|
20514
|
-
|
|
20515
|
-
|
|
20516
|
-
|
|
20517
|
-
|
|
20518
|
-
|
|
20519
|
-
|
|
20520
|
-
|
|
20521
|
-
|
|
20522
|
-
|
|
20523
|
-
|
|
20524
|
-
|
|
20525
|
-
|
|
20526
|
-
|
|
20527
|
-
|
|
20528
|
-
|
|
20529
|
-
|
|
20530
|
-
|
|
20531
|
-
|
|
20512
|
+
let pattern = null;
|
|
20513
|
+
const textureRadius = null !== (_a = null == textureOptions ? void 0 : textureOptions.radius) && void 0 !== _a ? _a : 0,
|
|
20514
|
+
patternKey = this.getPatternCacheKey(texture, textureSize, texturePadding, textureColor, context.dpr, textureRadius);
|
|
20515
|
+
if (null !== patternKey && (pattern = this.textureMap.get(patternKey)), !pattern) {
|
|
20516
|
+
if ("string" == typeof texture) switch (texture) {
|
|
20517
|
+
case "circle":
|
|
20518
|
+
pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
|
|
20519
|
+
break;
|
|
20520
|
+
case "diamond":
|
|
20521
|
+
pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
|
|
20522
|
+
break;
|
|
20523
|
+
case "rect":
|
|
20524
|
+
pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
|
|
20525
|
+
break;
|
|
20526
|
+
case "vertical-line":
|
|
20527
|
+
pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
|
|
20528
|
+
break;
|
|
20529
|
+
case "horizontal-line":
|
|
20530
|
+
pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
|
|
20531
|
+
break;
|
|
20532
|
+
case "bias-lr":
|
|
20533
|
+
pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
|
|
20534
|
+
break;
|
|
20535
|
+
case "bias-rl":
|
|
20536
|
+
pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
|
|
20537
|
+
break;
|
|
20538
|
+
case "grid":
|
|
20539
|
+
pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
|
|
20540
|
+
}
|
|
20541
|
+
pattern || (pattern = this.createResourcePattern(texture, graphic, context, texturePadding, textureRadius)), pattern && null !== patternKey && this.textureMap.set(patternKey, pattern);
|
|
20532
20542
|
}
|
|
20533
|
-
if (textureOptions && textureOptions.dynamicTexture) {
|
|
20543
|
+
if ("string" == typeof texture && textureOptions && textureOptions.dynamicTexture) {
|
|
20534
20544
|
const {
|
|
20535
20545
|
gridConfig = {},
|
|
20536
20546
|
useNewCanvas: useNewCanvas
|
|
@@ -20575,10 +20585,24 @@ class DefaultBaseTextureRenderContribution {
|
|
|
20575
20585
|
for (let i = 0; i < gridRows; i++) for (let j = 0; j < gridColumns; j++) {
|
|
20576
20586
|
const _x = x + cellSize / 2 + j * cellSize,
|
|
20577
20587
|
_y = y + cellSize / 2 + i * cellSize;
|
|
20578
|
-
null === (
|
|
20588
|
+
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());
|
|
20579
20589
|
}
|
|
20580
20590
|
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();
|
|
20581
|
-
} else if (pattern)
|
|
20591
|
+
} else if (pattern) {
|
|
20592
|
+
if (pattern.setTransform) {
|
|
20593
|
+
const alignToGraphic = !!(null == textureOptions ? void 0 : textureOptions.alignToGraphic),
|
|
20594
|
+
alignOffsetX = null !== (_c = null == textureOptions ? void 0 : textureOptions.alignOffsetX) && void 0 !== _c ? _c : 0,
|
|
20595
|
+
alignOffsetY = null !== (_d = null == textureOptions ? void 0 : textureOptions.alignOffsetY) && void 0 !== _d ? _d : 0;
|
|
20596
|
+
let translateX = 0,
|
|
20597
|
+
translateY = 0;
|
|
20598
|
+
if (alignToGraphic) {
|
|
20599
|
+
const m = context.currentMatrix;
|
|
20600
|
+
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;
|
|
20601
|
+
} else (alignOffsetX || alignOffsetY) && (translateX = alignOffsetX, translateY = alignOffsetY);
|
|
20602
|
+
pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, translateX, translateY]));
|
|
20603
|
+
}
|
|
20604
|
+
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore();
|
|
20605
|
+
} else if ("wave" === texture) {
|
|
20582
20606
|
context.save(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.clip();
|
|
20583
20607
|
const b = graphic.AABBBounds;
|
|
20584
20608
|
drawWave(context, textureRatio, b.width(), b.height(), Object.assign(Object.assign({}, textureOptions || {}), {
|
|
@@ -20586,6 +20610,45 @@ class DefaultBaseTextureRenderContribution {
|
|
|
20586
20610
|
}), x + b.x1 - x, y + b.y1 - y), context.restore();
|
|
20587
20611
|
}
|
|
20588
20612
|
}
|
|
20613
|
+
getPatternCacheKey(texture, textureSize, texturePadding, textureColor, dpr, textureRadius) {
|
|
20614
|
+
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}`;
|
|
20615
|
+
}
|
|
20616
|
+
createResourcePattern(texture, graphic, context, texturePadding, textureRadius) {
|
|
20617
|
+
var _a;
|
|
20618
|
+
const resource = null === (_a = graphic.resources) || void 0 === _a ? void 0 : _a.get(texture),
|
|
20619
|
+
data = "success" === (null == resource ? void 0 : resource.state) ? resource.data : "object" == typeof texture ? texture : null;
|
|
20620
|
+
if (!data) return null;
|
|
20621
|
+
if (texturePadding > 0 || textureRadius > 0) {
|
|
20622
|
+
const w = data.naturalWidth || data.width,
|
|
20623
|
+
h = data.naturalHeight || data.height;
|
|
20624
|
+
if (w > 0 && h > 0) {
|
|
20625
|
+
const tileW = w + 2 * texturePadding,
|
|
20626
|
+
tileH = h + 2 * texturePadding,
|
|
20627
|
+
canvas = canvasAllocate.allocate({
|
|
20628
|
+
width: tileW,
|
|
20629
|
+
height: tileH,
|
|
20630
|
+
dpr: context.dpr
|
|
20631
|
+
}),
|
|
20632
|
+
ctx = canvas.getContext("2d");
|
|
20633
|
+
if (ctx) {
|
|
20634
|
+
if (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, tileW, tileH), textureRadius > 0) {
|
|
20635
|
+
const r = Math.max(0, Math.min(textureRadius, Math.min(w, h) / 2)),
|
|
20636
|
+
x0 = texturePadding,
|
|
20637
|
+
y0 = texturePadding,
|
|
20638
|
+
x1 = x0 + w,
|
|
20639
|
+
y1 = y0 + h;
|
|
20640
|
+
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();
|
|
20641
|
+
}
|
|
20642
|
+
ctx.drawImage(data, texturePadding, texturePadding, w, h);
|
|
20643
|
+
const pattern = context.createPattern(canvas.nativeCanvas, "repeat");
|
|
20644
|
+
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;
|
|
20645
|
+
}
|
|
20646
|
+
canvasAllocate.free(canvas);
|
|
20647
|
+
}
|
|
20648
|
+
}
|
|
20649
|
+
const pattern = context.createPattern(data, "repeat");
|
|
20650
|
+
return (null == pattern ? void 0 : pattern.setTransform) && pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, 0, 0])), pattern;
|
|
20651
|
+
}
|
|
20589
20652
|
}
|
|
20590
20653
|
const defaultBaseTextureRenderContribution = new DefaultBaseTextureRenderContribution();
|
|
20591
20654
|
|
|
@@ -60939,7 +61002,7 @@ class VChart {
|
|
|
60939
61002
|
this._compiler.updateLayoutTag();
|
|
60940
61003
|
this._setFontFamilyTheme(this.getTheme('fontFamily'));
|
|
60941
61004
|
this._initDataSet(this._option.dataSet);
|
|
60942
|
-
this._autoSize = isTrueBrowseEnv ? (_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true : false;
|
|
61005
|
+
this._autoSize = isTrueBrowseEnv ? ((_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true) : false;
|
|
60943
61006
|
this._bindResizeEvent();
|
|
60944
61007
|
this._bindViewEvent();
|
|
60945
61008
|
this._initChartPlugin();
|
|
@@ -61124,7 +61187,7 @@ class VChart {
|
|
|
61124
61187
|
(_b = this._compiler) === null || _b === void 0 ? void 0 : _b.setBackground(this._getBackground());
|
|
61125
61188
|
}
|
|
61126
61189
|
if (updateResult.reMake) {
|
|
61127
|
-
(_c = this._compiler) === null || _c === void 0 ? void 0 : _c.releaseGrammar();
|
|
61190
|
+
(_c = this._compiler) === null || _c === void 0 ? void 0 : _c.releaseGrammar(true);
|
|
61128
61191
|
this._userEvents.forEach(e => { var _a; return (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(e.eType, e.query, e.handler); });
|
|
61129
61192
|
}
|
|
61130
61193
|
else if (updateResult.reCompile) {
|
|
@@ -61589,7 +61652,7 @@ class VChart {
|
|
|
61589
61652
|
resize = true;
|
|
61590
61653
|
}
|
|
61591
61654
|
const lasAutoSize = this._autoSize;
|
|
61592
|
-
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;
|
|
61655
|
+
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;
|
|
61593
61656
|
if (this._autoSize !== lasAutoSize) {
|
|
61594
61657
|
resize = true;
|
|
61595
61658
|
}
|
|
@@ -61784,9 +61847,10 @@ class VChart {
|
|
|
61784
61847
|
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.setLayout(layout);
|
|
61785
61848
|
}
|
|
61786
61849
|
reLayout() {
|
|
61787
|
-
var _a;
|
|
61788
|
-
this._chart.resetLayoutItemTag();
|
|
61789
|
-
(
|
|
61850
|
+
var _a, _b, _c;
|
|
61851
|
+
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.resetLayoutItemTag();
|
|
61852
|
+
(_b = this._chart) === null || _b === void 0 ? void 0 : _b.setLayoutTag(true, null, false);
|
|
61853
|
+
(_c = this._compiler) === null || _c === void 0 ? void 0 : _c.render();
|
|
61790
61854
|
}
|
|
61791
61855
|
getCompiler() {
|
|
61792
61856
|
return this._compiler;
|
|
@@ -73421,13 +73485,20 @@ class BarSeries extends CartesianSeries {
|
|
|
73421
73485
|
}
|
|
73422
73486
|
const xScale = (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
|
|
73423
73487
|
const yScale = (_d = (_c = this._yAxisHelper) === null || _c === void 0 ? void 0 : _c.getScale) === null || _d === void 0 ? void 0 : _d.call(_c, 0);
|
|
73488
|
+
const isVertical = this.direction === "vertical";
|
|
73424
73489
|
this._barMark.setMarkConfig({
|
|
73425
73490
|
clip: true,
|
|
73426
73491
|
clipPath: () => {
|
|
73492
|
+
const usePreCalculatedRect = !!this._shouldDoPreCalculate();
|
|
73493
|
+
if (usePreCalculatedRect) {
|
|
73494
|
+
this._calculateStackRectPosition(isVertical);
|
|
73495
|
+
}
|
|
73427
73496
|
const rectPaths = [];
|
|
73428
73497
|
this._forEachStackGroup(node => {
|
|
73429
73498
|
let min = Infinity;
|
|
73430
73499
|
let max = -Infinity;
|
|
73500
|
+
let rectMin = Infinity;
|
|
73501
|
+
let rectMax = -Infinity;
|
|
73431
73502
|
let hasPercent = false;
|
|
73432
73503
|
let minPercent = Infinity;
|
|
73433
73504
|
let maxPercent = -Infinity;
|
|
@@ -73438,6 +73509,12 @@ class BarSeries extends CartesianSeries {
|
|
|
73438
73509
|
const endPercent = datum[STACK_FIELD_END_PERCENT];
|
|
73439
73510
|
min = Math.min(min, start, end);
|
|
73440
73511
|
max = Math.max(max, start, end);
|
|
73512
|
+
if (usePreCalculatedRect) {
|
|
73513
|
+
const rectStart = datum[isVertical ? RECT_Y : RECT_X];
|
|
73514
|
+
const rectEnd = datum[isVertical ? RECT_Y1 : RECT_X1];
|
|
73515
|
+
rectMin = Math.min(rectMin, rectStart, rectEnd);
|
|
73516
|
+
rectMax = Math.max(rectMax, rectStart, rectEnd);
|
|
73517
|
+
}
|
|
73441
73518
|
if (isValid$1(startPercent) && isValid$1(endPercent)) {
|
|
73442
73519
|
hasPercent = true;
|
|
73443
73520
|
minPercent = Math.min(minPercent, startPercent, endPercent);
|
|
@@ -73452,14 +73529,14 @@ class BarSeries extends CartesianSeries {
|
|
|
73452
73529
|
: undefined));
|
|
73453
73530
|
const rectAttr = this.direction === "horizontal"
|
|
73454
73531
|
? {
|
|
73455
|
-
x: this._getBarXStart(mockDatum, xScale),
|
|
73456
|
-
x1: this._getBarXEnd(mockDatum, xScale),
|
|
73532
|
+
x: usePreCalculatedRect ? rectMin : this._getBarXStart(mockDatum, xScale),
|
|
73533
|
+
x1: usePreCalculatedRect ? rectMax : this._getBarXEnd(mockDatum, xScale),
|
|
73457
73534
|
y: this._getPosition(this.direction, mockDatum),
|
|
73458
73535
|
height: this._getBarWidth(this._yAxisHelper)
|
|
73459
73536
|
}
|
|
73460
73537
|
: {
|
|
73461
|
-
y: this._getBarYStart(mockDatum, yScale),
|
|
73462
|
-
y1: this._getBarYEnd(mockDatum, yScale),
|
|
73538
|
+
y: usePreCalculatedRect ? rectMin : this._getBarYStart(mockDatum, yScale),
|
|
73539
|
+
y1: usePreCalculatedRect ? rectMax : this._getBarYEnd(mockDatum, yScale),
|
|
73463
73540
|
x: this._getPosition(this.direction, mockDatum),
|
|
73464
73541
|
width: this._getBarWidth(this._xAxisHelper)
|
|
73465
73542
|
};
|
|
@@ -74010,7 +74087,7 @@ class ScatterSeries extends CartesianSeries {
|
|
|
74010
74087
|
}
|
|
74011
74088
|
}
|
|
74012
74089
|
handleZoom(e) {
|
|
74013
|
-
var _a, _b;
|
|
74090
|
+
var _a, _b, _c, _d;
|
|
74014
74091
|
this.getMarksWithoutRoot().forEach(mark => {
|
|
74015
74092
|
if (!mark) {
|
|
74016
74093
|
return;
|
|
@@ -74028,10 +74105,23 @@ class ScatterSeries extends CartesianSeries {
|
|
|
74028
74105
|
}
|
|
74029
74106
|
});
|
|
74030
74107
|
});
|
|
74031
|
-
const
|
|
74032
|
-
if (
|
|
74108
|
+
const labelComponent = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
|
|
74109
|
+
if (labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.renderInner) {
|
|
74110
|
+
labelComponent.renderInner();
|
|
74111
|
+
}
|
|
74112
|
+
const vgrammarLabel = (_b = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getComponent) === null || _b === void 0 ? void 0 : _b.call(labelComponent);
|
|
74113
|
+
if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.evaluate) {
|
|
74033
74114
|
vgrammarLabel.evaluate(null, null);
|
|
74034
74115
|
}
|
|
74116
|
+
const labelGroup = (_c = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getProduct) === null || _c === void 0 ? void 0 : _c.call(labelComponent);
|
|
74117
|
+
if (labelGroup && (e === null || e === void 0 ? void 0 : e.scale) && (e === null || e === void 0 ? void 0 : e.scaleCenter)) {
|
|
74118
|
+
if (!((_d = labelGroup.attribute) === null || _d === void 0 ? void 0 : _d.postMatrix)) {
|
|
74119
|
+
labelGroup.setAttributes({
|
|
74120
|
+
postMatrix: new Matrix()
|
|
74121
|
+
});
|
|
74122
|
+
}
|
|
74123
|
+
labelGroup.scale(e.scale, e.scale, e.scaleCenter);
|
|
74124
|
+
}
|
|
74035
74125
|
}
|
|
74036
74126
|
handlePan(e) {
|
|
74037
74127
|
this.handleZoom(e);
|
|
@@ -75293,7 +75383,7 @@ class MapSeries extends GeoSeries {
|
|
|
75293
75383
|
this._mapViewData = null;
|
|
75294
75384
|
}
|
|
75295
75385
|
handleZoom(e) {
|
|
75296
|
-
var _a;
|
|
75386
|
+
var _a, _b, _c, _d;
|
|
75297
75387
|
const { scale, scaleCenter } = e;
|
|
75298
75388
|
if (scale === 1) {
|
|
75299
75389
|
return;
|
|
@@ -75307,13 +75397,26 @@ class MapSeries extends GeoSeries {
|
|
|
75307
75397
|
}
|
|
75308
75398
|
pathGroup.scale(scale, scale, scaleCenter);
|
|
75309
75399
|
}
|
|
75310
|
-
const
|
|
75311
|
-
if (
|
|
75312
|
-
|
|
75400
|
+
const labelComponent = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
|
|
75401
|
+
if (labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.renderInner) {
|
|
75402
|
+
labelComponent.renderInner();
|
|
75403
|
+
}
|
|
75404
|
+
const vgrammarLabel = (_b = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getComponent) === null || _b === void 0 ? void 0 : _b.call(labelComponent);
|
|
75405
|
+
if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.evaluate) {
|
|
75406
|
+
vgrammarLabel.evaluate(null, null);
|
|
75407
|
+
}
|
|
75408
|
+
const labelGroup = (_c = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getProduct) === null || _c === void 0 ? void 0 : _c.call(labelComponent);
|
|
75409
|
+
if (labelGroup && scale && scaleCenter) {
|
|
75410
|
+
if (!((_d = labelGroup.attribute) === null || _d === void 0 ? void 0 : _d.postMatrix)) {
|
|
75411
|
+
labelGroup.setAttributes({
|
|
75412
|
+
postMatrix: new Matrix()
|
|
75413
|
+
});
|
|
75414
|
+
}
|
|
75415
|
+
labelGroup.scale(scale, scale, scaleCenter);
|
|
75313
75416
|
}
|
|
75314
75417
|
}
|
|
75315
75418
|
handlePan(e) {
|
|
75316
|
-
var _a;
|
|
75419
|
+
var _a, _b, _c, _d;
|
|
75317
75420
|
const { delta } = e;
|
|
75318
75421
|
if (delta[0] === 0 && delta[1] === 0) {
|
|
75319
75422
|
return;
|
|
@@ -75327,9 +75430,22 @@ class MapSeries extends GeoSeries {
|
|
|
75327
75430
|
}
|
|
75328
75431
|
pathGroup.translate(delta[0], delta[1]);
|
|
75329
75432
|
}
|
|
75330
|
-
const
|
|
75331
|
-
if (
|
|
75332
|
-
|
|
75433
|
+
const labelComponent = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
|
|
75434
|
+
if (labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.renderInner) {
|
|
75435
|
+
labelComponent.renderInner();
|
|
75436
|
+
}
|
|
75437
|
+
const vgrammarLabel = (_b = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getComponent) === null || _b === void 0 ? void 0 : _b.call(labelComponent);
|
|
75438
|
+
if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.evaluate) {
|
|
75439
|
+
vgrammarLabel.evaluate(null, null);
|
|
75440
|
+
}
|
|
75441
|
+
const labelGroup = (_c = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getProduct) === null || _c === void 0 ? void 0 : _c.call(labelComponent);
|
|
75442
|
+
if (labelGroup && delta) {
|
|
75443
|
+
if (!((_d = labelGroup.attribute) === null || _d === void 0 ? void 0 : _d.postMatrix)) {
|
|
75444
|
+
labelGroup.setAttributes({
|
|
75445
|
+
postMatrix: new Matrix()
|
|
75446
|
+
});
|
|
75447
|
+
}
|
|
75448
|
+
labelGroup.translate(delta[0], delta[1]);
|
|
75333
75449
|
}
|
|
75334
75450
|
}
|
|
75335
75451
|
getDatumCenter(datum) {
|
|
@@ -89377,7 +89493,7 @@ class SankeySeriesTooltipHelper extends BaseSeriesTooltipHelper {
|
|
|
89377
89493
|
constructor() {
|
|
89378
89494
|
super(...arguments);
|
|
89379
89495
|
this._getDimensionData = (datum) => {
|
|
89380
|
-
if (datum.source) {
|
|
89496
|
+
if (!isNil$1(datum === null || datum === void 0 ? void 0 : datum.source) && !isNil$1(datum === null || datum === void 0 ? void 0 : datum.target)) {
|
|
89381
89497
|
if (isNumber$1(datum.source)) {
|
|
89382
89498
|
const seriesKeys = this.series.getSeriesKeys();
|
|
89383
89499
|
return seriesKeys[datum.source] + ' => ' + seriesKeys[datum.target];
|
|
@@ -96604,19 +96720,31 @@ const getMarkInfoList = (datum, region) => {
|
|
|
96604
96720
|
const isMarkInfo = (info) => isValid$1(info) && !isArray$1(info);
|
|
96605
96721
|
const isDimensionInfo = (info) => isValid$1(info) && isArray$1(info);
|
|
96606
96722
|
|
|
96723
|
+
const TOOLTIP_STYLE_THEME_KEYS = [
|
|
96724
|
+
'panel',
|
|
96725
|
+
'shape',
|
|
96726
|
+
'titleLabel',
|
|
96727
|
+
'keyLabel',
|
|
96728
|
+
'valueLabel',
|
|
96729
|
+
'spaceRow',
|
|
96730
|
+
'maxContentHeight',
|
|
96731
|
+
'align'
|
|
96732
|
+
];
|
|
96607
96733
|
class TooltipSpecTransformer extends BaseComponentSpecTransformer {
|
|
96608
96734
|
_shouldMergeThemeToSpec() {
|
|
96609
96735
|
return false;
|
|
96610
96736
|
}
|
|
96611
96737
|
_initTheme(spec, chartSpec) {
|
|
96612
|
-
var _a, _b, _c;
|
|
96613
96738
|
const { spec: newSpec, theme } = super._initTheme(spec, chartSpec);
|
|
96614
|
-
|
|
96615
|
-
|
|
96616
|
-
|
|
96617
|
-
|
|
96618
|
-
|
|
96619
|
-
|
|
96739
|
+
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);
|
|
96740
|
+
const themeSpec = mergeSpec({}, theme);
|
|
96741
|
+
TOOLTIP_STYLE_THEME_KEYS.forEach(key => {
|
|
96742
|
+
delete themeSpec[key];
|
|
96743
|
+
});
|
|
96744
|
+
delete themeSpec.style;
|
|
96745
|
+
const mergedSpec = mergeSpec({}, themeSpec, newSpec);
|
|
96746
|
+
mergedSpec.style = mergeSpec({}, themeStyle, mergedSpec.style);
|
|
96747
|
+
return { spec: mergedSpec, theme };
|
|
96620
96748
|
}
|
|
96621
96749
|
_transformSpecAfterMergingTheme(spec, chartSpec, chartSpecInfo) {
|
|
96622
96750
|
var _a, _b, _c, _d, _e, _f, _g;
|