@visactor/vtable 0.17.5 → 0.17.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/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/component/custom.js +3 -3
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/dist/vtable.js +228 -185
- package/dist/vtable.min.js +2 -2
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/component/custom.js +3 -3
- package/es/scenegraph/component/custom.js.map +1 -1
- package/package.json +6 -6
package/dist/vtable.js
CHANGED
|
@@ -2115,6 +2115,54 @@
|
|
|
2115
2115
|
out.a = scaleX * a1, out.b = scaleX * b1, out.c = scaleY * c1, out.d = scaleY * d1, out.e = oe + oa * rotateCenterX + oc * rotateCenterY - a1 * offsetX - c1 * offsetY, out.f = of + ob * rotateCenterX + od * rotateCenterY - b1 * offsetX - d1 * offsetY;
|
|
2116
2116
|
}
|
|
2117
2117
|
|
|
2118
|
+
class LRU {
|
|
2119
|
+
constructor() {
|
|
2120
|
+
this.CLEAN_THRESHOLD = 1e3, this.L_TIME = 1e3, this.R_COUNT = 1, this.R_TIMESTAMP_MAX_SIZE = 20;
|
|
2121
|
+
}
|
|
2122
|
+
clearCache(cache, params) {
|
|
2123
|
+
const {
|
|
2124
|
+
CLEAN_THRESHOLD = this.CLEAN_THRESHOLD,
|
|
2125
|
+
L_TIME = this.L_TIME,
|
|
2126
|
+
R_COUNT = this.R_COUNT
|
|
2127
|
+
} = params;
|
|
2128
|
+
if (cache.size < CLEAN_THRESHOLD) return 0;
|
|
2129
|
+
let clearNum = 0;
|
|
2130
|
+
const clear = key => {
|
|
2131
|
+
clearNum++, cache.delete(key);
|
|
2132
|
+
},
|
|
2133
|
+
now = Date.now();
|
|
2134
|
+
return cache.forEach((item, key) => {
|
|
2135
|
+
if (item.timestamp.length < R_COUNT) return clear(key);
|
|
2136
|
+
let useCount = 0;
|
|
2137
|
+
for (; now - item.timestamp[item.timestamp.length - 1 - useCount] < L_TIME && (useCount++, !(useCount >= R_COUNT)););
|
|
2138
|
+
if (useCount < R_COUNT) return clear(key);
|
|
2139
|
+
for (; now - item.timestamp[0] > L_TIME;) item.timestamp.shift();
|
|
2140
|
+
}), clearNum;
|
|
2141
|
+
}
|
|
2142
|
+
addLimitedTimestamp(cacheItem, t, params) {
|
|
2143
|
+
const {
|
|
2144
|
+
R_TIMESTAMP_MAX_SIZE = this.R_TIMESTAMP_MAX_SIZE
|
|
2145
|
+
} = params;
|
|
2146
|
+
cacheItem.timestamp.length > R_TIMESTAMP_MAX_SIZE && cacheItem.timestamp.shift(), cacheItem.timestamp.push(t);
|
|
2147
|
+
}
|
|
2148
|
+
clearTimeStamp(cache, params) {
|
|
2149
|
+
const {
|
|
2150
|
+
L_TIME = this.L_TIME
|
|
2151
|
+
} = params,
|
|
2152
|
+
now = Date.now();
|
|
2153
|
+
cache.forEach(item => {
|
|
2154
|
+
for (; now - item.timestamp[0] > L_TIME;) item.timestamp.shift();
|
|
2155
|
+
});
|
|
2156
|
+
}
|
|
2157
|
+
clearItemTimestamp(cacheItem, params) {
|
|
2158
|
+
const {
|
|
2159
|
+
L_TIME = this.L_TIME
|
|
2160
|
+
} = params,
|
|
2161
|
+
now = Date.now();
|
|
2162
|
+
for (; now - cacheItem.timestamp[0] > L_TIME;) cacheItem.timestamp.shift();
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2118
2166
|
function hslToRgb$1(h, s, l) {
|
|
2119
2167
|
s /= 100, l /= 100;
|
|
2120
2168
|
const c = (1 - Math.abs(2 * l - 1)) * s,
|
|
@@ -3430,6 +3478,10 @@
|
|
|
3430
3478
|
let defined0 = !1;
|
|
3431
3479
|
for (let i = 0, n = points.length; i <= n; i++) i >= n === defined0 && ((defined0 = !defined0) ? path.lineStart() : path.lineEnd()), defined0 && path.point(points[i]);
|
|
3432
3480
|
}
|
|
3481
|
+
function genSegContext(curveType, direction, points) {
|
|
3482
|
+
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;
|
|
3483
|
+
return "monotoneY" === curveType ? new ReflectSegContext$1(curveType, curveDirection) : new SegContext$1(curveType, curveDirection);
|
|
3484
|
+
}
|
|
3433
3485
|
|
|
3434
3486
|
let Linear$1 = class Linear {
|
|
3435
3487
|
constructor(context, startPoint) {
|
|
@@ -3472,7 +3524,7 @@
|
|
|
3472
3524
|
startPoint: startPoint
|
|
3473
3525
|
} = params;
|
|
3474
3526
|
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
3475
|
-
const segContext =
|
|
3527
|
+
const segContext = genSegContext("linear", direction, points);
|
|
3476
3528
|
return genLinearTypeSegments$1(new Linear$1(segContext, startPoint), points), segContext;
|
|
3477
3529
|
}
|
|
3478
3530
|
function genLinearTypeSegments$1(path, points) {
|
|
@@ -3529,7 +3581,7 @@
|
|
|
3529
3581
|
} = params;
|
|
3530
3582
|
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
3531
3583
|
if (points.length < 3 - Number(!!startPoint)) return genLinearSegments$1(points, params);
|
|
3532
|
-
const segContext =
|
|
3584
|
+
const segContext = genSegContext("basis", direction, points);
|
|
3533
3585
|
return genBasisTypeSegments$1(new Basis$1(segContext, startPoint), points), segContext;
|
|
3534
3586
|
}
|
|
3535
3587
|
|
|
@@ -3614,7 +3666,7 @@
|
|
|
3614
3666
|
});
|
|
3615
3667
|
}
|
|
3616
3668
|
};
|
|
3617
|
-
function
|
|
3669
|
+
function genMonotoneXTypeSegments(path, points) {
|
|
3618
3670
|
return genCurveSegments$1(path, points);
|
|
3619
3671
|
}
|
|
3620
3672
|
function genMonotoneXSegments$1(points) {
|
|
@@ -3625,10 +3677,10 @@
|
|
|
3625
3677
|
} = params;
|
|
3626
3678
|
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
3627
3679
|
if (points.length < 3 - Number(!!startPoint)) return genLinearSegments$1(points, params);
|
|
3628
|
-
const segContext =
|
|
3629
|
-
return
|
|
3680
|
+
const segContext = genSegContext("monotoneX", direction, points);
|
|
3681
|
+
return genMonotoneXTypeSegments(new MonotoneX$1(segContext, startPoint), points), segContext;
|
|
3630
3682
|
}
|
|
3631
|
-
function
|
|
3683
|
+
function genMonotoneYTypeSegments(path, points) {
|
|
3632
3684
|
return genCurveSegments$1(path, points);
|
|
3633
3685
|
}
|
|
3634
3686
|
function genMonotoneYSegments$1(points) {
|
|
@@ -3639,8 +3691,8 @@
|
|
|
3639
3691
|
} = params;
|
|
3640
3692
|
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
3641
3693
|
if (points.length < 3 - Number(!!startPoint)) return genLinearSegments$1(points, params);
|
|
3642
|
-
const segContext =
|
|
3643
|
-
return
|
|
3694
|
+
const segContext = genSegContext("monotoneY", direction, points);
|
|
3695
|
+
return genMonotoneYTypeSegments(new MonotoneY$1(segContext, startPoint), points), segContext;
|
|
3644
3696
|
}
|
|
3645
3697
|
|
|
3646
3698
|
let Step$3 = class Step {
|
|
@@ -3696,39 +3748,10 @@
|
|
|
3696
3748
|
return genCurveSegments$1(path, points);
|
|
3697
3749
|
}
|
|
3698
3750
|
|
|
3699
|
-
let LinearClosed$1 = class LinearClosed {
|
|
3700
|
-
constructor(context, startPoint) {
|
|
3701
|
-
this.context = context, startPoint && (this.startPoint = startPoint);
|
|
3702
|
-
}
|
|
3703
|
-
areaStart() {
|
|
3704
|
-
this._line = 0;
|
|
3705
|
-
}
|
|
3706
|
-
areaEnd() {
|
|
3707
|
-
this._line = NaN;
|
|
3708
|
-
}
|
|
3709
|
-
lineStart() {
|
|
3710
|
-
this._point = 0, this.startPoint && this.point(this.startPoint);
|
|
3711
|
-
}
|
|
3751
|
+
let LinearClosed$1 = class LinearClosed extends Linear$1 {
|
|
3712
3752
|
lineEnd() {
|
|
3713
3753
|
this.context.closePath();
|
|
3714
3754
|
}
|
|
3715
|
-
point(p) {
|
|
3716
|
-
const x = p.x,
|
|
3717
|
-
y = p.y;
|
|
3718
|
-
switch (this._point) {
|
|
3719
|
-
case 0:
|
|
3720
|
-
this._point = 1, this._line ? this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p) : this.context.moveTo(x, y, p);
|
|
3721
|
-
break;
|
|
3722
|
-
case 1:
|
|
3723
|
-
this._point = 2;
|
|
3724
|
-
default:
|
|
3725
|
-
this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p);
|
|
3726
|
-
}
|
|
3727
|
-
this._lastDefined = p.defined;
|
|
3728
|
-
}
|
|
3729
|
-
tryUpdateLength() {
|
|
3730
|
-
return this.context.tryUpdateLength();
|
|
3731
|
-
}
|
|
3732
3755
|
};
|
|
3733
3756
|
function genLinearClosedSegments$1(points) {
|
|
3734
3757
|
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -3737,7 +3760,7 @@
|
|
|
3737
3760
|
startPoint: startPoint
|
|
3738
3761
|
} = params;
|
|
3739
3762
|
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
3740
|
-
const segContext =
|
|
3763
|
+
const segContext = genSegContext("linear", direction, points);
|
|
3741
3764
|
return genLinearClosedTypeSegments$1(new LinearClosed$1(segContext, startPoint), points), segContext;
|
|
3742
3765
|
}
|
|
3743
3766
|
function genLinearClosedTypeSegments$1(path, points) {
|
|
@@ -4146,6 +4169,8 @@
|
|
|
4146
4169
|
strokeSeg: null,
|
|
4147
4170
|
pickable: !0,
|
|
4148
4171
|
childrenPickable: !0,
|
|
4172
|
+
fillPickable: !0,
|
|
4173
|
+
strokePickable: !0,
|
|
4149
4174
|
visible: !0,
|
|
4150
4175
|
zIndex: 0,
|
|
4151
4176
|
layout: null,
|
|
@@ -8535,10 +8560,17 @@
|
|
|
8535
8560
|
return ConicalCanvas.ctx;
|
|
8536
8561
|
}
|
|
8537
8562
|
}
|
|
8538
|
-
class ColorInterpolate {
|
|
8563
|
+
class ColorInterpolate extends LRU {
|
|
8564
|
+
static getInstance() {
|
|
8565
|
+
return ColorInterpolate._instance || (ColorInterpolate._instance = new ColorInterpolate()), ColorInterpolate._instance;
|
|
8566
|
+
}
|
|
8539
8567
|
constructor() {
|
|
8540
8568
|
let stops = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
8541
8569
|
let precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
|
|
8570
|
+
super(), this.cacheParams = {
|
|
8571
|
+
CLEAN_THRESHOLD: 100,
|
|
8572
|
+
L_TIME: 1e3
|
|
8573
|
+
}, this.dataMap = new Map();
|
|
8542
8574
|
const canvas = ConicalCanvas.GetCanvas(),
|
|
8543
8575
|
conicalCtx = ConicalCanvas.GetCtx();
|
|
8544
8576
|
if (canvas.width = precision, canvas.height = 1, !conicalCtx) return;
|
|
@@ -8552,22 +8584,21 @@
|
|
|
8552
8584
|
const rgba = this.rgbaSet.slice(4 * offset, 4 * offset + 4);
|
|
8553
8585
|
return `rgba(${rgba[0]}, ${rgba[1]}, ${rgba[2]}, ${rgba[3] / 255})`;
|
|
8554
8586
|
}
|
|
8555
|
-
|
|
8556
|
-
let stops = arguments.length >
|
|
8557
|
-
let precision = arguments.length >
|
|
8558
|
-
let str =
|
|
8587
|
+
GetOrCreate(x, y, w, h) {
|
|
8588
|
+
let stops = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
8589
|
+
let precision = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 100;
|
|
8590
|
+
let str = `${x}${y}${w}${h}`;
|
|
8559
8591
|
stops.forEach(item => str += item.join()), str += precision;
|
|
8560
|
-
let colorInter =
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
return
|
|
8592
|
+
let colorInter = this.dataMap.get(str);
|
|
8593
|
+
if (!colorInter) {
|
|
8594
|
+
colorInter = {
|
|
8595
|
+
data: new ColorInterpolate(stops, precision),
|
|
8596
|
+
timestamp: []
|
|
8597
|
+
}, this.addLimitedTimestamp(colorInter, Date.now(), {}), this.dataMap.set(str, colorInter);
|
|
8598
|
+
}
|
|
8599
|
+
return this.clearCache(this.dataMap, this.cacheParams), colorInter.data;
|
|
8568
8600
|
}
|
|
8569
8601
|
}
|
|
8570
|
-
ColorInterpolate.dataMap = new Map();
|
|
8571
8602
|
class ConicalPatternStore {
|
|
8572
8603
|
static GetSize(minSize) {
|
|
8573
8604
|
for (let i = 0; i < ConicalPatternStore.ImageSize.length; i++) if (ConicalPatternStore.ImageSize[i] >= minSize) return ConicalPatternStore.ImageSize[i];
|
|
@@ -8628,7 +8659,7 @@
|
|
|
8628
8659
|
const r = Math.sqrt(Math.max(Math.max(Math.pow(x, 2) + Math.pow(y, 2), Math.pow(width - x, 2) + Math.pow(y, 2)), Math.max(Math.pow(width - x, 2) + Math.pow(height - y, 2), Math.pow(x, 2) + Math.pow(height - y, 2)))),
|
|
8629
8660
|
stepNum = deltaDeg + 1,
|
|
8630
8661
|
step = deltaAngle / Math.max(1, stepNum - 1),
|
|
8631
|
-
colorInter = ColorInterpolate.GetOrCreate(stops, stepNum),
|
|
8662
|
+
colorInter = ColorInterpolate.getInstance().GetOrCreate(x, y, width, height, stops, stepNum),
|
|
8632
8663
|
lineWidth = 2 * Math.PI * r / 360;
|
|
8633
8664
|
conicalCanvas.width = width, conicalCanvas.height = height, conicalCtx.setTransform(1, 0, 0, 1, 0, 0), conicalCtx.clearRect(0, 0, width, height), conicalCtx.translate(x, y), conicalCtx.rotate(startAngle);
|
|
8634
8665
|
for (let i = 0, len = stepNum - 1; i < len && !(startAngle + i * step > endAngle); i++) {
|
|
@@ -12488,6 +12519,7 @@
|
|
|
12488
12519
|
}
|
|
12489
12520
|
};
|
|
12490
12521
|
DefaultBaseInteractiveRenderContribution$1 = __decorate$23([injectable$1(), __param$11(0, inject$1(ContributionProvider$1)), __param$11(0, named$1(InteractiveSubRenderContribution$1)), __metadata$1h("design:paramtypes", [Object])], DefaultBaseInteractiveRenderContribution$1);
|
|
12522
|
+
|
|
12491
12523
|
let DefaultBaseTextureRenderContribution$1 = class DefaultBaseTextureRenderContribution {
|
|
12492
12524
|
constructor() {
|
|
12493
12525
|
this.time = BaseRenderContributionTime$1.afterFillStroke, this.useStyle = !0, this.order = 10;
|
|
@@ -12571,7 +12603,9 @@
|
|
|
12571
12603
|
textureSize = graphicAttribute.textureSize,
|
|
12572
12604
|
texturePadding = graphicAttribute.texturePadding
|
|
12573
12605
|
} = graphic.attribute;
|
|
12574
|
-
|
|
12606
|
+
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
12607
|
+
}
|
|
12608
|
+
drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
|
|
12575
12609
|
let pattern = this.textureMap.get(texture);
|
|
12576
12610
|
if (!pattern) switch (texture) {
|
|
12577
12611
|
case "circle":
|
|
@@ -13011,6 +13045,26 @@
|
|
|
13011
13045
|
const defaultSymbolTextureRenderContribution = defaultBaseTextureRenderContribution;
|
|
13012
13046
|
const defaultSymbolBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
|
|
13013
13047
|
|
|
13048
|
+
let DefaultAreaTextureRenderContribution$1 = class DefaultAreaTextureRenderContribution extends DefaultBaseTextureRenderContribution$1 {
|
|
13049
|
+
constructor() {
|
|
13050
|
+
super(...arguments), this.time = BaseRenderContributionTime$1.afterFillStroke;
|
|
13051
|
+
}
|
|
13052
|
+
drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
|
|
13053
|
+
var _a, _b, _c, _d;
|
|
13054
|
+
this.textureMap || this.initTextureMap(context, graphic.stage);
|
|
13055
|
+
const {
|
|
13056
|
+
attribute = graphic.attribute
|
|
13057
|
+
} = options || {},
|
|
13058
|
+
{
|
|
13059
|
+
texture = null !== (_a = graphic.attribute.texture) && void 0 !== _a ? _a : getAttributeFromDefaultAttrList$1(graphicAttribute, "texture"),
|
|
13060
|
+
textureColor = null !== (_b = graphic.attribute.textureColor) && void 0 !== _b ? _b : getAttributeFromDefaultAttrList$1(graphicAttribute, "textureColor"),
|
|
13061
|
+
textureSize = null !== (_c = graphic.attribute.textureSize) && void 0 !== _c ? _c : getAttributeFromDefaultAttrList$1(graphicAttribute, "textureSize"),
|
|
13062
|
+
texturePadding = null !== (_d = graphic.attribute.texturePadding) && void 0 !== _d ? _d : getAttributeFromDefaultAttrList$1(graphicAttribute, "texturePadding")
|
|
13063
|
+
} = attribute;
|
|
13064
|
+
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
13065
|
+
}
|
|
13066
|
+
};
|
|
13067
|
+
|
|
13014
13068
|
var __decorate$21 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
13015
13069
|
var d,
|
|
13016
13070
|
c = arguments.length,
|
|
@@ -13224,6 +13278,22 @@
|
|
|
13224
13278
|
};
|
|
13225
13279
|
DefaultCanvasCircleRender$1 = __decorate$20([injectable$1(), __param$$(0, inject$1(ContributionProvider$1)), __param$$(0, named$1(CircleRenderContribution$1)), __metadata$1f("design:paramtypes", [Object])], DefaultCanvasCircleRender$1);
|
|
13226
13280
|
|
|
13281
|
+
function drawSegItem$2(ctx, curve, endPercent, params) {
|
|
13282
|
+
if (!curve.p1) return;
|
|
13283
|
+
const {
|
|
13284
|
+
offsetX = 0,
|
|
13285
|
+
offsetY = 0,
|
|
13286
|
+
offsetZ = 0
|
|
13287
|
+
} = params || {};
|
|
13288
|
+
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) {
|
|
13289
|
+
const [curve1] = divideCubic$1(curve, endPercent);
|
|
13290
|
+
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);
|
|
13291
|
+
} else {
|
|
13292
|
+
const p = curve.getPointAt(endPercent);
|
|
13293
|
+
ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
|
|
13294
|
+
}
|
|
13295
|
+
}
|
|
13296
|
+
|
|
13227
13297
|
function drawSegments$1(path, segPath, percent, clipRangeByDimension, params) {
|
|
13228
13298
|
var _a;
|
|
13229
13299
|
const {
|
|
@@ -13266,7 +13336,7 @@
|
|
|
13266
13336
|
} else lastCurve = curve;
|
|
13267
13337
|
});
|
|
13268
13338
|
} else curves.forEach(curve => {
|
|
13269
|
-
curve.defined ? (needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem$
|
|
13339
|
+
curve.defined ? (needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem$2(path, curve, 1, params), needMoveTo = !1) : needMoveTo = !0;
|
|
13270
13340
|
});
|
|
13271
13341
|
return;
|
|
13272
13342
|
}
|
|
@@ -13307,7 +13377,7 @@
|
|
|
13307
13377
|
needMoveTo = !0;
|
|
13308
13378
|
continue;
|
|
13309
13379
|
}
|
|
13310
|
-
needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem$
|
|
13380
|
+
needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem$2(path, curve, min$1(_p, 1), params), needMoveTo = !1;
|
|
13311
13381
|
}
|
|
13312
13382
|
}
|
|
13313
13383
|
}
|
|
@@ -13344,21 +13414,6 @@
|
|
|
13344
13414
|
path.lineTo(null !== (_c = startP.x1) && void 0 !== _c ? _c : startP.x, null !== (_d = startP.y1) && void 0 !== _d ? _d : startP.y), path.closePath();
|
|
13345
13415
|
});
|
|
13346
13416
|
}
|
|
13347
|
-
function drawSegItem$3(ctx, curve, endPercent, params) {
|
|
13348
|
-
if (!curve.p1) return;
|
|
13349
|
-
const {
|
|
13350
|
-
offsetX = 0,
|
|
13351
|
-
offsetY = 0,
|
|
13352
|
-
offsetZ = 0
|
|
13353
|
-
} = params || {};
|
|
13354
|
-
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) {
|
|
13355
|
-
const [curve1] = divideCubic$1(curve, endPercent);
|
|
13356
|
-
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);
|
|
13357
|
-
} else {
|
|
13358
|
-
const p = curve.getPointAt(endPercent);
|
|
13359
|
-
ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
|
|
13360
|
-
}
|
|
13361
|
-
}
|
|
13362
13417
|
|
|
13363
13418
|
var __decorate$1$ = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
13364
13419
|
var d,
|
|
@@ -13419,10 +13474,10 @@
|
|
|
13419
13474
|
points: points
|
|
13420
13475
|
} = line.attribute,
|
|
13421
13476
|
startP = points[0];
|
|
13422
|
-
context.moveTo(startP.x, startP.y, z);
|
|
13477
|
+
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
13423
13478
|
for (let i = 1; i < points.length; i++) {
|
|
13424
13479
|
const p = points[i];
|
|
13425
|
-
context.lineTo(p.x, p.y, z);
|
|
13480
|
+
context.lineTo(p.x + offsetX, p.y + offsetY, z);
|
|
13426
13481
|
}
|
|
13427
13482
|
context.setShadowBlendStyle && context.setShadowBlendStyle(line, line.attribute, lineAttribute);
|
|
13428
13483
|
const {
|
|
@@ -13642,68 +13697,7 @@
|
|
|
13642
13697
|
}
|
|
13643
13698
|
path.closePath();
|
|
13644
13699
|
}
|
|
13645
|
-
function drawSegItem$2(ctx, curve, endPercent, params) {
|
|
13646
|
-
if (!curve.p1) return;
|
|
13647
|
-
const {
|
|
13648
|
-
offsetX = 0,
|
|
13649
|
-
offsetY = 0,
|
|
13650
|
-
offsetZ = 0
|
|
13651
|
-
} = params || {};
|
|
13652
|
-
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) {
|
|
13653
|
-
const [curve1] = divideCubic$1(curve, endPercent);
|
|
13654
|
-
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);
|
|
13655
|
-
} else {
|
|
13656
|
-
const p = curve.getPointAt(endPercent);
|
|
13657
|
-
ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
|
|
13658
|
-
}
|
|
13659
|
-
}
|
|
13660
13700
|
|
|
13661
|
-
let DefaultAreaTextureRenderContribution$1 = class DefaultAreaTextureRenderContribution extends DefaultBaseTextureRenderContribution$1 {
|
|
13662
|
-
constructor() {
|
|
13663
|
-
super(...arguments), this.time = BaseRenderContributionTime$1.afterFillStroke;
|
|
13664
|
-
}
|
|
13665
|
-
drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
|
|
13666
|
-
var _a, _b, _c, _d;
|
|
13667
|
-
this.textureMap || this.initTextureMap(context, graphic.stage);
|
|
13668
|
-
const {
|
|
13669
|
-
attribute = graphic.attribute
|
|
13670
|
-
} = options || {},
|
|
13671
|
-
{
|
|
13672
|
-
texture = null !== (_a = graphic.attribute.texture) && void 0 !== _a ? _a : getAttributeFromDefaultAttrList$1(graphicAttribute, "texture"),
|
|
13673
|
-
textureColor = null !== (_b = graphic.attribute.textureColor) && void 0 !== _b ? _b : getAttributeFromDefaultAttrList$1(graphicAttribute, "textureColor"),
|
|
13674
|
-
textureSize = null !== (_c = graphic.attribute.textureSize) && void 0 !== _c ? _c : getAttributeFromDefaultAttrList$1(graphicAttribute, "textureSize"),
|
|
13675
|
-
texturePadding = null !== (_d = graphic.attribute.texturePadding) && void 0 !== _d ? _d : getAttributeFromDefaultAttrList$1(graphicAttribute, "texturePadding")
|
|
13676
|
-
} = attribute;
|
|
13677
|
-
if (!texture) return;
|
|
13678
|
-
let pattern = this.textureMap.get(texture);
|
|
13679
|
-
if (!pattern) switch (texture) {
|
|
13680
|
-
case "circle":
|
|
13681
|
-
pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
|
|
13682
|
-
break;
|
|
13683
|
-
case "diamond":
|
|
13684
|
-
pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
|
|
13685
|
-
break;
|
|
13686
|
-
case "rect":
|
|
13687
|
-
pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
|
|
13688
|
-
break;
|
|
13689
|
-
case "vertical-line":
|
|
13690
|
-
pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
|
|
13691
|
-
break;
|
|
13692
|
-
case "horizontal-line":
|
|
13693
|
-
pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
|
|
13694
|
-
break;
|
|
13695
|
-
case "bias-lr":
|
|
13696
|
-
pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
|
|
13697
|
-
break;
|
|
13698
|
-
case "bias-rl":
|
|
13699
|
-
pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
|
|
13700
|
-
break;
|
|
13701
|
-
case "grid":
|
|
13702
|
-
pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
|
|
13703
|
-
}
|
|
13704
|
-
pattern && (context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore());
|
|
13705
|
-
}
|
|
13706
|
-
};
|
|
13707
13701
|
const defaultAreaTextureRenderContribution = new DefaultAreaTextureRenderContribution$1();
|
|
13708
13702
|
const defaultAreaBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
|
|
13709
13703
|
|
|
@@ -13755,39 +13749,43 @@
|
|
|
13755
13749
|
points: points
|
|
13756
13750
|
} = area.attribute,
|
|
13757
13751
|
startP = points[0];
|
|
13758
|
-
context.moveTo(startP.x, startP.y, z);
|
|
13752
|
+
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
13759
13753
|
for (let i = 1; i < points.length; i++) {
|
|
13760
13754
|
const p = points[i];
|
|
13761
|
-
context.lineTo(p.x, p.y, z);
|
|
13755
|
+
context.lineTo(p.x + offsetX, p.y + offsetY, z);
|
|
13762
13756
|
}
|
|
13763
13757
|
for (let i = points.length - 1; i >= 0; i--) {
|
|
13764
13758
|
const p = points[i];
|
|
13765
|
-
context.lineTo(null !== (_b = p.x1) && void 0 !== _b ? _b : p.x, null !== (_c = p.y1) && void 0 !== _c ? _c : p.y, z);
|
|
13759
|
+
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);
|
|
13766
13760
|
}
|
|
13767
|
-
context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(area, area.attribute, areaAttribute)
|
|
13761
|
+
context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(area, area.attribute, areaAttribute), this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
|
|
13762
|
+
attribute: area.attribute
|
|
13763
|
+
});
|
|
13768
13764
|
const {
|
|
13769
13765
|
x: originX = 0,
|
|
13770
13766
|
x: originY = 0
|
|
13771
13767
|
} = area.attribute;
|
|
13772
|
-
if (!1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())),
|
|
13768
|
+
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, {
|
|
13769
|
+
attribute: area.attribute
|
|
13770
|
+
}), stroke) {
|
|
13773
13771
|
const {
|
|
13774
13772
|
stroke = areaAttribute && areaAttribute.stroke
|
|
13775
13773
|
} = area.attribute;
|
|
13776
13774
|
if (isArray$3(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1]) if (context.beginPath(), stroke[0]) {
|
|
13777
|
-
context.moveTo(startP.x, startP.y, z);
|
|
13775
|
+
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
13778
13776
|
for (let i = 1; i < points.length; i++) {
|
|
13779
13777
|
const p = points[i];
|
|
13780
|
-
context.lineTo(p.x, p.y, z);
|
|
13778
|
+
context.lineTo(p.x + offsetX, p.y + offsetY, z);
|
|
13781
13779
|
}
|
|
13782
13780
|
} else if (stroke[2]) {
|
|
13783
13781
|
const endP = points[points.length - 1];
|
|
13784
|
-
context.moveTo(endP.x, endP.y, z);
|
|
13782
|
+
context.moveTo(endP.x + offsetX, endP.y + offsetY, z);
|
|
13785
13783
|
for (let i = points.length - 2; i >= 0; i--) {
|
|
13786
13784
|
const p = points[i];
|
|
13787
|
-
context.lineTo(null !== (_d = p.x1) && void 0 !== _d ? _d : p.x, null !== (_e = p.y1) && void 0 !== _e ? _e : p.y, z);
|
|
13785
|
+
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);
|
|
13788
13786
|
}
|
|
13789
13787
|
}
|
|
13790
|
-
context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke();
|
|
13788
|
+
strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke());
|
|
13791
13789
|
}
|
|
13792
13790
|
}
|
|
13793
13791
|
drawShape(area, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
@@ -16730,7 +16728,7 @@
|
|
|
16730
16728
|
return this.removeChild(this.findChildByUid(ILayerId));
|
|
16731
16729
|
}
|
|
16732
16730
|
tryInitInteractiveLayer() {
|
|
16733
|
-
this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.nextFrameRenderLayerSet.add(this.interactiveLayer));
|
|
16731
|
+
this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.interactiveLayer.attribute.pickable = !1, this.nextFrameRenderLayerSet.add(this.interactiveLayer));
|
|
16734
16732
|
}
|
|
16735
16733
|
clearViewBox(color) {
|
|
16736
16734
|
this.window.clearViewBox(this._viewBox, color);
|
|
@@ -19923,12 +19921,22 @@
|
|
|
19923
19921
|
x = areaAttribute.x,
|
|
19924
19922
|
y = areaAttribute.y
|
|
19925
19923
|
} = area.attribute;
|
|
19924
|
+
const {
|
|
19925
|
+
fillPickable = areaAttribute.fillPickable,
|
|
19926
|
+
strokePickable = areaAttribute.strokePickable
|
|
19927
|
+
} = area.attribute;
|
|
19926
19928
|
if (pickContext.highPerformanceSave(), area.transMatrix.onlyTranslate()) {
|
|
19927
19929
|
const point = area.getOffsetXY(areaAttribute);
|
|
19928
19930
|
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
19929
19931
|
} else x = 0, y = 0, pickContext.transformFromMatrix(area.transMatrix, !0);
|
|
19930
19932
|
let picked = !1;
|
|
19931
|
-
return this.canvasRenderer.drawShape(area, pickContext, x, y, {}, null, context => !!picked || (picked = context.isPointInPath(point.x, point.y), picked)
|
|
19933
|
+
return this.canvasRenderer.drawShape(area, pickContext, x, y, {}, null, context => !!picked || !!fillPickable && (picked = context.isPointInPath(point.x, point.y), picked), (context, areaAttribute, themeAttribute) => {
|
|
19934
|
+
if (picked) return !0;
|
|
19935
|
+
if (!strokePickable) return !1;
|
|
19936
|
+
const lineWidth = areaAttribute.lineWidth || themeAttribute.lineWidth,
|
|
19937
|
+
pickStrokeBuffer = areaAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
19938
|
+
return pickContext.lineWidth = getScaledStroke$1(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
19939
|
+
}), pickContext.highPerformanceRestore(), picked;
|
|
19932
19940
|
}
|
|
19933
19941
|
};
|
|
19934
19942
|
DefaultCanvasAreaPicker = __decorate$1h([injectable$1(), __param$F(0, inject$1(AreaRender$1)), __metadata$I("design:paramtypes", [Object])], DefaultCanvasAreaPicker);
|
|
@@ -24287,7 +24295,8 @@
|
|
|
24287
24295
|
padding = 4,
|
|
24288
24296
|
visible: visible,
|
|
24289
24297
|
state: state,
|
|
24290
|
-
type: type
|
|
24298
|
+
type: type,
|
|
24299
|
+
textAlwaysCenter: textAlwaysCenter
|
|
24291
24300
|
} = this.attribute,
|
|
24292
24301
|
parsedPadding = normalizePadding(padding),
|
|
24293
24302
|
group = this.createOrUpdateChild("tag-content", {
|
|
@@ -24393,7 +24402,10 @@
|
|
|
24393
24402
|
(isValid$3(minWidth) || isValid$3(maxWidth)) && (isValid$3(minWidth) && tagWidth < minWidth && (tagWidth = minWidth), isValid$3(maxWidth) && tagWidth > maxWidth && (tagWidth = maxWidth, textShape.setAttribute("maxLineWidth", maxWidth - parsedPadding[1] - parsedPadding[2])));
|
|
24394
24403
|
let x = 0,
|
|
24395
24404
|
y = 0;
|
|
24396
|
-
"center" === textAlign ? (x -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2)) : "right" === textAlign || "end" === textAlign ? (x -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : "left" !== textAlign && "start" !== textAlign || group.setAttribute("x", parsedPadding[3]),
|
|
24405
|
+
"center" === textAlign ? (x -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2)) : "right" === textAlign || "end" === textAlign ? (x -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : "left" !== textAlign && "start" !== textAlign || group.setAttribute("x", parsedPadding[3]), !textAlwaysCenter || "left" !== textAlign && "start" !== textAlign || textShape.setAttributes({
|
|
24406
|
+
x: textX + tagWidth / 2,
|
|
24407
|
+
textAlign: "center"
|
|
24408
|
+
}), "middle" === textBaseline ? (y -= tagHeight / 2, symbol && symbol.setAttribute("y", 0)) : "bottom" === textBaseline ? (y -= tagHeight, symbol && symbol.setAttribute("y", -textHeight / 2), group.setAttribute("y", -parsedPadding[2])) : "top" === textBaseline && (group.setAttribute("y", parsedPadding[0]), symbol && symbol.setAttribute("y", textHeight / 2));
|
|
24397
24409
|
const {
|
|
24398
24410
|
visible: bgVisible
|
|
24399
24411
|
} = panel,
|
|
@@ -25167,6 +25179,24 @@
|
|
|
25167
25179
|
const layerLabelGroup = this.renderLabels(labelGroup, axisItems, layer),
|
|
25168
25180
|
labels = layerLabelGroup.getChildren();
|
|
25169
25181
|
this.beforeLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length), this.handleLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length), this.afterLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length);
|
|
25182
|
+
let maxTextWidth = 0,
|
|
25183
|
+
maxTextHeight = 0,
|
|
25184
|
+
textAlign = "center",
|
|
25185
|
+
textBaseline = "middle";
|
|
25186
|
+
labels.forEach(label => {
|
|
25187
|
+
var _a;
|
|
25188
|
+
const labelStyle = label.attribute,
|
|
25189
|
+
angle = null !== (_a = labelStyle.angle) && void 0 !== _a ? _a : 0,
|
|
25190
|
+
textBounds = label.AABBBounds;
|
|
25191
|
+
let textWidth = textBounds.width(),
|
|
25192
|
+
textHeight = textBounds.height();
|
|
25193
|
+
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;
|
|
25194
|
+
}), this.axisLabelLayerSize[layer] = {
|
|
25195
|
+
width: maxTextWidth,
|
|
25196
|
+
height: maxTextHeight,
|
|
25197
|
+
textAlign: textAlign,
|
|
25198
|
+
textBaseline: textBaseline
|
|
25199
|
+
};
|
|
25170
25200
|
});
|
|
25171
25201
|
}
|
|
25172
25202
|
title && title.visible && this.renderTitle(axisContainer);
|
|
@@ -25218,13 +25248,8 @@
|
|
|
25218
25248
|
y: 0,
|
|
25219
25249
|
pickable: !1
|
|
25220
25250
|
});
|
|
25221
|
-
labelGroup.name = `${AXIS_ELEMENT_NAME.labelContainer}-layer-${layer}`, labelGroup.id = this._getNodeId(`label-container-layer-${layer}`), container.add(labelGroup)
|
|
25222
|
-
|
|
25223
|
-
maxTextHeight = 0,
|
|
25224
|
-
textAlign = "center",
|
|
25225
|
-
textBaseline = "middle";
|
|
25226
|
-
return data.forEach((item, index) => {
|
|
25227
|
-
var _a, _b, _c, _d;
|
|
25251
|
+
return labelGroup.name = `${AXIS_ELEMENT_NAME.labelContainer}-layer-${layer}`, labelGroup.id = this._getNodeId(`label-container-layer-${layer}`), container.add(labelGroup), data.forEach((item, index) => {
|
|
25252
|
+
var _a, _b, _c;
|
|
25228
25253
|
const labelStyle = this._getLabelAttribute(item, index, data, layer);
|
|
25229
25254
|
let text;
|
|
25230
25255
|
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$1.richtext(labelStyle)) : "html" === labelStyle.type ? (labelStyle.textConfig = [], labelStyle.html = Object.assign(Object.assign({
|
|
@@ -25236,14 +25261,7 @@
|
|
|
25236
25261
|
}), text.states = labelState;
|
|
25237
25262
|
}
|
|
25238
25263
|
labelGroup.add(text);
|
|
25239
|
-
|
|
25240
|
-
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;
|
|
25241
|
-
}), this.axisLabelLayerSize[layer] = {
|
|
25242
|
-
width: maxTextWidth,
|
|
25243
|
-
height: maxTextHeight,
|
|
25244
|
-
textAlign: textAlign,
|
|
25245
|
-
textBaseline: textBaseline
|
|
25246
|
-
}, labelGroup;
|
|
25264
|
+
}), labelGroup;
|
|
25247
25265
|
}
|
|
25248
25266
|
renderTitle(container) {
|
|
25249
25267
|
const titleAttributes = this.getTitleAttribute(),
|
|
@@ -25367,7 +25385,7 @@
|
|
|
25367
25385
|
const axisVector = this.getRelativeVector(tickDatum.point);
|
|
25368
25386
|
layer > 0 && (0 === axisVector[1] ? offset += (this.axisLabelLayerSize[layer - 1].height + get$5(this.attribute, "label.space", 4)) * layer : offset += (this.axisLabelLayerSize[layer - 1].width + get$5(this.attribute, "label.space", 4)) * layer);
|
|
25369
25387
|
const point = this.getVerticalCoord(tickDatum.point, offset, inside),
|
|
25370
|
-
vector = this.getVerticalVector(offset, inside, point),
|
|
25388
|
+
vector = this.getVerticalVector(offset || 1, inside, point),
|
|
25371
25389
|
textContent = formatMethod ? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer) : tickDatum.label;
|
|
25372
25390
|
let {
|
|
25373
25391
|
style: textStyle
|
|
@@ -25471,7 +25489,16 @@
|
|
|
25471
25489
|
do {
|
|
25472
25490
|
items = reduce(items, sep);
|
|
25473
25491
|
} while (items.length >= 3 && hasOverlap$1(items, sep));
|
|
25474
|
-
items.length < 3
|
|
25492
|
+
if (items.length < 3 || config.lastVisible) {
|
|
25493
|
+
const lastSourceItem = last$1(source);
|
|
25494
|
+
if (!lastSourceItem.attribute.opacity) {
|
|
25495
|
+
const remainLength = items.length;
|
|
25496
|
+
if (remainLength > 1) {
|
|
25497
|
+
lastSourceItem.setAttribute("opacity", 1);
|
|
25498
|
+
for (let i = remainLength - 1; i >= 0 && intersect$2(items[i], lastSourceItem, sep); i--) items[i].setAttribute("opacity", 0);
|
|
25499
|
+
}
|
|
25500
|
+
}
|
|
25501
|
+
}
|
|
25475
25502
|
}
|
|
25476
25503
|
source.forEach(item => {
|
|
25477
25504
|
item.setAttribute("visible", !!item.attribute.opacity);
|
|
@@ -25549,13 +25576,16 @@
|
|
|
25549
25576
|
function autoLimit(labels, config) {
|
|
25550
25577
|
const {
|
|
25551
25578
|
limitLength: limitLength,
|
|
25579
|
+
verticalLimitLength: verticalLimitLength,
|
|
25552
25580
|
ellipsis = "...",
|
|
25553
25581
|
orient: orient
|
|
25554
25582
|
} = config;
|
|
25555
25583
|
!isEmpty(labels) && isValidNumber$1(limitLength) && labels.forEach(label => {
|
|
25556
25584
|
if (("top" === orient || "bottom" === orient) && Math.floor(label.AABBBounds.height()) <= limitLength) return;
|
|
25557
|
-
|
|
25558
|
-
|
|
25585
|
+
const direction = label.attribute.direction;
|
|
25586
|
+
if (("left" === orient || "right" === orient) && ("vertical" === direction && Math.floor(label.AABBBounds.height()) <= verticalLimitLength || "vertical" !== direction && Math.floor(label.AABBBounds.width()) <= limitLength)) return;
|
|
25587
|
+
const angle = label.attribute.angle;
|
|
25588
|
+
let limitLabelLength = 0 === angle || isNil$3(angle) ? "top" === orient || "bottom" === orient ? null : "vertical" === direction ? verticalLimitLength : limitLength : Math.abs(limitLength / Math.sin(angle));
|
|
25559
25589
|
isValidNumber$1(label.attribute.maxLineWidth) && (limitLabelLength = isValidNumber$1(limitLabelLength) ? Math.min(label.attribute.maxLineWidth, limitLabelLength) : label.attribute.maxLineWidth), label.setAttributes({
|
|
25560
25590
|
maxLineWidth: limitLabelLength,
|
|
25561
25591
|
ellipsis: label.attribute.ellipsis || ellipsis
|
|
@@ -25901,20 +25931,29 @@
|
|
|
25901
25931
|
limitEllipsis: limitEllipsis,
|
|
25902
25932
|
autoHide: autoHide$1,
|
|
25903
25933
|
autoHideMethod: autoHideMethod,
|
|
25904
|
-
autoHideSeparation: autoHideSeparation
|
|
25934
|
+
autoHideSeparation: autoHideSeparation,
|
|
25935
|
+
lastVisible: lastVisible
|
|
25905
25936
|
} = label;
|
|
25906
|
-
isFunction$3(layoutFunc)
|
|
25907
|
-
|
|
25908
|
-
|
|
25909
|
-
|
|
25910
|
-
limitLength
|
|
25911
|
-
|
|
25912
|
-
|
|
25913
|
-
|
|
25914
|
-
|
|
25915
|
-
|
|
25916
|
-
|
|
25917
|
-
|
|
25937
|
+
if (isFunction$3(layoutFunc)) layoutFunc(labelShapes, labelData, layer, this);else {
|
|
25938
|
+
if (autoRotate$1 && autoRotate(labelShapes, {
|
|
25939
|
+
labelRotateAngle: autoRotateAngle,
|
|
25940
|
+
orient: orient
|
|
25941
|
+
}), autoLimit$1 && isValidNumber$1(limitLength) && limitLength > 0) {
|
|
25942
|
+
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;
|
|
25943
|
+
autoLimit(labelShapes, {
|
|
25944
|
+
limitLength: limitLength,
|
|
25945
|
+
verticalLimitLength: verticalLimitLength,
|
|
25946
|
+
ellipsis: limitEllipsis,
|
|
25947
|
+
orient: orient
|
|
25948
|
+
});
|
|
25949
|
+
}
|
|
25950
|
+
autoHide$1 && autoHide(labelShapes, {
|
|
25951
|
+
orient: orient,
|
|
25952
|
+
method: autoHideMethod,
|
|
25953
|
+
separation: autoHideSeparation,
|
|
25954
|
+
lastVisible: lastVisible
|
|
25955
|
+
});
|
|
25956
|
+
}
|
|
25918
25957
|
}
|
|
25919
25958
|
afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
|
|
25920
25959
|
const {
|
|
@@ -26383,7 +26422,8 @@
|
|
|
26383
26422
|
shapeSize = 0,
|
|
26384
26423
|
shapeSpace = 0;
|
|
26385
26424
|
if (shapeAttr && !1 !== shapeAttr.visible) {
|
|
26386
|
-
|
|
26425
|
+
const s = get$5(shapeStyle, "style.size", DEFAULT_SHAPE_SIZE);
|
|
26426
|
+
shapeSize = isArray$3(s) ? s[0] || 0 : s, shapeSpace = get$5(shapeAttr, "space", DEFAULT_SHAPE_SPACE);
|
|
26387
26427
|
const itemShape = graphicCreator$1.symbol(Object.assign(Object.assign({
|
|
26388
26428
|
x: 0,
|
|
26389
26429
|
y: 0,
|
|
@@ -48924,6 +48964,9 @@
|
|
|
48924
48964
|
return;
|
|
48925
48965
|
}
|
|
48926
48966
|
group.forEachChildren((child) => {
|
|
48967
|
+
if (!child) {
|
|
48968
|
+
return;
|
|
48969
|
+
}
|
|
48927
48970
|
if (isObject$6(child.attribute.width) && child.attribute.width.percent) {
|
|
48928
48971
|
child.setAttribute('width', (child.attribute.width.percent / 100) * parentWidth +
|
|
48929
48972
|
(child.attribute.width.delta ?? 0));
|
|
@@ -48938,7 +48981,7 @@
|
|
|
48938
48981
|
});
|
|
48939
48982
|
}
|
|
48940
48983
|
function decodeReactDom(dom) {
|
|
48941
|
-
if (!dom.$$typeof) {
|
|
48984
|
+
if (!dom || !dom.$$typeof) {
|
|
48942
48985
|
return dom;
|
|
48943
48986
|
}
|
|
48944
48987
|
const type = dom.type;
|
|
@@ -66947,7 +66990,7 @@
|
|
|
66947
66990
|
return TABLE_EVENT_TYPE;
|
|
66948
66991
|
}
|
|
66949
66992
|
options;
|
|
66950
|
-
version = "0.17.
|
|
66993
|
+
version = "0.17.6";
|
|
66951
66994
|
pagination;
|
|
66952
66995
|
id = `VTable${Date.now()}`;
|
|
66953
66996
|
headerStyleCache;
|
|
@@ -77690,7 +77733,7 @@
|
|
|
77690
77733
|
return new Tag$1(params ? params.attribute : {});
|
|
77691
77734
|
}
|
|
77692
77735
|
|
|
77693
|
-
const version = "0.17.
|
|
77736
|
+
const version = "0.17.6";
|
|
77694
77737
|
function getIcons() {
|
|
77695
77738
|
return get$2();
|
|
77696
77739
|
}
|