@visactor/vchart 1.8.4 → 1.8.6
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 +385 -310
- 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/plugin/chart/media-query/util/filter.js +3 -3
- package/cjs/plugin/chart/media-query/util/filter.js.map +1 -1
- package/cjs/plugin/chart/register.js +2 -2
- package/cjs/plugin/chart/register.js.map +1 -1
- package/cjs/series/funnel/funnel.js +4 -8
- package/cjs/series/funnel/funnel.js.map +1 -1
- package/cjs/series/scatter/scatter.js +1 -1
- package/cjs/series/scatter/scatter.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/plugin/chart/media-query/util/filter.js +1 -1
- package/esm/plugin/chart/media-query/util/filter.js.map +1 -1
- package/esm/plugin/chart/register.js +1 -1
- package/esm/plugin/chart/register.js.map +1 -1
- package/esm/series/funnel/funnel.js +5 -9
- package/esm/series/funnel/funnel.js.map +1 -1
- package/esm/series/scatter/scatter.js +1 -1
- package/esm/series/scatter/scatter.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) {
|
|
@@ -8684,6 +8659,7 @@
|
|
|
8684
8659
|
textureSize: 10,
|
|
8685
8660
|
texturePadding: 2,
|
|
8686
8661
|
backgroundMode: "no-repeat",
|
|
8662
|
+
backgroundFit: !0,
|
|
8687
8663
|
blur: 0,
|
|
8688
8664
|
cursor: null,
|
|
8689
8665
|
html: null
|
|
@@ -8701,6 +8677,8 @@
|
|
|
8701
8677
|
strokeSeg: null,
|
|
8702
8678
|
pickable: !0,
|
|
8703
8679
|
childrenPickable: !0,
|
|
8680
|
+
fillPickable: !0,
|
|
8681
|
+
strokePickable: !0,
|
|
8704
8682
|
visible: !0,
|
|
8705
8683
|
zIndex: 0,
|
|
8706
8684
|
layout: null,
|
|
@@ -14953,11 +14931,11 @@
|
|
|
14953
14931
|
get cliped() {
|
|
14954
14932
|
const textTheme = getTheme$1(this).text,
|
|
14955
14933
|
attribute = this.attribute;
|
|
14956
|
-
if (
|
|
14934
|
+
if (this.isMultiLine) return;
|
|
14957
14935
|
const {
|
|
14958
14936
|
maxLineWidth = textTheme.maxLineWidth
|
|
14959
14937
|
} = attribute;
|
|
14960
|
-
return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(), null != this.clipedText && this.clipedText !== attribute.text.toString());
|
|
14938
|
+
return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(), "vertical" === attribute.direction && this.cache.verticalList && this.cache.verticalList[0] ? this.cache.verticalList[0].map(item => item.text).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString());
|
|
14961
14939
|
}
|
|
14962
14940
|
get multilineLayout() {
|
|
14963
14941
|
if (this.isMultiLine) return this.tryUpdateAABBBounds(), this.cache.layoutData;
|
|
@@ -18563,7 +18541,8 @@
|
|
|
18563
18541
|
drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
|
|
18564
18542
|
const {
|
|
18565
18543
|
background: background,
|
|
18566
|
-
backgroundMode = graphicAttribute.backgroundMode
|
|
18544
|
+
backgroundMode = graphicAttribute.backgroundMode,
|
|
18545
|
+
backgroundFit = graphicAttribute.backgroundFit
|
|
18567
18546
|
} = graphic.attribute;
|
|
18568
18547
|
if (background) if (graphic.backgroundImg && graphic.resources) {
|
|
18569
18548
|
const res = graphic.resources.get(background);
|
|
@@ -18578,13 +18557,33 @@
|
|
|
18578
18557
|
}
|
|
18579
18558
|
context.clip();
|
|
18580
18559
|
const b = graphic.AABBBounds;
|
|
18581
|
-
context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
|
|
18560
|
+
context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
|
|
18582
18561
|
} else context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, context.fill(), context.highPerformanceRestore();
|
|
18583
18562
|
}
|
|
18584
|
-
doDrawImage(context, data, b, backgroundMode) {
|
|
18563
|
+
doDrawImage(context, data, b, backgroundMode, backgroundFit) {
|
|
18585
18564
|
if ("no-repeat" === backgroundMode) context.drawImage(data, b.x1, b.y1, b.width(), b.height());else {
|
|
18565
|
+
const targetW = b.width(),
|
|
18566
|
+
targetH = b.height();
|
|
18567
|
+
let w = targetW,
|
|
18568
|
+
h = targetH;
|
|
18569
|
+
if (backgroundFit && "repeat" !== backgroundMode && (data.width || data.height)) {
|
|
18570
|
+
const resW = data.width,
|
|
18571
|
+
resH = data.height;
|
|
18572
|
+
if ("repeat-x" === backgroundMode) {
|
|
18573
|
+
w = resW * (targetH / resH);
|
|
18574
|
+
} else if ("repeat-y" === backgroundMode) {
|
|
18575
|
+
h = resH * (targetW / resW);
|
|
18576
|
+
}
|
|
18577
|
+
const canvas = canvasAllocate.allocate({
|
|
18578
|
+
width: w,
|
|
18579
|
+
height: h,
|
|
18580
|
+
dpr: context.dpr
|
|
18581
|
+
}),
|
|
18582
|
+
ctx = canvas.getContext("2d");
|
|
18583
|
+
ctx && (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, w, h), ctx.drawImage(data, 0, 0, w, h), data = canvas.nativeCanvas), document.body.appendChild(data), canvasAllocate.free(canvas);
|
|
18584
|
+
}
|
|
18586
18585
|
const pattern = context.createPattern(data, backgroundMode);
|
|
18587
|
-
context.fillStyle = pattern, context.translate(b.x1, b.y1), context.fillRect(0, 0,
|
|
18586
|
+
context.fillStyle = pattern, context.translate(b.x1, b.y1), context.fillRect(0, 0, targetW, targetH), context.translate(-b.x1, -b.y1);
|
|
18588
18587
|
}
|
|
18589
18588
|
}
|
|
18590
18589
|
}
|
|
@@ -18600,6 +18599,7 @@
|
|
|
18600
18599
|
}
|
|
18601
18600
|
};
|
|
18602
18601
|
DefaultBaseInteractiveRenderContribution = __decorate$1p([injectable(), __param$J(0, inject(ContributionProvider)), __param$J(0, named(InteractiveSubRenderContribution)), __metadata$13("design:paramtypes", [Object])], DefaultBaseInteractiveRenderContribution);
|
|
18602
|
+
|
|
18603
18603
|
class DefaultBaseTextureRenderContribution {
|
|
18604
18604
|
constructor() {
|
|
18605
18605
|
this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 10;
|
|
@@ -18683,7 +18683,9 @@
|
|
|
18683
18683
|
textureSize = graphicAttribute.textureSize,
|
|
18684
18684
|
texturePadding = graphicAttribute.texturePadding
|
|
18685
18685
|
} = graphic.attribute;
|
|
18686
|
-
|
|
18686
|
+
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
18687
|
+
}
|
|
18688
|
+
drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
|
|
18687
18689
|
let pattern = this.textureMap.get(texture);
|
|
18688
18690
|
if (!pattern) switch (texture) {
|
|
18689
18691
|
case "circle":
|
|
@@ -18841,14 +18843,15 @@
|
|
|
18841
18843
|
drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
|
|
18842
18844
|
const {
|
|
18843
18845
|
background: background,
|
|
18844
|
-
backgroundMode = graphicAttribute.backgroundMode
|
|
18846
|
+
backgroundMode = graphicAttribute.backgroundMode,
|
|
18847
|
+
backgroundFit = graphicAttribute.backgroundFit
|
|
18845
18848
|
} = graphic.attribute;
|
|
18846
18849
|
if (background) if (graphic.backgroundImg && graphic.resources) {
|
|
18847
18850
|
const res = graphic.resources.get(background);
|
|
18848
18851
|
if ("success" !== res.state || !res.data) return;
|
|
18849
18852
|
context.highPerformanceSave(), context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0);
|
|
18850
18853
|
const b = graphic.AABBBounds;
|
|
18851
|
-
this.doDrawImage(context, res.data, b, backgroundMode), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
18854
|
+
this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
18852
18855
|
} else context.highPerformanceSave(), context.fillStyle = background, context.fill(), context.highPerformanceRestore();
|
|
18853
18856
|
}
|
|
18854
18857
|
}
|
|
@@ -18917,7 +18920,8 @@
|
|
|
18917
18920
|
drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
|
|
18918
18921
|
const {
|
|
18919
18922
|
background: background,
|
|
18920
|
-
backgroundMode = graphicAttribute.backgroundMode
|
|
18923
|
+
backgroundMode = graphicAttribute.backgroundMode,
|
|
18924
|
+
backgroundFit = graphicAttribute.backgroundFit
|
|
18921
18925
|
} = graphic.attribute;
|
|
18922
18926
|
if (background) if (graphic.backgroundImg) {
|
|
18923
18927
|
const res = graphic.resources.get(background);
|
|
@@ -18931,7 +18935,7 @@
|
|
|
18931
18935
|
context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.translate(scrollX, scrollY);
|
|
18932
18936
|
}
|
|
18933
18937
|
const b = graphic.AABBBounds;
|
|
18934
|
-
this.doDrawImage(context, res.data, b, backgroundMode), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
|
|
18938
|
+
this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
|
|
18935
18939
|
} else if (isObject$2(background)) {
|
|
18936
18940
|
const {
|
|
18937
18941
|
stroke: stroke,
|
|
@@ -19123,6 +19127,26 @@
|
|
|
19123
19127
|
const defaultSymbolTextureRenderContribution = defaultBaseTextureRenderContribution;
|
|
19124
19128
|
const defaultSymbolBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
|
|
19125
19129
|
|
|
19130
|
+
class DefaultAreaTextureRenderContribution extends DefaultBaseTextureRenderContribution {
|
|
19131
|
+
constructor() {
|
|
19132
|
+
super(...arguments), this.time = BaseRenderContributionTime.afterFillStroke;
|
|
19133
|
+
}
|
|
19134
|
+
drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
|
|
19135
|
+
var _a, _b, _c, _d;
|
|
19136
|
+
this.textureMap || this.initTextureMap(context, graphic.stage);
|
|
19137
|
+
const {
|
|
19138
|
+
attribute = graphic.attribute
|
|
19139
|
+
} = options || {},
|
|
19140
|
+
{
|
|
19141
|
+
texture = null !== (_a = graphic.attribute.texture) && void 0 !== _a ? _a : getAttributeFromDefaultAttrList(graphicAttribute, "texture"),
|
|
19142
|
+
textureColor = null !== (_b = graphic.attribute.textureColor) && void 0 !== _b ? _b : getAttributeFromDefaultAttrList(graphicAttribute, "textureColor"),
|
|
19143
|
+
textureSize = null !== (_c = graphic.attribute.textureSize) && void 0 !== _c ? _c : getAttributeFromDefaultAttrList(graphicAttribute, "textureSize"),
|
|
19144
|
+
texturePadding = null !== (_d = graphic.attribute.texturePadding) && void 0 !== _d ? _d : getAttributeFromDefaultAttrList(graphicAttribute, "texturePadding")
|
|
19145
|
+
} = attribute;
|
|
19146
|
+
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
19147
|
+
}
|
|
19148
|
+
}
|
|
19149
|
+
|
|
19126
19150
|
var __decorate$1n = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
19127
19151
|
var d,
|
|
19128
19152
|
c = arguments.length,
|
|
@@ -19336,6 +19360,22 @@
|
|
|
19336
19360
|
};
|
|
19337
19361
|
DefaultCanvasCircleRender = __decorate$1m([injectable(), __param$H(0, inject(ContributionProvider)), __param$H(0, named(CircleRenderContribution)), __metadata$11("design:paramtypes", [Object])], DefaultCanvasCircleRender);
|
|
19338
19362
|
|
|
19363
|
+
function drawSegItem(ctx, curve, endPercent, params) {
|
|
19364
|
+
if (!curve.p1) return;
|
|
19365
|
+
const {
|
|
19366
|
+
offsetX = 0,
|
|
19367
|
+
offsetY = 0,
|
|
19368
|
+
offsetZ = 0
|
|
19369
|
+
} = params || {};
|
|
19370
|
+
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) {
|
|
19371
|
+
const [curve1] = divideCubic(curve, endPercent);
|
|
19372
|
+
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);
|
|
19373
|
+
} else {
|
|
19374
|
+
const p = curve.getPointAt(endPercent);
|
|
19375
|
+
ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
|
|
19376
|
+
}
|
|
19377
|
+
}
|
|
19378
|
+
|
|
19339
19379
|
function drawSegments(path, segPath, percent, clipRangeByDimension, params) {
|
|
19340
19380
|
var _a;
|
|
19341
19381
|
const {
|
|
@@ -19378,7 +19418,7 @@
|
|
|
19378
19418
|
} else lastCurve = curve;
|
|
19379
19419
|
});
|
|
19380
19420
|
} else curves.forEach(curve => {
|
|
19381
|
-
curve.defined ? (needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem
|
|
19421
|
+
curve.defined ? (needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem(path, curve, 1, params), needMoveTo = !1) : needMoveTo = !0;
|
|
19382
19422
|
});
|
|
19383
19423
|
return;
|
|
19384
19424
|
}
|
|
@@ -19419,7 +19459,7 @@
|
|
|
19419
19459
|
needMoveTo = !0;
|
|
19420
19460
|
continue;
|
|
19421
19461
|
}
|
|
19422
|
-
needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem
|
|
19462
|
+
needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem(path, curve, min$1(_p, 1), params), needMoveTo = !1;
|
|
19423
19463
|
}
|
|
19424
19464
|
}
|
|
19425
19465
|
}
|
|
@@ -19456,21 +19496,6 @@
|
|
|
19456
19496
|
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
19497
|
});
|
|
19458
19498
|
}
|
|
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
19499
|
|
|
19475
19500
|
var __decorate$1l = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
19476
19501
|
var d,
|
|
@@ -19531,10 +19556,10 @@
|
|
|
19531
19556
|
points: points
|
|
19532
19557
|
} = line.attribute,
|
|
19533
19558
|
startP = points[0];
|
|
19534
|
-
context.moveTo(startP.x, startP.y, z);
|
|
19559
|
+
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
19535
19560
|
for (let i = 1; i < points.length; i++) {
|
|
19536
19561
|
const p = points[i];
|
|
19537
|
-
context.lineTo(p.x, p.y, z);
|
|
19562
|
+
context.lineTo(p.x + offsetX, p.y + offsetY, z);
|
|
19538
19563
|
}
|
|
19539
19564
|
context.setShadowBlendStyle && context.setShadowBlendStyle(line, line.attribute, lineAttribute);
|
|
19540
19565
|
const {
|
|
@@ -19754,68 +19779,7 @@
|
|
|
19754
19779
|
}
|
|
19755
19780
|
path.closePath();
|
|
19756
19781
|
}
|
|
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
19782
|
|
|
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
19783
|
const defaultAreaTextureRenderContribution = new DefaultAreaTextureRenderContribution();
|
|
19820
19784
|
const defaultAreaBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
|
|
19821
19785
|
|
|
@@ -19867,39 +19831,43 @@
|
|
|
19867
19831
|
points: points
|
|
19868
19832
|
} = area.attribute,
|
|
19869
19833
|
startP = points[0];
|
|
19870
|
-
context.moveTo(startP.x, startP.y, z);
|
|
19834
|
+
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
19871
19835
|
for (let i = 1; i < points.length; i++) {
|
|
19872
19836
|
const p = points[i];
|
|
19873
|
-
context.lineTo(p.x, p.y, z);
|
|
19837
|
+
context.lineTo(p.x + offsetX, p.y + offsetY, z);
|
|
19874
19838
|
}
|
|
19875
19839
|
for (let i = points.length - 1; i >= 0; i--) {
|
|
19876
19840
|
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);
|
|
19841
|
+
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
19842
|
}
|
|
19879
|
-
context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(area, area.attribute, areaAttribute)
|
|
19843
|
+
context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(area, area.attribute, areaAttribute), this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
|
|
19844
|
+
attribute: area.attribute
|
|
19845
|
+
});
|
|
19880
19846
|
const {
|
|
19881
19847
|
x: originX = 0,
|
|
19882
19848
|
x: originY = 0
|
|
19883
19849
|
} = 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())),
|
|
19850
|
+
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, {
|
|
19851
|
+
attribute: area.attribute
|
|
19852
|
+
}), stroke) {
|
|
19885
19853
|
const {
|
|
19886
19854
|
stroke = areaAttribute && areaAttribute.stroke
|
|
19887
19855
|
} = area.attribute;
|
|
19888
19856
|
if (isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1]) if (context.beginPath(), stroke[0]) {
|
|
19889
|
-
context.moveTo(startP.x, startP.y, z);
|
|
19857
|
+
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
19890
19858
|
for (let i = 1; i < points.length; i++) {
|
|
19891
19859
|
const p = points[i];
|
|
19892
|
-
context.lineTo(p.x, p.y, z);
|
|
19860
|
+
context.lineTo(p.x + offsetX, p.y + offsetY, z);
|
|
19893
19861
|
}
|
|
19894
19862
|
} else if (stroke[2]) {
|
|
19895
19863
|
const endP = points[points.length - 1];
|
|
19896
|
-
context.moveTo(endP.x, endP.y, z);
|
|
19864
|
+
context.moveTo(endP.x + offsetX, endP.y + offsetY, z);
|
|
19897
19865
|
for (let i = points.length - 2; i >= 0; i--) {
|
|
19898
19866
|
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);
|
|
19867
|
+
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
19868
|
}
|
|
19901
19869
|
}
|
|
19902
|
-
context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke();
|
|
19870
|
+
strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke());
|
|
19903
19871
|
}
|
|
19904
19872
|
}
|
|
19905
19873
|
drawShape(area, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
@@ -20268,14 +20236,15 @@
|
|
|
20268
20236
|
drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
|
|
20269
20237
|
const {
|
|
20270
20238
|
background: background,
|
|
20271
|
-
backgroundMode = graphicAttribute.backgroundMode
|
|
20239
|
+
backgroundMode = graphicAttribute.backgroundMode,
|
|
20240
|
+
backgroundFit = graphicAttribute.backgroundFit
|
|
20272
20241
|
} = graphic.attribute;
|
|
20273
20242
|
if (!background) return;
|
|
20274
20243
|
const b = graphic.AABBBounds;
|
|
20275
20244
|
if (graphic.backgroundImg && graphic.resources) {
|
|
20276
20245
|
const res = graphic.resources.get(background);
|
|
20277
20246
|
if ("success" !== res.state || !res.data) return;
|
|
20278
|
-
context.highPerformanceSave(), context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), this.doDrawImage(context, res.data, b, backgroundMode), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
20247
|
+
context.highPerformanceSave(), context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
20279
20248
|
} else context.highPerformanceSave(), context.fillStyle = background, context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
20280
20249
|
}
|
|
20281
20250
|
}
|
|
@@ -22174,10 +22143,10 @@
|
|
|
22174
22143
|
let left = 0,
|
|
22175
22144
|
top = 0;
|
|
22176
22145
|
if ("position" === anchorType) {
|
|
22177
|
-
const matrix = graphic.
|
|
22146
|
+
const matrix = graphic.globalTransMatrix;
|
|
22178
22147
|
left = matrix.e, top = matrix.f;
|
|
22179
22148
|
} else {
|
|
22180
|
-
const b = graphic.
|
|
22149
|
+
const b = graphic.globalAABBBounds;
|
|
22181
22150
|
left = b.x1, top = b.y1;
|
|
22182
22151
|
}
|
|
22183
22152
|
const containerTL = application.global.getElementTopLeft(nativeContainer, !1),
|
|
@@ -22839,7 +22808,7 @@
|
|
|
22839
22808
|
return this.removeChild(this.findChildByUid(ILayerId));
|
|
22840
22809
|
}
|
|
22841
22810
|
tryInitInteractiveLayer() {
|
|
22842
|
-
this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.nextFrameRenderLayerSet.add(this.interactiveLayer));
|
|
22811
|
+
this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.interactiveLayer.attribute.pickable = !1, this.nextFrameRenderLayerSet.add(this.interactiveLayer));
|
|
22843
22812
|
}
|
|
22844
22813
|
clearViewBox(color) {
|
|
22845
22814
|
this.window.clearViewBox(this._viewBox, color);
|
|
@@ -31588,12 +31557,22 @@
|
|
|
31588
31557
|
x = areaAttribute.x,
|
|
31589
31558
|
y = areaAttribute.y
|
|
31590
31559
|
} = area.attribute;
|
|
31560
|
+
const {
|
|
31561
|
+
fillPickable = areaAttribute.fillPickable,
|
|
31562
|
+
strokePickable = areaAttribute.strokePickable
|
|
31563
|
+
} = area.attribute;
|
|
31591
31564
|
if (pickContext.highPerformanceSave(), area.transMatrix.onlyTranslate()) {
|
|
31592
31565
|
const point = area.getOffsetXY(areaAttribute);
|
|
31593
31566
|
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
31594
31567
|
} else x = 0, y = 0, pickContext.transformFromMatrix(area.transMatrix, !0);
|
|
31595
31568
|
let picked = !1;
|
|
31596
|
-
return this.canvasRenderer.drawShape(area, pickContext, x, y, {}, null, context => !!picked || (picked = context.isPointInPath(point.x, point.y), picked)
|
|
31569
|
+
return this.canvasRenderer.drawShape(area, pickContext, x, y, {}, null, context => !!picked || !!fillPickable && (picked = context.isPointInPath(point.x, point.y), picked), (context, areaAttribute, themeAttribute) => {
|
|
31570
|
+
if (picked) return !0;
|
|
31571
|
+
if (!strokePickable) return !1;
|
|
31572
|
+
const lineWidth = areaAttribute.lineWidth || themeAttribute.lineWidth,
|
|
31573
|
+
pickStrokeBuffer = areaAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
31574
|
+
return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
31575
|
+
}), pickContext.highPerformanceRestore(), picked;
|
|
31597
31576
|
}
|
|
31598
31577
|
};
|
|
31599
31578
|
DefaultCanvasAreaPicker = __decorate$l([injectable(), __param$g(0, inject(AreaRender)), __metadata$g("design:paramtypes", [Object])], DefaultCanvasAreaPicker);
|
|
@@ -34262,6 +34241,34 @@
|
|
|
34262
34241
|
y: graphicBounds.y1
|
|
34263
34242
|
};
|
|
34264
34243
|
}
|
|
34244
|
+
function connectLineBetweenBounds(boundA, boundB) {
|
|
34245
|
+
if (!boundA || !boundB) return;
|
|
34246
|
+
if (isRectIntersect(boundA, boundB, !0)) return;
|
|
34247
|
+
const x1 = Math.min(boundA.x1, boundA.x2),
|
|
34248
|
+
y1 = Math.min(boundA.y1, boundA.y2),
|
|
34249
|
+
x2 = Math.min(boundB.x1, boundB.x2),
|
|
34250
|
+
y2 = Math.min(boundB.y1, boundB.y2),
|
|
34251
|
+
w1 = Math.abs(boundA.x2 - x1) / 2,
|
|
34252
|
+
h1 = Math.abs(boundA.y2 - y1) / 2,
|
|
34253
|
+
w2 = Math.abs(boundB.x2 - x2) / 2,
|
|
34254
|
+
h2 = Math.abs(boundB.y2 - y2) / 2,
|
|
34255
|
+
cx1 = x1 + w1,
|
|
34256
|
+
cy1 = y1 + h1,
|
|
34257
|
+
cx2 = x2 + w2,
|
|
34258
|
+
cy2 = y2 + h2,
|
|
34259
|
+
dx = cx2 - cx1,
|
|
34260
|
+
dy = cy2 - cy1;
|
|
34261
|
+
return [getIntersection(dx, dy, cx1, cy1, w1, h1), getIntersection(-dx, -dy, cx2, cy2, w2, h2)];
|
|
34262
|
+
}
|
|
34263
|
+
function getIntersection(dx, dy, cx, cy, w, h) {
|
|
34264
|
+
return Math.abs(dy / dx) < h / w ? {
|
|
34265
|
+
x: cx + (dx > 0 ? w : -w),
|
|
34266
|
+
y: cy + dy * w / Math.abs(dx)
|
|
34267
|
+
} : {
|
|
34268
|
+
x: cx + dx * h / Math.abs(dy),
|
|
34269
|
+
y: cy + (dy > 0 ? h : -h)
|
|
34270
|
+
};
|
|
34271
|
+
}
|
|
34265
34272
|
|
|
34266
34273
|
function loadLabelComponent() {
|
|
34267
34274
|
registerGroup(), registerText(), registerRichtext(), registerLine();
|
|
@@ -34294,9 +34301,9 @@
|
|
|
34294
34301
|
node === target || isEmpty(node.states) || node.addState(StateValue.selectedReverse, !0);
|
|
34295
34302
|
}), this._lastSelect = target);
|
|
34296
34303
|
}, 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 !== (
|
|
34304
|
+
var _a, _b, _c, _d, _e;
|
|
34305
|
+
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)) {
|
|
34306
|
+
const currentStates = null !== (_e = null === (_d = e.target) || void 0 === _d ? void 0 : _d.currentStates) && void 0 !== _e ? _e : [];
|
|
34300
34307
|
(this._isCollectionBase ? [...this._graphicToText.values()] : [this._graphicToText.get(e.target)]).forEach(label => {
|
|
34301
34308
|
label && (label.text && label.text.useStates(currentStates), label.labelLine && label.labelLine.useStates(currentStates));
|
|
34302
34309
|
});
|
|
@@ -34304,7 +34311,15 @@
|
|
|
34304
34311
|
};
|
|
34305
34312
|
}
|
|
34306
34313
|
labeling(textBounds, graphicBounds, position, offset) {}
|
|
34307
|
-
|
|
34314
|
+
_createLabelLine(text, baseMark) {
|
|
34315
|
+
const points = connectLineBetweenBounds(text.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds);
|
|
34316
|
+
if (points) {
|
|
34317
|
+
const line = graphicCreator.line({
|
|
34318
|
+
points: points
|
|
34319
|
+
});
|
|
34320
|
+
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;
|
|
34321
|
+
}
|
|
34322
|
+
}
|
|
34308
34323
|
render() {
|
|
34309
34324
|
if (this._prepare(), isNil$1(this._idToGraphic) || this._isCollectionBase && isNil$1(this._idToPoint)) return;
|
|
34310
34325
|
const {
|
|
@@ -34370,7 +34385,7 @@
|
|
|
34370
34385
|
for (let i = 0; i < currentBaseMarks.length; i++) {
|
|
34371
34386
|
const baseMark = currentBaseMarks[i],
|
|
34372
34387
|
points = getPointsOfLineArea(baseMark);
|
|
34373
|
-
if (
|
|
34388
|
+
if (points && points.length) for (let j = 0; j < points.length; j++) {
|
|
34374
34389
|
const textData = data[cur];
|
|
34375
34390
|
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
34391
|
}
|
|
@@ -34460,7 +34475,7 @@
|
|
|
34460
34475
|
bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
|
|
34461
34476
|
continue;
|
|
34462
34477
|
}
|
|
34463
|
-
if (checkBounds &&
|
|
34478
|
+
if (checkBounds && baseMark && baseMark.AABBBounds && this._canPlaceInside(text.AABBBounds, baseMark.AABBBounds)) {
|
|
34464
34479
|
bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
|
|
34465
34480
|
continue;
|
|
34466
34481
|
}
|
|
@@ -34508,29 +34523,49 @@
|
|
|
34508
34523
|
}
|
|
34509
34524
|
getGraphicBounds(graphic) {
|
|
34510
34525
|
let point = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
34511
|
-
|
|
34512
|
-
|
|
34513
|
-
|
|
34514
|
-
|
|
34515
|
-
|
|
34526
|
+
if (graphic) {
|
|
34527
|
+
if (!1 !== graphic.attribute.visible) return graphic.AABBBounds;
|
|
34528
|
+
const {
|
|
34529
|
+
x: x,
|
|
34530
|
+
y: y
|
|
34531
|
+
} = graphic.attribute;
|
|
34532
|
+
return {
|
|
34533
|
+
x1: x,
|
|
34534
|
+
x2: x,
|
|
34535
|
+
y1: y,
|
|
34536
|
+
y2: y
|
|
34537
|
+
};
|
|
34538
|
+
}
|
|
34539
|
+
const {
|
|
34540
|
+
x: x,
|
|
34541
|
+
y: y
|
|
34542
|
+
} = point;
|
|
34543
|
+
return {
|
|
34544
|
+
x1: x,
|
|
34545
|
+
x2: x,
|
|
34546
|
+
y1: y,
|
|
34547
|
+
y2: y
|
|
34516
34548
|
};
|
|
34517
34549
|
}
|
|
34518
34550
|
_renderLabels(labels) {
|
|
34519
34551
|
!1 === this._enableAnimation || !1 === this.attribute.animation ? this._renderWithOutAnimation(labels) : this._renderWithAnimation(labels);
|
|
34520
34552
|
}
|
|
34521
34553
|
_renderWithAnimation(labels) {
|
|
34554
|
+
var _a;
|
|
34522
34555
|
const currentTextMap = new Map(),
|
|
34523
34556
|
prevTextMap = this._graphicToText || new Map(),
|
|
34524
34557
|
texts = [],
|
|
34525
|
-
labelLines = []
|
|
34558
|
+
labelLines = [],
|
|
34559
|
+
{
|
|
34560
|
+
visible: showLabelLine
|
|
34561
|
+
} = null !== (_a = this.attribute.line) && void 0 !== _a ? _a : {};
|
|
34526
34562
|
labels.forEach((text, index) => {
|
|
34527
|
-
|
|
34528
|
-
const labelLine = this._labelLine(text),
|
|
34529
|
-
relatedGraphic = this.getRelatedGraphic(text.attribute),
|
|
34563
|
+
const relatedGraphic = this.getRelatedGraphic(text.attribute),
|
|
34530
34564
|
textId = text.attribute.id,
|
|
34531
34565
|
textKey = this._isCollectionBase ? textId : relatedGraphic,
|
|
34532
34566
|
state = (null == prevTextMap ? void 0 : prevTextMap.get(textKey)) ? "update" : "enter";
|
|
34533
|
-
|
|
34567
|
+
let labelLine;
|
|
34568
|
+
if (showLabelLine && (labelLine = this._createLabelLine(text, relatedGraphic)), "enter" === state) {
|
|
34534
34569
|
if (texts.push(text), currentTextMap.set(textKey, labelLine ? {
|
|
34535
34570
|
text: text,
|
|
34536
34571
|
labelLine: labelLine
|
|
@@ -34541,7 +34576,7 @@
|
|
|
34541
34576
|
from: from,
|
|
34542
34577
|
to: to
|
|
34543
34578
|
} = getAnimationAttributes(text.attribute, "fadeIn");
|
|
34544
|
-
this.add(text), labelLine && (
|
|
34579
|
+
this.add(text), labelLine && (labelLines.push(labelLine), this.add(labelLine)), this._syncStateWithRelatedGraphic(relatedGraphic), this._animationConfig.enter.duration > 0 && relatedGraphic.once("animate-bind", a => {
|
|
34545
34580
|
text.setAttributes(from), labelLine && labelLine.setAttributes(from);
|
|
34546
34581
|
const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, labelLine, labelLines, index, relatedGraphic, to, this._animationConfig.enter);
|
|
34547
34582
|
relatedGraphic.on("afterAttributeUpdate", listener);
|
|
@@ -34555,40 +34590,42 @@
|
|
|
34555
34590
|
duration: duration,
|
|
34556
34591
|
easing: easing
|
|
34557
34592
|
} = 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
|
|
34593
|
+
updateAnimation(prevText, text, this._animationConfig.update), prevLabel.labelLine && labelLine && prevLabel.labelLine.animate().to(merge$1({}, prevLabel.labelLine.attribute, {
|
|
34594
|
+
points: labelLine.attribute.points
|
|
34561
34595
|
}), duration, easing);
|
|
34562
34596
|
}
|
|
34563
34597
|
}), prevTextMap.forEach(label => {
|
|
34564
34598
|
var _a;
|
|
34565
34599
|
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),
|
|
34600
|
+
this.removeChild(label.text), label.labelLine && this.removeChild(label.labelLine);
|
|
34567
34601
|
});
|
|
34568
34602
|
}), this._graphicToText = currentTextMap;
|
|
34569
34603
|
}
|
|
34570
34604
|
_renderWithOutAnimation(labels) {
|
|
34605
|
+
var _a;
|
|
34571
34606
|
const currentTextMap = new Map(),
|
|
34572
|
-
prevTextMap = this._graphicToText || new Map()
|
|
34607
|
+
prevTextMap = this._graphicToText || new Map(),
|
|
34608
|
+
{
|
|
34609
|
+
visible: showLabelLine
|
|
34610
|
+
} = null !== (_a = this.attribute.line) && void 0 !== _a ? _a : {};
|
|
34573
34611
|
labels.forEach(text => {
|
|
34574
|
-
|
|
34575
|
-
const labelLine = this._labelLine(text),
|
|
34576
|
-
relatedGraphic = this.getRelatedGraphic(text.attribute),
|
|
34612
|
+
const relatedGraphic = this.getRelatedGraphic(text.attribute),
|
|
34577
34613
|
state = (null == prevTextMap ? void 0 : prevTextMap.get(relatedGraphic)) ? "update" : "enter",
|
|
34578
34614
|
textKey = this._isCollectionBase ? text.attribute.id : relatedGraphic;
|
|
34579
|
-
|
|
34615
|
+
let labelLine;
|
|
34616
|
+
if (showLabelLine && (labelLine = this._createLabelLine(text, relatedGraphic)), "enter" === state) currentTextMap.set(textKey, labelLine ? {
|
|
34580
34617
|
text: text,
|
|
34581
34618
|
labelLine: labelLine
|
|
34582
34619
|
} : {
|
|
34583
34620
|
text: text
|
|
34584
34621
|
}), this.add(text), labelLine && this.add(labelLine), this._syncStateWithRelatedGraphic(relatedGraphic);else if ("update" === state) {
|
|
34585
34622
|
const prevLabel = prevTextMap.get(textKey);
|
|
34586
|
-
prevTextMap.delete(textKey), currentTextMap.set(textKey, prevLabel), prevLabel.text.setAttributes(text.attribute),
|
|
34587
|
-
points:
|
|
34623
|
+
prevTextMap.delete(textKey), currentTextMap.set(textKey, prevLabel), prevLabel.text.setAttributes(text.attribute), prevLabel.labelLine && labelLine && prevLabel.labelLine.setAttributes({
|
|
34624
|
+
points: labelLine.attribute.points
|
|
34588
34625
|
});
|
|
34589
34626
|
}
|
|
34590
34627
|
}), prevTextMap.forEach(label => {
|
|
34591
|
-
this.removeChild(label.text),
|
|
34628
|
+
this.removeChild(label.text), label.labelLine && this.removeChild(label.labelLine);
|
|
34592
34629
|
}), this._graphicToText = currentTextMap;
|
|
34593
34630
|
}
|
|
34594
34631
|
_syncStateWithRelatedGraphic(relatedGraphic) {
|
|
@@ -34674,7 +34711,7 @@
|
|
|
34674
34711
|
stroke: stroke
|
|
34675
34712
|
});
|
|
34676
34713
|
} else {
|
|
34677
|
-
if (this._canPlaceInside(label.AABBBounds,
|
|
34714
|
+
if (this._canPlaceInside(label.AABBBounds, baseMark.AABBBounds)) {
|
|
34678
34715
|
const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
|
|
34679
34716
|
if (fill && label.setAttributes({
|
|
34680
34717
|
fill: fill
|
|
@@ -34917,17 +34954,19 @@
|
|
|
34917
34954
|
basedArc = arcs.find(arc => {
|
|
34918
34955
|
var _a;
|
|
34919
34956
|
return (null === (_a = arc.refDatum) || void 0 === _a ? void 0 : _a.id) === textData.id;
|
|
34920
|
-
})
|
|
34921
|
-
|
|
34957
|
+
});
|
|
34958
|
+
if (basedArc) {
|
|
34959
|
+
const labelAttribute = {
|
|
34922
34960
|
visible: basedArc.labelVisible,
|
|
34923
34961
|
x: basedArc.labelPosition.x,
|
|
34924
34962
|
y: basedArc.labelPosition.y,
|
|
34925
34963
|
angle: basedArc.angle,
|
|
34926
34964
|
maxLineWidth: basedArc.labelLimit,
|
|
34927
|
-
points:
|
|
34928
|
-
line:
|
|
34965
|
+
points: basedArc.pointA && basedArc.pointB && basedArc.pointC ? [basedArc.pointA, basedArc.pointB, basedArc.pointC] : void 0,
|
|
34966
|
+
line: basedArc.labelLine
|
|
34929
34967
|
};
|
|
34930
|
-
|
|
34968
|
+
labels[i].setAttributes(labelAttribute);
|
|
34969
|
+
}
|
|
34931
34970
|
}
|
|
34932
34971
|
return labels;
|
|
34933
34972
|
}
|
|
@@ -34981,8 +35020,8 @@
|
|
|
34981
35020
|
var _a, _b;
|
|
34982
35021
|
const labelConfig = attribute,
|
|
34983
35022
|
spaceWidth = labelConfig.spaceWidth,
|
|
34984
|
-
position = null !== (_a =
|
|
34985
|
-
offsetRadius = null !== (_b =
|
|
35023
|
+
position = null !== (_a = labelConfig.position) && void 0 !== _a ? _a : "inside",
|
|
35024
|
+
offsetRadius = null !== (_b = labelConfig.offsetRadius) && void 0 !== _b ? _b : -spaceWidth;
|
|
34986
35025
|
return arcs.forEach(arc => {
|
|
34987
35026
|
var _a, _b, _c;
|
|
34988
35027
|
const {
|
|
@@ -34996,22 +35035,22 @@
|
|
|
34996
35035
|
let minRadius;
|
|
34997
35036
|
minRadius = radian >= Math.PI ? innerRadius : Math.max(innerRadius, labelSize.height / 2 / Math.tan(radian / 2)), limit = outerRadius - minRadius - spaceWidth;
|
|
34998
35037
|
}
|
|
34999
|
-
!0 !==
|
|
35038
|
+
!0 !== labelConfig.rotate && (limit = outerRadius - spaceWidth);
|
|
35000
35039
|
const text = this._getFormatLabelText(arc.refDatum, limit);
|
|
35001
35040
|
arc.labelText = text;
|
|
35002
35041
|
const labelWidth = Math.min(limit, arc.labelSize.width),
|
|
35003
35042
|
align = this._computeAlign(arc, attribute);
|
|
35004
35043
|
let labelRadius,
|
|
35005
35044
|
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 =
|
|
35045
|
+
"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;
|
|
35046
|
+
let offsetAngle = null !== (_c = labelConfig.offsetAngle) && void 0 !== _c ? _c : 0;
|
|
35008
35047
|
["inside-inner", "inside-outer"].includes(position) && (offsetAngle += Math.PI / 2), arc.angle += offsetAngle;
|
|
35009
35048
|
}), arcs;
|
|
35010
35049
|
}
|
|
35011
35050
|
_layoutOutsideLabels(arcs, attribute, currentMarks) {
|
|
35012
|
-
var _a, _b, _c
|
|
35013
|
-
const center_x = null !== (
|
|
35014
|
-
height = 2 * (null !== (
|
|
35051
|
+
var _a, _b, _c;
|
|
35052
|
+
const center_x = null !== (_a = currentMarks[0].attribute.x) && void 0 !== _a ? _a : 0,
|
|
35053
|
+
height = 2 * (null !== (_b = currentMarks[0].attribute.y) && void 0 !== _b ? _b : 0),
|
|
35015
35054
|
line2MinLength = attribute.line.line2MinLength,
|
|
35016
35055
|
labelLayout = attribute.layout,
|
|
35017
35056
|
spaceWidth = attribute.spaceWidth;
|
|
@@ -35037,7 +35076,7 @@
|
|
|
35037
35076
|
}
|
|
35038
35077
|
!1 === attribute.coverEnable && "none" === labelLayout.strategy && this._coverLabels(arcs);
|
|
35039
35078
|
} else {
|
|
35040
|
-
const maxLabels = height / ((null === (
|
|
35079
|
+
const maxLabels = height / ((null === (_c = attribute.textStyle) || void 0 === _c ? void 0 : _c.fontSize) || 16);
|
|
35041
35080
|
this._adjustY(arcs, maxLabels, attribute, currentMarks);
|
|
35042
35081
|
const {
|
|
35043
35082
|
minY: minY,
|
|
@@ -35059,7 +35098,7 @@
|
|
|
35059
35098
|
const width = 2 * center_x;
|
|
35060
35099
|
return arcs.forEach(arc => {
|
|
35061
35100
|
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 =
|
|
35101
|
+
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
35102
|
}), arcs;
|
|
35064
35103
|
}
|
|
35065
35104
|
_computeX(arc, attribute, currentMarks) {
|
|
@@ -35127,9 +35166,9 @@
|
|
|
35127
35166
|
return null !== (_a = null == value ? void 0 : value.text) && void 0 !== _a ? _a : "";
|
|
35128
35167
|
}
|
|
35129
35168
|
_adjustY(arcs, maxLabels, attribute, currentMarks) {
|
|
35130
|
-
var
|
|
35131
|
-
|
|
35132
|
-
const plotRect_height = 2 * (null !== (
|
|
35169
|
+
var _b;
|
|
35170
|
+
currentMarks[0].attribute.x;
|
|
35171
|
+
const plotRect_height = 2 * (null !== (_b = currentMarks[0].attribute.y) && void 0 !== _b ? _b : 0),
|
|
35133
35172
|
labelLayout = attribute.layout;
|
|
35134
35173
|
if ("vertical" === labelLayout.strategy) {
|
|
35135
35174
|
let delta,
|
|
@@ -35347,15 +35386,22 @@
|
|
|
35347
35386
|
checkBoundsOverlap(lastBounds, bounds) ? arcs[i].labelVisible = !1 : lastBounds = bounds;
|
|
35348
35387
|
}
|
|
35349
35388
|
}
|
|
35350
|
-
|
|
35351
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
35352
|
-
|
|
35353
|
-
|
|
35354
|
-
|
|
35355
|
-
|
|
35356
|
-
|
|
35357
|
-
|
|
35358
|
-
|
|
35389
|
+
_createLabelLine(text, baseMark) {
|
|
35390
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
35391
|
+
const {
|
|
35392
|
+
points: points,
|
|
35393
|
+
line = {},
|
|
35394
|
+
visible: visible,
|
|
35395
|
+
fill: fill
|
|
35396
|
+
} = text.attribute,
|
|
35397
|
+
labelLine = text.attribute.points ? graphicCreator.line({
|
|
35398
|
+
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,
|
|
35399
|
+
stroke: null !== (_e = null === (_d = line.style) || void 0 === _d ? void 0 : _d.stroke) && void 0 !== _e ? _e : fill,
|
|
35400
|
+
lineWidth: null !== (_g = null === (_f = line.style) || void 0 === _f ? void 0 : _f.lineWidth) && void 0 !== _g ? _g : 1,
|
|
35401
|
+
points: points,
|
|
35402
|
+
curveType: line.smooth ? "basis" : null
|
|
35403
|
+
}) : void 0;
|
|
35404
|
+
return labelLine && this._setStatesOfLabelLine(labelLine), labelLine;
|
|
35359
35405
|
}
|
|
35360
35406
|
computeRadius(r, width, height, k) {
|
|
35361
35407
|
return this.computeLayoutRadius(width || 0, height || 0) * r * (isNil$1(k) ? 1 : k);
|
|
@@ -35850,6 +35896,24 @@
|
|
|
35850
35896
|
const layerLabelGroup = this.renderLabels(labelGroup, axisItems, layer),
|
|
35851
35897
|
labels = layerLabelGroup.getChildren();
|
|
35852
35898
|
this.beforeLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length), this.handleLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length), this.afterLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length);
|
|
35899
|
+
let maxTextWidth = 0,
|
|
35900
|
+
maxTextHeight = 0,
|
|
35901
|
+
textAlign = "center",
|
|
35902
|
+
textBaseline = "middle";
|
|
35903
|
+
labels.forEach(label => {
|
|
35904
|
+
var _a;
|
|
35905
|
+
const labelStyle = label.attribute,
|
|
35906
|
+
angle = null !== (_a = labelStyle.angle) && void 0 !== _a ? _a : 0,
|
|
35907
|
+
textBounds = label.AABBBounds;
|
|
35908
|
+
let textWidth = textBounds.width(),
|
|
35909
|
+
textHeight = textBounds.height();
|
|
35910
|
+
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;
|
|
35911
|
+
}), this.axisLabelLayerSize[layer] = {
|
|
35912
|
+
width: maxTextWidth,
|
|
35913
|
+
height: maxTextHeight,
|
|
35914
|
+
textAlign: textAlign,
|
|
35915
|
+
textBaseline: textBaseline
|
|
35916
|
+
};
|
|
35853
35917
|
});
|
|
35854
35918
|
}
|
|
35855
35919
|
title && title.visible && this.renderTitle(axisContainer);
|
|
@@ -35901,13 +35965,8 @@
|
|
|
35901
35965
|
y: 0,
|
|
35902
35966
|
pickable: !1
|
|
35903
35967
|
});
|
|
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;
|
|
35968
|
+
return labelGroup.name = `${AXIS_ELEMENT_NAME.labelContainer}-layer-${layer}`, labelGroup.id = this._getNodeId(`label-container-layer-${layer}`), container.add(labelGroup), data.forEach((item, index) => {
|
|
35969
|
+
var _a, _b, _c;
|
|
35911
35970
|
const labelStyle = this._getLabelAttribute(item, index, data, layer);
|
|
35912
35971
|
let text;
|
|
35913
35972
|
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 +35978,7 @@
|
|
|
35919
35978
|
}), text.states = labelState;
|
|
35920
35979
|
}
|
|
35921
35980
|
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;
|
|
35981
|
+
}), labelGroup;
|
|
35930
35982
|
}
|
|
35931
35983
|
renderTitle(container) {
|
|
35932
35984
|
const titleAttributes = this.getTitleAttribute(),
|
|
@@ -36154,7 +36206,16 @@
|
|
|
36154
36206
|
do {
|
|
36155
36207
|
items = reduce(items, sep);
|
|
36156
36208
|
} while (items.length >= 3 && hasOverlap$1(items, sep));
|
|
36157
|
-
items.length < 3
|
|
36209
|
+
if (items.length < 3 || config.lastVisible) {
|
|
36210
|
+
const lastSourceItem = last(source);
|
|
36211
|
+
if (!lastSourceItem.attribute.opacity) {
|
|
36212
|
+
const remainLength = items.length;
|
|
36213
|
+
if (remainLength > 1) {
|
|
36214
|
+
lastSourceItem.setAttribute("opacity", 1);
|
|
36215
|
+
for (let i = remainLength - 1; i >= 0 && intersect(items[i], lastSourceItem, sep); i--) items[i].setAttribute("opacity", 0);
|
|
36216
|
+
}
|
|
36217
|
+
}
|
|
36218
|
+
}
|
|
36158
36219
|
}
|
|
36159
36220
|
source.forEach(item => {
|
|
36160
36221
|
item.setAttribute("visible", !!item.attribute.opacity);
|
|
@@ -36232,13 +36293,16 @@
|
|
|
36232
36293
|
function autoLimit(labels, config) {
|
|
36233
36294
|
const {
|
|
36234
36295
|
limitLength: limitLength,
|
|
36296
|
+
verticalLimitLength: verticalLimitLength,
|
|
36235
36297
|
ellipsis = "...",
|
|
36236
36298
|
orient: orient
|
|
36237
36299
|
} = config;
|
|
36238
36300
|
!isEmpty(labels) && isValidNumber$1(limitLength) && labels.forEach(label => {
|
|
36239
36301
|
if (("top" === orient || "bottom" === orient) && Math.floor(label.AABBBounds.height()) <= limitLength) return;
|
|
36240
|
-
|
|
36241
|
-
|
|
36302
|
+
const direction = label.attribute.direction;
|
|
36303
|
+
if (("left" === orient || "right" === orient) && ("vertical" === direction && Math.floor(label.AABBBounds.height()) <= verticalLimitLength || "vertical" !== direction && Math.floor(label.AABBBounds.width()) <= limitLength)) return;
|
|
36304
|
+
const angle = label.attribute.angle;
|
|
36305
|
+
let limitLabelLength = 0 === angle || isNil$1(angle) ? "top" === orient || "bottom" === orient ? null : "vertical" === direction ? verticalLimitLength : limitLength : Math.abs(limitLength / Math.sin(angle));
|
|
36242
36306
|
isValidNumber$1(label.attribute.maxLineWidth) && (limitLabelLength = isValidNumber$1(limitLabelLength) ? Math.min(label.attribute.maxLineWidth, limitLabelLength) : label.attribute.maxLineWidth), label.setAttributes({
|
|
36243
36307
|
maxLineWidth: limitLabelLength,
|
|
36244
36308
|
ellipsis: label.attribute.ellipsis || ellipsis
|
|
@@ -36593,20 +36657,29 @@
|
|
|
36593
36657
|
limitEllipsis: limitEllipsis,
|
|
36594
36658
|
autoHide: autoHide$1,
|
|
36595
36659
|
autoHideMethod: autoHideMethod,
|
|
36596
|
-
autoHideSeparation: autoHideSeparation
|
|
36660
|
+
autoHideSeparation: autoHideSeparation,
|
|
36661
|
+
lastVisible: lastVisible
|
|
36597
36662
|
} = label;
|
|
36598
|
-
isFunction$1(layoutFunc)
|
|
36599
|
-
|
|
36600
|
-
|
|
36601
|
-
|
|
36602
|
-
limitLength
|
|
36603
|
-
|
|
36604
|
-
|
|
36605
|
-
|
|
36606
|
-
|
|
36607
|
-
|
|
36608
|
-
|
|
36609
|
-
|
|
36663
|
+
if (isFunction$1(layoutFunc)) layoutFunc(labelShapes, labelData, layer, this);else {
|
|
36664
|
+
if (autoRotate$1 && autoRotate(labelShapes, {
|
|
36665
|
+
labelRotateAngle: autoRotateAngle,
|
|
36666
|
+
orient: orient
|
|
36667
|
+
}), autoLimit$1 && isValidNumber$1(limitLength) && limitLength > 0) {
|
|
36668
|
+
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;
|
|
36669
|
+
autoLimit(labelShapes, {
|
|
36670
|
+
limitLength: limitLength,
|
|
36671
|
+
verticalLimitLength: verticalLimitLength,
|
|
36672
|
+
ellipsis: limitEllipsis,
|
|
36673
|
+
orient: orient
|
|
36674
|
+
});
|
|
36675
|
+
}
|
|
36676
|
+
autoHide$1 && autoHide(labelShapes, {
|
|
36677
|
+
orient: orient,
|
|
36678
|
+
method: autoHideMethod,
|
|
36679
|
+
separation: autoHideSeparation,
|
|
36680
|
+
lastVisible: lastVisible
|
|
36681
|
+
});
|
|
36682
|
+
}
|
|
36610
36683
|
}
|
|
36611
36684
|
afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
|
|
36612
36685
|
const {
|
|
@@ -39216,7 +39289,8 @@
|
|
|
39216
39289
|
shapeSize = 0,
|
|
39217
39290
|
shapeSpace = 0;
|
|
39218
39291
|
if (shapeAttr && !1 !== shapeAttr.visible) {
|
|
39219
|
-
|
|
39292
|
+
const s = get$1(shapeStyle, "style.size", DEFAULT_SHAPE_SIZE);
|
|
39293
|
+
shapeSize = isArray$1(s) ? s[0] || 0 : s, shapeSpace = get$1(shapeAttr, "space", DEFAULT_SHAPE_SPACE);
|
|
39220
39294
|
const itemShape = graphicCreator.symbol(Object.assign(Object.assign({
|
|
39221
39295
|
x: 0,
|
|
39222
39296
|
y: 0,
|
|
@@ -43366,9 +43440,9 @@
|
|
|
43366
43440
|
effects = timeSlice.effects;
|
|
43367
43441
|
if (delay > 0 && graphicAnimate.wait(delay), effects.length < 0) graphicAnimate.wait(duration);else {
|
|
43368
43442
|
const customAnimates = effects.map((effect, index) => {
|
|
43369
|
-
|
|
43370
|
-
|
|
43371
|
-
|
|
43443
|
+
const attributes = effect.type ? typeAnimationAttributes(this.element, effect, animationParameters, parameters) : effect.channel ? channelAnimationAttributes(this.element, effect, animationParameters, parameters) : void 0;
|
|
43444
|
+
if (!attributes) return null;
|
|
43445
|
+
const customOption = (null == attributes ? void 0 : attributes.custom) || (null == effect ? void 0 : effect.custom),
|
|
43372
43446
|
customParametersOption = (null == attributes ? void 0 : attributes.customParameters) || (null == effect ? void 0 : effect.customParameters);
|
|
43373
43447
|
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
43448
|
const isCustomAnimate = isCustomAnimateCtor(customOption);
|
|
@@ -43378,7 +43452,7 @@
|
|
|
43378
43452
|
parameters: customParametersOption
|
|
43379
43453
|
}) : 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
43454
|
}).filter(animate => !isNil$1(animate));
|
|
43381
|
-
1 === customAnimates.length ? graphicAnimate.play(customAnimates[0]) : graphicAnimate.play(new AnimateGroup(duration, customAnimates));
|
|
43455
|
+
1 === customAnimates.length ? graphicAnimate.play(customAnimates[0]) : customAnimates.length > 1 && graphicAnimate.play(new AnimateGroup(duration, customAnimates));
|
|
43382
43456
|
}
|
|
43383
43457
|
delayAfter > 0 && graphicAnimate.wait(delayAfter);
|
|
43384
43458
|
}
|
|
@@ -47661,9 +47735,10 @@
|
|
|
47661
47735
|
return [];
|
|
47662
47736
|
};
|
|
47663
47737
|
|
|
47738
|
+
const HIDE_KEY = "_mo_hide_";
|
|
47664
47739
|
function reset(elements) {
|
|
47665
47740
|
return elements.forEach(element => {
|
|
47666
|
-
element.setGraphicAttribute("visible", !0);
|
|
47741
|
+
element.getGraphicAttribute("HIDE_KEY") && (element.setGraphicAttribute("visible", !0), element.setGraphicAttribute(HIDE_KEY, !1));
|
|
47667
47742
|
}), elements;
|
|
47668
47743
|
}
|
|
47669
47744
|
function overlapX(elements, delta, deltaMul, useRadius) {
|
|
@@ -47673,9 +47748,10 @@
|
|
|
47673
47748
|
const useDeltaMul = isNil$1(delta);
|
|
47674
47749
|
let itemDelta = delta;
|
|
47675
47750
|
elements.forEach(element => {
|
|
47751
|
+
if (!1 === element.getGraphicAttribute("visible")) return;
|
|
47676
47752
|
const r = element.getGraphicAttribute("size") / 2,
|
|
47677
47753
|
currentX = element.getGraphicAttribute("x");
|
|
47678
|
-
useDeltaMul && (itemDelta = (r + lastR) * deltaMul), Math.abs(currentX - lastX) < itemDelta + lastR + r ? element.getGraphicAttribute("forceShow") || element.setGraphicAttribute("visible", !1) : lastX = currentX, lastR = r;
|
|
47754
|
+
useDeltaMul && (itemDelta = (r + lastR) * deltaMul), Math.abs(currentX - lastX) < itemDelta + lastR + r ? element.getGraphicAttribute("forceShow") || (element.setGraphicAttribute(HIDE_KEY, !0), element.setGraphicAttribute("visible", !1)) : lastX = currentX, lastR = r;
|
|
47679
47755
|
});
|
|
47680
47756
|
}
|
|
47681
47757
|
}
|
|
@@ -47686,9 +47762,10 @@
|
|
|
47686
47762
|
const useDeltaMul = isNil$1(delta);
|
|
47687
47763
|
let itemDelta = delta;
|
|
47688
47764
|
elements.forEach(element => {
|
|
47765
|
+
if (!1 === element.getGraphicAttribute("visible")) return;
|
|
47689
47766
|
const r = element.getGraphicAttribute("size") / 2,
|
|
47690
47767
|
currentY = element.getGraphicAttribute("y");
|
|
47691
|
-
useDeltaMul && (itemDelta = (r + lastR) * deltaMul), Math.abs(currentY - lastY) < itemDelta + lastR + r ? element.getGraphicAttribute("forceShow") || element.setGraphicAttribute("visible", !1) : lastY = currentY, lastR = r;
|
|
47768
|
+
useDeltaMul && (itemDelta = (r + lastR) * deltaMul), Math.abs(currentY - lastY) < itemDelta + lastR + r ? element.getGraphicAttribute("forceShow") || (element.setGraphicAttribute(HIDE_KEY, !0), element.setGraphicAttribute("visible", !1)) : lastY = currentY, lastR = r;
|
|
47692
47769
|
});
|
|
47693
47770
|
}
|
|
47694
47771
|
}
|
|
@@ -47701,10 +47778,11 @@
|
|
|
47701
47778
|
const useDeltaMul = isNil$1(delta);
|
|
47702
47779
|
let itemDelta = delta;
|
|
47703
47780
|
elements.forEach(element => {
|
|
47781
|
+
if (!1 === element.getGraphicAttribute("visible")) return;
|
|
47704
47782
|
const r = element.getGraphicAttribute("size") / 2,
|
|
47705
47783
|
currentX = element.getGraphicAttribute("x"),
|
|
47706
47784
|
currentY = element.getGraphicAttribute("y");
|
|
47707
|
-
useDeltaMul && (itemDelta = (r + lastR) * deltaMul), dis = (lastX - currentX) ** 2 + (lastY - currentY) ** 2, dis < (itemDelta + lastR + r) ** 2 ? element.getGraphicAttribute("forceShow") || element.setGraphicAttribute("visible", !1) : lastY = currentY, lastR = r;
|
|
47785
|
+
useDeltaMul && (itemDelta = (r + lastR) * deltaMul), dis = (lastX - currentX) ** 2 + (lastY - currentY) ** 2, dis < (itemDelta + lastR + r) ** 2 ? element.getGraphicAttribute("forceShow") || (element.setGraphicAttribute(HIDE_KEY, !0), element.setGraphicAttribute("visible", !1)) : lastY = currentY, lastR = r;
|
|
47708
47786
|
});
|
|
47709
47787
|
}
|
|
47710
47788
|
}
|
|
@@ -48314,7 +48392,7 @@
|
|
|
48314
48392
|
};
|
|
48315
48393
|
return points.forEach(point => {
|
|
48316
48394
|
center.x += point.x, center.y += point.y;
|
|
48317
|
-
}), center.x /= points.length, center.y /= points.length, options && options.center && (isValidNumber$1(options.center.x) && (center.x = options.center.x), isValidNumber$1(options.center.y) && (center.y = options.center.y)), points.map(() => Object.assign(center));
|
|
48395
|
+
}), center.x /= points.length, center.y /= points.length, options && options.center && (isValidNumber$1(options.center.x) && (center.x = options.center.x), isValidNumber$1(options.center.y) && (center.y = options.center.y)), "area" === element.mark.markType && (center.x1 = center.x, center.y1 = center.y), points.map(() => Object.assign(center));
|
|
48318
48396
|
};
|
|
48319
48397
|
const growPointsIn = (element, options, animationParameters) => ({
|
|
48320
48398
|
from: {
|
|
@@ -49250,6 +49328,9 @@
|
|
|
49250
49328
|
}
|
|
49251
49329
|
}
|
|
49252
49330
|
};
|
|
49331
|
+
const axisZ = Object.assign(Object.assign({}, axisX), { label: {
|
|
49332
|
+
space: 0
|
|
49333
|
+
} });
|
|
49253
49334
|
|
|
49254
49335
|
const commonAxis = {
|
|
49255
49336
|
domainLine: {
|
|
@@ -50116,6 +50197,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
50116
50197
|
axisLinear,
|
|
50117
50198
|
axisX,
|
|
50118
50199
|
axisY,
|
|
50200
|
+
axisZ,
|
|
50119
50201
|
axisAngle,
|
|
50120
50202
|
axisRadius,
|
|
50121
50203
|
markLine,
|
|
@@ -57813,7 +57895,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57813
57895
|
registerChartPlugin(MediaQuery);
|
|
57814
57896
|
};
|
|
57815
57897
|
|
|
57816
|
-
const version = "1.8.
|
|
57898
|
+
const version = "1.8.6";
|
|
57817
57899
|
|
|
57818
57900
|
var ChartTypeEnum;
|
|
57819
57901
|
(function (ChartTypeEnum) {
|
|
@@ -57904,9 +57986,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57904
57986
|
this._markReverse = new MarkSet();
|
|
57905
57987
|
this.onHover = (params) => {
|
|
57906
57988
|
if (this.filterEventMark(params)) {
|
|
57989
|
+
this._isHovered = true;
|
|
57907
57990
|
this.hoverItem(params);
|
|
57908
57991
|
}
|
|
57909
|
-
else {
|
|
57992
|
+
else if (this._isHovered) {
|
|
57993
|
+
this._isHovered = false;
|
|
57910
57994
|
this.unhoverItem();
|
|
57911
57995
|
}
|
|
57912
57996
|
};
|
|
@@ -63185,7 +63269,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63185
63269
|
(_a = this._option) === null || _a === void 0 ? void 0 : _a.onError(`${key}Field is required.`);
|
|
63186
63270
|
return spec;
|
|
63187
63271
|
}
|
|
63188
|
-
if (spec.length > 2) {
|
|
63272
|
+
if (defaultScaleType !== 'ordinal' && spec.length > 2) {
|
|
63189
63273
|
(_b = this._option) === null || _b === void 0 ? void 0 : _b.onError(`${key} length is invalid, specify up to 2 ${key}s.`);
|
|
63190
63274
|
return spec;
|
|
63191
63275
|
}
|
|
@@ -63922,7 +64006,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63922
64006
|
: {})) !== null && _a !== void 0 ? _a : {};
|
|
63923
64007
|
const axisTheme = isXAxis(orient)
|
|
63924
64008
|
? getComponentThemeFromOption('axisX', chartTheme)
|
|
63925
|
-
:
|
|
64009
|
+
: isYAxis(orient)
|
|
64010
|
+
? getComponentThemeFromOption('axisY', chartTheme)
|
|
64011
|
+
: getComponentThemeFromOption('axisZ', chartTheme);
|
|
63926
64012
|
return mergeSpec({}, getComponentThemeFromOption('axis', chartTheme), axisTypeTheme, axisTheme);
|
|
63927
64013
|
};
|
|
63928
64014
|
const getPolarAxisTheme = (orient, type, chartTheme) => {
|
|
@@ -64125,13 +64211,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64125
64211
|
function getComponentThemeFromGlobalTheme(type, chartTheme, componentSpec, chartSpec) {
|
|
64126
64212
|
switch (type) {
|
|
64127
64213
|
case ComponentTypeEnum.cartesianBandAxis:
|
|
64128
|
-
return getCartesianAxisTheme(getOrient(componentSpec), 'band', chartTheme);
|
|
64214
|
+
return getCartesianAxisTheme(getOrient(componentSpec, ['z']), 'band', chartTheme);
|
|
64129
64215
|
case ComponentTypeEnum.cartesianLinearAxis:
|
|
64130
|
-
return getCartesianAxisTheme(getOrient(componentSpec), 'linear', chartTheme);
|
|
64216
|
+
return getCartesianAxisTheme(getOrient(componentSpec, ['z']), 'linear', chartTheme);
|
|
64131
64217
|
case ComponentTypeEnum.cartesianLogAxis:
|
|
64132
|
-
return getCartesianAxisTheme(getOrient(componentSpec), 'log', chartTheme);
|
|
64218
|
+
return getCartesianAxisTheme(getOrient(componentSpec, ['z']), 'log', chartTheme);
|
|
64133
64219
|
case ComponentTypeEnum.cartesianSymlogAxis:
|
|
64134
|
-
return getCartesianAxisTheme(getOrient(componentSpec), 'symlog', chartTheme);
|
|
64220
|
+
return getCartesianAxisTheme(getOrient(componentSpec, ['z']), 'symlog', chartTheme);
|
|
64135
64221
|
case ComponentTypeEnum.cartesianAxis:
|
|
64136
64222
|
case ComponentTypeEnum.cartesianTimeAxis:
|
|
64137
64223
|
return getCartesianAxisTheme(getOrient(componentSpec), undefined, chartTheme);
|
|
@@ -65511,6 +65597,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65511
65597
|
|
|
65512
65598
|
class WaterfallSeriesSpecTransformer extends BarSeriesSpecTransformer {
|
|
65513
65599
|
_transformLabelSpec(spec) {
|
|
65600
|
+
this._addMarkLabelSpec(spec, exports.SeriesMarkNameEnum.bar);
|
|
65514
65601
|
this._addMarkLabelSpec(spec, exports.SeriesMarkNameEnum.bar, 'stackLabel');
|
|
65515
65602
|
}
|
|
65516
65603
|
}
|
|
@@ -72442,7 +72529,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72442
72529
|
themeSpec: (_a = this._theme) === null || _a === void 0 ? void 0 : _a.funnel,
|
|
72443
72530
|
morph: shouldMarkDoMorph(this._spec, this._funnelMarkName),
|
|
72444
72531
|
defaultMorphElementKey: this._seriesField,
|
|
72445
|
-
key: this._seriesField,
|
|
72446
72532
|
groupKey: this._seriesField,
|
|
72447
72533
|
isSeriesMark: true,
|
|
72448
72534
|
customShape: (_b = this._spec.funnel) === null || _b === void 0 ? void 0 : _b.customShape
|
|
@@ -72450,7 +72536,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72450
72536
|
if (this._spec.isTransform) {
|
|
72451
72537
|
this._funnelTransformMark = this._createMark(Object.assign(Object.assign({}, FunnelSeries.mark.transform), { name: this._transformMarkName, type: this._transformMarkType }), {
|
|
72452
72538
|
themeSpec: (_c = this._theme) === null || _c === void 0 ? void 0 : _c.transform,
|
|
72453
|
-
key: this._seriesField,
|
|
72454
72539
|
skipBeforeLayouted: false,
|
|
72455
72540
|
dataView: this._viewDataTransform.getDataView(),
|
|
72456
72541
|
dataProductId: this._viewDataTransform.getProductId(),
|
|
@@ -72462,13 +72547,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72462
72547
|
const { line: lineTheme } = (_j = (_h = this._theme) === null || _h === void 0 ? void 0 : _h.outerLabel) !== null && _j !== void 0 ? _j : {};
|
|
72463
72548
|
this._funnelOuterLabelMark.label = this._createMark(FunnelSeries.mark.outerLabel, {
|
|
72464
72549
|
themeSpec: (_k = this._theme) === null || _k === void 0 ? void 0 : _k.outerLabel,
|
|
72465
|
-
key: this._seriesField,
|
|
72466
72550
|
markSpec: this._spec.outerLabel,
|
|
72467
72551
|
skipBeforeLayouted: true
|
|
72468
72552
|
});
|
|
72469
72553
|
this._funnelOuterLabelMark.line = this._createMark(FunnelSeries.mark.outerLabelLine, {
|
|
72470
72554
|
themeSpec: lineTheme,
|
|
72471
|
-
key: this._seriesField,
|
|
72472
72555
|
markSpec: line,
|
|
72473
72556
|
depend: [this._funnelOuterLabelMark.label]
|
|
72474
72557
|
});
|
|
@@ -72577,7 +72660,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72577
72660
|
const rootMark = this.getRootMark().getProduct();
|
|
72578
72661
|
if (rootMark) {
|
|
72579
72662
|
const { x1, x2 } = rootMark.getBounds();
|
|
72580
|
-
return Math.
|
|
72663
|
+
return Math.max(x1, x2);
|
|
72581
72664
|
}
|
|
72582
72665
|
return this.getLayoutRect().width;
|
|
72583
72666
|
},
|
|
@@ -72585,7 +72668,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72585
72668
|
const rootMark = this.getRootMark().getProduct();
|
|
72586
72669
|
if (rootMark) {
|
|
72587
72670
|
const { y1, y2 } = rootMark.getBounds();
|
|
72588
|
-
return Math.
|
|
72671
|
+
return Math.max(y1, y2);
|
|
72589
72672
|
}
|
|
72590
72673
|
return this.getLayoutRect().height;
|
|
72591
72674
|
},
|
|
@@ -72674,7 +72757,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72674
72757
|
}
|
|
72675
72758
|
_getMainAxisLength(isTransform = false) {
|
|
72676
72759
|
var _a;
|
|
72677
|
-
const funnelCount = this.
|
|
72760
|
+
const funnelCount = this.getViewData().latestData.length;
|
|
72678
72761
|
const viewHeight = this._isHorizontal() ? this.getLayoutRect().width : this.getLayoutRect().height;
|
|
72679
72762
|
const hasTransform = !!this._spec.isTransform;
|
|
72680
72763
|
const gap = hasTransform ? 0 : (_a = this._spec.gap) !== null && _a !== void 0 ? _a : 0;
|
|
@@ -72693,7 +72776,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72693
72776
|
}
|
|
72694
72777
|
_getPositionByData(datum) {
|
|
72695
72778
|
var _a;
|
|
72696
|
-
const index = (_a = this.getViewData().latestData) === null || _a === void 0 ? void 0 : _a.findIndex((d) => d[this.
|
|
72779
|
+
const index = (_a = this.getViewData().latestData) === null || _a === void 0 ? void 0 : _a.findIndex((d) => d[this._categoryField] === datum[this._categoryField] && d[DEFAULT_DATA_KEY] === datum[DEFAULT_DATA_KEY]);
|
|
72697
72780
|
if (!isValid$1(index) || index < 0) {
|
|
72698
72781
|
return {};
|
|
72699
72782
|
}
|
|
@@ -85904,8 +85987,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
85904
85987
|
this.triggerOff = 'hover';
|
|
85905
85988
|
this._handleEvent = throttle((params) => {
|
|
85906
85989
|
const { event } = params;
|
|
85907
|
-
const
|
|
85908
|
-
const
|
|
85990
|
+
const layer = this._option.getCompiler().getStage().getLayer(undefined);
|
|
85991
|
+
const point = { x: event.viewX, y: event.viewY };
|
|
85992
|
+
layer.globalTransMatrix.transformPoint({ x: event.viewX, y: event.viewY }, point);
|
|
85993
|
+
const x = point.x - this.getLayoutStartPoint().x;
|
|
85994
|
+
const y = point.y - this.getLayoutStartPoint().y;
|
|
85909
85995
|
this.showDefault = false;
|
|
85910
85996
|
this._layoutCrosshair(x, y);
|
|
85911
85997
|
}, 10);
|
|
@@ -88553,36 +88639,25 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88553
88639
|
return median(data, opt.field);
|
|
88554
88640
|
}
|
|
88555
88641
|
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
88642
|
const results = [];
|
|
88566
88643
|
options.forEach(option => {
|
|
88567
88644
|
const result = { x: null, y: null };
|
|
88568
88645
|
if (isValid$1(option.x)) {
|
|
88569
88646
|
const x = option.x;
|
|
88570
|
-
if (
|
|
88571
|
-
|
|
88572
|
-
result.x = aggrMap[aggrType](_data, { field: field });
|
|
88647
|
+
if (isArray$1(x)) {
|
|
88648
|
+
result.x = x.map(item => getFinalValue(item, _data, option));
|
|
88573
88649
|
}
|
|
88574
88650
|
else {
|
|
88575
|
-
result.x = x;
|
|
88651
|
+
result.x = getFinalValue(x, _data, option);
|
|
88576
88652
|
}
|
|
88577
88653
|
}
|
|
88578
88654
|
if (isValid$1(option.y)) {
|
|
88579
88655
|
const y = option.y;
|
|
88580
|
-
if (
|
|
88581
|
-
|
|
88582
|
-
result.y = aggrMap[aggrType](_data, { field: field });
|
|
88656
|
+
if (isArray$1(y)) {
|
|
88657
|
+
result.y = y.map(item => getFinalValue(item, _data, option));
|
|
88583
88658
|
}
|
|
88584
88659
|
else {
|
|
88585
|
-
result.y = y;
|
|
88660
|
+
result.y = getFinalValue(y, _data, option);
|
|
88586
88661
|
}
|
|
88587
88662
|
}
|
|
88588
88663
|
if (option.getRefRelativeSeries) {
|
|
@@ -88592,6 +88667,31 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88592
88667
|
});
|
|
88593
88668
|
return results;
|
|
88594
88669
|
}
|
|
88670
|
+
const aggrMap = {
|
|
88671
|
+
min: markerMin,
|
|
88672
|
+
max: markerMax,
|
|
88673
|
+
sum: markerSum,
|
|
88674
|
+
average: markerAverage,
|
|
88675
|
+
variance: markerVariance,
|
|
88676
|
+
standardDeviation: markerStandardDeviation,
|
|
88677
|
+
median: markerMedian
|
|
88678
|
+
};
|
|
88679
|
+
function getFinalValue(source, _data, option) {
|
|
88680
|
+
const relativeSeries = option.getRelativeSeries();
|
|
88681
|
+
const startSeries = option.getStartRelativeSeries();
|
|
88682
|
+
const endSeries = option.getEndRelativeSeries();
|
|
88683
|
+
const relativeSeriesData = relativeSeries.getData().getLatestData();
|
|
88684
|
+
const startRelativeSeriesData = startSeries.getData().getLatestData();
|
|
88685
|
+
const endRelativeSeriesData = endSeries.getData().getLatestData();
|
|
88686
|
+
if (isFunction$1(source)) {
|
|
88687
|
+
return source(relativeSeriesData, startRelativeSeriesData, endRelativeSeriesData, relativeSeries, startSeries, endSeries);
|
|
88688
|
+
}
|
|
88689
|
+
if (isPlainObject$1(source)) {
|
|
88690
|
+
const { aggrType, field } = source;
|
|
88691
|
+
return aggrMap[aggrType](_data, { field: field });
|
|
88692
|
+
}
|
|
88693
|
+
return source;
|
|
88694
|
+
}
|
|
88595
88695
|
|
|
88596
88696
|
const AGGR_TYPE = ['sum', 'average', 'min', 'max', 'variance', 'standardDeviation', 'median'];
|
|
88597
88697
|
|
|
@@ -88609,7 +88709,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88609
88709
|
}
|
|
88610
88710
|
function getXValue(datum, xDomain, autoRange, refSeries, regionWidth, regionStartLayoutStartPoint) {
|
|
88611
88711
|
var _a, _b;
|
|
88612
|
-
const { relativeSeries
|
|
88712
|
+
const { relativeSeries } = refSeries;
|
|
88613
88713
|
isNumber$2(datum.x) &&
|
|
88614
88714
|
isNeedExtendDomain(xDomain, datum.x, autoRange) &&
|
|
88615
88715
|
((_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 +88718,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88618
88718
|
x = convertPercentToValue(datum.x, regionWidth) + regionStartLayoutStartPoint.x;
|
|
88619
88719
|
}
|
|
88620
88720
|
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;
|
|
88721
|
+
x = relativeSeries.getXAxisHelper().dataToPosition([datum.x]) + regionStartLayoutStartPoint.x;
|
|
88629
88722
|
}
|
|
88630
88723
|
return x;
|
|
88631
88724
|
}
|
|
88632
88725
|
function getYValue(datum, yDomain, autoRange, refSeries, regionHeight, regionStartLayoutStartPoint) {
|
|
88633
88726
|
var _a, _b;
|
|
88634
|
-
const { relativeSeries
|
|
88727
|
+
const { relativeSeries } = refSeries;
|
|
88635
88728
|
isNumber$2(datum.y) &&
|
|
88636
88729
|
isNeedExtendDomain(yDomain, datum.y, autoRange) &&
|
|
88637
88730
|
((_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 +88733,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88640
88733
|
y = convertPercentToValue(datum.y, regionHeight) + regionStartLayoutStartPoint.y;
|
|
88641
88734
|
}
|
|
88642
88735
|
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;
|
|
88736
|
+
y = relativeSeries.getYAxisHelper().dataToPosition([datum.y]) + regionStartLayoutStartPoint.y;
|
|
88651
88737
|
}
|
|
88652
88738
|
return y;
|
|
88653
88739
|
}
|
|
@@ -88741,19 +88827,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88741
88827
|
}
|
|
88742
88828
|
const xDomain = refRelativeSeries.getXAxisHelper().getScale(0).domain();
|
|
88743
88829
|
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
|
-
});
|
|
88830
|
+
const xValue = array(datum.x);
|
|
88831
|
+
const yValue = array(datum.y);
|
|
88757
88832
|
xValue.length === 1 &&
|
|
88758
88833
|
isNumber$2(xValue[0]) &&
|
|
88759
88834
|
isNeedExtendDomain(xDomain, xValue[0], autoRange) &&
|