@visactor/vchart 1.13.6 → 1.13.7
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 +115 -92
- package/build/index.js +127 -91
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/component/label/interface.d.ts +7 -3
- package/cjs/component/label/interface.js.map +1 -1
- package/cjs/component/label/label.js +6 -1
- package/cjs/component/label/label.js.map +1 -1
- package/cjs/component/label/total-label.d.ts +1 -1
- package/cjs/component/label/total-label.js +22 -11
- package/cjs/component/label/total-label.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +3 -2
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/interface.js +1 -2
- package/cjs/core/vchart.js +6 -2
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/index.d.ts +3 -0
- package/cjs/index.js +7 -6
- package/cjs/index.js.map +1 -1
- package/esm/component/label/interface.d.ts +7 -3
- package/esm/component/label/interface.js.map +1 -1
- package/esm/component/label/label.js +6 -1
- package/esm/component/label/label.js.map +1 -1
- package/esm/component/label/total-label.d.ts +1 -1
- package/esm/component/label/total-label.js +23 -12
- package/esm/component/label/total-label.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +3 -2
- package/esm/core/index.js.map +1 -1
- package/esm/core/interface.js +1 -2
- package/esm/core/vchart.js +7 -3
- package/esm/core/vchart.js.map +1 -1
- package/esm/index.d.ts +3 -0
- package/esm/index.js +6 -0
- package/esm/index.js.map +1 -1
- package/package.json +13 -13
package/build/index.es.js
CHANGED
|
@@ -28440,7 +28440,6 @@ var __decorate$G = undefined && undefined.__decorate || function (decorators, ta
|
|
|
28440
28440
|
function makeUpCanvas$4(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, pixelRatio) {
|
|
28441
28441
|
const dpr = null != pixelRatio ? pixelRatio : tt.getSystemInfoSync().pixelRatio;
|
|
28442
28442
|
canvasIdLists.forEach((id, i) => {
|
|
28443
|
-
if (canvasMap.has(id)) return;
|
|
28444
28443
|
const ctx = tt.createCanvasContext(id),
|
|
28445
28444
|
canvas = new CanvasWrapDisableWH(ctx.canvas || {}, ctx, dpr, domref.width, domref.height, id);
|
|
28446
28445
|
ctx.canvas = canvas, canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas);
|
|
@@ -29774,12 +29773,12 @@ var __decorate$q = undefined && undefined.__decorate || function (decorators, ta
|
|
|
29774
29773
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
29775
29774
|
});
|
|
29776
29775
|
};
|
|
29777
|
-
function makeUpCanvas$1(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, component) {
|
|
29776
|
+
function makeUpCanvas$1(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, component, forceUpdate) {
|
|
29778
29777
|
return __awaiter$2(this, void 0, void 0, function* () {
|
|
29779
29778
|
const dpr = wx.getSystemInfoSync().pixelRatio;
|
|
29780
29779
|
for (let i = 0; i < canvasIdLists.length; i++) {
|
|
29781
29780
|
const id = canvasIdLists[i];
|
|
29782
|
-
canvasMap.has(id) || (yield new Promise(resolve => {
|
|
29781
|
+
!forceUpdate && canvasMap.has(id) || (yield new Promise(resolve => {
|
|
29783
29782
|
let data = wx.createSelectorQuery();
|
|
29784
29783
|
component && (data = data.in(component)), data.select(`#${id}`).fields({
|
|
29785
29784
|
node: !0,
|
|
@@ -29806,7 +29805,7 @@ let WxEnvContribution = class extends BaseEnvContribution {
|
|
|
29806
29805
|
this.applyStyles = !0;
|
|
29807
29806
|
}
|
|
29808
29807
|
configure(service, params) {
|
|
29809
|
-
if (service.env === this.type) return service.setActiveEnvContribution(this), makeUpCanvas$1(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList, params.component).then(() => {});
|
|
29808
|
+
if (service.env === this.type) return service.setActiveEnvContribution(this), makeUpCanvas$1(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList, params.component, params.forceUpdate).then(() => {});
|
|
29810
29809
|
}
|
|
29811
29810
|
loadImage(url) {
|
|
29812
29811
|
return Promise.resolve({
|
|
@@ -30109,7 +30108,7 @@ function makeUpCanvas(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanva
|
|
|
30109
30108
|
const dpr = tt.getSystemInfoSync().pixelRatio;
|
|
30110
30109
|
for (let i = 0; i < canvasIdLists.length; i++) {
|
|
30111
30110
|
const id = canvasIdLists[i];
|
|
30112
|
-
|
|
30111
|
+
yield new Promise(resolve => {
|
|
30113
30112
|
let data = tt.createSelectorQuery();
|
|
30114
30113
|
component && (data = data.in(component)), data.select(`#${id}`).node().exec(res => {
|
|
30115
30114
|
const canvas = res[0].node,
|
|
@@ -30117,7 +30116,7 @@ function makeUpCanvas(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanva
|
|
|
30117
30116
|
height = canvas.height;
|
|
30118
30117
|
canvas.width = width * dpr, canvas.height = height * dpr, canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas), resolve(null);
|
|
30119
30118
|
});
|
|
30120
|
-
})
|
|
30119
|
+
});
|
|
30121
30120
|
}
|
|
30122
30121
|
});
|
|
30123
30122
|
}
|
|
@@ -31213,11 +31212,15 @@ function _registerText() {
|
|
|
31213
31212
|
_registerText.__loaded = !1;
|
|
31214
31213
|
const registerText = _registerText;
|
|
31215
31214
|
|
|
31215
|
+
function pseudoRandom(n) {
|
|
31216
|
+
let seed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
31217
|
+
let hash = 3735928559 ^ seed;
|
|
31218
|
+
return hash = (2654435769 ^ hash) + (hash << 6) + (hash >> 2), hash = 3432918353 * (hash ^ n), hash = hash << 15 | hash >>> 17, hash ^= hash << 25, hash += hash << 9, hash ^= hash >> 4, hash ^= hash << 18, hash |= 1, (hash >>> 0) % 2147483647 / 2147483647;
|
|
31219
|
+
}
|
|
31216
31220
|
function randomOpacity(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
31217
31221
|
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
31218
31222
|
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
31219
|
-
|
|
31220
|
-
const targetRandomValue = graphic.dynamicTextureCache[row * columnCount + column],
|
|
31223
|
+
const targetRandomValue = 2 * pseudoRandom(row * columnCount + column) * Math.PI,
|
|
31221
31224
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI + targetRandomValue) + 1) / 2;
|
|
31222
31225
|
return Math.min(1, Math.max(0, _r));
|
|
31223
31226
|
}
|
|
@@ -31377,15 +31380,10 @@ function pulseWave(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
|
31377
31380
|
function particleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
31378
31381
|
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
31379
31382
|
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
31380
|
-
graphic.dynamicTextureCache || (graphic.dynamicTextureCache = {
|
|
31381
|
-
phases: new Array(rowCount * columnCount).fill(0).map(() => 2 * Math.random() * Math.PI),
|
|
31382
|
-
speeds: new Array(rowCount * columnCount).fill(0).map(() => .5 + .5 * Math.random()),
|
|
31383
|
-
directions: new Array(rowCount * columnCount).fill(0).map(() => 2 * Math.random() * Math.PI)
|
|
31384
|
-
});
|
|
31385
31383
|
const index = row * columnCount + column,
|
|
31386
|
-
phase =
|
|
31387
|
-
speed =
|
|
31388
|
-
direction =
|
|
31384
|
+
phase = 2 * pseudoRandom(index, 0) * Math.PI,
|
|
31385
|
+
speed = .5 * pseudoRandom(index, 1) + .5,
|
|
31386
|
+
direction = 2 * pseudoRandom(index, 2) * Math.PI,
|
|
31389
31387
|
centerRow = rowCount / 2,
|
|
31390
31388
|
centerCol = columnCount / 2,
|
|
31391
31389
|
distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)),
|
|
@@ -32180,7 +32178,7 @@ class Tag extends AbstractComponent {
|
|
|
32180
32178
|
y: maxSize / 2
|
|
32181
32179
|
}), "symbol"), isEmpty(null == state ? void 0 : state.shape) || (symbol.states = state.shape), shapeVisible && (symbolPlaceWidth = maxSize + space);
|
|
32182
32180
|
}
|
|
32183
|
-
let textShape;
|
|
32181
|
+
let textShape, textWidth, textHeight;
|
|
32184
32182
|
tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth;
|
|
32185
32183
|
if (isRichText({
|
|
32186
32184
|
text: text
|
|
@@ -32193,7 +32191,7 @@ class Tag extends AbstractComponent {
|
|
|
32193
32191
|
x: textX,
|
|
32194
32192
|
y: 0
|
|
32195
32193
|
});
|
|
32196
|
-
textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext"),
|
|
32194
|
+
isNil$1(richTextAttrs.lineHeight) && (richTextAttrs.lineHeight = textStyle.fontSize), textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext"), textWidth = textShape.AABBBounds.width(), textHeight = textShape.AABBBounds.height();
|
|
32197
32195
|
} else {
|
|
32198
32196
|
const textAttrs = Object.assign(Object.assign({
|
|
32199
32197
|
text: isObject$2(text) && "type" in text && "text" === text.type ? text.text : text,
|
|
@@ -32203,66 +32201,67 @@ class Tag extends AbstractComponent {
|
|
|
32203
32201
|
x: textX,
|
|
32204
32202
|
y: 0
|
|
32205
32203
|
});
|
|
32206
|
-
isNil$1(textAttrs.lineHeight) && (textAttrs.lineHeight = textStyle.fontSize), textShape = group.createOrUpdateChild("tag-text", textAttrs, "text")
|
|
32207
|
-
const textBounds = measureTextSize(textAttrs.text, textStyle, null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.getTheme()) || void 0 === _b ? void 0 : _b.text)
|
|
32208
|
-
|
|
32209
|
-
|
|
32210
|
-
|
|
32211
|
-
|
|
32212
|
-
|
|
32213
|
-
|
|
32214
|
-
|
|
32215
|
-
|
|
32216
|
-
|
|
32217
|
-
|
|
32218
|
-
|
|
32219
|
-
|
|
32220
|
-
|
|
32221
|
-
|
|
32222
|
-
|
|
32223
|
-
|
|
32224
|
-
|
|
32225
|
-
tsWidth = textWidth + symbolPlaceWidth,
|
|
32226
|
-
textX = 1 === flag ? (containerWidth - tsWidth) / 2 + symbolPlaceWidth + textWidth / 2 : parsedPadding[0] + symbolPlaceWidth - (tagWidth / 2 + tsWidth / 2 - symbolPlaceWidth) + textWidth / 2;
|
|
32227
|
-
if (textShape.setAttributes({
|
|
32204
|
+
isNil$1(textAttrs.lineHeight) && (textAttrs.lineHeight = textStyle.fontSize), textShape = group.createOrUpdateChild("tag-text", textAttrs, "text");
|
|
32205
|
+
const textBounds = measureTextSize(textAttrs.text, textStyle, null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.getTheme()) || void 0 === _b ? void 0 : _b.text);
|
|
32206
|
+
textWidth = textBounds.width, textHeight = textBounds.height;
|
|
32207
|
+
}
|
|
32208
|
+
tagWidth += textWidth;
|
|
32209
|
+
const size = null !== (_c = shape.size) && void 0 !== _c ? _c : 10,
|
|
32210
|
+
maxSize = isNumber$1(size) ? size : Math.max(size[0], size[1]);
|
|
32211
|
+
tagHeight += Math.max(textHeight, shape.visible ? maxSize : 0);
|
|
32212
|
+
const {
|
|
32213
|
+
textAlign: textAlign,
|
|
32214
|
+
textBaseline: textBaseline
|
|
32215
|
+
} = textStyle;
|
|
32216
|
+
(isValid$1(minWidth) || isValid$1(maxWidth)) && (isValid$1(minWidth) && tagWidth < minWidth && (tagWidth = minWidth), isValid$1(maxWidth) && tagWidth > maxWidth && (tagWidth = maxWidth, textShape.setAttribute("maxLineWidth", maxWidth - parsedPadding[1] - parsedPadding[2]))), tagX = 0, tagY = 0;
|
|
32217
|
+
let flag = 0;
|
|
32218
|
+
"left" === textAlign || "start" === textAlign ? flag = 1 : "right" === textAlign || "end" === textAlign ? flag = -1 : "center" === textAlign && (flag = 0), flag ? flag < 0 ? (tagX -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : flag > 0 && group.setAttribute("x", parsedPadding[3]) : (tagX -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2));
|
|
32219
|
+
const shouldRight = "right" === containerTextAlign || "end" === containerTextAlign,
|
|
32220
|
+
shouldLeft = "left" === containerTextAlign || "start" === containerTextAlign,
|
|
32221
|
+
updateTextAttrs = (textX, textAlign) => {
|
|
32222
|
+
"richtext" === textShape.type ? textShape.setAttributes({
|
|
32228
32223
|
x: textX,
|
|
32229
|
-
textAlign:
|
|
32230
|
-
|
|
32231
|
-
|
|
32232
|
-
|
|
32233
|
-
|
|
32234
|
-
});
|
|
32235
|
-
}
|
|
32236
|
-
}
|
|
32237
|
-
if (shouldLeft && 1 !== flag) {
|
|
32238
|
-
const containerWidth = tagWidth - parsedPadding[1] - parsedPadding[3],
|
|
32239
|
-
offset = 0 === flag ? -containerWidth / 2 + symbolPlaceWidth / 2 : -tagWidth + parsedPadding[3] + parsedPadding[1] + symbolPlaceWidth,
|
|
32240
|
-
textX = offset + symbolPlaceWidth;
|
|
32241
|
-
if (textShape.setAttributes({
|
|
32224
|
+
textAlign: textAlign,
|
|
32225
|
+
textConfig: array(textShape.attribute.textConfig).map(t => Object.assign(Object.assign({}, t), {
|
|
32226
|
+
textAlign: textAlign
|
|
32227
|
+
}))
|
|
32228
|
+
}) : textShape.setAttributes({
|
|
32242
32229
|
x: textX,
|
|
32243
|
-
textAlign:
|
|
32244
|
-
})
|
|
32245
|
-
|
|
32246
|
-
|
|
32247
|
-
|
|
32248
|
-
|
|
32249
|
-
|
|
32230
|
+
textAlign: textAlign
|
|
32231
|
+
});
|
|
32232
|
+
};
|
|
32233
|
+
if ((containerTextAlign ? "center" === containerTextAlign : textAlwaysCenter) && flag) {
|
|
32234
|
+
const containerWidth = tagWidth - parsedPadding[1] - parsedPadding[3],
|
|
32235
|
+
tsWidth = textWidth + symbolPlaceWidth,
|
|
32236
|
+
textX = 1 === flag ? (containerWidth - tsWidth) / 2 + symbolPlaceWidth + textWidth / 2 : parsedPadding[0] + symbolPlaceWidth - (tagWidth / 2 + tsWidth / 2 - symbolPlaceWidth) + textWidth / 2;
|
|
32237
|
+
if (updateTextAttrs(textX, "center"), symbol) {
|
|
32238
|
+
const symbolX = textX - textWidth / 2 - symbolPlaceWidth + maxSize / 2;
|
|
32239
|
+
symbol.setAttributes({
|
|
32240
|
+
x: symbolX
|
|
32241
|
+
});
|
|
32250
32242
|
}
|
|
32251
|
-
|
|
32252
|
-
|
|
32253
|
-
|
|
32254
|
-
|
|
32255
|
-
|
|
32256
|
-
|
|
32257
|
-
|
|
32258
|
-
|
|
32259
|
-
|
|
32260
|
-
|
|
32261
|
-
|
|
32262
|
-
|
|
32243
|
+
}
|
|
32244
|
+
if (shouldLeft && 1 !== flag) {
|
|
32245
|
+
const containerWidth = tagWidth - parsedPadding[1] - parsedPadding[3],
|
|
32246
|
+
offset = 0 === flag ? -containerWidth / 2 + symbolPlaceWidth / 2 : -tagWidth + parsedPadding[3] + parsedPadding[1] + symbolPlaceWidth;
|
|
32247
|
+
if (updateTextAttrs(offset + symbolPlaceWidth, "left"), symbol) {
|
|
32248
|
+
const symbolX = offset + maxSize / 2;
|
|
32249
|
+
symbol.setAttributes({
|
|
32250
|
+
x: symbolX
|
|
32251
|
+
});
|
|
32252
|
+
}
|
|
32253
|
+
}
|
|
32254
|
+
if (shouldRight && -1 !== flag) {
|
|
32255
|
+
const containerWidth = tagWidth - parsedPadding[1] - parsedPadding[3],
|
|
32256
|
+
textX = 0 === flag ? containerWidth / 2 + symbolPlaceWidth / 2 : containerWidth;
|
|
32257
|
+
if (updateTextAttrs(textX, "right"), symbol) {
|
|
32258
|
+
const symbolX = textX - textWidth - symbolPlaceWidth + maxSize / 2;
|
|
32259
|
+
symbol.setAttributes({
|
|
32260
|
+
x: symbolX
|
|
32261
|
+
});
|
|
32263
32262
|
}
|
|
32264
|
-
"middle" === textBaseline ? (tagY -= tagHeight / 2, symbol && symbol.setAttribute("y", 0)) : "bottom" === textBaseline ? (tagY -= tagHeight, symbol && symbol.setAttribute("y", -textHeight / 2), group.setAttribute("y", -parsedPadding[2])) : "top" === textBaseline && (group.setAttribute("y", parsedPadding[0]), symbol && symbol.setAttribute("y", textHeight / 2));
|
|
32265
32263
|
}
|
|
32264
|
+
"middle" === textBaseline ? (tagY -= tagHeight / 2, symbol && symbol.setAttribute("y", 0)) : "bottom" === textBaseline ? (tagY -= tagHeight, symbol && symbol.setAttribute("y", -textHeight / 2), group.setAttribute("y", -parsedPadding[2])) : "top" === textBaseline && (group.setAttribute("y", parsedPadding[0]), symbol && symbol.setAttribute("y", textHeight / 2)), isEmpty(null == state ? void 0 : state.text) || (textShape.states = state.text);
|
|
32266
32265
|
const {
|
|
32267
32266
|
visible: bgVisible
|
|
32268
32267
|
} = panel,
|
|
@@ -36413,10 +36412,16 @@ function clampRangeByBitmap($, range) {
|
|
|
36413
36412
|
y1: y1,
|
|
36414
36413
|
y2: y2
|
|
36415
36414
|
} = range,
|
|
36416
|
-
|
|
36417
|
-
|
|
36418
|
-
|
|
36419
|
-
|
|
36415
|
+
{
|
|
36416
|
+
top = 0,
|
|
36417
|
+
left = 0,
|
|
36418
|
+
right = 0,
|
|
36419
|
+
bottom = 0
|
|
36420
|
+
} = $.padding,
|
|
36421
|
+
_x1 = clamp$1(x1, -left, $.width + right),
|
|
36422
|
+
_x2 = clamp$1(x2, -left, $.width + right),
|
|
36423
|
+
_y1 = clamp$1(y1, -top, $.height + bottom),
|
|
36424
|
+
_y2 = clamp$1(y2, -top, $.height + bottom);
|
|
36420
36425
|
return {
|
|
36421
36426
|
x1: $.x(_x1),
|
|
36422
36427
|
x2: $.x(_x2),
|
|
@@ -62461,7 +62466,10 @@ class VChart {
|
|
|
62461
62466
|
return userUpdateOptions
|
|
62462
62467
|
? Object.assign(Object.assign({}, res), userUpdateOptions) : res;
|
|
62463
62468
|
};
|
|
62464
|
-
this._option =
|
|
62469
|
+
this._option = Object.assign(Object.assign(Object.assign({}, this._option), { animation: spec.animation !== false }), options);
|
|
62470
|
+
if (options === null || options === void 0 ? void 0 : options.optimize) {
|
|
62471
|
+
this._option.optimize = Object.assign(Object.assign({}, this._option.optimize), options.optimize);
|
|
62472
|
+
}
|
|
62465
62473
|
this._onError = (_a = this._option) === null || _a === void 0 ? void 0 : _a.onError;
|
|
62466
62474
|
const _j = this._option, { dom, renderCanvas, mode, stage, poptip } = _j, restOptions = __rest$e(_j, ["dom", "renderCanvas", "mode", "stage", "poptip"]);
|
|
62467
62475
|
const isTrueBrowseEnv = isTrueBrowser(mode);
|
|
@@ -63213,7 +63221,10 @@ class VChart {
|
|
|
63213
63221
|
if (!fontFamily) {
|
|
63214
63222
|
return;
|
|
63215
63223
|
}
|
|
63216
|
-
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.setTheme({
|
|
63224
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.setTheme({
|
|
63225
|
+
text: { fontFamily },
|
|
63226
|
+
richtext: { fontFamily }
|
|
63227
|
+
});
|
|
63217
63228
|
}
|
|
63218
63229
|
_getTooltipComponent() {
|
|
63219
63230
|
var _a;
|
|
@@ -63602,7 +63613,7 @@ const registerVChartCore = () => {
|
|
|
63602
63613
|
};
|
|
63603
63614
|
registerVChartCore();
|
|
63604
63615
|
|
|
63605
|
-
const version = "1.13.
|
|
63616
|
+
const version = "1.13.7";
|
|
63606
63617
|
|
|
63607
63618
|
const addVChartProperty = (data, op) => {
|
|
63608
63619
|
const context = op.beforeCall();
|
|
@@ -99471,7 +99482,10 @@ class Label extends BaseLabelComponent {
|
|
|
99471
99482
|
: textAttribute(labelInfos[params.labelIndex], datum, labelSpec.formatMethod, labelSpec.formatter);
|
|
99472
99483
|
}
|
|
99473
99484
|
})
|
|
99474
|
-
.size(() =>
|
|
99485
|
+
.size(() => {
|
|
99486
|
+
var _a;
|
|
99487
|
+
return Object.assign({ padding: (_a = labelInfos[0].labelSpec.overlap) === null || _a === void 0 ? void 0 : _a.padding }, labelInfos[0].series.getRegion().getLayoutRect());
|
|
99488
|
+
});
|
|
99475
99489
|
}
|
|
99476
99490
|
compileMarks() {
|
|
99477
99491
|
this.getMarks().forEach(m => {
|
|
@@ -99608,11 +99622,11 @@ class TotalLabel extends BaseLabelComponent {
|
|
|
99608
99622
|
.labelStyle(() => {
|
|
99609
99623
|
var _a, _b;
|
|
99610
99624
|
if (this._baseMark) {
|
|
99611
|
-
const { offset, animation, overlap } = this._spec;
|
|
99625
|
+
const { offset, animation, overlap, position = 'top' } = this._spec;
|
|
99612
99626
|
const interactive = this._interactiveConfig(this._spec);
|
|
99613
99627
|
return mergeSpec({
|
|
99614
99628
|
textStyle: { pickable: this._spec.interactive === true },
|
|
99615
|
-
position: totalLabelPosition(series, this._baseMark.type),
|
|
99629
|
+
position: totalLabelPosition(series, this._baseMark.type, position),
|
|
99616
99630
|
x: 0,
|
|
99617
99631
|
y: 0
|
|
99618
99632
|
}, (_b = (_a = series.getTotalLabelComponentStyle) === null || _a === void 0 ? void 0 : _a.call(series, {
|
|
@@ -99621,7 +99635,7 @@ class TotalLabel extends BaseLabelComponent {
|
|
|
99621
99635
|
})) !== null && _b !== void 0 ? _b : {}, Object.assign({ offset,
|
|
99622
99636
|
animation,
|
|
99623
99637
|
overlap, dataFilter: (data) => {
|
|
99624
|
-
return data.filter((d) => d.data[STACK_FIELD_TOTAL_TOP]);
|
|
99638
|
+
return data.filter((d) => position === 'bottom' ? d.data[STACK_FIELD_TOTAL_BOTTOM] : d.data[STACK_FIELD_TOTAL_TOP]);
|
|
99625
99639
|
} }, interactive));
|
|
99626
99640
|
}
|
|
99627
99641
|
})
|
|
@@ -99633,7 +99647,10 @@ class TotalLabel extends BaseLabelComponent {
|
|
|
99633
99647
|
labelSpec: series.getSpec().totalLabel
|
|
99634
99648
|
}, datum, this._spec.formatMethod);
|
|
99635
99649
|
})
|
|
99636
|
-
.size(() =>
|
|
99650
|
+
.size(() => {
|
|
99651
|
+
var _a;
|
|
99652
|
+
return Object.assign({ padding: (_a = this._spec.overlap) === null || _a === void 0 ? void 0 : _a.padding }, this._regions[0].getLayoutRect());
|
|
99653
|
+
});
|
|
99637
99654
|
});
|
|
99638
99655
|
}
|
|
99639
99656
|
compileMarks() {
|
|
@@ -99658,24 +99675,30 @@ class TotalLabel extends BaseLabelComponent {
|
|
|
99658
99675
|
}
|
|
99659
99676
|
TotalLabel.type = ComponentTypeEnum.totalLabel;
|
|
99660
99677
|
TotalLabel.specKey = 'totalLabel';
|
|
99661
|
-
function totalLabelPosition(series, type) {
|
|
99678
|
+
function totalLabelPosition(series, type, position = 'top') {
|
|
99662
99679
|
var _a, _b;
|
|
99663
|
-
let
|
|
99680
|
+
let finalPosition;
|
|
99664
99681
|
const { direction } = series;
|
|
99665
99682
|
const isInverse = direction === 'horizontal'
|
|
99666
99683
|
? (_a = series.getXAxisHelper()) === null || _a === void 0 ? void 0 : _a.isInverse()
|
|
99667
99684
|
: (_b = series.getYAxisHelper()) === null || _b === void 0 ? void 0 : _b.isInverse();
|
|
99668
|
-
|
|
99685
|
+
let positionMap;
|
|
99686
|
+
if (position === 'bottom') {
|
|
99687
|
+
positionMap = { vertical: ['bottom', 'top'], horizontal: ['left', 'right'] };
|
|
99688
|
+
}
|
|
99689
|
+
else {
|
|
99690
|
+
positionMap = { vertical: ['top', 'bottom'], horizontal: ['right', 'left'] };
|
|
99691
|
+
}
|
|
99669
99692
|
const index = isInverse ? 1 : 0;
|
|
99670
99693
|
switch (type) {
|
|
99671
99694
|
case 'rect':
|
|
99672
99695
|
case 'symbol':
|
|
99673
|
-
|
|
99696
|
+
finalPosition = positionMap[direction][index];
|
|
99674
99697
|
break;
|
|
99675
99698
|
default:
|
|
99676
|
-
|
|
99699
|
+
finalPosition = 'top';
|
|
99677
99700
|
}
|
|
99678
|
-
return
|
|
99701
|
+
return finalPosition;
|
|
99679
99702
|
}
|
|
99680
99703
|
const registerTotalLabel = () => {
|
|
99681
99704
|
registerLabel$1();
|
|
@@ -103663,4 +103686,4 @@ const registerMediaQuery = () => {
|
|
|
103663
103686
|
registerChartPlugin(MediaQuery);
|
|
103664
103687
|
};
|
|
103665
103688
|
|
|
103666
|
-
export { Arc3dMark, ArcMark, AreaChart, AreaMark, AreaSeries, AxisSyncPlugin, Bar3dChart, Bar3dSeries, BarChart, BarSeries, BaseChart, BaseChartSpecTransformer, BaseMark, BaseSeries, BoxPlotChart, BoxPlotSeries, Brush, CanvasTooltipHandler, CartesianAxis, CartesianBandAxis, CartesianCrossHair, CartesianLinearAxis, CartesianLogAxis, CartesianMarkArea, CartesianMarkLine, CartesianMarkPoint, CartesianSeries, CartesianSymlogAxis, CartesianTimeAxis, CirclePackingChart, CirclePackingSeries, CircularProgressChart, CircularProgressSeries, CommonChart, ComponentMark, ComposedEventMapper, ContinuousLegend, CorrelationChart, CorrelationSeries, CustomMark, DEFAULT_CHART_HEIGHT, DEFAULT_CHART_WIDTH, DEFAULT_DATA_INDEX, DEFAULT_DATA_KEY, DEFAULT_DATA_SERIES_FIELD, DEFAULT_MEASURE_CANVAS_ID, DEFAULT_SERIES_STYLE_NAME, DataZoom, DimensionClickEvent, DimensionEventEnum, DimensionHoverEvent, DiscreteLegend, DomTooltipHandler, DotSeries, Event$1 as Event, Factory$1 as Factory, FormatterPlugin, Funnel3dChart, Funnel3dSeries, FunnelChart, FunnelSeries, GaugeChart, GaugePointerSeries, GaugeSeries, GeoCoordinate, GeoMarkPoint, GridLayout, GroupMark, HeatmapChart, HeatmapSeries, Histogram3dChart, HistogramChart, ImageMark, Indicator, Label, Layout$1 as Layout, Layout3d, LineChart, LineMark, LineSeries, LinearProgressChart, LinearProgressSeries, LinkSeries, LiquidChart, LiquidSeries, MOSAIC_CAT_END_PERCENT, MOSAIC_CAT_START_PERCENT, MOSAIC_VALUE_END_PERCENT, MOSAIC_VALUE_START_PERCENT, MapChart, MapLabelComponent, MapSeries, MediaQuery, MosaicChart, MosaicSeries, PREFIX, PathMark, PictogramChart, PictogramSeries, Pie3dChart, Pie3dSeries, PieChart, PieSeries, Player, PolarAxis, PolarBandAxis, PolarCrossHair, PolarLinearAxis, PolarMarkArea, PolarMarkLine, PolarMarkPoint, PolarSeries, PolygonMark, ProgressLikeSeries, Pyramid3dMark, RadarChart, RadarSeries, RangeAreaChart, RangeAreaSeries, RangeColumn3dChart, RangeColumn3dSeries, RangeColumnChart, RangeColumnSeries, Rect3dMark, RectMark, RenderModeEnum, RippleMark, RoseChart, RoseLikeSeries, RoseSeries, RuleMark, SEGMENT_FIELD_END, SEGMENT_FIELD_START, STACK_FIELD_END, STACK_FIELD_END_OffsetSilhouette, STACK_FIELD_END_PERCENT, STACK_FIELD_KEY, STACK_FIELD_START, STACK_FIELD_START_OffsetSilhouette, STACK_FIELD_START_PERCENT, STACK_FIELD_TOTAL, STACK_FIELD_TOTAL_BOTTOM, STACK_FIELD_TOTAL_PERCENT, STACK_FIELD_TOTAL_TOP, SankeyChart, SankeySeries, ScatterChart, ScatterSeries, ScrollBar, SequenceChart, SeriesMarkNameEnum, SeriesTypeEnum, SeriesTypeForThemeEnum, SunburstChart, SunburstSeries, SymbolMark, TextMark, ThemeManager$1 as ThemeManager, Title, Tooltip, TooltipResult, TotalLabel, TreemapChart, TreemapSeries, VChart, VennChart, VennSeries, WaterfallChart, WaterfallSeries, WordCloud3dChart, WordCloud3dSeries, WordCloudChart, WordCloudSeries, alternatingWave, builtinThemes, centerToCorner, columnCenterToEdge, columnEdgeToCenter, columnLeftToRight, columnRightToLeft, computeActualDataScheme, cornerToCenter, createArc, createArea, createGroup, createLine, createRect, createRichText, createSymbol, createText, darkTheme$1 as darkTheme, dataScheme, VChart as default, defaultThemeName, diagonalCenterToEdge, diagonalTopLeftToBottomRight, getActualColor, getCartesianDimensionInfo, getColorSchemeBySeries, getDataScheme, getMergedTheme, getPolarDimensionInfo, getTheme, hasThemeMerged, isColorKey, isProgressiveDataColorScheme, isTokenKey, lightTheme, particleEffect, pulseWave, queryColorFromColorScheme, queryToken, randomOpacity, register3DPlugin, registerAllEnv, registerAllMarks, registerAnimate, registerArc3dMark, registerArcMark, registerAreaChart, registerAreaMark, registerAreaSeries, registerBar3dChart, registerBar3dSeries, registerBarChart, registerBarSeries, registerBoxplotChart, registerBoxplotSeries, registerBrowserEnv, registerBrush, registerCanvasTooltipHandler, registerCartesianBandAxis, registerCartesianCrossHair, registerCartesianLinearAxis, registerCartesianLogAxis, registerCartesianSymlogAxis, registerCartesianTimeAxis, registerChartPlugin, registerCirclePackingChart, registerCirclePackingSeries, registerCircularProgressChart, registerCircularProgressSeries, registerCommonChart, registerComponentMark, registerContinuousLegend, registerCorrelationChart, registerCustomMark, registerDataZoom, registerDiscreteLegend, registerDomTooltipHandler, registerDotSeries, registerDragPlugin, registerFormatPlugin, registerFunnel3dChart, registerFunnel3dSeries, registerFunnelChart, registerFunnelSeries, registerGaugeChart, registerGaugePointerSeries, registerGaugeSeries, registerGeoCoordinate, registerGeoMarkPoint, registerGesturePlugin, registerGridLayout, registerGroupMark, registerHarmonyEnv, registerHeatmapChart, registerHeatmapSeries, registerHistogram3dChart, registerHistogramChart, registerHtmlAttributePlugin, registerImageMark, registerIndicator, registerLabel, registerLarkEnv, registerLayout3d, registerLineChart, registerLineMark, registerLineSeries, registerLinearProgressChart, registerLinearProgressSeries, registerLinkSeries, registerLiquidChart, registerLiquidSeries, registerLynxEnv, registerMapChart, registerMapLabel, registerMapSeries, registerMarkArea, registerMarkLine, registerMarkPoint, registerMediaQuery, registerMorph, registerMosaicChart, registerMosaicSeries, registerNodeEnv, registerPathMark, registerPictogramChart, registerPictogramSeries, registerPie3dChart, registerPie3dSeries, registerPieChart, registerPieSeries, registerPlayer, registerPolarBandAxis, registerPolarCrossHair, registerPolarLinearAxis, registerPolarMarkArea, registerPolarMarkLine, registerPolarMarkPoint, registerPolygonMark, registerPoptip, registerPyramid3dMark, registerRadarChart, registerRadarSeries, registerRangeAreaChart, registerRangeAreaSeries, registerRangeColumn3dChart, registerRangeColumn3dSeries, registerRangeColumnChart, registerRangeColumnSeries, registerReactAttributePlugin, registerRect3dMark, registerRectMark, registerRippleMark, registerRoseChart, registerRoseSeries, registerRuleMark, registerSankeyChart, registerSankeySeries, registerScatterChart, registerScatterSeries, registerScrollBar, registerSequenceChart, registerSunBurstSeries, registerSunburstChart, registerSymbolMark, registerTTEnv, registerTaroEnv, registerTextMark, registerTheme, registerTitle, registerTooltip, registerTotalLabel, registerTreemapChart, registerTreemapSeries, registerVennChart, registerVennSeries, registerWXEnv, registerWaterfallChart, registerWaterfallSeries, registerWordCloud3dChart, registerWordCloud3dSeries, registerWordCloudChart, registerWordCloudSeries, registerWordCloudShapeChart, removeTheme, rippleEffect, rotationScan, rowBottomToTop, rowCenterToEdge, rowEdgeToCenter, rowTopToBottom, snakeWave, spiralEffect, themeExist, themes, token, transformColorSchemeToStandardStruct, version, vglobal };
|
|
103689
|
+
export { Arc3dMark, ArcMark, AreaChart, AreaMark, AreaSeries, AxisSyncPlugin, Bar3dChart, Bar3dSeries, BarChart, BarSeries, BaseChart, BaseChartSpecTransformer, BaseMark, BaseSeries, BoxPlotChart, BoxPlotSeries, Brush, CanvasTooltipHandler, CartesianAxis, CartesianBandAxis, CartesianCrossHair, CartesianLinearAxis, CartesianLogAxis, CartesianMarkArea, CartesianMarkLine, CartesianMarkPoint, CartesianSeries, CartesianSymlogAxis, CartesianTimeAxis, CirclePackingChart, CirclePackingSeries, CircularProgressChart, CircularProgressSeries, CommonChart, CommonChartSpecTransformer, ComponentMark, ComposedEventMapper, ContinuousLegend, CorrelationChart, CorrelationSeries, CustomMark, DEFAULT_CHART_HEIGHT, DEFAULT_CHART_WIDTH, DEFAULT_DATA_INDEX, DEFAULT_DATA_KEY, DEFAULT_DATA_SERIES_FIELD, DEFAULT_MEASURE_CANVAS_ID, DEFAULT_SERIES_STYLE_NAME, DataZoom, DimensionClickEvent, DimensionEventEnum, DimensionHoverEvent, DiscreteLegend, DomTooltipHandler, DotSeries, Event$1 as Event, Factory$1 as Factory, FormatterPlugin, Funnel3dChart, Funnel3dSeries, FunnelChart, FunnelSeries, GaugeChart, GaugePointerSeries, GaugeSeries, GeoCoordinate, GeoMarkPoint, GridLayout, GroupMark, HeatmapChart, HeatmapSeries, Histogram3dChart, HistogramChart, ImageMark, Indicator, Label, Layout$1 as Layout, Layout3d, LineChart, LineMark, LineSeries, LinearProgressChart, LinearProgressSeries, LinkSeries, LiquidChart, LiquidSeries, MOSAIC_CAT_END_PERCENT, MOSAIC_CAT_START_PERCENT, MOSAIC_VALUE_END_PERCENT, MOSAIC_VALUE_START_PERCENT, MapChart, MapLabelComponent, MapSeries, MediaQuery, MosaicChart, MosaicSeries, PREFIX, PathMark, PictogramChart, PictogramSeries, Pie3dChart, Pie3dSeries, PieChart, PieSeries, Player, PolarAxis, PolarBandAxis, PolarCrossHair, PolarLinearAxis, PolarMarkArea, PolarMarkLine, PolarMarkPoint, PolarSeries, PolygonMark, ProgressLikeSeries, Pyramid3dMark, RadarChart, RadarSeries, RangeAreaChart, RangeAreaSeries, RangeColumn3dChart, RangeColumn3dSeries, RangeColumnChart, RangeColumnSeries, Rect3dMark, RectMark, RenderModeEnum, RippleMark, RoseChart, RoseLikeSeries, RoseSeries, RuleMark, SEGMENT_FIELD_END, SEGMENT_FIELD_START, STACK_FIELD_END, STACK_FIELD_END_OffsetSilhouette, STACK_FIELD_END_PERCENT, STACK_FIELD_KEY, STACK_FIELD_START, STACK_FIELD_START_OffsetSilhouette, STACK_FIELD_START_PERCENT, STACK_FIELD_TOTAL, STACK_FIELD_TOTAL_BOTTOM, STACK_FIELD_TOTAL_PERCENT, STACK_FIELD_TOTAL_TOP, SankeyChart, SankeySeries, ScatterChart, ScatterSeries, ScrollBar, SequenceChart, SeriesMarkNameEnum, SeriesTypeEnum, SeriesTypeForThemeEnum, SunburstChart, SunburstSeries, SymbolMark, TextMark, ThemeManager$1 as ThemeManager, Title, Tooltip, TooltipResult, TotalLabel, TreemapChart, TreemapSeries, VChart, VennChart, VennSeries, WaterfallChart, WaterfallSeries, WordCloud3dChart, WordCloud3dSeries, WordCloudChart, WordCloudSeries, alternatingWave, builtinThemes, centerToCorner, columnCenterToEdge, columnEdgeToCenter, columnLeftToRight, columnRightToLeft, computeActualDataScheme, cornerToCenter, createArc, createArea, createGroup, createLine, createRect, createRichText, createSymbol, createText, darkTheme$1 as darkTheme, dataScheme, VChart as default, defaultThemeName, diagonalCenterToEdge, diagonalTopLeftToBottomRight, functionTransform, getActualColor, getCartesianDimensionInfo, getColorSchemeBySeries, getDataScheme, getFieldAlias, getMergedTheme, getPolarDimensionInfo, getRegionStackGroup, getTheme, hasThemeMerged, isColorKey, isProgressiveDataColorScheme, isTokenKey, lightTheme, mergeFields, particleEffect, pulseWave, queryColorFromColorScheme, queryToken, randomOpacity, register3DPlugin, registerAllEnv, registerAllMarks, registerAnimate, registerArc3dMark, registerArcMark, registerAreaChart, registerAreaMark, registerAreaSeries, registerBar3dChart, registerBar3dSeries, registerBarChart, registerBarSeries, registerBoxplotChart, registerBoxplotSeries, registerBrowserEnv, registerBrush, registerCanvasTooltipHandler, registerCartesianBandAxis, registerCartesianCrossHair, registerCartesianLinearAxis, registerCartesianLogAxis, registerCartesianSymlogAxis, registerCartesianTimeAxis, registerChartPlugin, registerCirclePackingChart, registerCirclePackingSeries, registerCircularProgressChart, registerCircularProgressSeries, registerCommonChart, registerComponentMark, registerContinuousLegend, registerCorrelationChart, registerCustomMark, registerDataZoom, registerDiscreteLegend, registerDomTooltipHandler, registerDotSeries, registerDragPlugin, registerFormatPlugin, registerFunnel3dChart, registerFunnel3dSeries, registerFunnelChart, registerFunnelSeries, registerGaugeChart, registerGaugePointerSeries, registerGaugeSeries, registerGeoCoordinate, registerGeoMarkPoint, registerGesturePlugin, registerGridLayout, registerGroupMark, registerHarmonyEnv, registerHeatmapChart, registerHeatmapSeries, registerHistogram3dChart, registerHistogramChart, registerHtmlAttributePlugin, registerImageMark, registerIndicator, registerLabel, registerLarkEnv, registerLayout3d, registerLineChart, registerLineMark, registerLineSeries, registerLinearProgressChart, registerLinearProgressSeries, registerLinkSeries, registerLiquidChart, registerLiquidSeries, registerLynxEnv, registerMapChart, registerMapLabel, registerMapSeries, registerMarkArea, registerMarkLine, registerMarkPoint, registerMediaQuery, registerMorph, registerMosaicChart, registerMosaicSeries, registerNodeEnv, registerPathMark, registerPictogramChart, registerPictogramSeries, registerPie3dChart, registerPie3dSeries, registerPieChart, registerPieSeries, registerPlayer, registerPolarBandAxis, registerPolarCrossHair, registerPolarLinearAxis, registerPolarMarkArea, registerPolarMarkLine, registerPolarMarkPoint, registerPolygonMark, registerPoptip, registerPyramid3dMark, registerRadarChart, registerRadarSeries, registerRangeAreaChart, registerRangeAreaSeries, registerRangeColumn3dChart, registerRangeColumn3dSeries, registerRangeColumnChart, registerRangeColumnSeries, registerReactAttributePlugin, registerRect3dMark, registerRectMark, registerRippleMark, registerRoseChart, registerRoseSeries, registerRuleMark, registerSankeyChart, registerSankeySeries, registerScatterChart, registerScatterSeries, registerScrollBar, registerSequenceChart, registerSunBurstSeries, registerSunburstChart, registerSymbolMark, registerTTEnv, registerTaroEnv, registerTextMark, registerTheme, registerTitle, registerTooltip, registerTotalLabel, registerTreemapChart, registerTreemapSeries, registerVennChart, registerVennSeries, registerWXEnv, registerWaterfallChart, registerWaterfallSeries, registerWordCloud3dChart, registerWordCloud3dSeries, registerWordCloudChart, registerWordCloudSeries, registerWordCloudShapeChart, removeTheme, rippleEffect, rotationScan, rowBottomToTop, rowCenterToEdge, rowEdgeToCenter, rowTopToBottom, snakeWave, sortStackValueGroup, specTransform, spiralEffect, stack, stackGroup, stackMosaic, stackMosaicTotal, stackOffsetSilhouette, stackTotal, themeExist, themes, token, transformColorSchemeToStandardStruct, version, vglobal };
|