@visactor/vchart 1.8.4 → 1.8.5
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.js +312 -279
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/component/axis/util.js +2 -1
- package/cjs/component/axis/util.js.map +1 -1
- package/cjs/component/base/util.js +4 -4
- package/cjs/component/base/util.js.map +1 -1
- package/cjs/component/crosshair/base.js +9 -1
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/interface/theme.d.ts +1 -0
- package/cjs/component/interface/theme.js.map +1 -1
- package/cjs/component/marker/interface.d.ts +3 -4
- package/cjs/component/marker/interface.js.map +1 -1
- package/cjs/component/marker/utils.js +10 -23
- package/cjs/component/marker/utils.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/data/transforms/aggregation.js +25 -21
- package/cjs/data/transforms/aggregation.js.map +1 -1
- package/cjs/interaction/trigger.d.ts +1 -0
- package/cjs/interaction/trigger.js +2 -1
- package/cjs/interaction/trigger.js.map +1 -1
- package/cjs/series/funnel/funnel.js +2 -2
- package/cjs/series/funnel/funnel.js.map +1 -1
- package/cjs/series/waterfall/waterfall-transformer.js +1 -1
- package/cjs/series/waterfall/waterfall-transformer.js.map +1 -1
- package/cjs/theme/builtin/common/component/axis/cartesian-axis.d.ts +1 -0
- package/cjs/theme/builtin/common/component/axis/cartesian-axis.js +6 -2
- package/cjs/theme/builtin/common/component/axis/cartesian-axis.js.map +1 -1
- package/cjs/theme/builtin/common/component/index.js +1 -0
- package/cjs/theme/builtin/common/component/index.js.map +1 -1
- package/cjs/theme/builtin/common-mobile/component/axis/cartesian-axis.d.ts +1 -0
- package/cjs/theme/builtin/common-mobile/component/axis/cartesian-axis.js +6 -2
- package/cjs/theme/builtin/common-mobile/component/axis/cartesian-axis.js.map +1 -1
- package/cjs/theme/builtin/common-mobile/component/index.js +1 -0
- package/cjs/theme/builtin/common-mobile/component/index.js.map +1 -1
- package/esm/component/axis/util.js +2 -2
- package/esm/component/axis/util.js.map +1 -1
- package/esm/component/base/util.js +4 -4
- package/esm/component/base/util.js.map +1 -1
- package/esm/component/crosshair/base.js +9 -1
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/interface/theme.d.ts +1 -0
- package/esm/component/interface/theme.js.map +1 -1
- package/esm/component/marker/interface.d.ts +3 -4
- package/esm/component/marker/interface.js.map +1 -1
- package/esm/component/marker/utils.js +10 -22
- package/esm/component/marker/utils.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/data/transforms/aggregation.js +26 -22
- package/esm/data/transforms/aggregation.js.map +1 -1
- package/esm/interaction/trigger.d.ts +1 -0
- package/esm/interaction/trigger.js +2 -1
- package/esm/interaction/trigger.js.map +1 -1
- package/esm/series/funnel/funnel.js +2 -2
- package/esm/series/funnel/funnel.js.map +1 -1
- package/esm/series/waterfall/waterfall-transformer.js +1 -1
- package/esm/series/waterfall/waterfall-transformer.js.map +1 -1
- package/esm/theme/builtin/common/component/axis/cartesian-axis.d.ts +1 -0
- package/esm/theme/builtin/common/component/axis/cartesian-axis.js +6 -0
- package/esm/theme/builtin/common/component/axis/cartesian-axis.js.map +1 -1
- package/esm/theme/builtin/common/component/index.js +2 -1
- package/esm/theme/builtin/common/component/index.js.map +1 -1
- package/esm/theme/builtin/common-mobile/component/axis/cartesian-axis.d.ts +1 -0
- package/esm/theme/builtin/common-mobile/component/axis/cartesian-axis.js +6 -0
- package/esm/theme/builtin/common-mobile/component/axis/cartesian-axis.js.map +1 -1
- package/esm/theme/builtin/common-mobile/component/index.js +2 -1
- package/esm/theme/builtin/common-mobile/component/index.js.map +1 -1
- package/package.json +14 -14
package/build/index.js
CHANGED
|
@@ -7985,6 +7985,10 @@
|
|
|
7985
7985
|
let defined0 = !1;
|
|
7986
7986
|
for (let i = 0, n = points.length; i <= n; i++) i >= n === defined0 && ((defined0 = !defined0) ? path.lineStart() : path.lineEnd()), defined0 && path.point(points[i]);
|
|
7987
7987
|
}
|
|
7988
|
+
function genSegContext(curveType, direction, points) {
|
|
7989
|
+
const curveDirection = null != direction ? direction : abs$1(points[points.length - 1].x - points[0].x) > abs$1(points[points.length - 1].y - points[0].y) ? Direction$2.ROW : Direction$2.COLUMN;
|
|
7990
|
+
return "monotoneY" === curveType ? new ReflectSegContext(curveType, curveDirection) : new SegContext(curveType, curveDirection);
|
|
7991
|
+
}
|
|
7988
7992
|
|
|
7989
7993
|
class Linear {
|
|
7990
7994
|
constructor(context, startPoint) {
|
|
@@ -8027,7 +8031,7 @@
|
|
|
8027
8031
|
startPoint: startPoint
|
|
8028
8032
|
} = params;
|
|
8029
8033
|
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
8030
|
-
const segContext =
|
|
8034
|
+
const segContext = genSegContext("linear", direction, points);
|
|
8031
8035
|
return genLinearTypeSegments(new Linear(segContext, startPoint), points), segContext;
|
|
8032
8036
|
}
|
|
8033
8037
|
function genLinearTypeSegments(path, points) {
|
|
@@ -8084,7 +8088,7 @@
|
|
|
8084
8088
|
} = params;
|
|
8085
8089
|
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
8086
8090
|
if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
|
|
8087
|
-
const segContext =
|
|
8091
|
+
const segContext = genSegContext("basis", direction, points);
|
|
8088
8092
|
return genBasisTypeSegments(new Basis(segContext, startPoint), points), segContext;
|
|
8089
8093
|
}
|
|
8090
8094
|
|
|
@@ -8169,7 +8173,7 @@
|
|
|
8169
8173
|
});
|
|
8170
8174
|
}
|
|
8171
8175
|
}
|
|
8172
|
-
function
|
|
8176
|
+
function genMonotoneXTypeSegments(path, points) {
|
|
8173
8177
|
return genCurveSegments(path, points);
|
|
8174
8178
|
}
|
|
8175
8179
|
function genMonotoneXSegments(points) {
|
|
@@ -8180,10 +8184,10 @@
|
|
|
8180
8184
|
} = params;
|
|
8181
8185
|
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
8182
8186
|
if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
|
|
8183
|
-
const segContext =
|
|
8184
|
-
return
|
|
8187
|
+
const segContext = genSegContext("monotoneX", direction, points);
|
|
8188
|
+
return genMonotoneXTypeSegments(new MonotoneX(segContext, startPoint), points), segContext;
|
|
8185
8189
|
}
|
|
8186
|
-
function
|
|
8190
|
+
function genMonotoneYTypeSegments(path, points) {
|
|
8187
8191
|
return genCurveSegments(path, points);
|
|
8188
8192
|
}
|
|
8189
8193
|
function genMonotoneYSegments(points) {
|
|
@@ -8194,8 +8198,8 @@
|
|
|
8194
8198
|
} = params;
|
|
8195
8199
|
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
8196
8200
|
if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
|
|
8197
|
-
const segContext =
|
|
8198
|
-
return
|
|
8201
|
+
const segContext = genSegContext("monotoneY", direction, points);
|
|
8202
|
+
return genMonotoneYTypeSegments(new MonotoneY(segContext, startPoint), points), segContext;
|
|
8199
8203
|
}
|
|
8200
8204
|
|
|
8201
8205
|
let Step$1 = class Step {
|
|
@@ -8251,39 +8255,10 @@
|
|
|
8251
8255
|
return genCurveSegments(path, points);
|
|
8252
8256
|
}
|
|
8253
8257
|
|
|
8254
|
-
class LinearClosed {
|
|
8255
|
-
constructor(context, startPoint) {
|
|
8256
|
-
this.context = context, startPoint && (this.startPoint = startPoint);
|
|
8257
|
-
}
|
|
8258
|
-
areaStart() {
|
|
8259
|
-
this._line = 0;
|
|
8260
|
-
}
|
|
8261
|
-
areaEnd() {
|
|
8262
|
-
this._line = NaN;
|
|
8263
|
-
}
|
|
8264
|
-
lineStart() {
|
|
8265
|
-
this._point = 0, this.startPoint && this.point(this.startPoint);
|
|
8266
|
-
}
|
|
8258
|
+
class LinearClosed extends Linear {
|
|
8267
8259
|
lineEnd() {
|
|
8268
8260
|
this.context.closePath();
|
|
8269
8261
|
}
|
|
8270
|
-
point(p) {
|
|
8271
|
-
const x = p.x,
|
|
8272
|
-
y = p.y;
|
|
8273
|
-
switch (this._point) {
|
|
8274
|
-
case 0:
|
|
8275
|
-
this._point = 1, this._line ? this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p) : this.context.moveTo(x, y, p);
|
|
8276
|
-
break;
|
|
8277
|
-
case 1:
|
|
8278
|
-
this._point = 2;
|
|
8279
|
-
default:
|
|
8280
|
-
this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p);
|
|
8281
|
-
}
|
|
8282
|
-
this._lastDefined = p.defined;
|
|
8283
|
-
}
|
|
8284
|
-
tryUpdateLength() {
|
|
8285
|
-
return this.context.tryUpdateLength();
|
|
8286
|
-
}
|
|
8287
8262
|
}
|
|
8288
8263
|
function genLinearClosedSegments(points) {
|
|
8289
8264
|
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -8292,7 +8267,7 @@
|
|
|
8292
8267
|
startPoint: startPoint
|
|
8293
8268
|
} = params;
|
|
8294
8269
|
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
8295
|
-
const segContext =
|
|
8270
|
+
const segContext = genSegContext("linear", direction, points);
|
|
8296
8271
|
return genLinearClosedTypeSegments(new LinearClosed(segContext, startPoint), points), segContext;
|
|
8297
8272
|
}
|
|
8298
8273
|
function genLinearClosedTypeSegments(path, points) {
|
|
@@ -8701,6 +8676,8 @@
|
|
|
8701
8676
|
strokeSeg: null,
|
|
8702
8677
|
pickable: !0,
|
|
8703
8678
|
childrenPickable: !0,
|
|
8679
|
+
fillPickable: !0,
|
|
8680
|
+
strokePickable: !0,
|
|
8704
8681
|
visible: !0,
|
|
8705
8682
|
zIndex: 0,
|
|
8706
8683
|
layout: null,
|
|
@@ -18600,6 +18577,7 @@
|
|
|
18600
18577
|
}
|
|
18601
18578
|
};
|
|
18602
18579
|
DefaultBaseInteractiveRenderContribution = __decorate$1p([injectable(), __param$J(0, inject(ContributionProvider)), __param$J(0, named(InteractiveSubRenderContribution)), __metadata$13("design:paramtypes", [Object])], DefaultBaseInteractiveRenderContribution);
|
|
18580
|
+
|
|
18603
18581
|
class DefaultBaseTextureRenderContribution {
|
|
18604
18582
|
constructor() {
|
|
18605
18583
|
this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 10;
|
|
@@ -18683,7 +18661,9 @@
|
|
|
18683
18661
|
textureSize = graphicAttribute.textureSize,
|
|
18684
18662
|
texturePadding = graphicAttribute.texturePadding
|
|
18685
18663
|
} = graphic.attribute;
|
|
18686
|
-
|
|
18664
|
+
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
18665
|
+
}
|
|
18666
|
+
drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
|
|
18687
18667
|
let pattern = this.textureMap.get(texture);
|
|
18688
18668
|
if (!pattern) switch (texture) {
|
|
18689
18669
|
case "circle":
|
|
@@ -19123,6 +19103,26 @@
|
|
|
19123
19103
|
const defaultSymbolTextureRenderContribution = defaultBaseTextureRenderContribution;
|
|
19124
19104
|
const defaultSymbolBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
|
|
19125
19105
|
|
|
19106
|
+
class DefaultAreaTextureRenderContribution extends DefaultBaseTextureRenderContribution {
|
|
19107
|
+
constructor() {
|
|
19108
|
+
super(...arguments), this.time = BaseRenderContributionTime.afterFillStroke;
|
|
19109
|
+
}
|
|
19110
|
+
drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
|
|
19111
|
+
var _a, _b, _c, _d;
|
|
19112
|
+
this.textureMap || this.initTextureMap(context, graphic.stage);
|
|
19113
|
+
const {
|
|
19114
|
+
attribute = graphic.attribute
|
|
19115
|
+
} = options || {},
|
|
19116
|
+
{
|
|
19117
|
+
texture = null !== (_a = graphic.attribute.texture) && void 0 !== _a ? _a : getAttributeFromDefaultAttrList(graphicAttribute, "texture"),
|
|
19118
|
+
textureColor = null !== (_b = graphic.attribute.textureColor) && void 0 !== _b ? _b : getAttributeFromDefaultAttrList(graphicAttribute, "textureColor"),
|
|
19119
|
+
textureSize = null !== (_c = graphic.attribute.textureSize) && void 0 !== _c ? _c : getAttributeFromDefaultAttrList(graphicAttribute, "textureSize"),
|
|
19120
|
+
texturePadding = null !== (_d = graphic.attribute.texturePadding) && void 0 !== _d ? _d : getAttributeFromDefaultAttrList(graphicAttribute, "texturePadding")
|
|
19121
|
+
} = attribute;
|
|
19122
|
+
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
19123
|
+
}
|
|
19124
|
+
}
|
|
19125
|
+
|
|
19126
19126
|
var __decorate$1n = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
19127
19127
|
var d,
|
|
19128
19128
|
c = arguments.length,
|
|
@@ -19336,6 +19336,22 @@
|
|
|
19336
19336
|
};
|
|
19337
19337
|
DefaultCanvasCircleRender = __decorate$1m([injectable(), __param$H(0, inject(ContributionProvider)), __param$H(0, named(CircleRenderContribution)), __metadata$11("design:paramtypes", [Object])], DefaultCanvasCircleRender);
|
|
19338
19338
|
|
|
19339
|
+
function drawSegItem(ctx, curve, endPercent, params) {
|
|
19340
|
+
if (!curve.p1) return;
|
|
19341
|
+
const {
|
|
19342
|
+
offsetX = 0,
|
|
19343
|
+
offsetY = 0,
|
|
19344
|
+
offsetZ = 0
|
|
19345
|
+
} = params || {};
|
|
19346
|
+
if (1 === endPercent) curve.p2 && curve.p3 ? ctx.bezierCurveTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetX + curve.p2.x, offsetY + curve.p2.y, offsetX + curve.p3.x, offsetY + curve.p3.y, offsetZ) : ctx.lineTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetZ);else if (curve.p2 && curve.p3) {
|
|
19347
|
+
const [curve1] = divideCubic(curve, endPercent);
|
|
19348
|
+
ctx.bezierCurveTo(offsetX + curve1.p1.x, offsetY + curve1.p1.y, offsetX + curve1.p2.x, offsetY + curve1.p2.y, offsetX + curve1.p3.x, offsetY + curve1.p3.y, offsetZ);
|
|
19349
|
+
} else {
|
|
19350
|
+
const p = curve.getPointAt(endPercent);
|
|
19351
|
+
ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
|
|
19352
|
+
}
|
|
19353
|
+
}
|
|
19354
|
+
|
|
19339
19355
|
function drawSegments(path, segPath, percent, clipRangeByDimension, params) {
|
|
19340
19356
|
var _a;
|
|
19341
19357
|
const {
|
|
@@ -19378,7 +19394,7 @@
|
|
|
19378
19394
|
} else lastCurve = curve;
|
|
19379
19395
|
});
|
|
19380
19396
|
} else curves.forEach(curve => {
|
|
19381
|
-
curve.defined ? (needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem
|
|
19397
|
+
curve.defined ? (needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem(path, curve, 1, params), needMoveTo = !1) : needMoveTo = !0;
|
|
19382
19398
|
});
|
|
19383
19399
|
return;
|
|
19384
19400
|
}
|
|
@@ -19419,7 +19435,7 @@
|
|
|
19419
19435
|
needMoveTo = !0;
|
|
19420
19436
|
continue;
|
|
19421
19437
|
}
|
|
19422
|
-
needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem
|
|
19438
|
+
needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem(path, curve, min$1(_p, 1), params), needMoveTo = !1;
|
|
19423
19439
|
}
|
|
19424
19440
|
}
|
|
19425
19441
|
}
|
|
@@ -19456,21 +19472,6 @@
|
|
|
19456
19472
|
path.lineTo(null !== (_c = startP.x1) && void 0 !== _c ? _c : startP.x, null !== (_d = startP.y1) && void 0 !== _d ? _d : startP.y), path.closePath();
|
|
19457
19473
|
});
|
|
19458
19474
|
}
|
|
19459
|
-
function drawSegItem$1(ctx, curve, endPercent, params) {
|
|
19460
|
-
if (!curve.p1) return;
|
|
19461
|
-
const {
|
|
19462
|
-
offsetX = 0,
|
|
19463
|
-
offsetY = 0,
|
|
19464
|
-
offsetZ = 0
|
|
19465
|
-
} = params || {};
|
|
19466
|
-
if (1 === endPercent) curve.p2 && curve.p3 ? ctx.bezierCurveTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetX + curve.p2.x, offsetY + curve.p2.y, offsetX + curve.p3.x, offsetY + curve.p3.y, offsetZ) : ctx.lineTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetZ);else if (curve.p2 && curve.p3) {
|
|
19467
|
-
const [curve1] = divideCubic(curve, endPercent);
|
|
19468
|
-
ctx.bezierCurveTo(offsetX + curve1.p1.x, offsetY + curve1.p1.y, offsetX + curve1.p2.x, offsetY + curve1.p2.y, offsetX + curve1.p3.x, offsetY + curve1.p3.y, offsetZ);
|
|
19469
|
-
} else {
|
|
19470
|
-
const p = curve.getPointAt(endPercent);
|
|
19471
|
-
ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
|
|
19472
|
-
}
|
|
19473
|
-
}
|
|
19474
19475
|
|
|
19475
19476
|
var __decorate$1l = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
19476
19477
|
var d,
|
|
@@ -19531,10 +19532,10 @@
|
|
|
19531
19532
|
points: points
|
|
19532
19533
|
} = line.attribute,
|
|
19533
19534
|
startP = points[0];
|
|
19534
|
-
context.moveTo(startP.x, startP.y, z);
|
|
19535
|
+
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
19535
19536
|
for (let i = 1; i < points.length; i++) {
|
|
19536
19537
|
const p = points[i];
|
|
19537
|
-
context.lineTo(p.x, p.y, z);
|
|
19538
|
+
context.lineTo(p.x + offsetX, p.y + offsetY, z);
|
|
19538
19539
|
}
|
|
19539
19540
|
context.setShadowBlendStyle && context.setShadowBlendStyle(line, line.attribute, lineAttribute);
|
|
19540
19541
|
const {
|
|
@@ -19754,68 +19755,7 @@
|
|
|
19754
19755
|
}
|
|
19755
19756
|
path.closePath();
|
|
19756
19757
|
}
|
|
19757
|
-
function drawSegItem(ctx, curve, endPercent, params) {
|
|
19758
|
-
if (!curve.p1) return;
|
|
19759
|
-
const {
|
|
19760
|
-
offsetX = 0,
|
|
19761
|
-
offsetY = 0,
|
|
19762
|
-
offsetZ = 0
|
|
19763
|
-
} = params || {};
|
|
19764
|
-
if (1 === endPercent) curve.p2 && curve.p3 ? ctx.bezierCurveTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetX + curve.p2.x, offsetY + curve.p2.y, offsetX + curve.p3.x, offsetY + curve.p3.y, offsetZ) : ctx.lineTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetZ);else if (curve.p2 && curve.p3) {
|
|
19765
|
-
const [curve1] = divideCubic(curve, endPercent);
|
|
19766
|
-
ctx.bezierCurveTo(offsetX + curve1.p1.x, offsetY + curve1.p1.y, offsetX + curve1.p2.x, offsetY + curve1.p2.y, offsetX + curve1.p3.x, offsetY + curve1.p3.y, offsetZ);
|
|
19767
|
-
} else {
|
|
19768
|
-
const p = curve.getPointAt(endPercent);
|
|
19769
|
-
ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
|
|
19770
|
-
}
|
|
19771
|
-
}
|
|
19772
19758
|
|
|
19773
|
-
class DefaultAreaTextureRenderContribution extends DefaultBaseTextureRenderContribution {
|
|
19774
|
-
constructor() {
|
|
19775
|
-
super(...arguments), this.time = BaseRenderContributionTime.afterFillStroke;
|
|
19776
|
-
}
|
|
19777
|
-
drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
|
|
19778
|
-
var _a, _b, _c, _d;
|
|
19779
|
-
this.textureMap || this.initTextureMap(context, graphic.stage);
|
|
19780
|
-
const {
|
|
19781
|
-
attribute = graphic.attribute
|
|
19782
|
-
} = options || {},
|
|
19783
|
-
{
|
|
19784
|
-
texture = null !== (_a = graphic.attribute.texture) && void 0 !== _a ? _a : getAttributeFromDefaultAttrList(graphicAttribute, "texture"),
|
|
19785
|
-
textureColor = null !== (_b = graphic.attribute.textureColor) && void 0 !== _b ? _b : getAttributeFromDefaultAttrList(graphicAttribute, "textureColor"),
|
|
19786
|
-
textureSize = null !== (_c = graphic.attribute.textureSize) && void 0 !== _c ? _c : getAttributeFromDefaultAttrList(graphicAttribute, "textureSize"),
|
|
19787
|
-
texturePadding = null !== (_d = graphic.attribute.texturePadding) && void 0 !== _d ? _d : getAttributeFromDefaultAttrList(graphicAttribute, "texturePadding")
|
|
19788
|
-
} = attribute;
|
|
19789
|
-
if (!texture) return;
|
|
19790
|
-
let pattern = this.textureMap.get(texture);
|
|
19791
|
-
if (!pattern) switch (texture) {
|
|
19792
|
-
case "circle":
|
|
19793
|
-
pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
|
|
19794
|
-
break;
|
|
19795
|
-
case "diamond":
|
|
19796
|
-
pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
|
|
19797
|
-
break;
|
|
19798
|
-
case "rect":
|
|
19799
|
-
pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
|
|
19800
|
-
break;
|
|
19801
|
-
case "vertical-line":
|
|
19802
|
-
pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
|
|
19803
|
-
break;
|
|
19804
|
-
case "horizontal-line":
|
|
19805
|
-
pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
|
|
19806
|
-
break;
|
|
19807
|
-
case "bias-lr":
|
|
19808
|
-
pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
|
|
19809
|
-
break;
|
|
19810
|
-
case "bias-rl":
|
|
19811
|
-
pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
|
|
19812
|
-
break;
|
|
19813
|
-
case "grid":
|
|
19814
|
-
pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
|
|
19815
|
-
}
|
|
19816
|
-
pattern && (context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore());
|
|
19817
|
-
}
|
|
19818
|
-
}
|
|
19819
19759
|
const defaultAreaTextureRenderContribution = new DefaultAreaTextureRenderContribution();
|
|
19820
19760
|
const defaultAreaBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
|
|
19821
19761
|
|
|
@@ -19867,39 +19807,43 @@
|
|
|
19867
19807
|
points: points
|
|
19868
19808
|
} = area.attribute,
|
|
19869
19809
|
startP = points[0];
|
|
19870
|
-
context.moveTo(startP.x, startP.y, z);
|
|
19810
|
+
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
19871
19811
|
for (let i = 1; i < points.length; i++) {
|
|
19872
19812
|
const p = points[i];
|
|
19873
|
-
context.lineTo(p.x, p.y, z);
|
|
19813
|
+
context.lineTo(p.x + offsetX, p.y + offsetY, z);
|
|
19874
19814
|
}
|
|
19875
19815
|
for (let i = points.length - 1; i >= 0; i--) {
|
|
19876
19816
|
const p = points[i];
|
|
19877
|
-
context.lineTo(null !== (_b = p.x1) && void 0 !== _b ? _b : p.x, null !== (_c = p.y1) && void 0 !== _c ? _c : p.y, z);
|
|
19817
|
+
context.lineTo((null !== (_b = p.x1) && void 0 !== _b ? _b : p.x) + offsetX, (null !== (_c = p.y1) && void 0 !== _c ? _c : p.y) + offsetY, z);
|
|
19878
19818
|
}
|
|
19879
|
-
context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(area, area.attribute, areaAttribute)
|
|
19819
|
+
context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(area, area.attribute, areaAttribute), this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
|
|
19820
|
+
attribute: area.attribute
|
|
19821
|
+
});
|
|
19880
19822
|
const {
|
|
19881
19823
|
x: originX = 0,
|
|
19882
19824
|
x: originY = 0
|
|
19883
19825
|
} = area.attribute;
|
|
19884
|
-
if (!1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())),
|
|
19826
|
+
if (!1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
|
|
19827
|
+
attribute: area.attribute
|
|
19828
|
+
}), stroke) {
|
|
19885
19829
|
const {
|
|
19886
19830
|
stroke = areaAttribute && areaAttribute.stroke
|
|
19887
19831
|
} = area.attribute;
|
|
19888
19832
|
if (isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1]) if (context.beginPath(), stroke[0]) {
|
|
19889
|
-
context.moveTo(startP.x, startP.y, z);
|
|
19833
|
+
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
19890
19834
|
for (let i = 1; i < points.length; i++) {
|
|
19891
19835
|
const p = points[i];
|
|
19892
|
-
context.lineTo(p.x, p.y, z);
|
|
19836
|
+
context.lineTo(p.x + offsetX, p.y + offsetY, z);
|
|
19893
19837
|
}
|
|
19894
19838
|
} else if (stroke[2]) {
|
|
19895
19839
|
const endP = points[points.length - 1];
|
|
19896
|
-
context.moveTo(endP.x, endP.y, z);
|
|
19840
|
+
context.moveTo(endP.x + offsetX, endP.y + offsetY, z);
|
|
19897
19841
|
for (let i = points.length - 2; i >= 0; i--) {
|
|
19898
19842
|
const p = points[i];
|
|
19899
|
-
context.lineTo(null !== (_d = p.x1) && void 0 !== _d ? _d : p.x, null !== (_e = p.y1) && void 0 !== _e ? _e : p.y, z);
|
|
19843
|
+
context.lineTo((null !== (_d = p.x1) && void 0 !== _d ? _d : p.x) + offsetX, (null !== (_e = p.y1) && void 0 !== _e ? _e : p.y) + offsetY, z);
|
|
19900
19844
|
}
|
|
19901
19845
|
}
|
|
19902
|
-
context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke();
|
|
19846
|
+
strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke());
|
|
19903
19847
|
}
|
|
19904
19848
|
}
|
|
19905
19849
|
drawShape(area, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
@@ -22839,7 +22783,7 @@
|
|
|
22839
22783
|
return this.removeChild(this.findChildByUid(ILayerId));
|
|
22840
22784
|
}
|
|
22841
22785
|
tryInitInteractiveLayer() {
|
|
22842
|
-
this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.nextFrameRenderLayerSet.add(this.interactiveLayer));
|
|
22786
|
+
this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.interactiveLayer.attribute.pickable = !1, this.nextFrameRenderLayerSet.add(this.interactiveLayer));
|
|
22843
22787
|
}
|
|
22844
22788
|
clearViewBox(color) {
|
|
22845
22789
|
this.window.clearViewBox(this._viewBox, color);
|
|
@@ -31588,12 +31532,22 @@
|
|
|
31588
31532
|
x = areaAttribute.x,
|
|
31589
31533
|
y = areaAttribute.y
|
|
31590
31534
|
} = area.attribute;
|
|
31535
|
+
const {
|
|
31536
|
+
fillPickable = areaAttribute.fillPickable,
|
|
31537
|
+
strokePickable = areaAttribute.strokePickable
|
|
31538
|
+
} = area.attribute;
|
|
31591
31539
|
if (pickContext.highPerformanceSave(), area.transMatrix.onlyTranslate()) {
|
|
31592
31540
|
const point = area.getOffsetXY(areaAttribute);
|
|
31593
31541
|
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
31594
31542
|
} else x = 0, y = 0, pickContext.transformFromMatrix(area.transMatrix, !0);
|
|
31595
31543
|
let picked = !1;
|
|
31596
|
-
return this.canvasRenderer.drawShape(area, pickContext, x, y, {}, null, context => !!picked || (picked = context.isPointInPath(point.x, point.y), picked)
|
|
31544
|
+
return this.canvasRenderer.drawShape(area, pickContext, x, y, {}, null, context => !!picked || !!fillPickable && (picked = context.isPointInPath(point.x, point.y), picked), (context, areaAttribute, themeAttribute) => {
|
|
31545
|
+
if (picked) return !0;
|
|
31546
|
+
if (!strokePickable) return !1;
|
|
31547
|
+
const lineWidth = areaAttribute.lineWidth || themeAttribute.lineWidth,
|
|
31548
|
+
pickStrokeBuffer = areaAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
31549
|
+
return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
31550
|
+
}), pickContext.highPerformanceRestore(), picked;
|
|
31597
31551
|
}
|
|
31598
31552
|
};
|
|
31599
31553
|
DefaultCanvasAreaPicker = __decorate$l([injectable(), __param$g(0, inject(AreaRender)), __metadata$g("design:paramtypes", [Object])], DefaultCanvasAreaPicker);
|
|
@@ -34262,6 +34216,34 @@
|
|
|
34262
34216
|
y: graphicBounds.y1
|
|
34263
34217
|
};
|
|
34264
34218
|
}
|
|
34219
|
+
function connectLineBetweenBounds(boundA, boundB) {
|
|
34220
|
+
if (!boundA || !boundB) return;
|
|
34221
|
+
if (isRectIntersect(boundA, boundB, !0)) return;
|
|
34222
|
+
const x1 = Math.min(boundA.x1, boundA.x2),
|
|
34223
|
+
y1 = Math.min(boundA.y1, boundA.y2),
|
|
34224
|
+
x2 = Math.min(boundB.x1, boundB.x2),
|
|
34225
|
+
y2 = Math.min(boundB.y1, boundB.y2),
|
|
34226
|
+
w1 = Math.abs(boundA.x2 - x1) / 2,
|
|
34227
|
+
h1 = Math.abs(boundA.y2 - y1) / 2,
|
|
34228
|
+
w2 = Math.abs(boundB.x2 - x2) / 2,
|
|
34229
|
+
h2 = Math.abs(boundB.y2 - y2) / 2,
|
|
34230
|
+
cx1 = x1 + w1,
|
|
34231
|
+
cy1 = y1 + h1,
|
|
34232
|
+
cx2 = x2 + w2,
|
|
34233
|
+
cy2 = y2 + h2,
|
|
34234
|
+
dx = cx2 - cx1,
|
|
34235
|
+
dy = cy2 - cy1;
|
|
34236
|
+
return [getIntersection(dx, dy, cx1, cy1, w1, h1), getIntersection(-dx, -dy, cx2, cy2, w2, h2)];
|
|
34237
|
+
}
|
|
34238
|
+
function getIntersection(dx, dy, cx, cy, w, h) {
|
|
34239
|
+
return Math.abs(dy / dx) < h / w ? {
|
|
34240
|
+
x: cx + (dx > 0 ? w : -w),
|
|
34241
|
+
y: cy + dy * w / Math.abs(dx)
|
|
34242
|
+
} : {
|
|
34243
|
+
x: cx + dx * h / Math.abs(dy),
|
|
34244
|
+
y: cy + (dy > 0 ? h : -h)
|
|
34245
|
+
};
|
|
34246
|
+
}
|
|
34265
34247
|
|
|
34266
34248
|
function loadLabelComponent() {
|
|
34267
34249
|
registerGroup(), registerText(), registerRichtext(), registerLine();
|
|
@@ -34294,9 +34276,9 @@
|
|
|
34294
34276
|
node === target || isEmpty(node.states) || node.addState(StateValue.selectedReverse, !0);
|
|
34295
34277
|
}), this._lastSelect = target);
|
|
34296
34278
|
}, this._handleRelatedGraphicSetState = e => {
|
|
34297
|
-
var _a, _b, _c;
|
|
34298
|
-
if ((null === (_a = e.detail) || void 0 === _a ? void 0 : _a.type) === AttributeUpdateType.STATE) {
|
|
34299
|
-
const currentStates = null !== (
|
|
34279
|
+
var _a, _b, _c, _d, _e;
|
|
34280
|
+
if ((null === (_a = e.detail) || void 0 === _a ? void 0 : _a.type) === AttributeUpdateType.STATE || (null === (_b = e.detail) || void 0 === _b ? void 0 : _b.type) === AttributeUpdateType.ANIMATE_UPDATE && (null === (_c = e.detail.animationState) || void 0 === _c ? void 0 : _c.isFirstFrameOfStep)) {
|
|
34281
|
+
const currentStates = null !== (_e = null === (_d = e.target) || void 0 === _d ? void 0 : _d.currentStates) && void 0 !== _e ? _e : [];
|
|
34300
34282
|
(this._isCollectionBase ? [...this._graphicToText.values()] : [this._graphicToText.get(e.target)]).forEach(label => {
|
|
34301
34283
|
label && (label.text && label.text.useStates(currentStates), label.labelLine && label.labelLine.useStates(currentStates));
|
|
34302
34284
|
});
|
|
@@ -34304,7 +34286,15 @@
|
|
|
34304
34286
|
};
|
|
34305
34287
|
}
|
|
34306
34288
|
labeling(textBounds, graphicBounds, position, offset) {}
|
|
34307
|
-
|
|
34289
|
+
_createLabelLine(text, baseMark) {
|
|
34290
|
+
const points = connectLineBetweenBounds(text.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds);
|
|
34291
|
+
if (points) {
|
|
34292
|
+
const line = graphicCreator.line({
|
|
34293
|
+
points: points
|
|
34294
|
+
});
|
|
34295
|
+
return baseMark && baseMark.attribute.fill && line.setAttribute("stroke", baseMark.attribute.fill), this.attribute.line && !isEmpty(this.attribute.line.style) && line.setAttributes(this.attribute.line.style), this._setStatesOfLabelLine(line), line;
|
|
34296
|
+
}
|
|
34297
|
+
}
|
|
34308
34298
|
render() {
|
|
34309
34299
|
if (this._prepare(), isNil$1(this._idToGraphic) || this._isCollectionBase && isNil$1(this._idToPoint)) return;
|
|
34310
34300
|
const {
|
|
@@ -34370,7 +34360,7 @@
|
|
|
34370
34360
|
for (let i = 0; i < currentBaseMarks.length; i++) {
|
|
34371
34361
|
const baseMark = currentBaseMarks[i],
|
|
34372
34362
|
points = getPointsOfLineArea(baseMark);
|
|
34373
|
-
if (
|
|
34363
|
+
if (points && points.length) for (let j = 0; j < points.length; j++) {
|
|
34374
34364
|
const textData = data[cur];
|
|
34375
34365
|
textData && points[j] && (isValid$1(textData.id) || (textData.id = `vrender-component-${this.name}-${cur}`), this._idToPoint.set(textData.id, points[j]), this._idToGraphic.set(textData.id, baseMark)), cur++;
|
|
34376
34366
|
}
|
|
@@ -34460,7 +34450,7 @@
|
|
|
34460
34450
|
bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
|
|
34461
34451
|
continue;
|
|
34462
34452
|
}
|
|
34463
|
-
if (checkBounds &&
|
|
34453
|
+
if (checkBounds && baseMark && baseMark.AABBBounds && this._canPlaceInside(text.AABBBounds, baseMark.AABBBounds)) {
|
|
34464
34454
|
bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
|
|
34465
34455
|
continue;
|
|
34466
34456
|
}
|
|
@@ -34519,18 +34509,21 @@
|
|
|
34519
34509
|
!1 === this._enableAnimation || !1 === this.attribute.animation ? this._renderWithOutAnimation(labels) : this._renderWithAnimation(labels);
|
|
34520
34510
|
}
|
|
34521
34511
|
_renderWithAnimation(labels) {
|
|
34512
|
+
var _a;
|
|
34522
34513
|
const currentTextMap = new Map(),
|
|
34523
34514
|
prevTextMap = this._graphicToText || new Map(),
|
|
34524
34515
|
texts = [],
|
|
34525
|
-
labelLines = []
|
|
34516
|
+
labelLines = [],
|
|
34517
|
+
{
|
|
34518
|
+
visible: showLabelLine
|
|
34519
|
+
} = null !== (_a = this.attribute.line) && void 0 !== _a ? _a : {};
|
|
34526
34520
|
labels.forEach((text, index) => {
|
|
34527
|
-
|
|
34528
|
-
const labelLine = this._labelLine(text),
|
|
34529
|
-
relatedGraphic = this.getRelatedGraphic(text.attribute),
|
|
34521
|
+
const relatedGraphic = this.getRelatedGraphic(text.attribute),
|
|
34530
34522
|
textId = text.attribute.id,
|
|
34531
34523
|
textKey = this._isCollectionBase ? textId : relatedGraphic,
|
|
34532
34524
|
state = (null == prevTextMap ? void 0 : prevTextMap.get(textKey)) ? "update" : "enter";
|
|
34533
|
-
|
|
34525
|
+
let labelLine;
|
|
34526
|
+
if (showLabelLine && (labelLine = this._createLabelLine(text, relatedGraphic)), "enter" === state) {
|
|
34534
34527
|
if (texts.push(text), currentTextMap.set(textKey, labelLine ? {
|
|
34535
34528
|
text: text,
|
|
34536
34529
|
labelLine: labelLine
|
|
@@ -34541,7 +34534,7 @@
|
|
|
34541
34534
|
from: from,
|
|
34542
34535
|
to: to
|
|
34543
34536
|
} = getAnimationAttributes(text.attribute, "fadeIn");
|
|
34544
|
-
this.add(text), labelLine && (
|
|
34537
|
+
this.add(text), labelLine && (labelLines.push(labelLine), this.add(labelLine)), this._syncStateWithRelatedGraphic(relatedGraphic), this._animationConfig.enter.duration > 0 && relatedGraphic.once("animate-bind", a => {
|
|
34545
34538
|
text.setAttributes(from), labelLine && labelLine.setAttributes(from);
|
|
34546
34539
|
const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, labelLine, labelLines, index, relatedGraphic, to, this._animationConfig.enter);
|
|
34547
34540
|
relatedGraphic.on("afterAttributeUpdate", listener);
|
|
@@ -34555,40 +34548,42 @@
|
|
|
34555
34548
|
duration: duration,
|
|
34556
34549
|
easing: easing
|
|
34557
34550
|
} = this._animationConfig.update;
|
|
34558
|
-
updateAnimation(prevText, text, this._animationConfig.update), prevLabel.labelLine && prevLabel.labelLine.animate().to(merge$1({}, prevLabel.labelLine.attribute, {
|
|
34559
|
-
|
|
34560
|
-
points: null === (_g = text.attribute) || void 0 === _g ? void 0 : _g.points
|
|
34551
|
+
updateAnimation(prevText, text, this._animationConfig.update), prevLabel.labelLine && labelLine && prevLabel.labelLine.animate().to(merge$1({}, prevLabel.labelLine.attribute, {
|
|
34552
|
+
points: labelLine.attribute.points
|
|
34561
34553
|
}), duration, easing);
|
|
34562
34554
|
}
|
|
34563
34555
|
}), prevTextMap.forEach(label => {
|
|
34564
34556
|
var _a;
|
|
34565
34557
|
null === (_a = label.text) || void 0 === _a || _a.animate().to(getAnimationAttributes(label.text.attribute, "fadeOut").to, this._animationConfig.exit.duration, this._animationConfig.exit.easing).onEnd(() => {
|
|
34566
|
-
this.removeChild(label.text),
|
|
34558
|
+
this.removeChild(label.text), label.labelLine && this.removeChild(label.labelLine);
|
|
34567
34559
|
});
|
|
34568
34560
|
}), this._graphicToText = currentTextMap;
|
|
34569
34561
|
}
|
|
34570
34562
|
_renderWithOutAnimation(labels) {
|
|
34563
|
+
var _a;
|
|
34571
34564
|
const currentTextMap = new Map(),
|
|
34572
|
-
prevTextMap = this._graphicToText || new Map()
|
|
34565
|
+
prevTextMap = this._graphicToText || new Map(),
|
|
34566
|
+
{
|
|
34567
|
+
visible: showLabelLine
|
|
34568
|
+
} = null !== (_a = this.attribute.line) && void 0 !== _a ? _a : {};
|
|
34573
34569
|
labels.forEach(text => {
|
|
34574
|
-
|
|
34575
|
-
const labelLine = this._labelLine(text),
|
|
34576
|
-
relatedGraphic = this.getRelatedGraphic(text.attribute),
|
|
34570
|
+
const relatedGraphic = this.getRelatedGraphic(text.attribute),
|
|
34577
34571
|
state = (null == prevTextMap ? void 0 : prevTextMap.get(relatedGraphic)) ? "update" : "enter",
|
|
34578
34572
|
textKey = this._isCollectionBase ? text.attribute.id : relatedGraphic;
|
|
34579
|
-
|
|
34573
|
+
let labelLine;
|
|
34574
|
+
if (showLabelLine && (labelLine = this._createLabelLine(text, relatedGraphic)), "enter" === state) currentTextMap.set(textKey, labelLine ? {
|
|
34580
34575
|
text: text,
|
|
34581
34576
|
labelLine: labelLine
|
|
34582
34577
|
} : {
|
|
34583
34578
|
text: text
|
|
34584
34579
|
}), this.add(text), labelLine && this.add(labelLine), this._syncStateWithRelatedGraphic(relatedGraphic);else if ("update" === state) {
|
|
34585
34580
|
const prevLabel = prevTextMap.get(textKey);
|
|
34586
|
-
prevTextMap.delete(textKey), currentTextMap.set(textKey, prevLabel), prevLabel.text.setAttributes(text.attribute),
|
|
34587
|
-
points:
|
|
34581
|
+
prevTextMap.delete(textKey), currentTextMap.set(textKey, prevLabel), prevLabel.text.setAttributes(text.attribute), prevLabel.labelLine && labelLine && prevLabel.labelLine.setAttributes({
|
|
34582
|
+
points: labelLine.attribute.points
|
|
34588
34583
|
});
|
|
34589
34584
|
}
|
|
34590
34585
|
}), prevTextMap.forEach(label => {
|
|
34591
|
-
this.removeChild(label.text),
|
|
34586
|
+
this.removeChild(label.text), label.labelLine && this.removeChild(label.labelLine);
|
|
34592
34587
|
}), this._graphicToText = currentTextMap;
|
|
34593
34588
|
}
|
|
34594
34589
|
_syncStateWithRelatedGraphic(relatedGraphic) {
|
|
@@ -34674,7 +34669,7 @@
|
|
|
34674
34669
|
stroke: stroke
|
|
34675
34670
|
});
|
|
34676
34671
|
} else {
|
|
34677
|
-
if (this._canPlaceInside(label.AABBBounds,
|
|
34672
|
+
if (this._canPlaceInside(label.AABBBounds, baseMark.AABBBounds)) {
|
|
34678
34673
|
const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
|
|
34679
34674
|
if (fill && label.setAttributes({
|
|
34680
34675
|
fill: fill
|
|
@@ -34917,17 +34912,19 @@
|
|
|
34917
34912
|
basedArc = arcs.find(arc => {
|
|
34918
34913
|
var _a;
|
|
34919
34914
|
return (null === (_a = arc.refDatum) || void 0 === _a ? void 0 : _a.id) === textData.id;
|
|
34920
|
-
})
|
|
34921
|
-
|
|
34915
|
+
});
|
|
34916
|
+
if (basedArc) {
|
|
34917
|
+
const labelAttribute = {
|
|
34922
34918
|
visible: basedArc.labelVisible,
|
|
34923
34919
|
x: basedArc.labelPosition.x,
|
|
34924
34920
|
y: basedArc.labelPosition.y,
|
|
34925
34921
|
angle: basedArc.angle,
|
|
34926
34922
|
maxLineWidth: basedArc.labelLimit,
|
|
34927
|
-
points:
|
|
34928
|
-
line:
|
|
34923
|
+
points: basedArc.pointA && basedArc.pointB && basedArc.pointC ? [basedArc.pointA, basedArc.pointB, basedArc.pointC] : void 0,
|
|
34924
|
+
line: basedArc.labelLine
|
|
34929
34925
|
};
|
|
34930
|
-
|
|
34926
|
+
labels[i].setAttributes(labelAttribute);
|
|
34927
|
+
}
|
|
34931
34928
|
}
|
|
34932
34929
|
return labels;
|
|
34933
34930
|
}
|
|
@@ -34981,8 +34978,8 @@
|
|
|
34981
34978
|
var _a, _b;
|
|
34982
34979
|
const labelConfig = attribute,
|
|
34983
34980
|
spaceWidth = labelConfig.spaceWidth,
|
|
34984
|
-
position = null !== (_a =
|
|
34985
|
-
offsetRadius = null !== (_b =
|
|
34981
|
+
position = null !== (_a = labelConfig.position) && void 0 !== _a ? _a : "inside",
|
|
34982
|
+
offsetRadius = null !== (_b = labelConfig.offsetRadius) && void 0 !== _b ? _b : -spaceWidth;
|
|
34986
34983
|
return arcs.forEach(arc => {
|
|
34987
34984
|
var _a, _b, _c;
|
|
34988
34985
|
const {
|
|
@@ -34996,22 +34993,22 @@
|
|
|
34996
34993
|
let minRadius;
|
|
34997
34994
|
minRadius = radian >= Math.PI ? innerRadius : Math.max(innerRadius, labelSize.height / 2 / Math.tan(radian / 2)), limit = outerRadius - minRadius - spaceWidth;
|
|
34998
34995
|
}
|
|
34999
|
-
!0 !==
|
|
34996
|
+
!0 !== labelConfig.rotate && (limit = outerRadius - spaceWidth);
|
|
35000
34997
|
const text = this._getFormatLabelText(arc.refDatum, limit);
|
|
35001
34998
|
arc.labelText = text;
|
|
35002
34999
|
const labelWidth = Math.min(limit, arc.labelSize.width),
|
|
35003
35000
|
align = this._computeAlign(arc, attribute);
|
|
35004
35001
|
let labelRadius,
|
|
35005
35002
|
alignOffset = 0;
|
|
35006
|
-
"inside" === position && (alignOffset = "left" === align ? labelWidth : "right" === align ? 0 : labelWidth / 2), labelRadius = "inside-inner" === position ? innerRadius - offsetRadius + alignOffset : outerRadius + offsetRadius - alignOffset, arc.labelPosition = circlePoint(arc.circleCenter.x, arc.circleCenter.y, labelRadius, arc.middleAngle), arc.labelLimit = labelWidth, isGreater(labelWidth, 0) || (arc.labelVisible = !1), arc.angle = null !== (_b = null === (_a =
|
|
35007
|
-
let offsetAngle = null !== (_c =
|
|
35003
|
+
"inside" === position && (alignOffset = "left" === align ? labelWidth : "right" === align ? 0 : labelWidth / 2), labelRadius = "inside-inner" === position ? innerRadius - offsetRadius + alignOffset : outerRadius + offsetRadius - alignOffset, arc.labelPosition = circlePoint(arc.circleCenter.x, arc.circleCenter.y, labelRadius, arc.middleAngle), arc.labelLimit = labelWidth, isGreater(labelWidth, 0) || (arc.labelVisible = !1), arc.angle = null !== (_b = null === (_a = attribute.textStyle) || void 0 === _a ? void 0 : _a.angle) && void 0 !== _b ? _b : arc.middleAngle;
|
|
35004
|
+
let offsetAngle = null !== (_c = labelConfig.offsetAngle) && void 0 !== _c ? _c : 0;
|
|
35008
35005
|
["inside-inner", "inside-outer"].includes(position) && (offsetAngle += Math.PI / 2), arc.angle += offsetAngle;
|
|
35009
35006
|
}), arcs;
|
|
35010
35007
|
}
|
|
35011
35008
|
_layoutOutsideLabels(arcs, attribute, currentMarks) {
|
|
35012
|
-
var _a, _b, _c
|
|
35013
|
-
const center_x = null !== (
|
|
35014
|
-
height = 2 * (null !== (
|
|
35009
|
+
var _a, _b, _c;
|
|
35010
|
+
const center_x = null !== (_a = currentMarks[0].attribute.x) && void 0 !== _a ? _a : 0,
|
|
35011
|
+
height = 2 * (null !== (_b = currentMarks[0].attribute.y) && void 0 !== _b ? _b : 0),
|
|
35015
35012
|
line2MinLength = attribute.line.line2MinLength,
|
|
35016
35013
|
labelLayout = attribute.layout,
|
|
35017
35014
|
spaceWidth = attribute.spaceWidth;
|
|
@@ -35037,7 +35034,7 @@
|
|
|
35037
35034
|
}
|
|
35038
35035
|
!1 === attribute.coverEnable && "none" === labelLayout.strategy && this._coverLabels(arcs);
|
|
35039
35036
|
} else {
|
|
35040
|
-
const maxLabels = height / ((null === (
|
|
35037
|
+
const maxLabels = height / ((null === (_c = attribute.textStyle) || void 0 === _c ? void 0 : _c.fontSize) || 16);
|
|
35041
35038
|
this._adjustY(arcs, maxLabels, attribute, currentMarks);
|
|
35042
35039
|
const {
|
|
35043
35040
|
minY: minY,
|
|
@@ -35059,7 +35056,7 @@
|
|
|
35059
35056
|
const width = 2 * center_x;
|
|
35060
35057
|
return arcs.forEach(arc => {
|
|
35061
35058
|
var _a, _b;
|
|
35062
|
-
arc.labelVisible && (isLess(arc.pointB.x, line2MinLength + spaceWidth) || isGreater(arc.pointB.x, width - line2MinLength - spaceWidth)) && (arc.labelVisible = !1), arc.angle = null !== (_b = null === (_a =
|
|
35059
|
+
arc.labelVisible && (isLess(arc.pointB.x, line2MinLength + spaceWidth) || isGreater(arc.pointB.x, width - line2MinLength - spaceWidth)) && (arc.labelVisible = !1), arc.angle = null !== (_b = null === (_a = attribute.textStyle) || void 0 === _a ? void 0 : _a.angle) && void 0 !== _b ? _b : 0, attribute.offsetAngle && (arc.angle += attribute.offsetAngle), arc.labelLine = Object.assign({}, attribute.line);
|
|
35063
35060
|
}), arcs;
|
|
35064
35061
|
}
|
|
35065
35062
|
_computeX(arc, attribute, currentMarks) {
|
|
@@ -35127,9 +35124,9 @@
|
|
|
35127
35124
|
return null !== (_a = null == value ? void 0 : value.text) && void 0 !== _a ? _a : "";
|
|
35128
35125
|
}
|
|
35129
35126
|
_adjustY(arcs, maxLabels, attribute, currentMarks) {
|
|
35130
|
-
var
|
|
35131
|
-
|
|
35132
|
-
const plotRect_height = 2 * (null !== (
|
|
35127
|
+
var _b;
|
|
35128
|
+
currentMarks[0].attribute.x;
|
|
35129
|
+
const plotRect_height = 2 * (null !== (_b = currentMarks[0].attribute.y) && void 0 !== _b ? _b : 0),
|
|
35133
35130
|
labelLayout = attribute.layout;
|
|
35134
35131
|
if ("vertical" === labelLayout.strategy) {
|
|
35135
35132
|
let delta,
|
|
@@ -35347,15 +35344,22 @@
|
|
|
35347
35344
|
checkBoundsOverlap(lastBounds, bounds) ? arcs[i].labelVisible = !1 : lastBounds = bounds;
|
|
35348
35345
|
}
|
|
35349
35346
|
}
|
|
35350
|
-
|
|
35351
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
35352
|
-
|
|
35353
|
-
|
|
35354
|
-
|
|
35355
|
-
|
|
35356
|
-
|
|
35357
|
-
|
|
35358
|
-
|
|
35347
|
+
_createLabelLine(text, baseMark) {
|
|
35348
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
35349
|
+
const {
|
|
35350
|
+
points: points,
|
|
35351
|
+
line = {},
|
|
35352
|
+
visible: visible,
|
|
35353
|
+
fill: fill
|
|
35354
|
+
} = text.attribute,
|
|
35355
|
+
labelLine = text.attribute.points ? graphicCreator.line({
|
|
35356
|
+
visible: null === (_c = null !== (_a = line.visible && visible) && void 0 !== _a ? _a : null === (_b = text.attribute) || void 0 === _b ? void 0 : _b.visible) || void 0 === _c || _c,
|
|
35357
|
+
stroke: null !== (_e = null === (_d = line.style) || void 0 === _d ? void 0 : _d.stroke) && void 0 !== _e ? _e : fill,
|
|
35358
|
+
lineWidth: null !== (_g = null === (_f = line.style) || void 0 === _f ? void 0 : _f.lineWidth) && void 0 !== _g ? _g : 1,
|
|
35359
|
+
points: points,
|
|
35360
|
+
curveType: line.smooth ? "basis" : null
|
|
35361
|
+
}) : void 0;
|
|
35362
|
+
return labelLine && this._setStatesOfLabelLine(labelLine), labelLine;
|
|
35359
35363
|
}
|
|
35360
35364
|
computeRadius(r, width, height, k) {
|
|
35361
35365
|
return this.computeLayoutRadius(width || 0, height || 0) * r * (isNil$1(k) ? 1 : k);
|
|
@@ -35850,6 +35854,24 @@
|
|
|
35850
35854
|
const layerLabelGroup = this.renderLabels(labelGroup, axisItems, layer),
|
|
35851
35855
|
labels = layerLabelGroup.getChildren();
|
|
35852
35856
|
this.beforeLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length), this.handleLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length), this.afterLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length);
|
|
35857
|
+
let maxTextWidth = 0,
|
|
35858
|
+
maxTextHeight = 0,
|
|
35859
|
+
textAlign = "center",
|
|
35860
|
+
textBaseline = "middle";
|
|
35861
|
+
labels.forEach(label => {
|
|
35862
|
+
var _a;
|
|
35863
|
+
const labelStyle = label.attribute,
|
|
35864
|
+
angle = null !== (_a = labelStyle.angle) && void 0 !== _a ? _a : 0,
|
|
35865
|
+
textBounds = label.AABBBounds;
|
|
35866
|
+
let textWidth = textBounds.width(),
|
|
35867
|
+
textHeight = textBounds.height();
|
|
35868
|
+
angle && (textWidth = Math.abs(textWidth * Math.cos(angle)), textHeight = Math.abs(textHeight * Math.sin(angle))), maxTextWidth = Math.max(maxTextWidth, textWidth), maxTextHeight = Math.max(maxTextHeight, textHeight), textAlign = labelStyle.textAlign, textBaseline = labelStyle.textBaseline;
|
|
35869
|
+
}), this.axisLabelLayerSize[layer] = {
|
|
35870
|
+
width: maxTextWidth,
|
|
35871
|
+
height: maxTextHeight,
|
|
35872
|
+
textAlign: textAlign,
|
|
35873
|
+
textBaseline: textBaseline
|
|
35874
|
+
};
|
|
35853
35875
|
});
|
|
35854
35876
|
}
|
|
35855
35877
|
title && title.visible && this.renderTitle(axisContainer);
|
|
@@ -35901,13 +35923,8 @@
|
|
|
35901
35923
|
y: 0,
|
|
35902
35924
|
pickable: !1
|
|
35903
35925
|
});
|
|
35904
|
-
labelGroup.name = `${AXIS_ELEMENT_NAME.labelContainer}-layer-${layer}`, labelGroup.id = this._getNodeId(`label-container-layer-${layer}`), container.add(labelGroup)
|
|
35905
|
-
|
|
35906
|
-
maxTextHeight = 0,
|
|
35907
|
-
textAlign = "center",
|
|
35908
|
-
textBaseline = "middle";
|
|
35909
|
-
return data.forEach((item, index) => {
|
|
35910
|
-
var _a, _b, _c, _d;
|
|
35926
|
+
return labelGroup.name = `${AXIS_ELEMENT_NAME.labelContainer}-layer-${layer}`, labelGroup.id = this._getNodeId(`label-container-layer-${layer}`), container.add(labelGroup), data.forEach((item, index) => {
|
|
35927
|
+
var _a, _b, _c;
|
|
35911
35928
|
const labelStyle = this._getLabelAttribute(item, index, data, layer);
|
|
35912
35929
|
let text;
|
|
35913
35930
|
if ("rich" === labelStyle.type ? (labelStyle.textConfig = labelStyle.text, labelStyle.width = null !== (_a = labelStyle.width) && void 0 !== _a ? _a : 0, labelStyle.height = null !== (_b = labelStyle.height) && void 0 !== _b ? _b : 0, text = graphicCreator.richtext(labelStyle)) : "html" === labelStyle.type ? (labelStyle.textConfig = [], labelStyle.html = Object.assign(Object.assign({
|
|
@@ -35919,14 +35936,7 @@
|
|
|
35919
35936
|
}), text.states = labelState;
|
|
35920
35937
|
}
|
|
35921
35938
|
labelGroup.add(text);
|
|
35922
|
-
|
|
35923
|
-
maxTextWidth = Math.max(maxTextWidth, text.AABBBounds.width()), maxTextHeight = Math.max(maxTextHeight, text.AABBBounds.height()), angle && (maxTextWidth = Math.abs(maxTextWidth * Math.cos(angle)), maxTextHeight = Math.abs(maxTextHeight * Math.sin(angle))), textAlign = labelStyle.textAlign, textBaseline = labelStyle.textBaseline;
|
|
35924
|
-
}), this.axisLabelLayerSize[layer] = {
|
|
35925
|
-
width: maxTextWidth,
|
|
35926
|
-
height: maxTextHeight,
|
|
35927
|
-
textAlign: textAlign,
|
|
35928
|
-
textBaseline: textBaseline
|
|
35929
|
-
}, labelGroup;
|
|
35939
|
+
}), labelGroup;
|
|
35930
35940
|
}
|
|
35931
35941
|
renderTitle(container) {
|
|
35932
35942
|
const titleAttributes = this.getTitleAttribute(),
|
|
@@ -36154,7 +36164,16 @@
|
|
|
36154
36164
|
do {
|
|
36155
36165
|
items = reduce(items, sep);
|
|
36156
36166
|
} while (items.length >= 3 && hasOverlap$1(items, sep));
|
|
36157
|
-
items.length < 3
|
|
36167
|
+
if (items.length < 3 || config.lastVisible) {
|
|
36168
|
+
const lastSourceItem = last(source);
|
|
36169
|
+
if (!lastSourceItem.attribute.opacity) {
|
|
36170
|
+
const remainLength = items.length;
|
|
36171
|
+
if (remainLength > 1) {
|
|
36172
|
+
lastSourceItem.setAttribute("opacity", 1);
|
|
36173
|
+
for (let i = remainLength - 1; i >= 0 && intersect(items[i], lastSourceItem, sep); i--) items[i].setAttribute("opacity", 0);
|
|
36174
|
+
}
|
|
36175
|
+
}
|
|
36176
|
+
}
|
|
36158
36177
|
}
|
|
36159
36178
|
source.forEach(item => {
|
|
36160
36179
|
item.setAttribute("visible", !!item.attribute.opacity);
|
|
@@ -36232,13 +36251,16 @@
|
|
|
36232
36251
|
function autoLimit(labels, config) {
|
|
36233
36252
|
const {
|
|
36234
36253
|
limitLength: limitLength,
|
|
36254
|
+
verticalLimitLength: verticalLimitLength,
|
|
36235
36255
|
ellipsis = "...",
|
|
36236
36256
|
orient: orient
|
|
36237
36257
|
} = config;
|
|
36238
36258
|
!isEmpty(labels) && isValidNumber$1(limitLength) && labels.forEach(label => {
|
|
36239
36259
|
if (("top" === orient || "bottom" === orient) && Math.floor(label.AABBBounds.height()) <= limitLength) return;
|
|
36240
|
-
|
|
36241
|
-
|
|
36260
|
+
const direction = label.attribute.direction;
|
|
36261
|
+
if (("left" === orient || "right" === orient) && ("vertical" === direction && Math.floor(label.AABBBounds.height()) <= verticalLimitLength || "vertical" !== direction && Math.floor(label.AABBBounds.width()) <= limitLength)) return;
|
|
36262
|
+
const angle = label.attribute.angle;
|
|
36263
|
+
let limitLabelLength = 0 === angle || isNil$1(angle) ? "top" === orient || "bottom" === orient ? null : "vertical" === direction ? verticalLimitLength : limitLength : Math.abs(limitLength / Math.sin(angle));
|
|
36242
36264
|
isValidNumber$1(label.attribute.maxLineWidth) && (limitLabelLength = isValidNumber$1(limitLabelLength) ? Math.min(label.attribute.maxLineWidth, limitLabelLength) : label.attribute.maxLineWidth), label.setAttributes({
|
|
36243
36265
|
maxLineWidth: limitLabelLength,
|
|
36244
36266
|
ellipsis: label.attribute.ellipsis || ellipsis
|
|
@@ -36593,20 +36615,29 @@
|
|
|
36593
36615
|
limitEllipsis: limitEllipsis,
|
|
36594
36616
|
autoHide: autoHide$1,
|
|
36595
36617
|
autoHideMethod: autoHideMethod,
|
|
36596
|
-
autoHideSeparation: autoHideSeparation
|
|
36618
|
+
autoHideSeparation: autoHideSeparation,
|
|
36619
|
+
lastVisible: lastVisible
|
|
36597
36620
|
} = label;
|
|
36598
|
-
isFunction$1(layoutFunc)
|
|
36599
|
-
|
|
36600
|
-
|
|
36601
|
-
|
|
36602
|
-
limitLength
|
|
36603
|
-
|
|
36604
|
-
|
|
36605
|
-
|
|
36606
|
-
|
|
36607
|
-
|
|
36608
|
-
|
|
36609
|
-
|
|
36621
|
+
if (isFunction$1(layoutFunc)) layoutFunc(labelShapes, labelData, layer, this);else {
|
|
36622
|
+
if (autoRotate$1 && autoRotate(labelShapes, {
|
|
36623
|
+
labelRotateAngle: autoRotateAngle,
|
|
36624
|
+
orient: orient
|
|
36625
|
+
}), autoLimit$1 && isValidNumber$1(limitLength) && limitLength > 0) {
|
|
36626
|
+
const verticalLimitLength = "left" !== orient && "right" !== orient || !labelShapes.some(label => "vertical" === label.attribute.direction) ? 1 / 0 : Math.abs(this.attribute.start.y - this.attribute.end.y) / labelShapes.length;
|
|
36627
|
+
autoLimit(labelShapes, {
|
|
36628
|
+
limitLength: limitLength,
|
|
36629
|
+
verticalLimitLength: verticalLimitLength,
|
|
36630
|
+
ellipsis: limitEllipsis,
|
|
36631
|
+
orient: orient
|
|
36632
|
+
});
|
|
36633
|
+
}
|
|
36634
|
+
autoHide$1 && autoHide(labelShapes, {
|
|
36635
|
+
orient: orient,
|
|
36636
|
+
method: autoHideMethod,
|
|
36637
|
+
separation: autoHideSeparation,
|
|
36638
|
+
lastVisible: lastVisible
|
|
36639
|
+
});
|
|
36640
|
+
}
|
|
36610
36641
|
}
|
|
36611
36642
|
afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
|
|
36612
36643
|
const {
|
|
@@ -39216,7 +39247,8 @@
|
|
|
39216
39247
|
shapeSize = 0,
|
|
39217
39248
|
shapeSpace = 0;
|
|
39218
39249
|
if (shapeAttr && !1 !== shapeAttr.visible) {
|
|
39219
|
-
|
|
39250
|
+
const s = get$1(shapeStyle, "style.size", DEFAULT_SHAPE_SIZE);
|
|
39251
|
+
shapeSize = isArray$1(s) ? s[0] || 0 : s, shapeSpace = get$1(shapeAttr, "space", DEFAULT_SHAPE_SPACE);
|
|
39220
39252
|
const itemShape = graphicCreator.symbol(Object.assign(Object.assign({
|
|
39221
39253
|
x: 0,
|
|
39222
39254
|
y: 0,
|
|
@@ -43366,9 +43398,9 @@
|
|
|
43366
43398
|
effects = timeSlice.effects;
|
|
43367
43399
|
if (delay > 0 && graphicAnimate.wait(delay), effects.length < 0) graphicAnimate.wait(duration);else {
|
|
43368
43400
|
const customAnimates = effects.map((effect, index) => {
|
|
43369
|
-
|
|
43370
|
-
|
|
43371
|
-
|
|
43401
|
+
const attributes = effect.type ? typeAnimationAttributes(this.element, effect, animationParameters, parameters) : effect.channel ? channelAnimationAttributes(this.element, effect, animationParameters, parameters) : void 0;
|
|
43402
|
+
if (!attributes) return null;
|
|
43403
|
+
const customOption = (null == attributes ? void 0 : attributes.custom) || (null == effect ? void 0 : effect.custom),
|
|
43372
43404
|
customParametersOption = (null == attributes ? void 0 : attributes.customParameters) || (null == effect ? void 0 : effect.customParameters);
|
|
43373
43405
|
attributes.from && Object.keys(attributes.from).length && this.unit && this.animationOptions.timeline.controlOptions.immediatelyApply && "component" !== this.element.mark.markType && this.element.getGraphicItem().setAttributes(attributes.from);
|
|
43374
43406
|
const isCustomAnimate = isCustomAnimateCtor(customOption);
|
|
@@ -43378,7 +43410,7 @@
|
|
|
43378
43410
|
parameters: customParametersOption
|
|
43379
43411
|
}) : isCustomAnimate ? new customOption(attributes.from, attributes.to, duration, effect.easing, customParametersOption) : attributes.to ? new AttributeAnimate(attributes.from, attributes.to, duration, effect.easing) : void 0;
|
|
43380
43412
|
}).filter(animate => !isNil$1(animate));
|
|
43381
|
-
1 === customAnimates.length ? graphicAnimate.play(customAnimates[0]) : graphicAnimate.play(new AnimateGroup(duration, customAnimates));
|
|
43413
|
+
1 === customAnimates.length ? graphicAnimate.play(customAnimates[0]) : customAnimates.length > 1 && graphicAnimate.play(new AnimateGroup(duration, customAnimates));
|
|
43382
43414
|
}
|
|
43383
43415
|
delayAfter > 0 && graphicAnimate.wait(delayAfter);
|
|
43384
43416
|
}
|
|
@@ -49250,6 +49282,9 @@
|
|
|
49250
49282
|
}
|
|
49251
49283
|
}
|
|
49252
49284
|
};
|
|
49285
|
+
const axisZ = Object.assign(Object.assign({}, axisX), { label: {
|
|
49286
|
+
space: 0
|
|
49287
|
+
} });
|
|
49253
49288
|
|
|
49254
49289
|
const commonAxis = {
|
|
49255
49290
|
domainLine: {
|
|
@@ -50116,6 +50151,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
50116
50151
|
axisLinear,
|
|
50117
50152
|
axisX,
|
|
50118
50153
|
axisY,
|
|
50154
|
+
axisZ,
|
|
50119
50155
|
axisAngle,
|
|
50120
50156
|
axisRadius,
|
|
50121
50157
|
markLine,
|
|
@@ -57813,7 +57849,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57813
57849
|
registerChartPlugin(MediaQuery);
|
|
57814
57850
|
};
|
|
57815
57851
|
|
|
57816
|
-
const version = "1.8.
|
|
57852
|
+
const version = "1.8.5";
|
|
57817
57853
|
|
|
57818
57854
|
var ChartTypeEnum;
|
|
57819
57855
|
(function (ChartTypeEnum) {
|
|
@@ -57904,9 +57940,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57904
57940
|
this._markReverse = new MarkSet();
|
|
57905
57941
|
this.onHover = (params) => {
|
|
57906
57942
|
if (this.filterEventMark(params)) {
|
|
57943
|
+
this._isHovered = true;
|
|
57907
57944
|
this.hoverItem(params);
|
|
57908
57945
|
}
|
|
57909
|
-
else {
|
|
57946
|
+
else if (this._isHovered) {
|
|
57947
|
+
this._isHovered = false;
|
|
57910
57948
|
this.unhoverItem();
|
|
57911
57949
|
}
|
|
57912
57950
|
};
|
|
@@ -63922,7 +63960,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63922
63960
|
: {})) !== null && _a !== void 0 ? _a : {};
|
|
63923
63961
|
const axisTheme = isXAxis(orient)
|
|
63924
63962
|
? getComponentThemeFromOption('axisX', chartTheme)
|
|
63925
|
-
:
|
|
63963
|
+
: isYAxis(orient)
|
|
63964
|
+
? getComponentThemeFromOption('axisY', chartTheme)
|
|
63965
|
+
: getComponentThemeFromOption('axisZ', chartTheme);
|
|
63926
63966
|
return mergeSpec({}, getComponentThemeFromOption('axis', chartTheme), axisTypeTheme, axisTheme);
|
|
63927
63967
|
};
|
|
63928
63968
|
const getPolarAxisTheme = (orient, type, chartTheme) => {
|
|
@@ -64125,13 +64165,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64125
64165
|
function getComponentThemeFromGlobalTheme(type, chartTheme, componentSpec, chartSpec) {
|
|
64126
64166
|
switch (type) {
|
|
64127
64167
|
case ComponentTypeEnum.cartesianBandAxis:
|
|
64128
|
-
return getCartesianAxisTheme(getOrient(componentSpec), 'band', chartTheme);
|
|
64168
|
+
return getCartesianAxisTheme(getOrient(componentSpec, ['z']), 'band', chartTheme);
|
|
64129
64169
|
case ComponentTypeEnum.cartesianLinearAxis:
|
|
64130
|
-
return getCartesianAxisTheme(getOrient(componentSpec), 'linear', chartTheme);
|
|
64170
|
+
return getCartesianAxisTheme(getOrient(componentSpec, ['z']), 'linear', chartTheme);
|
|
64131
64171
|
case ComponentTypeEnum.cartesianLogAxis:
|
|
64132
|
-
return getCartesianAxisTheme(getOrient(componentSpec), 'log', chartTheme);
|
|
64172
|
+
return getCartesianAxisTheme(getOrient(componentSpec, ['z']), 'log', chartTheme);
|
|
64133
64173
|
case ComponentTypeEnum.cartesianSymlogAxis:
|
|
64134
|
-
return getCartesianAxisTheme(getOrient(componentSpec), 'symlog', chartTheme);
|
|
64174
|
+
return getCartesianAxisTheme(getOrient(componentSpec, ['z']), 'symlog', chartTheme);
|
|
64135
64175
|
case ComponentTypeEnum.cartesianAxis:
|
|
64136
64176
|
case ComponentTypeEnum.cartesianTimeAxis:
|
|
64137
64177
|
return getCartesianAxisTheme(getOrient(componentSpec), undefined, chartTheme);
|
|
@@ -65511,6 +65551,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65511
65551
|
|
|
65512
65552
|
class WaterfallSeriesSpecTransformer extends BarSeriesSpecTransformer {
|
|
65513
65553
|
_transformLabelSpec(spec) {
|
|
65554
|
+
this._addMarkLabelSpec(spec, exports.SeriesMarkNameEnum.bar);
|
|
65514
65555
|
this._addMarkLabelSpec(spec, exports.SeriesMarkNameEnum.bar, 'stackLabel');
|
|
65515
65556
|
}
|
|
65516
65557
|
}
|
|
@@ -72577,7 +72618,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72577
72618
|
const rootMark = this.getRootMark().getProduct();
|
|
72578
72619
|
if (rootMark) {
|
|
72579
72620
|
const { x1, x2 } = rootMark.getBounds();
|
|
72580
|
-
return Math.
|
|
72621
|
+
return Math.max(x1, x2);
|
|
72581
72622
|
}
|
|
72582
72623
|
return this.getLayoutRect().width;
|
|
72583
72624
|
},
|
|
@@ -72585,7 +72626,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72585
72626
|
const rootMark = this.getRootMark().getProduct();
|
|
72586
72627
|
if (rootMark) {
|
|
72587
72628
|
const { y1, y2 } = rootMark.getBounds();
|
|
72588
|
-
return Math.
|
|
72629
|
+
return Math.max(y1, y2);
|
|
72589
72630
|
}
|
|
72590
72631
|
return this.getLayoutRect().height;
|
|
72591
72632
|
},
|
|
@@ -85904,8 +85945,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
85904
85945
|
this.triggerOff = 'hover';
|
|
85905
85946
|
this._handleEvent = throttle((params) => {
|
|
85906
85947
|
const { event } = params;
|
|
85907
|
-
const
|
|
85908
|
-
const
|
|
85948
|
+
const layer = this._option.getCompiler().getStage().getLayer(undefined);
|
|
85949
|
+
const point = { x: event.viewX, y: event.viewY };
|
|
85950
|
+
layer.globalTransMatrix.transformPoint({ x: event.viewX, y: event.viewY }, point);
|
|
85951
|
+
const x = point.x - this.getLayoutStartPoint().x;
|
|
85952
|
+
const y = point.y - this.getLayoutStartPoint().y;
|
|
85909
85953
|
this.showDefault = false;
|
|
85910
85954
|
this._layoutCrosshair(x, y);
|
|
85911
85955
|
}, 10);
|
|
@@ -88553,36 +88597,25 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88553
88597
|
return median(data, opt.field);
|
|
88554
88598
|
}
|
|
88555
88599
|
function markerAggregation(_data, options) {
|
|
88556
|
-
const aggrMap = {
|
|
88557
|
-
min: markerMin,
|
|
88558
|
-
max: markerMax,
|
|
88559
|
-
sum: markerSum,
|
|
88560
|
-
average: markerAverage,
|
|
88561
|
-
variance: markerVariance,
|
|
88562
|
-
standardDeviation: markerStandardDeviation,
|
|
88563
|
-
median: markerMedian
|
|
88564
|
-
};
|
|
88565
88600
|
const results = [];
|
|
88566
88601
|
options.forEach(option => {
|
|
88567
88602
|
const result = { x: null, y: null };
|
|
88568
88603
|
if (isValid$1(option.x)) {
|
|
88569
88604
|
const x = option.x;
|
|
88570
|
-
if (
|
|
88571
|
-
|
|
88572
|
-
result.x = aggrMap[aggrType](_data, { field: field });
|
|
88605
|
+
if (isArray$1(x)) {
|
|
88606
|
+
result.x = x.map(item => getFinalValue(item, _data, option));
|
|
88573
88607
|
}
|
|
88574
88608
|
else {
|
|
88575
|
-
result.x = x;
|
|
88609
|
+
result.x = getFinalValue(x, _data, option);
|
|
88576
88610
|
}
|
|
88577
88611
|
}
|
|
88578
88612
|
if (isValid$1(option.y)) {
|
|
88579
88613
|
const y = option.y;
|
|
88580
|
-
if (
|
|
88581
|
-
|
|
88582
|
-
result.y = aggrMap[aggrType](_data, { field: field });
|
|
88614
|
+
if (isArray$1(y)) {
|
|
88615
|
+
result.y = y.map(item => getFinalValue(item, _data, option));
|
|
88583
88616
|
}
|
|
88584
88617
|
else {
|
|
88585
|
-
result.y = y;
|
|
88618
|
+
result.y = getFinalValue(y, _data, option);
|
|
88586
88619
|
}
|
|
88587
88620
|
}
|
|
88588
88621
|
if (option.getRefRelativeSeries) {
|
|
@@ -88592,6 +88625,31 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88592
88625
|
});
|
|
88593
88626
|
return results;
|
|
88594
88627
|
}
|
|
88628
|
+
const aggrMap = {
|
|
88629
|
+
min: markerMin,
|
|
88630
|
+
max: markerMax,
|
|
88631
|
+
sum: markerSum,
|
|
88632
|
+
average: markerAverage,
|
|
88633
|
+
variance: markerVariance,
|
|
88634
|
+
standardDeviation: markerStandardDeviation,
|
|
88635
|
+
median: markerMedian
|
|
88636
|
+
};
|
|
88637
|
+
function getFinalValue(source, _data, option) {
|
|
88638
|
+
const relativeSeries = option.getRelativeSeries();
|
|
88639
|
+
const startSeries = option.getStartRelativeSeries();
|
|
88640
|
+
const endSeries = option.getEndRelativeSeries();
|
|
88641
|
+
const relativeSeriesData = relativeSeries.getData().getLatestData();
|
|
88642
|
+
const startRelativeSeriesData = startSeries.getData().getLatestData();
|
|
88643
|
+
const endRelativeSeriesData = endSeries.getData().getLatestData();
|
|
88644
|
+
if (isFunction$1(source)) {
|
|
88645
|
+
return source(relativeSeriesData, startRelativeSeriesData, endRelativeSeriesData, relativeSeries, startSeries, endSeries);
|
|
88646
|
+
}
|
|
88647
|
+
if (isPlainObject$1(source)) {
|
|
88648
|
+
const { aggrType, field } = source;
|
|
88649
|
+
return aggrMap[aggrType](_data, { field: field });
|
|
88650
|
+
}
|
|
88651
|
+
return source;
|
|
88652
|
+
}
|
|
88595
88653
|
|
|
88596
88654
|
const AGGR_TYPE = ['sum', 'average', 'min', 'max', 'variance', 'standardDeviation', 'median'];
|
|
88597
88655
|
|
|
@@ -88609,7 +88667,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88609
88667
|
}
|
|
88610
88668
|
function getXValue(datum, xDomain, autoRange, refSeries, regionWidth, regionStartLayoutStartPoint) {
|
|
88611
88669
|
var _a, _b;
|
|
88612
|
-
const { relativeSeries
|
|
88670
|
+
const { relativeSeries } = refSeries;
|
|
88613
88671
|
isNumber$2(datum.x) &&
|
|
88614
88672
|
isNeedExtendDomain(xDomain, datum.x, autoRange) &&
|
|
88615
88673
|
((_b = relativeSeries === null || relativeSeries === void 0 ? void 0 : (_a = relativeSeries.getXAxisHelper()).setExtendDomain) === null || _b === void 0 ? void 0 : _b.call(_a, 'marker_xAxis_extend', datum.x));
|
|
@@ -88618,20 +88676,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88618
88676
|
x = convertPercentToValue(datum.x, regionWidth) + regionStartLayoutStartPoint.x;
|
|
88619
88677
|
}
|
|
88620
88678
|
else {
|
|
88621
|
-
x = datum.x;
|
|
88622
|
-
if (isFunction$1(datum.x)) {
|
|
88623
|
-
const relativeSeriesData = relativeSeries.getData().getLatestData();
|
|
88624
|
-
const startRelativeSeriesData = startRelativeSeries.getData().getLatestData();
|
|
88625
|
-
const endRelativeSeriesData = endRelativeSeries.getData().getLatestData();
|
|
88626
|
-
x = datum.x(relativeSeriesData, startRelativeSeriesData, endRelativeSeriesData, relativeSeries, startRelativeSeries, endRelativeSeries);
|
|
88627
|
-
}
|
|
88628
|
-
x = relativeSeries.getXAxisHelper().dataToPosition([x]) + regionStartLayoutStartPoint.x;
|
|
88679
|
+
x = relativeSeries.getXAxisHelper().dataToPosition([datum.x]) + regionStartLayoutStartPoint.x;
|
|
88629
88680
|
}
|
|
88630
88681
|
return x;
|
|
88631
88682
|
}
|
|
88632
88683
|
function getYValue(datum, yDomain, autoRange, refSeries, regionHeight, regionStartLayoutStartPoint) {
|
|
88633
88684
|
var _a, _b;
|
|
88634
|
-
const { relativeSeries
|
|
88685
|
+
const { relativeSeries } = refSeries;
|
|
88635
88686
|
isNumber$2(datum.y) &&
|
|
88636
88687
|
isNeedExtendDomain(yDomain, datum.y, autoRange) &&
|
|
88637
88688
|
((_b = (_a = relativeSeries.getYAxisHelper()) === null || _a === void 0 ? void 0 : _a.setExtendDomain) === null || _b === void 0 ? void 0 : _b.call(_a, 'marker_yAxis_extend', datum.y));
|
|
@@ -88640,14 +88691,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88640
88691
|
y = convertPercentToValue(datum.y, regionHeight) + regionStartLayoutStartPoint.y;
|
|
88641
88692
|
}
|
|
88642
88693
|
else {
|
|
88643
|
-
y = datum.y;
|
|
88644
|
-
if (isFunction$1(datum.y)) {
|
|
88645
|
-
const relativeSeriesData = relativeSeries.getData().getLatestData();
|
|
88646
|
-
const startRelativeSeriesData = startRelativeSeries.getData().getLatestData();
|
|
88647
|
-
const endRelativeSeriesData = endRelativeSeries.getData().getLatestData();
|
|
88648
|
-
y = datum.y(relativeSeriesData, startRelativeSeriesData, endRelativeSeriesData, relativeSeries, startRelativeSeries, endRelativeSeries);
|
|
88649
|
-
}
|
|
88650
|
-
y = relativeSeries.getYAxisHelper().dataToPosition([y]) + regionStartLayoutStartPoint.y;
|
|
88694
|
+
y = relativeSeries.getYAxisHelper().dataToPosition([datum.y]) + regionStartLayoutStartPoint.y;
|
|
88651
88695
|
}
|
|
88652
88696
|
return y;
|
|
88653
88697
|
}
|
|
@@ -88741,19 +88785,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88741
88785
|
}
|
|
88742
88786
|
const xDomain = refRelativeSeries.getXAxisHelper().getScale(0).domain();
|
|
88743
88787
|
const yDomain = refRelativeSeries.getYAxisHelper().getScale(0).domain();
|
|
88744
|
-
const
|
|
88745
|
-
const
|
|
88746
|
-
if (isFunction$1(x)) {
|
|
88747
|
-
return x(refRelativeSeriesData, refRelativeSeries);
|
|
88748
|
-
}
|
|
88749
|
-
return x;
|
|
88750
|
-
});
|
|
88751
|
-
const yValue = array(datum.y).map(y => {
|
|
88752
|
-
if (isFunction$1(y)) {
|
|
88753
|
-
return y(refRelativeSeriesData, refRelativeSeries);
|
|
88754
|
-
}
|
|
88755
|
-
return y;
|
|
88756
|
-
});
|
|
88788
|
+
const xValue = array(datum.x);
|
|
88789
|
+
const yValue = array(datum.y);
|
|
88757
88790
|
xValue.length === 1 &&
|
|
88758
88791
|
isNumber$2(xValue[0]) &&
|
|
88759
88792
|
isNeedExtendDomain(xDomain, xValue[0], autoRange) &&
|