@visactor/vchart-extension 1.13.3 → 1.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +14 -30
- package/build/index.min.js +2 -2
- package/package.json +8 -8
package/build/index.js
CHANGED
|
@@ -2237,7 +2237,7 @@
|
|
|
2237
2237
|
default:
|
|
2238
2238
|
if (this._t <= 0) this.context.lineTo(this._x, y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p);else {
|
|
2239
2239
|
const x1 = this._x * (1 - this._t) + x * this._t;
|
|
2240
|
-
this.context.lineTo(x1, this._y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x1, y, !1 !== this._lastDefined && !1 !== p.defined, p);
|
|
2240
|
+
.5 === this._t ? this.context.lineTo(x1, this._y, !1 !== this._lastDefined, this.lastPoint) : this.context.lineTo(x1, this._y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x1, y, !1 !== this._lastDefined && !1 !== p.defined, p);
|
|
2241
2241
|
}
|
|
2242
2242
|
}
|
|
2243
2243
|
this._lastDefined = p.defined, this._x = x, this._y = y, this.lastPoint = p;
|
|
@@ -3827,7 +3827,7 @@
|
|
|
3827
3827
|
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Generator.GenAutoIncrementId();
|
|
3828
3828
|
let timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline;
|
|
3829
3829
|
let slience = arguments.length > 2 ? arguments[2] : undefined;
|
|
3830
|
-
this.id = id, this.timeline = timeline, this.status = AnimateStatus.INITIAL, this.tailAnimate = new SubAnimate(this), this.subAnimates = [this.tailAnimate], this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0, this.timeline.addAnimate(this), this.slience = slience;
|
|
3830
|
+
this.id = id, this.timeline = timeline || defaultTimeline, this.status = AnimateStatus.INITIAL, this.tailAnimate = new SubAnimate(this), this.subAnimates = [this.tailAnimate], this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0, this.timeline.addAnimate(this), this.slience = slience;
|
|
3831
3831
|
}
|
|
3832
3832
|
setTimeline(timeline) {
|
|
3833
3833
|
timeline !== this.timeline && (this.timeline.removeAnimate(this, !1), timeline.addAnimate(this));
|
|
@@ -4361,7 +4361,7 @@
|
|
|
4361
4361
|
}
|
|
4362
4362
|
static GetFile(url, type) {
|
|
4363
4363
|
let data = ResourceLoader.cache.get(url);
|
|
4364
|
-
return data ? "
|
|
4364
|
+
return data ? "fail" === data.loadState ? Promise.reject() : "init" === data.loadState || "loading" === data.loadState ? data.dataPromise.then(data => data.data) : Promise.resolve(data.data) : (data = {
|
|
4365
4365
|
type: type,
|
|
4366
4366
|
loadState: "init"
|
|
4367
4367
|
}, ResourceLoader.cache.set(url, data), "arrayBuffer" === type ? data.dataPromise = application.global.loadArrayBuffer(url) : "blob" === type ? data.dataPromise = application.global.loadBlob(url) : "json" === type && (data.dataPromise = application.global.loadJson(url)), data.dataPromise.then(data => data.data));
|
|
@@ -6453,7 +6453,7 @@
|
|
|
6453
6453
|
this._draw(line, lineAttribute, !1, drawContext, params);
|
|
6454
6454
|
}
|
|
6455
6455
|
drawSegmentItem(context, cache, fill, stroke, fillOpacity, strokeOpacity, attribute, defaultAttribute, clipRange, clipRangeByDimension, offsetX, offsetY, line, fillCb, strokeCb) {
|
|
6456
|
-
var _a
|
|
6456
|
+
var _a;
|
|
6457
6457
|
if (!cache) return;
|
|
6458
6458
|
context.beginPath();
|
|
6459
6459
|
const z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
|
|
@@ -6466,27 +6466,7 @@
|
|
|
6466
6466
|
x: originX = 0,
|
|
6467
6467
|
x: originY = 0
|
|
6468
6468
|
} = attribute;
|
|
6469
|
-
!1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke()));
|
|
6470
|
-
let {
|
|
6471
|
-
connectedType: connectedType,
|
|
6472
|
-
connectedX: connectedX,
|
|
6473
|
-
connectedY: connectedY,
|
|
6474
|
-
connectedStyle: connectedStyle
|
|
6475
|
-
} = attribute;
|
|
6476
|
-
if (vutils.isArray(defaultAttribute) ? (connectedType = null !== (_b = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _b ? _b : defaultAttribute[1].connectedType, connectedX = null !== (_c = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _c ? _c : defaultAttribute[1].connectedX, connectedY = null !== (_d = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _d ? _d : defaultAttribute[1].connectedY, connectedStyle = null !== (_e = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _e ? _e : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), "none" !== connectedType) {
|
|
6477
|
-
context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, cache, clipRange, clipRangeByDimension, {
|
|
6478
|
-
offsetX: offsetX,
|
|
6479
|
-
offsetY: offsetY,
|
|
6480
|
-
offsetZ: z,
|
|
6481
|
-
drawConnect: !0,
|
|
6482
|
-
mode: connectedType,
|
|
6483
|
-
zeroX: connectedX,
|
|
6484
|
-
zeroY: connectedY
|
|
6485
|
-
});
|
|
6486
|
-
const da = [];
|
|
6487
|
-
vutils.isArray(defaultAttribute) ? defaultAttribute.forEach(i => da.push(i)) : da.push(defaultAttribute), da.push(attribute), !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da), context.stroke()));
|
|
6488
|
-
}
|
|
6489
|
-
return !1;
|
|
6469
|
+
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke())), !1;
|
|
6490
6470
|
}
|
|
6491
6471
|
drawLinearLineHighPerformance(line, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, lineAttribute, drawContext, params, fillCb, strokeCb) {
|
|
6492
6472
|
var _a;
|
|
@@ -6518,7 +6498,8 @@
|
|
|
6518
6498
|
segments: segments,
|
|
6519
6499
|
points: points,
|
|
6520
6500
|
closePath: closePath,
|
|
6521
|
-
curveTension = lineAttribute.curveTension
|
|
6501
|
+
curveTension = lineAttribute.curveTension,
|
|
6502
|
+
connectedType = lineAttribute.connectedType
|
|
6522
6503
|
} = line.attribute;
|
|
6523
6504
|
if (!this.valid(line, lineAttribute, fillCb, strokeCb)) return;
|
|
6524
6505
|
let {
|
|
@@ -6530,6 +6511,9 @@
|
|
|
6530
6511
|
clipRangeByDimension = lineAttribute.clipRangeByDimension
|
|
6531
6512
|
} = line.attribute;
|
|
6532
6513
|
if (1 === clipRange && !segments && !points.some(p => !1 === p.defined) && "linear" === curveType) return this.drawLinearLineHighPerformance(line, context, !!fill, !!stroke, fillOpacity, strokeOpacity, x, y, lineAttribute, drawContext, params, fillCb, strokeCb);
|
|
6514
|
+
function parsePoint(points, connectedType) {
|
|
6515
|
+
return "none" === connectedType ? points : points.filter(p => !1 !== p.defined);
|
|
6516
|
+
}
|
|
6533
6517
|
if (line.shouldUpdateShape()) {
|
|
6534
6518
|
const {
|
|
6535
6519
|
points: points,
|
|
@@ -6551,7 +6535,7 @@
|
|
|
6551
6535
|
y: lastSeg.endY,
|
|
6552
6536
|
defined: lastSeg.curves[lastSeg.curves.length - 1].defined
|
|
6553
6537
|
} : index > 1 && (startPoint.x = lastSeg.endX, startPoint.y = lastSeg.endY, startPoint.defined = lastSeg.curves[lastSeg.curves.length - 1].defined);
|
|
6554
|
-
const data = calcLineCache(seg.points, curveType, {
|
|
6538
|
+
const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {
|
|
6555
6539
|
startPoint: startPoint,
|
|
6556
6540
|
curveTension: curveTension
|
|
6557
6541
|
});
|
|
@@ -6570,7 +6554,7 @@
|
|
|
6570
6554
|
}
|
|
6571
6555
|
} else {
|
|
6572
6556
|
if (!points || !points.length) return line.cache = null, void line.clearUpdateShapeTag();
|
|
6573
|
-
line.cache = calcLineCache(_points, curveType, {
|
|
6557
|
+
line.cache = calcLineCache(parsePoint(_points, connectedType), curveType, {
|
|
6574
6558
|
curveTension: curveTension
|
|
6575
6559
|
});
|
|
6576
6560
|
}
|
|
@@ -7990,7 +7974,7 @@
|
|
|
7990
7974
|
} = attribute,
|
|
7991
7975
|
b = aabbBounds;
|
|
7992
7976
|
return points.forEach(p => {
|
|
7993
|
-
!1 === p.defined && "
|
|
7977
|
+
!1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
|
|
7994
7978
|
}), b;
|
|
7995
7979
|
}
|
|
7996
7980
|
updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) {
|
|
@@ -8001,7 +7985,7 @@
|
|
|
8001
7985
|
b = aabbBounds;
|
|
8002
7986
|
return segments.forEach(s => {
|
|
8003
7987
|
s.points.forEach(p => {
|
|
8004
|
-
!1 === p.defined && "
|
|
7988
|
+
!1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
|
|
8005
7989
|
});
|
|
8006
7990
|
}), b;
|
|
8007
7991
|
}
|