@visactor/vrender-components 0.15.0-alpha.15 → 0.15.0-alpha.17
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/base.d.ts +2 -1
- package/cjs/core/base.js +4 -2
- package/cjs/core/base.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/label/arc.d.ts +2 -1
- package/cjs/label/arc.js +33 -11
- package/cjs/label/arc.js.map +1 -1
- package/cjs/label/type.d.ts +2 -2
- package/cjs/label/type.js.map +1 -1
- package/cjs/marker/config.js +1 -1
- package/cjs/marker/index.js +1 -1
- package/cjs/marker/line.js +1 -1
- package/cjs/pager/index.js +1 -1
- package/cjs/pager/pager.js +1 -1
- package/cjs/pager/type.js +1 -1
- package/dist/index.js +39 -13
- package/dist/index.min.js +1 -1
- package/es/core/base.d.ts +2 -1
- package/es/core/base.js +3 -3
- package/es/core/base.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/label/arc.d.ts +2 -1
- package/es/label/arc.js +33 -11
- package/es/label/arc.js.map +1 -1
- package/es/label/type.d.ts +2 -2
- package/es/label/type.js.map +1 -1
- package/es/marker/config.js +1 -1
- package/es/marker/index.js +1 -1
- package/es/marker/line.js +1 -1
- package/es/pager/index.js +1 -1
- package/es/pager/pager.js +1 -1
- package/es/pager/type.js +1 -1
- package/package.json +4 -4
package/cjs/marker/line.js
CHANGED
package/cjs/pager/index.js
CHANGED
|
@@ -18,4 +18,4 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", {
|
|
19
19
|
value: !0
|
|
20
20
|
}), __exportStar(require("./type"), exports), __exportStar(require("./pager"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
package/cjs/pager/pager.js
CHANGED
package/cjs/pager/type.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
setAttribute(key, value, forceUpdateTag) {
|
|
39
|
-
if (vutils.isPlainObject(this.attribute[key])) {
|
|
39
|
+
if (vutils.isPlainObject(this.attribute[key]) && !vutils.isFunction(this.attribute[key]) && !vutils.isFunction(value)) {
|
|
40
40
|
vutils.merge(this.attribute[key], value);
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
}
|
|
78
78
|
for (let i = 0; i < keys.length; i++) {
|
|
79
79
|
const key = keys[i];
|
|
80
|
-
if (vutils.isPlainObject(this.attribute[key])) {
|
|
80
|
+
if (vutils.isPlainObject(this.attribute[key]) && !vutils.isFunction(this.attribute[key]) && !vutils.isFunction(params[key])) {
|
|
81
81
|
vutils.merge(this.attribute[key], params[key]);
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
@@ -2471,7 +2471,8 @@
|
|
|
2471
2471
|
maxLineWidth: basedArc.labelLimit,
|
|
2472
2472
|
points: (basedArc === null || basedArc === void 0 ? void 0 : basedArc.pointA) && (basedArc === null || basedArc === void 0 ? void 0 : basedArc.pointB) && (basedArc === null || basedArc === void 0 ? void 0 : basedArc.pointC)
|
|
2473
2473
|
? [basedArc.pointA, basedArc.pointB, basedArc.pointC]
|
|
2474
|
-
: undefined
|
|
2474
|
+
: undefined,
|
|
2475
|
+
line: basedArc === null || basedArc === void 0 ? void 0 : basedArc.labelLine
|
|
2475
2476
|
};
|
|
2476
2477
|
labels[i].setAttributes(labelAttribute);
|
|
2477
2478
|
}
|
|
@@ -2633,6 +2634,7 @@
|
|
|
2633
2634
|
arc.labelVisible = false;
|
|
2634
2635
|
}
|
|
2635
2636
|
arc.angle = (_b = (_a = attribute === null || attribute === void 0 ? void 0 : attribute.textStyle) === null || _a === void 0 ? void 0 : _a.angle) !== null && _b !== void 0 ? _b : 0;
|
|
2637
|
+
arc.labelLine = Object.assign({}, attribute === null || attribute === void 0 ? void 0 : attribute.line);
|
|
2636
2638
|
});
|
|
2637
2639
|
return arcs;
|
|
2638
2640
|
}
|
|
@@ -2641,7 +2643,13 @@
|
|
|
2641
2643
|
const center = { x: (_b = (_a = currentMarks[0].attribute) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0, y: (_d = (_c = currentMarks[0].attribute) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0 };
|
|
2642
2644
|
const centerOffset = (_e = attribute === null || attribute === void 0 ? void 0 : attribute.centerOffset) !== null && _e !== void 0 ? _e : 0;
|
|
2643
2645
|
const plotLayout = { width: center.x * 2, height: center.y * 2 };
|
|
2644
|
-
|
|
2646
|
+
let maxRadius = 0;
|
|
2647
|
+
currentMarks.forEach((currentMark) => {
|
|
2648
|
+
if (currentMark.attribute.outerRadius > maxRadius) {
|
|
2649
|
+
maxRadius = currentMark.attribute.outerRadius;
|
|
2650
|
+
}
|
|
2651
|
+
});
|
|
2652
|
+
const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height);
|
|
2645
2653
|
const line1MinLength = attribute.line.line1MinLength;
|
|
2646
2654
|
const line2MinLength = attribute.line.line2MinLength;
|
|
2647
2655
|
const labelLayoutAlign = (_f = attribute.layout) === null || _f === void 0 ? void 0 : _f.align;
|
|
@@ -2872,7 +2880,13 @@
|
|
|
2872
2880
|
_computePointB(arc, r, attribute, currentMarks) {
|
|
2873
2881
|
var _a, _b, _c, _d, _e;
|
|
2874
2882
|
const labelConfig = attribute;
|
|
2875
|
-
|
|
2883
|
+
let maxRadius = 0;
|
|
2884
|
+
currentMarks.forEach((currentMark) => {
|
|
2885
|
+
if (currentMark.attribute.outerRadius > maxRadius) {
|
|
2886
|
+
maxRadius = currentMark.attribute.outerRadius;
|
|
2887
|
+
}
|
|
2888
|
+
});
|
|
2889
|
+
const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height);
|
|
2876
2890
|
const line1MinLength = labelConfig.line.line1MinLength;
|
|
2877
2891
|
const labelLayout = labelConfig.layout;
|
|
2878
2892
|
if (labelLayout.strategy === 'none') {
|
|
@@ -2911,7 +2925,13 @@
|
|
|
2911
2925
|
var _a, _b, _c, _d, _e;
|
|
2912
2926
|
const center = { x: (_b = (_a = currentMarks[0].attribute) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0, y: (_d = (_c = currentMarks[0].attribute) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0 };
|
|
2913
2927
|
const plotRect = { width: center.x * 2, height: center.y * 2 };
|
|
2914
|
-
|
|
2928
|
+
let maxRadius = 0;
|
|
2929
|
+
currentMarks.forEach((currentMark) => {
|
|
2930
|
+
if (currentMark.attribute.outerRadius > maxRadius) {
|
|
2931
|
+
maxRadius = currentMark.attribute.outerRadius;
|
|
2932
|
+
}
|
|
2933
|
+
});
|
|
2934
|
+
const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height);
|
|
2915
2935
|
const line1MinLength = attribute.line.line1MinLength;
|
|
2916
2936
|
const { width, height } = plotRect;
|
|
2917
2937
|
const centerOffset = (_e = attribute === null || attribute === void 0 ? void 0 : attribute.centerOffset) !== null && _e !== void 0 ? _e : 0;
|
|
@@ -2978,7 +2998,13 @@
|
|
|
2978
2998
|
const labelConfig = attribute;
|
|
2979
2999
|
const layoutArcGap = labelConfig.layoutArcGap;
|
|
2980
3000
|
const line1MinLength = labelConfig.line.line1MinLength;
|
|
2981
|
-
|
|
3001
|
+
let maxRadius = 0;
|
|
3002
|
+
currentMarks.forEach((currentMark) => {
|
|
3003
|
+
if (currentMark.attribute.outerRadius > maxRadius) {
|
|
3004
|
+
maxRadius = currentMark.attribute.outerRadius;
|
|
3005
|
+
}
|
|
3006
|
+
});
|
|
3007
|
+
const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height);
|
|
2982
3008
|
const centerOffset = (_a = attribute === null || attribute === void 0 ? void 0 : attribute.centerOffset) !== null && _a !== void 0 ? _a : 0;
|
|
2983
3009
|
const radius = this.computeRadius(radiusRatio, attribute.width, attribute.height, centerOffset);
|
|
2984
3010
|
const outerR = radius + line1MinLength;
|
|
@@ -3047,13 +3073,13 @@
|
|
|
3047
3073
|
}
|
|
3048
3074
|
}
|
|
3049
3075
|
_labelLine(text) {
|
|
3050
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
3076
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
3051
3077
|
const labelLine = ((_a = text.attribute) === null || _a === void 0 ? void 0 : _a.points)
|
|
3052
3078
|
? vrender.createLine({
|
|
3053
|
-
visible: (_c = (_b = text.attribute) === null || _b === void 0 ? void 0 : _b.visible) !== null &&
|
|
3054
|
-
stroke: (
|
|
3055
|
-
lineWidth: (
|
|
3056
|
-
points: (
|
|
3079
|
+
visible: (_g = (_e = (((_c = (_b = text.attribute) === null || _b === void 0 ? void 0 : _b.line) === null || _c === void 0 ? void 0 : _c.visible) && ((_d = text.attribute) === null || _d === void 0 ? void 0 : _d.visible))) !== null && _e !== void 0 ? _e : (_f = text.attribute) === null || _f === void 0 ? void 0 : _f.visible) !== null && _g !== void 0 ? _g : true,
|
|
3080
|
+
stroke: (_k = (_j = (_h = text.attribute) === null || _h === void 0 ? void 0 : _h.line) === null || _j === void 0 ? void 0 : _j.stroke) !== null && _k !== void 0 ? _k : (_l = text.attribute) === null || _l === void 0 ? void 0 : _l.fill,
|
|
3081
|
+
lineWidth: (_p = (_o = (_m = text.attribute) === null || _m === void 0 ? void 0 : _m.line) === null || _o === void 0 ? void 0 : _o.lineWidth) !== null && _p !== void 0 ? _p : 1,
|
|
3082
|
+
points: (_q = text.attribute) === null || _q === void 0 ? void 0 : _q.points
|
|
3057
3083
|
})
|
|
3058
3084
|
: undefined;
|
|
3059
3085
|
return labelLine;
|
|
@@ -10331,7 +10357,7 @@
|
|
|
10331
10357
|
return new Tag(params ? params.attribute : {});
|
|
10332
10358
|
}
|
|
10333
10359
|
|
|
10334
|
-
const version = "0.15.0-alpha.
|
|
10360
|
+
const version = "0.15.0-alpha.17";
|
|
10335
10361
|
|
|
10336
10362
|
exports.AbstractComponent = AbstractComponent;
|
|
10337
10363
|
exports.ArcInfo = ArcInfo;
|