@visactor/react-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/index.js +157 -58
- package/build/index.min.js +3 -3
- package/package.json +7 -7
package/build/index.js
CHANGED
|
@@ -14571,6 +14571,7 @@
|
|
|
14571
14571
|
const tempConstantXYKey = ["x", "y"],
|
|
14572
14572
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
14573
14573
|
tempConstantAngleKey = ["angle"],
|
|
14574
|
+
builtinTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave"]),
|
|
14574
14575
|
point = new Point();
|
|
14575
14576
|
const NOWORK_ANIMATE_ATTR = {
|
|
14576
14577
|
strokeSeg: 1,
|
|
@@ -14627,7 +14628,7 @@
|
|
|
14627
14628
|
}
|
|
14628
14629
|
constructor(params = {}) {
|
|
14629
14630
|
var _a;
|
|
14630
|
-
super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background
|
|
14631
|
+
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);
|
|
14631
14632
|
}
|
|
14632
14633
|
getGraphicService() {
|
|
14633
14634
|
var _a, _b;
|
|
@@ -14816,7 +14817,7 @@
|
|
|
14816
14817
|
});
|
|
14817
14818
|
}
|
|
14818
14819
|
setAttributes(params, forceUpdateTag = !1, context) {
|
|
14819
|
-
params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background
|
|
14820
|
+
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));
|
|
14820
14821
|
}
|
|
14821
14822
|
_setAttributes(params, forceUpdateTag = !1, context) {
|
|
14822
14823
|
const keys = Object.keys(params);
|
|
@@ -14831,7 +14832,7 @@
|
|
|
14831
14832
|
const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
|
|
14832
14833
|
[key]: value
|
|
14833
14834
|
}, this.attribute, key, context);
|
|
14834
|
-
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);
|
|
14835
|
+
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);
|
|
14835
14836
|
}
|
|
14836
14837
|
needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
14837
14838
|
for (let i = 0; i < k.length; i++) {
|
|
@@ -14850,7 +14851,7 @@
|
|
|
14850
14851
|
const context = {
|
|
14851
14852
|
type: AttributeUpdateType.INIT
|
|
14852
14853
|
};
|
|
14853
|
-
params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background
|
|
14854
|
+
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);
|
|
14854
14855
|
}
|
|
14855
14856
|
translate(x, y) {
|
|
14856
14857
|
var _a, _b;
|
|
@@ -15241,6 +15242,9 @@
|
|
|
15241
15242
|
function backgroundNotImage(image) {
|
|
15242
15243
|
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));
|
|
15243
15244
|
}
|
|
15245
|
+
function isExternalTexture(texture) {
|
|
15246
|
+
return !!texture && ("string" == typeof texture ? !builtinTextureTypes.has(texture) && (texture.startsWith("<svg") || isValidUrl$1(texture) || texture.includes("/") || isBase64$1(texture)) : isObject$2(texture));
|
|
15247
|
+
}
|
|
15244
15248
|
Graphic.userSymbolMap = {}, Graphic.mixin(EventTarget);
|
|
15245
15249
|
|
|
15246
15250
|
var GroupUpdateAABBBoundsMode;
|
|
@@ -18892,6 +18896,7 @@
|
|
|
18892
18896
|
}
|
|
18893
18897
|
const defaultBaseClipRenderAfterContribution = new DefaultBaseClipRenderAfterContribution();
|
|
18894
18898
|
|
|
18899
|
+
const builtinProceduralTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid"]);
|
|
18895
18900
|
function formatRatio(ratio) {
|
|
18896
18901
|
return ratio <= .5 ? 4 * ratio - 1 : -4 * ratio + 3;
|
|
18897
18902
|
}
|
|
@@ -19005,38 +19010,43 @@
|
|
|
19005
19010
|
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
19006
19011
|
}
|
|
19007
19012
|
drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
|
|
19008
|
-
var _a;
|
|
19013
|
+
var _a, _b, _c, _d, _e, _f;
|
|
19009
19014
|
const {
|
|
19010
19015
|
textureRatio = graphicAttribute.textureRatio,
|
|
19011
19016
|
textureOptions = null
|
|
19012
19017
|
} = graphic.attribute;
|
|
19013
|
-
let pattern =
|
|
19014
|
-
|
|
19015
|
-
|
|
19016
|
-
|
|
19017
|
-
|
|
19018
|
-
|
|
19019
|
-
|
|
19020
|
-
|
|
19021
|
-
|
|
19022
|
-
|
|
19023
|
-
|
|
19024
|
-
|
|
19025
|
-
|
|
19026
|
-
|
|
19027
|
-
|
|
19028
|
-
|
|
19029
|
-
|
|
19030
|
-
|
|
19031
|
-
|
|
19032
|
-
|
|
19033
|
-
|
|
19034
|
-
|
|
19035
|
-
|
|
19036
|
-
|
|
19037
|
-
|
|
19018
|
+
let pattern = null;
|
|
19019
|
+
const textureRadius = null !== (_a = null == textureOptions ? void 0 : textureOptions.radius) && void 0 !== _a ? _a : 0,
|
|
19020
|
+
patternKey = this.getPatternCacheKey(texture, textureSize, texturePadding, textureColor, context.dpr, textureRadius);
|
|
19021
|
+
if (null !== patternKey && (pattern = this.textureMap.get(patternKey)), !pattern) {
|
|
19022
|
+
if ("string" == typeof texture) switch (texture) {
|
|
19023
|
+
case "circle":
|
|
19024
|
+
pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
|
|
19025
|
+
break;
|
|
19026
|
+
case "diamond":
|
|
19027
|
+
pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
|
|
19028
|
+
break;
|
|
19029
|
+
case "rect":
|
|
19030
|
+
pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
|
|
19031
|
+
break;
|
|
19032
|
+
case "vertical-line":
|
|
19033
|
+
pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
|
|
19034
|
+
break;
|
|
19035
|
+
case "horizontal-line":
|
|
19036
|
+
pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
|
|
19037
|
+
break;
|
|
19038
|
+
case "bias-lr":
|
|
19039
|
+
pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
|
|
19040
|
+
break;
|
|
19041
|
+
case "bias-rl":
|
|
19042
|
+
pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
|
|
19043
|
+
break;
|
|
19044
|
+
case "grid":
|
|
19045
|
+
pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
|
|
19046
|
+
}
|
|
19047
|
+
pattern || (pattern = this.createResourcePattern(texture, graphic, context, texturePadding, textureRadius)), pattern && null !== patternKey && this.textureMap.set(patternKey, pattern);
|
|
19038
19048
|
}
|
|
19039
|
-
if (textureOptions && textureOptions.dynamicTexture) {
|
|
19049
|
+
if ("string" == typeof texture && textureOptions && textureOptions.dynamicTexture) {
|
|
19040
19050
|
const {
|
|
19041
19051
|
gridConfig = {},
|
|
19042
19052
|
useNewCanvas: useNewCanvas
|
|
@@ -19081,10 +19091,24 @@
|
|
|
19081
19091
|
for (let i = 0; i < gridRows; i++) for (let j = 0; j < gridColumns; j++) {
|
|
19082
19092
|
const _x = x + cellSize / 2 + j * cellSize,
|
|
19083
19093
|
_y = y + cellSize / 2 + i * cellSize;
|
|
19084
|
-
null === (
|
|
19094
|
+
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());
|
|
19085
19095
|
}
|
|
19086
19096
|
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();
|
|
19087
|
-
} else if (pattern)
|
|
19097
|
+
} else if (pattern) {
|
|
19098
|
+
if (pattern.setTransform) {
|
|
19099
|
+
const alignToGraphic = !!(null == textureOptions ? void 0 : textureOptions.alignToGraphic),
|
|
19100
|
+
alignOffsetX = null !== (_c = null == textureOptions ? void 0 : textureOptions.alignOffsetX) && void 0 !== _c ? _c : 0,
|
|
19101
|
+
alignOffsetY = null !== (_d = null == textureOptions ? void 0 : textureOptions.alignOffsetY) && void 0 !== _d ? _d : 0;
|
|
19102
|
+
let translateX = 0,
|
|
19103
|
+
translateY = 0;
|
|
19104
|
+
if (alignToGraphic) {
|
|
19105
|
+
const m = context.currentMatrix;
|
|
19106
|
+
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;
|
|
19107
|
+
} else (alignOffsetX || alignOffsetY) && (translateX = alignOffsetX, translateY = alignOffsetY);
|
|
19108
|
+
pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, translateX, translateY]));
|
|
19109
|
+
}
|
|
19110
|
+
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore();
|
|
19111
|
+
} else if ("wave" === texture) {
|
|
19088
19112
|
context.save(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.clip();
|
|
19089
19113
|
const b = graphic.AABBBounds;
|
|
19090
19114
|
drawWave(context, textureRatio, b.width(), b.height(), Object.assign(Object.assign({}, textureOptions || {}), {
|
|
@@ -19092,6 +19116,45 @@
|
|
|
19092
19116
|
}), x + b.x1 - x, y + b.y1 - y), context.restore();
|
|
19093
19117
|
}
|
|
19094
19118
|
}
|
|
19119
|
+
getPatternCacheKey(texture, textureSize, texturePadding, textureColor, dpr, textureRadius) {
|
|
19120
|
+
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}`;
|
|
19121
|
+
}
|
|
19122
|
+
createResourcePattern(texture, graphic, context, texturePadding, textureRadius) {
|
|
19123
|
+
var _a;
|
|
19124
|
+
const resource = null === (_a = graphic.resources) || void 0 === _a ? void 0 : _a.get(texture),
|
|
19125
|
+
data = "success" === (null == resource ? void 0 : resource.state) ? resource.data : "object" == typeof texture ? texture : null;
|
|
19126
|
+
if (!data) return null;
|
|
19127
|
+
if (texturePadding > 0 || textureRadius > 0) {
|
|
19128
|
+
const w = data.naturalWidth || data.width,
|
|
19129
|
+
h = data.naturalHeight || data.height;
|
|
19130
|
+
if (w > 0 && h > 0) {
|
|
19131
|
+
const tileW = w + 2 * texturePadding,
|
|
19132
|
+
tileH = h + 2 * texturePadding,
|
|
19133
|
+
canvas = canvasAllocate.allocate({
|
|
19134
|
+
width: tileW,
|
|
19135
|
+
height: tileH,
|
|
19136
|
+
dpr: context.dpr
|
|
19137
|
+
}),
|
|
19138
|
+
ctx = canvas.getContext("2d");
|
|
19139
|
+
if (ctx) {
|
|
19140
|
+
if (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, tileW, tileH), textureRadius > 0) {
|
|
19141
|
+
const r = Math.max(0, Math.min(textureRadius, Math.min(w, h) / 2)),
|
|
19142
|
+
x0 = texturePadding,
|
|
19143
|
+
y0 = texturePadding,
|
|
19144
|
+
x1 = x0 + w,
|
|
19145
|
+
y1 = y0 + h;
|
|
19146
|
+
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();
|
|
19147
|
+
}
|
|
19148
|
+
ctx.drawImage(data, texturePadding, texturePadding, w, h);
|
|
19149
|
+
const pattern = context.createPattern(canvas.nativeCanvas, "repeat");
|
|
19150
|
+
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;
|
|
19151
|
+
}
|
|
19152
|
+
canvasAllocate.free(canvas);
|
|
19153
|
+
}
|
|
19154
|
+
}
|
|
19155
|
+
const pattern = context.createPattern(data, "repeat");
|
|
19156
|
+
return (null == pattern ? void 0 : pattern.setTransform) && pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, 0, 0])), pattern;
|
|
19157
|
+
}
|
|
19095
19158
|
}
|
|
19096
19159
|
const defaultBaseTextureRenderContribution = new DefaultBaseTextureRenderContribution();
|
|
19097
19160
|
|
|
@@ -51546,7 +51609,7 @@
|
|
|
51546
51609
|
}
|
|
51547
51610
|
_reCompile(updateResult, morphConfig) {
|
|
51548
51611
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
51549
|
-
if (updateResult.reMake && (this._releaseData(), this._initDataSet(), null === (_a = this._chart) || void 0 === _a || _a.release(), this._chart = null), updateResult.reTransformSpec && (this._chartSpecTransformer = null), updateResult.changeTheme ? (this._setCurrentTheme(), this._setFontFamilyTheme(this.getTheme("fontFamily"))) : updateResult.changeBackground && (null === (_b = this._compiler) || void 0 === _b || _b.setBackground(this._getBackground())), updateResult.reMake ? (null === (_c = this._compiler) || void 0 === _c || _c.releaseGrammar(), this._userEvents.forEach(e => {
|
|
51612
|
+
if (updateResult.reMake && (this._releaseData(), this._initDataSet(), null === (_a = this._chart) || void 0 === _a || _a.release(), this._chart = null), updateResult.reTransformSpec && (this._chartSpecTransformer = null), updateResult.changeTheme ? (this._setCurrentTheme(), this._setFontFamilyTheme(this.getTheme("fontFamily"))) : updateResult.changeBackground && (null === (_b = this._compiler) || void 0 === _b || _b.setBackground(this._getBackground())), updateResult.reMake ? (null === (_c = this._compiler) || void 0 === _c || _c.releaseGrammar(!0), this._userEvents.forEach(e => {
|
|
51550
51613
|
var _a;
|
|
51551
51614
|
return null === (_a = this._event) || void 0 === _a ? void 0 : _a.on(e.eType, e.query, e.handler);
|
|
51552
51615
|
})) : updateResult.reCompile && (null === (_d = this._compiler) || void 0 === _d || _d.clear({
|
|
@@ -51954,8 +52017,8 @@
|
|
|
51954
52017
|
this._option.layout = layout, null === (_a = this._chart) || void 0 === _a || _a.setLayout(layout);
|
|
51955
52018
|
}
|
|
51956
52019
|
reLayout() {
|
|
51957
|
-
var _a;
|
|
51958
|
-
this._chart.resetLayoutItemTag(), null === (
|
|
52020
|
+
var _a, _b, _c;
|
|
52021
|
+
null === (_a = this._chart) || void 0 === _a || _a.resetLayoutItemTag(), null === (_b = this._chart) || void 0 === _b || _b.setLayoutTag(!0, null, !1), null === (_c = this._compiler) || void 0 === _c || _c.render();
|
|
51959
52022
|
}
|
|
51960
52023
|
getCompiler() {
|
|
51961
52024
|
return this._compiler;
|
|
@@ -60128,14 +60191,19 @@
|
|
|
60128
60191
|
var _a, _b, _c, _d;
|
|
60129
60192
|
if (!this._spec.stackCornerRadius) return;
|
|
60130
60193
|
const xScale = null === (_b = null === (_a = this._xAxisHelper) || void 0 === _a ? void 0 : _a.getScale) || void 0 === _b ? void 0 : _b.call(_a, 0),
|
|
60131
|
-
yScale = null === (_d = null === (_c = this._yAxisHelper) || void 0 === _c ? void 0 : _c.getScale) || void 0 === _d ? void 0 : _d.call(_c, 0)
|
|
60194
|
+
yScale = null === (_d = null === (_c = this._yAxisHelper) || void 0 === _c ? void 0 : _c.getScale) || void 0 === _d ? void 0 : _d.call(_c, 0),
|
|
60195
|
+
isVertical = "vertical" === this.direction;
|
|
60132
60196
|
this._barMark.setMarkConfig({
|
|
60133
60197
|
clip: !0,
|
|
60134
60198
|
clipPath: () => {
|
|
60199
|
+
const usePreCalculatedRect = !!this._shouldDoPreCalculate();
|
|
60200
|
+
usePreCalculatedRect && this._calculateStackRectPosition(isVertical);
|
|
60135
60201
|
const rectPaths = [];
|
|
60136
60202
|
return this._forEachStackGroup(node => {
|
|
60137
60203
|
let min = 1 / 0,
|
|
60138
60204
|
max = -1 / 0,
|
|
60205
|
+
rectMin = 1 / 0,
|
|
60206
|
+
rectMax = -1 / 0,
|
|
60139
60207
|
hasPercent = !1,
|
|
60140
60208
|
minPercent = 1 / 0,
|
|
60141
60209
|
maxPercent = -1 / 0;
|
|
@@ -60144,7 +60212,12 @@
|
|
|
60144
60212
|
end = datum[STACK_FIELD_END],
|
|
60145
60213
|
startPercent = datum[STACK_FIELD_START_PERCENT],
|
|
60146
60214
|
endPercent = datum[STACK_FIELD_END_PERCENT];
|
|
60147
|
-
min = Math.min(min, start, end), max = Math.max(max, start, end),
|
|
60215
|
+
if (min = Math.min(min, start, end), max = Math.max(max, start, end), usePreCalculatedRect) {
|
|
60216
|
+
const rectStart = datum[isVertical ? RECT_Y : RECT_X],
|
|
60217
|
+
rectEnd = datum[isVertical ? RECT_Y1 : RECT_X1];
|
|
60218
|
+
rectMin = Math.min(rectMin, rectStart, rectEnd), rectMax = Math.max(rectMax, rectStart, rectEnd);
|
|
60219
|
+
}
|
|
60220
|
+
isValid$1(startPercent) && isValid$1(endPercent) && (hasPercent = !0, minPercent = Math.min(minPercent, startPercent, endPercent), maxPercent = Math.max(maxPercent, startPercent, endPercent));
|
|
60148
60221
|
});
|
|
60149
60222
|
const mockDatum = Object.assign(Object.assign(Object.assign({}, node.values[0]), {
|
|
60150
60223
|
[STACK_FIELD_START]: min,
|
|
@@ -60154,13 +60227,13 @@
|
|
|
60154
60227
|
[STACK_FIELD_END_PERCENT]: maxPercent
|
|
60155
60228
|
} : void 0),
|
|
60156
60229
|
rectAttr = "horizontal" === this.direction ? {
|
|
60157
|
-
x: this._getBarXStart(mockDatum, xScale),
|
|
60158
|
-
x1: this._getBarXEnd(mockDatum, xScale),
|
|
60230
|
+
x: usePreCalculatedRect ? rectMin : this._getBarXStart(mockDatum, xScale),
|
|
60231
|
+
x1: usePreCalculatedRect ? rectMax : this._getBarXEnd(mockDatum, xScale),
|
|
60159
60232
|
y: this._getPosition(this.direction, mockDatum),
|
|
60160
60233
|
height: this._getBarWidth(this._yAxisHelper)
|
|
60161
60234
|
} : {
|
|
60162
|
-
y: this._getBarYStart(mockDatum, yScale),
|
|
60163
|
-
y1: this._getBarYEnd(mockDatum, yScale),
|
|
60235
|
+
y: usePreCalculatedRect ? rectMin : this._getBarYStart(mockDatum, yScale),
|
|
60236
|
+
y1: usePreCalculatedRect ? rectMax : this._getBarYEnd(mockDatum, yScale),
|
|
60164
60237
|
x: this._getPosition(this.direction, mockDatum),
|
|
60165
60238
|
width: this._getBarWidth(this._xAxisHelper)
|
|
60166
60239
|
};
|
|
@@ -60570,7 +60643,7 @@
|
|
|
60570
60643
|
}, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series));
|
|
60571
60644
|
}
|
|
60572
60645
|
handleZoom(e) {
|
|
60573
|
-
var _a, _b;
|
|
60646
|
+
var _a, _b, _c, _d;
|
|
60574
60647
|
this.getMarksWithoutRoot().forEach(mark => {
|
|
60575
60648
|
if (!mark) return;
|
|
60576
60649
|
const graphics = mark.getGraphics();
|
|
@@ -60581,8 +60654,14 @@
|
|
|
60581
60654
|
newPosition && graphicItem && graphicItem.translateTo(newPosition.x, newPosition.y);
|
|
60582
60655
|
});
|
|
60583
60656
|
});
|
|
60584
|
-
const
|
|
60585
|
-
|
|
60657
|
+
const labelComponent = null === (_a = this._labelMark) || void 0 === _a ? void 0 : _a.getComponent();
|
|
60658
|
+
(null == labelComponent ? void 0 : labelComponent.renderInner) && labelComponent.renderInner();
|
|
60659
|
+
const vgrammarLabel = null === (_b = null == labelComponent ? void 0 : labelComponent.getComponent) || void 0 === _b ? void 0 : _b.call(labelComponent);
|
|
60660
|
+
(null == vgrammarLabel ? void 0 : vgrammarLabel.evaluate) && vgrammarLabel.evaluate(null, null);
|
|
60661
|
+
const labelGroup = null === (_c = null == labelComponent ? void 0 : labelComponent.getProduct) || void 0 === _c ? void 0 : _c.call(labelComponent);
|
|
60662
|
+
labelGroup && (null == e ? void 0 : e.scale) && (null == e ? void 0 : e.scaleCenter) && ((null === (_d = labelGroup.attribute) || void 0 === _d ? void 0 : _d.postMatrix) || labelGroup.setAttributes({
|
|
60663
|
+
postMatrix: new Matrix()
|
|
60664
|
+
}), labelGroup.scale(e.scale, e.scale, e.scaleCenter));
|
|
60586
60665
|
}
|
|
60587
60666
|
handlePan(e) {
|
|
60588
60667
|
this.handleZoom(e);
|
|
@@ -61609,7 +61688,7 @@
|
|
|
61609
61688
|
super.release(), this._areaCache.clear(), this._nameMap = {}, this._mapViewData = null;
|
|
61610
61689
|
}
|
|
61611
61690
|
handleZoom(e) {
|
|
61612
|
-
var _a;
|
|
61691
|
+
var _a, _b, _c, _d;
|
|
61613
61692
|
const {
|
|
61614
61693
|
scale: scale,
|
|
61615
61694
|
scaleCenter: scaleCenter
|
|
@@ -61619,11 +61698,17 @@
|
|
|
61619
61698
|
pathGroup && (pathGroup.attribute.postMatrix || pathGroup.setAttributes({
|
|
61620
61699
|
postMatrix: new Matrix()
|
|
61621
61700
|
}), pathGroup.scale(scale, scale, scaleCenter));
|
|
61622
|
-
const
|
|
61623
|
-
|
|
61701
|
+
const labelComponent = null === (_a = this._labelMark) || void 0 === _a ? void 0 : _a.getComponent();
|
|
61702
|
+
(null == labelComponent ? void 0 : labelComponent.renderInner) && labelComponent.renderInner();
|
|
61703
|
+
const vgrammarLabel = null === (_b = null == labelComponent ? void 0 : labelComponent.getComponent) || void 0 === _b ? void 0 : _b.call(labelComponent);
|
|
61704
|
+
(null == vgrammarLabel ? void 0 : vgrammarLabel.evaluate) && vgrammarLabel.evaluate(null, null);
|
|
61705
|
+
const labelGroup = null === (_c = null == labelComponent ? void 0 : labelComponent.getProduct) || void 0 === _c ? void 0 : _c.call(labelComponent);
|
|
61706
|
+
labelGroup && scale && scaleCenter && ((null === (_d = labelGroup.attribute) || void 0 === _d ? void 0 : _d.postMatrix) || labelGroup.setAttributes({
|
|
61707
|
+
postMatrix: new Matrix()
|
|
61708
|
+
}), labelGroup.scale(scale, scale, scaleCenter));
|
|
61624
61709
|
}
|
|
61625
61710
|
handlePan(e) {
|
|
61626
|
-
var _a;
|
|
61711
|
+
var _a, _b, _c, _d;
|
|
61627
61712
|
const {
|
|
61628
61713
|
delta: delta
|
|
61629
61714
|
} = e;
|
|
@@ -61632,8 +61717,14 @@
|
|
|
61632
61717
|
pathGroup && (pathGroup.attribute.postMatrix || pathGroup.setAttributes({
|
|
61633
61718
|
postMatrix: new Matrix()
|
|
61634
61719
|
}), pathGroup.translate(delta[0], delta[1]));
|
|
61635
|
-
const
|
|
61636
|
-
|
|
61720
|
+
const labelComponent = null === (_a = this._labelMark) || void 0 === _a ? void 0 : _a.getComponent();
|
|
61721
|
+
(null == labelComponent ? void 0 : labelComponent.renderInner) && labelComponent.renderInner();
|
|
61722
|
+
const vgrammarLabel = null === (_b = null == labelComponent ? void 0 : labelComponent.getComponent) || void 0 === _b ? void 0 : _b.call(labelComponent);
|
|
61723
|
+
(null == vgrammarLabel ? void 0 : vgrammarLabel.evaluate) && vgrammarLabel.evaluate(null, null);
|
|
61724
|
+
const labelGroup = null === (_c = null == labelComponent ? void 0 : labelComponent.getProduct) || void 0 === _c ? void 0 : _c.call(labelComponent);
|
|
61725
|
+
labelGroup && delta && ((null === (_d = labelGroup.attribute) || void 0 === _d ? void 0 : _d.postMatrix) || labelGroup.setAttributes({
|
|
61726
|
+
postMatrix: new Matrix()
|
|
61727
|
+
}), labelGroup.translate(delta[0], delta[1]));
|
|
61637
61728
|
}
|
|
61638
61729
|
getDatumCenter(datum) {
|
|
61639
61730
|
var _a, _b, _c, _d;
|
|
@@ -72730,7 +72821,7 @@
|
|
|
72730
72821
|
class SankeySeriesTooltipHelper extends BaseSeriesTooltipHelper {
|
|
72731
72822
|
constructor() {
|
|
72732
72823
|
super(...arguments), this._getDimensionData = datum => {
|
|
72733
|
-
if (datum.source) {
|
|
72824
|
+
if (!isNil$1(null == datum ? void 0 : datum.source) && !isNil$1(null == datum ? void 0 : datum.target)) {
|
|
72734
72825
|
if (isNumber$1(datum.source)) {
|
|
72735
72826
|
const seriesKeys = this.series.getSeriesKeys();
|
|
72736
72827
|
return seriesKeys[datum.source] + " => " + seriesKeys[datum.target];
|
|
@@ -78108,18 +78199,26 @@
|
|
|
78108
78199
|
const isMarkInfo = info => isValid$1(info) && !isArray$1(info);
|
|
78109
78200
|
const isDimensionInfo = info => isValid$1(info) && isArray$1(info);
|
|
78110
78201
|
|
|
78202
|
+
const TOOLTIP_STYLE_THEME_KEYS = ["panel", "shape", "titleLabel", "keyLabel", "valueLabel", "spaceRow", "maxContentHeight", "align"];
|
|
78111
78203
|
class TooltipSpecTransformer extends BaseComponentSpecTransformer {
|
|
78112
78204
|
_shouldMergeThemeToSpec() {
|
|
78113
78205
|
return !1;
|
|
78114
78206
|
}
|
|
78115
78207
|
_initTheme(spec, chartSpec) {
|
|
78116
|
-
var _a, _b, _c;
|
|
78117
78208
|
const {
|
|
78118
|
-
|
|
78119
|
-
|
|
78120
|
-
|
|
78121
|
-
|
|
78122
|
-
|
|
78209
|
+
spec: newSpec,
|
|
78210
|
+
theme: theme
|
|
78211
|
+
} = super._initTheme(spec, chartSpec),
|
|
78212
|
+
themeStyle = mergeSpec({}, ...TOOLTIP_STYLE_THEME_KEYS.map(key => void 0 !== (null == theme ? void 0 : theme[key]) ? {
|
|
78213
|
+
[key]: theme[key]
|
|
78214
|
+
} : void 0), null == theme ? void 0 : theme.style),
|
|
78215
|
+
themeSpec = mergeSpec({}, theme);
|
|
78216
|
+
TOOLTIP_STYLE_THEME_KEYS.forEach(key => {
|
|
78217
|
+
delete themeSpec[key];
|
|
78218
|
+
}), delete themeSpec.style;
|
|
78219
|
+
const mergedSpec = mergeSpec({}, themeSpec, newSpec);
|
|
78220
|
+
return mergedSpec.style = mergeSpec({}, themeStyle, mergedSpec.style), {
|
|
78221
|
+
spec: mergedSpec,
|
|
78123
78222
|
theme: theme
|
|
78124
78223
|
};
|
|
78125
78224
|
}
|