@visactor/vstory 0.0.17 → 0.0.19
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/dist/index.js +1912 -117
- package/dist/index.min.js +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -4382,6 +4382,11 @@
|
|
|
4382
4382
|
var lowerCamelCaseToMiddle = function lowerCamelCaseToMiddle(str) {
|
|
4383
4383
|
return str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
4384
4384
|
};
|
|
4385
|
+
function toCamelCase(str) {
|
|
4386
|
+
return str.replace(/-([a-z])/g, function (_, letter) {
|
|
4387
|
+
return letter.toUpperCase();
|
|
4388
|
+
});
|
|
4389
|
+
}
|
|
4385
4390
|
|
|
4386
4391
|
/**
|
|
4387
4392
|
* @module helpers
|
|
@@ -7274,7 +7279,8 @@
|
|
|
7274
7279
|
justifyContent: "flex-start",
|
|
7275
7280
|
alignItems: "flex-start",
|
|
7276
7281
|
alignContent: "flex-start",
|
|
7277
|
-
baseOpacity: 1
|
|
7282
|
+
baseOpacity: 1,
|
|
7283
|
+
cornerType: "round"
|
|
7278
7284
|
});
|
|
7279
7285
|
var DefaultGlyphAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
7280
7286
|
path: "",
|
|
@@ -7311,7 +7317,8 @@
|
|
|
7311
7317
|
x1: 0,
|
|
7312
7318
|
y1: 0,
|
|
7313
7319
|
strokeBoundsBuffer: 0,
|
|
7314
|
-
cornerRadius: 0
|
|
7320
|
+
cornerRadius: 0,
|
|
7321
|
+
cornerType: "round"
|
|
7315
7322
|
});
|
|
7316
7323
|
Object.assign(Object.assign({}, DefaultAttribute), {
|
|
7317
7324
|
width: 0,
|
|
@@ -7319,7 +7326,8 @@
|
|
|
7319
7326
|
x1: 0,
|
|
7320
7327
|
y1: 0,
|
|
7321
7328
|
cornerRadius: 0,
|
|
7322
|
-
length: 0
|
|
7329
|
+
length: 0,
|
|
7330
|
+
cornerType: "round"
|
|
7323
7331
|
});
|
|
7324
7332
|
var DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
7325
7333
|
symbolType: "circle",
|
|
@@ -7355,7 +7363,8 @@
|
|
|
7355
7363
|
height: 0
|
|
7356
7364
|
}, DefaultAttribute), {
|
|
7357
7365
|
fill: !0,
|
|
7358
|
-
cornerRadius: 0
|
|
7366
|
+
cornerRadius: 0,
|
|
7367
|
+
cornerType: "round"
|
|
7359
7368
|
});
|
|
7360
7369
|
var DefaultRichTextIconAttribute = Object.assign(Object.assign({}, DefaultImageAttribute), {
|
|
7361
7370
|
backgroundShowMode: "never",
|
|
@@ -10699,6 +10708,13 @@
|
|
|
10699
10708
|
}
|
|
10700
10709
|
}]);
|
|
10701
10710
|
}();
|
|
10711
|
+
function flicker$1(t, n) {
|
|
10712
|
+
var step = 1 / n;
|
|
10713
|
+
var flag = 1;
|
|
10714
|
+
for (; t > step;) t -= step, flag *= -1;
|
|
10715
|
+
var v = flag * t / step;
|
|
10716
|
+
return v > 0 ? v : 1 + v;
|
|
10717
|
+
}
|
|
10702
10718
|
Easing.quadIn = Easing.getPowIn(2), Easing.quadOut = Easing.getPowOut(2), Easing.quadInOut = Easing.getPowInOut(2), Easing.cubicIn = Easing.getPowIn(3), Easing.cubicOut = Easing.getPowOut(3), Easing.cubicInOut = Easing.getPowInOut(3), Easing.quartIn = Easing.getPowIn(4), Easing.quartOut = Easing.getPowOut(4), Easing.quartInOut = Easing.getPowInOut(4), Easing.quintIn = Easing.getPowIn(5), Easing.quintOut = Easing.getPowOut(5), Easing.quintInOut = Easing.getPowInOut(5), Easing.backIn = Easing.getBackIn(1.7), Easing.backOut = Easing.getBackOut(1.7), Easing.backInOut = Easing.getBackInOut(1.7), Easing.elasticIn = Easing.getElasticIn(1, .3), Easing.elasticOut = Easing.getElasticOut(1, .3), Easing.elasticInOut = Easing.getElasticInOut(1, .3 * 1.5), Easing.easeInOutQuad = function (t) {
|
|
10703
10719
|
return (t /= .5) < 1 ? .5 * Math.pow(t, 2) : -.5 * ((t -= 2) * t - 2);
|
|
10704
10720
|
}, Easing.easeOutElastic = function (x) {
|
|
@@ -10708,6 +10724,22 @@
|
|
|
10708
10724
|
var c5 = 2 * Math.PI / 4.5;
|
|
10709
10725
|
return 0 === x ? 0 : 1 === x ? 1 : x < .5 ? -Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1;
|
|
10710
10726
|
};
|
|
10727
|
+
var _loop = function _loop(i) {
|
|
10728
|
+
Easing["flicker".concat(i)] = function (t) {
|
|
10729
|
+
return flicker$1(t, i);
|
|
10730
|
+
};
|
|
10731
|
+
};
|
|
10732
|
+
for (var i$1 = 0; i$1 < 10; i$1++) {
|
|
10733
|
+
_loop(i$1);
|
|
10734
|
+
}
|
|
10735
|
+
var _loop2 = function _loop2(_i) {
|
|
10736
|
+
Easing["aIn".concat(_i)] = function (t) {
|
|
10737
|
+
return _i * t * t + (1 - _i) * t;
|
|
10738
|
+
};
|
|
10739
|
+
};
|
|
10740
|
+
for (var _i = 2; _i < 10; _i++) {
|
|
10741
|
+
_loop2(_i);
|
|
10742
|
+
}
|
|
10711
10743
|
|
|
10712
10744
|
var DefaultTimeline = /*#__PURE__*/function () {
|
|
10713
10745
|
function DefaultTimeline() {
|
|
@@ -11465,6 +11497,54 @@
|
|
|
11465
11497
|
!function (Direction) {
|
|
11466
11498
|
Direction[Direction.LEFT_TO_RIGHT = 0] = "LEFT_TO_RIGHT", Direction[Direction.RIGHT_TO_LEFT = 1] = "RIGHT_TO_LEFT", Direction[Direction.TOP_TO_BOTTOM = 2] = "TOP_TO_BOTTOM", Direction[Direction.BOTTOM_TO_TOP = 3] = "BOTTOM_TO_TOP", Direction[Direction.STROKE = 4] = "STROKE";
|
|
11467
11499
|
}(Direction$1 || (Direction$1 = {}));
|
|
11500
|
+
var InputText = /*#__PURE__*/function (_ACustomAnimate3) {
|
|
11501
|
+
function InputText() {
|
|
11502
|
+
var _this2;
|
|
11503
|
+
_classCallCheck(this, InputText);
|
|
11504
|
+
_this2 = _callSuper(this, InputText, arguments), _this2.fromText = "", _this2.toText = "";
|
|
11505
|
+
return _this2;
|
|
11506
|
+
}
|
|
11507
|
+
_inherits(InputText, _ACustomAnimate3);
|
|
11508
|
+
return _createClass(InputText, [{
|
|
11509
|
+
key: "getEndProps",
|
|
11510
|
+
value: function getEndProps() {
|
|
11511
|
+
return !1 === this.valid ? {} : {
|
|
11512
|
+
text: this.to
|
|
11513
|
+
};
|
|
11514
|
+
}
|
|
11515
|
+
}, {
|
|
11516
|
+
key: "onBind",
|
|
11517
|
+
value: function onBind() {
|
|
11518
|
+
var _a, _b, _c;
|
|
11519
|
+
this.fromText = null !== (_b = null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) && void 0 !== _b ? _b : "", this.toText = (null === (_c = this.to) || void 0 === _c ? void 0 : _c.text) || "", (!this.toText || isArray$3(this.toText) && 0 === this.toText.length) && (this.valid = !1), isArray$3(this.toText) && (this.toText = this.toText.map(function (item) {
|
|
11520
|
+
return (item || "").toString();
|
|
11521
|
+
}));
|
|
11522
|
+
}
|
|
11523
|
+
}, {
|
|
11524
|
+
key: "onEnd",
|
|
11525
|
+
value: function onEnd() {
|
|
11526
|
+
this.target.detachShadow();
|
|
11527
|
+
}
|
|
11528
|
+
}, {
|
|
11529
|
+
key: "onUpdate",
|
|
11530
|
+
value: function onUpdate(end, ratio, out) {
|
|
11531
|
+
if (!1 === this.valid) return;
|
|
11532
|
+
var fromCount = this.fromText.length,
|
|
11533
|
+
toTextIsArray = isArray$3(this.toText),
|
|
11534
|
+
toCount = toTextIsArray ? this.toText.reduce(function (c, t) {
|
|
11535
|
+
return c + (t || "").length;
|
|
11536
|
+
}, 0) : this.toText.length,
|
|
11537
|
+
count = Math.ceil(fromCount + (toCount - fromCount) * ratio);
|
|
11538
|
+
if (toTextIsArray) {
|
|
11539
|
+
out.text = [];
|
|
11540
|
+
var len = 0;
|
|
11541
|
+
this.toText.forEach(function (t) {
|
|
11542
|
+
len + t.length > count ? (out.text.push(t.substr(0, count - len)), len = count) : (out.text.push(t), len += t.length);
|
|
11543
|
+
});
|
|
11544
|
+
} else out.text = this.toText.substr(0, count);
|
|
11545
|
+
}
|
|
11546
|
+
}]);
|
|
11547
|
+
}(ACustomAnimate);
|
|
11468
11548
|
var TagPointsUpdate = /*#__PURE__*/function (_ACustomAnimate7) {
|
|
11469
11549
|
function TagPointsUpdate(from, to, duration, easing, params) {
|
|
11470
11550
|
var _this6;
|
|
@@ -12923,6 +13003,20 @@
|
|
|
12923
13003
|
});
|
|
12924
13004
|
return _color2 && (nextAttributes[key] = _color2), !0;
|
|
12925
13005
|
}
|
|
13006
|
+
if (Array.isArray(nextStepVal) && nextStepVal.length === lastStepVal.length) {
|
|
13007
|
+
var nextList = [];
|
|
13008
|
+
var valid = !0;
|
|
13009
|
+
for (var i = 0; i < nextStepVal.length; i++) {
|
|
13010
|
+
var v = lastStepVal[i],
|
|
13011
|
+
val = v + (nextStepVal[i] - v) * ratio;
|
|
13012
|
+
if (!Number.isFinite(val)) {
|
|
13013
|
+
valid = !1;
|
|
13014
|
+
break;
|
|
13015
|
+
}
|
|
13016
|
+
nextList.push(val);
|
|
13017
|
+
}
|
|
13018
|
+
valid && (nextAttributes[key] = nextList);
|
|
13019
|
+
}
|
|
12926
13020
|
return !1;
|
|
12927
13021
|
}
|
|
12928
13022
|
}, {
|
|
@@ -19358,7 +19452,7 @@
|
|
|
19358
19452
|
var defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
|
|
19359
19453
|
|
|
19360
19454
|
var halfPi$1 = pi$1 / 2;
|
|
19361
|
-
function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
|
|
19455
|
+
function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner, edgeCb) {
|
|
19362
19456
|
var cornerRadius;
|
|
19363
19457
|
if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$3(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs$1(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
|
|
19364
19458
|
var cornerRadiusArr = rectCornerRadius;
|
|
@@ -19393,27 +19487,29 @@
|
|
|
19393
19487
|
rightBottomPoint2 = [rightBottom[0], rightBottom[1] - _cornerRadius[2]],
|
|
19394
19488
|
leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]],
|
|
19395
19489
|
leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
|
|
19396
|
-
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]),
|
|
19397
|
-
edgeCb && edgeCb[0]
|
|
19398
|
-
|
|
19399
|
-
|
|
19400
|
-
|
|
19401
|
-
|
|
19402
|
-
|
|
19403
|
-
|
|
19404
|
-
|
|
19405
|
-
|
|
19406
|
-
|
|
19407
|
-
|
|
19408
|
-
|
|
19409
|
-
|
|
19410
|
-
|
|
19411
|
-
|
|
19412
|
-
|
|
19413
|
-
|
|
19414
|
-
|
|
19415
|
-
|
|
19416
|
-
|
|
19490
|
+
if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), roundCorner) {
|
|
19491
|
+
if (edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
|
|
19492
|
+
edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
|
|
19493
|
+
var centerX = rightTopPoint1[0],
|
|
19494
|
+
centerY = rightTopPoint1[1] + _cornerRadius[1];
|
|
19495
|
+
path.arc(centerX, centerY, _cornerRadius[1], -halfPi$1, 0, !1);
|
|
19496
|
+
}
|
|
19497
|
+
if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
|
|
19498
|
+
var _centerX = rightBottomPoint2[0] - _cornerRadius[2],
|
|
19499
|
+
_centerY = rightBottomPoint2[1];
|
|
19500
|
+
edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(_centerX, _centerY, _cornerRadius[2], 0, halfPi$1, !1);
|
|
19501
|
+
}
|
|
19502
|
+
if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
|
|
19503
|
+
var _centerX2 = leftBottomPoint1[0],
|
|
19504
|
+
_centerY2 = leftBottomPoint1[1] - _cornerRadius[3];
|
|
19505
|
+
edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(_centerX2, _centerY2, _cornerRadius[3], halfPi$1, pi$1, !1);
|
|
19506
|
+
}
|
|
19507
|
+
if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
|
|
19508
|
+
var _centerX3 = leftTopPoint1[0],
|
|
19509
|
+
_centerY3 = leftTopPoint1[1] + _cornerRadius[0];
|
|
19510
|
+
edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(_centerX3, _centerY3, _cornerRadius[0], pi$1, pi$1 + halfPi$1, !1);
|
|
19511
|
+
}
|
|
19512
|
+
} else edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint1[0], rightTopPoint1[1], rightBottomPoint1[0], rightBottomPoint1[1]) : path.lineTo(rightBottomPoint1[0], rightBottomPoint1[1]), edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), edgeCb && edgeCb[2] ? edgeCb[2](leftBottomPoint1[0], leftBottomPoint1[1], leftTopPoint1[0], leftTopPoint1[1]) : path.lineTo(leftTopPoint1[0], leftTopPoint1[1]);
|
|
19417
19513
|
return !edgeCb && path.closePath(), path;
|
|
19418
19514
|
}
|
|
19419
19515
|
|
|
@@ -19441,6 +19537,8 @@
|
|
|
19441
19537
|
var _rect$attribute2 = rect.attribute,
|
|
19442
19538
|
_rect$attribute2$corn = _rect$attribute2.cornerRadius,
|
|
19443
19539
|
cornerRadius = _rect$attribute2$corn === void 0 ? rectAttribute.cornerRadius : _rect$attribute2$corn,
|
|
19540
|
+
_rect$attribute2$corn2 = _rect$attribute2.cornerType,
|
|
19541
|
+
cornerType = _rect$attribute2$corn2 === void 0 ? rectAttribute.cornerType : _rect$attribute2$corn2,
|
|
19444
19542
|
_rect$attribute2$opac = _rect$attribute2.opacity,
|
|
19445
19543
|
opacity = _rect$attribute2$opac === void 0 ? rectAttribute.opacity : _rect$attribute2$opac,
|
|
19446
19544
|
_rect$attribute2$x = _rect$attribute2.x,
|
|
@@ -19470,7 +19568,7 @@
|
|
|
19470
19568
|
dw = 2 * d;
|
|
19471
19569
|
if (0 === cornerRadius || isArray$3(cornerRadius) && cornerRadius.every(function (num) {
|
|
19472
19570
|
return 0 === num;
|
|
19473
|
-
}) ? (context.beginPath(), context.rect(nextX, nextY, width - sign * dw, height - sign * dw)) : (context.beginPath(), createRectPath(context, nextX, nextY, width - sign * dw, height - sign * dw, cornerRadius)), context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), strokeCb) strokeCb(context, borderStyle, rectAttribute[key]);else if (doStroke) {
|
|
19571
|
+
}) ? (context.beginPath(), context.rect(nextX, nextY, width - sign * dw, height - sign * dw)) : (context.beginPath(), createRectPath(context, nextX, nextY, width - sign * dw, height - sign * dw, cornerRadius, "round" === cornerType)), context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), strokeCb) strokeCb(context, borderStyle, rectAttribute[key]);else if (doStroke) {
|
|
19474
19572
|
var lastOpacity = rectAttribute[key].opacity;
|
|
19475
19573
|
rectAttribute[key].opacity = opacity, context.setStrokeStyle(rect, borderStyle, (originX - x) / scaleX, (originY - y) / scaleY, rectAttribute[key]), rectAttribute[key].opacity = lastOpacity, context.stroke();
|
|
19476
19574
|
}
|
|
@@ -19514,7 +19612,9 @@
|
|
|
19514
19612
|
_rect$attribute4$stro = _rect$attribute4.stroke,
|
|
19515
19613
|
stroke = _rect$attribute4$stro === void 0 ? groupAttribute.stroke : _rect$attribute4$stro,
|
|
19516
19614
|
_rect$attribute4$corn = _rect$attribute4.cornerRadius,
|
|
19517
|
-
cornerRadius = _rect$attribute4$corn === void 0 ? groupAttribute.cornerRadius : _rect$attribute4$corn
|
|
19615
|
+
cornerRadius = _rect$attribute4$corn === void 0 ? groupAttribute.cornerRadius : _rect$attribute4$corn,
|
|
19616
|
+
_rect$attribute4$corn2 = _rect$attribute4.cornerType,
|
|
19617
|
+
cornerType = _rect$attribute4$corn2 === void 0 ? groupAttribute.cornerType : _rect$attribute4$corn2;
|
|
19518
19618
|
var _rect$attribute5 = rect.attribute,
|
|
19519
19619
|
width = _rect$attribute5.width,
|
|
19520
19620
|
height = _rect$attribute5.height;
|
|
@@ -19526,7 +19626,7 @@
|
|
|
19526
19626
|
}))) {
|
|
19527
19627
|
var lastStroke,
|
|
19528
19628
|
lastStrokeI = 0;
|
|
19529
|
-
return createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map(function (_, i) {
|
|
19629
|
+
return createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType, new Array(4).fill(0).map(function (_, i) {
|
|
19530
19630
|
return function (x1, y1, x2, y2) {
|
|
19531
19631
|
stroke[i] && (lastStrokeI === i - 1 && stroke[i] === lastStroke || (context.setStrokeStyle(rect, Object.assign(Object.assign({}, rect.attribute), {
|
|
19532
19632
|
stroke: stroke[i]
|
|
@@ -19597,7 +19697,7 @@
|
|
|
19597
19697
|
_y = _getActualPosition.y,
|
|
19598
19698
|
width = _getActualPosition.width,
|
|
19599
19699
|
height = _getActualPosition.height;
|
|
19600
|
-
cornerRadius ? createRectPath(context, _x - expandX, _y - expandY, width + 2 * expandX, height + 2 * expandY, cornerRadius) : context.rect(_x - expandX, _y - expandY, width + 2 * expandX, height + 2 * expandY), context.globalAlpha = 1, fill && (context.fillStyle = fill, context.fill()), stroke && lineWidth > 0 && (context.lineWidth = lineWidth, context.strokeStyle = stroke, context.stroke());
|
|
19700
|
+
cornerRadius ? createRectPath(context, _x - expandX, _y - expandY, width + 2 * expandX, height + 2 * expandY, cornerRadius, !0) : context.rect(_x - expandX, _y - expandY, width + 2 * expandX, height + 2 * expandY), context.globalAlpha = 1, fill && (context.fillStyle = fill, context.fill()), stroke && lineWidth > 0 && (context.lineWidth = lineWidth, context.strokeStyle = stroke, context.stroke());
|
|
19601
19701
|
} else {
|
|
19602
19702
|
context.beginPath();
|
|
19603
19703
|
var _b = graphic.AABBBounds;
|
|
@@ -20831,6 +20931,8 @@
|
|
|
20831
20931
|
stroke = _rect$attribute$strok === void 0 ? rectAttribute.stroke : _rect$attribute$strok,
|
|
20832
20932
|
_rect$attribute$corne = _rect$attribute.cornerRadius,
|
|
20833
20933
|
cornerRadius = _rect$attribute$corne === void 0 ? rectAttribute.cornerRadius : _rect$attribute$corne,
|
|
20934
|
+
_rect$attribute$corne2 = _rect$attribute.cornerType,
|
|
20935
|
+
cornerType = _rect$attribute$corne2 === void 0 ? rectAttribute.cornerType : _rect$attribute$corne2,
|
|
20834
20936
|
_rect$attribute$opaci = _rect$attribute.opacity,
|
|
20835
20937
|
opacity = _rect$attribute$opaci === void 0 ? rectAttribute.opacity : _rect$attribute$opaci,
|
|
20836
20938
|
_rect$attribute$fillO = _rect$attribute.fillOpacity,
|
|
@@ -20862,7 +20964,7 @@
|
|
|
20862
20964
|
if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
|
|
20863
20965
|
0 === cornerRadius || isArray$3(cornerRadius) && cornerRadius.every(function (num) {
|
|
20864
20966
|
return 0 === num;
|
|
20865
|
-
}) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
|
|
20967
|
+
}) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType));
|
|
20866
20968
|
var doFillOrStroke = {
|
|
20867
20969
|
doFill: doFill,
|
|
20868
20970
|
doStroke: doStroke
|
|
@@ -21070,7 +21172,7 @@
|
|
|
21070
21172
|
context.highPerformanceSave(), onlyTranslate && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
21071
21173
|
} else {
|
|
21072
21174
|
var backgroundCornerRadius = graphic.attribute.backgroundCornerRadius;
|
|
21073
|
-
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
21175
|
+
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
21074
21176
|
}
|
|
21075
21177
|
shouldReCalBounds && boundsAllocate.free(b), restore();
|
|
21076
21178
|
}
|
|
@@ -21421,6 +21523,8 @@
|
|
|
21421
21523
|
visible = _group$attribute$visi === void 0 ? groupAttribute.visible : _group$attribute$visi,
|
|
21422
21524
|
_group$attribute$fill3 = _group$attribute.fillStrokeOrder,
|
|
21423
21525
|
fillStrokeOrder = _group$attribute$fill3 === void 0 ? groupAttribute.fillStrokeOrder : _group$attribute$fill3,
|
|
21526
|
+
_group$attribute$corn2 = _group$attribute.cornerType,
|
|
21527
|
+
cornerType = _group$attribute$corn2 === void 0 ? groupAttribute.cornerType : _group$attribute$corn2,
|
|
21424
21528
|
_group$attribute$x = _group$attribute.x,
|
|
21425
21529
|
originX = _group$attribute$x === void 0 ? groupAttribute.x : _group$attribute$x,
|
|
21426
21530
|
_group$attribute$y = _group$attribute.y,
|
|
@@ -21443,7 +21547,7 @@
|
|
|
21443
21547
|
}), context.disableFill = disableFill, context.disableStroke = disableStroke, context.disableBeginPath = disableBeginPath;
|
|
21444
21548
|
} else 0 === cornerRadius || isArray$3(cornerRadius) && cornerRadius.every(function (num) {
|
|
21445
21549
|
return 0 === num;
|
|
21446
|
-
}) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
|
|
21550
|
+
}) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType));
|
|
21447
21551
|
this._groupRenderContribitions || (this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution));
|
|
21448
21552
|
var doFillOrStroke = {
|
|
21449
21553
|
doFill: doFill,
|
|
@@ -21545,6 +21649,8 @@
|
|
|
21545
21649
|
cornerRadius = _image$attribute$corn === void 0 ? imageAttribute.cornerRadius : _image$attribute$corn,
|
|
21546
21650
|
_image$attribute$fill = _image$attribute.fillStrokeOrder,
|
|
21547
21651
|
fillStrokeOrder = _image$attribute$fill === void 0 ? imageAttribute.fillStrokeOrder : _image$attribute$fill,
|
|
21652
|
+
_image$attribute$corn2 = _image$attribute.cornerType,
|
|
21653
|
+
cornerType = _image$attribute$corn2 === void 0 ? imageAttribute.cornerType : _image$attribute$corn2,
|
|
21548
21654
|
url = _image$attribute.image,
|
|
21549
21655
|
data = this.valid(image, imageAttribute, fillCb);
|
|
21550
21656
|
if (!data) return;
|
|
@@ -21561,7 +21667,7 @@
|
|
|
21561
21667
|
var needRestore = !1;
|
|
21562
21668
|
0 === cornerRadius || isArray$3(cornerRadius) && cornerRadius.every(function (num) {
|
|
21563
21669
|
return 0 === num;
|
|
21564
|
-
}) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
|
|
21670
|
+
}) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
|
|
21565
21671
|
var repeat = 0;
|
|
21566
21672
|
if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
|
|
21567
21673
|
var pattern = context.createPattern(res.data, repeatStr[repeat]);
|
|
@@ -24783,7 +24889,7 @@
|
|
|
24783
24889
|
if (margin && (x += icon._marginArray[3], y += icon._marginArray[0]), icon._hovered) {
|
|
24784
24890
|
var expandX = (backgroundWidth - width) / 2,
|
|
24785
24891
|
expandY = (backgroundHeight - height) / 2;
|
|
24786
|
-
0 === backgroundRadius ? (context.beginPath(), context.rect(x - expandX, y - expandY, backgroundWidth, backgroundHeight)) : (context.beginPath(), createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius)), backgroundFill && (context.globalAlpha = backgroundFillOpacity, context.fillStyle = backgroundFill, context.fill()), backgroundStroke && (context.globalAlpha = backgroundStrokeOpacity, context.strokeStyle = backgroundStroke, context.stroke());
|
|
24892
|
+
0 === backgroundRadius ? (context.beginPath(), context.rect(x - expandX, y - expandY, backgroundWidth, backgroundHeight)) : (context.beginPath(), createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius, !0)), backgroundFill && (context.globalAlpha = backgroundFillOpacity, context.fillStyle = backgroundFill, context.fill()), backgroundStroke && (context.globalAlpha = backgroundStrokeOpacity, context.strokeStyle = backgroundStroke, context.stroke());
|
|
24787
24893
|
}
|
|
24788
24894
|
var res = url && (null === (_a = null == icon ? void 0 : icon.resources) || void 0 === _a ? void 0 : _a.get(url));
|
|
24789
24895
|
res && "success" === res.state && (context.globalAlpha = opacity, context.drawImage(res.data, x, y, width, height));
|
|
@@ -26793,13 +26899,15 @@
|
|
|
26793
26899
|
lineJoin = _attribute$lineJoin === void 0 ? defaultParams.lineJoin : _attribute$lineJoin,
|
|
26794
26900
|
_attribute$lineDash = attribute.lineDash,
|
|
26795
26901
|
lineDash = _attribute$lineDash === void 0 ? defaultParams.lineDash : _attribute$lineDash,
|
|
26902
|
+
_attribute$lineDashOf = attribute.lineDashOffset,
|
|
26903
|
+
lineDashOffset = _attribute$lineDashOf === void 0 ? defaultParams.lineDashOffset : _attribute$lineDashOf,
|
|
26796
26904
|
_attribute$lineCap = attribute.lineCap,
|
|
26797
26905
|
lineCap = _attribute$lineCap === void 0 ? defaultParams.lineCap : _attribute$lineCap,
|
|
26798
26906
|
_attribute$miterLimit = attribute.miterLimit,
|
|
26799
26907
|
miterLimit = _attribute$miterLimit === void 0 ? defaultParams.miterLimit : _attribute$miterLimit,
|
|
26800
26908
|
_attribute$keepStroke = attribute.keepStrokeScale,
|
|
26801
26909
|
keepStrokeScale = _attribute$keepStroke === void 0 ? defaultParams.keepStrokeScale : _attribute$keepStroke;
|
|
26802
|
-
_context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
26910
|
+
_context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && (_context.setLineDash(lineDash), _context.lineDashOffset = lineDashOffset), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
26803
26911
|
}
|
|
26804
26912
|
}
|
|
26805
26913
|
}, {
|
|
@@ -35083,6 +35191,180 @@
|
|
|
35083
35191
|
}), data;
|
|
35084
35192
|
};
|
|
35085
35193
|
|
|
35194
|
+
var tagNameToType = {
|
|
35195
|
+
svg: "group",
|
|
35196
|
+
rect: "rect",
|
|
35197
|
+
line: "rule",
|
|
35198
|
+
polygon: "polygon",
|
|
35199
|
+
path: "path",
|
|
35200
|
+
polyline: "line",
|
|
35201
|
+
g: "group",
|
|
35202
|
+
circle: "arc",
|
|
35203
|
+
ellipse: "arc"
|
|
35204
|
+
},
|
|
35205
|
+
validTagName = Object.keys(tagNameToType),
|
|
35206
|
+
validGroupNode = ["g", "svg", "text", "tspan", "switch"],
|
|
35207
|
+
validTextAttributes = ["font-size", "font-family", "font-weight", "font-style", "text-align", "text-anchor"],
|
|
35208
|
+
validCircleAttributes = ["cx", "cy", "r"],
|
|
35209
|
+
validEllipseAttributes = ["cx", "cy", "rx", "ry"],
|
|
35210
|
+
validLineAttributes = ["x1", "x2", "y1", "y2"],
|
|
35211
|
+
validAttributes = ["visibility", "x", "y", "width", "height", "d", "points", "stroke", "stroke-width", "fill", "fill-opacity", "stroke-opacity"].concat(validTextAttributes, validCircleAttributes, validEllipseAttributes, validLineAttributes),
|
|
35212
|
+
validInheritAttributes = ["visible", "fill", "stroke", "stroke-width", "fill-opacity", "stroke-opacity"].concat(validTextAttributes),
|
|
35213
|
+
numberReg = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;
|
|
35214
|
+
function splitNumberSequence(rawStr) {
|
|
35215
|
+
return rawStr.match(numberReg) || [];
|
|
35216
|
+
}
|
|
35217
|
+
var svgParser = function svgParser(data) {
|
|
35218
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
35219
|
+
var parser = option.customDOMParser;
|
|
35220
|
+
if (parser || (null === window || void 0 === window ? void 0 : window.DOMParser) && (parser = function parser(svg) {
|
|
35221
|
+
return new DOMParser().parseFromString(svg, "text/xml");
|
|
35222
|
+
}), !parser) throw new Error("No Available DOMParser!");
|
|
35223
|
+
var svg = parser(data);
|
|
35224
|
+
var node = 9 === svg.nodeType ? svg.firstChild : svg;
|
|
35225
|
+
for (; node && ("svg" !== node.nodeName.toLowerCase() || 1 !== node.nodeType);) node = node.nextSibling;
|
|
35226
|
+
if (node) {
|
|
35227
|
+
return parseSvgNode(node);
|
|
35228
|
+
}
|
|
35229
|
+
return null;
|
|
35230
|
+
};
|
|
35231
|
+
var idx = 0;
|
|
35232
|
+
function parseSvgNode(svg) {
|
|
35233
|
+
var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
35234
|
+
var elements = [],
|
|
35235
|
+
root = parseNode(svg, null);
|
|
35236
|
+
var width = parseFloat(svg.getAttribute("width") || opt.width),
|
|
35237
|
+
height = parseFloat(svg.getAttribute("height") || opt.height);
|
|
35238
|
+
!isValidNumber$1(width) && (width = null), !isValidNumber$1(height) && (height = null);
|
|
35239
|
+
var viewBox = svg.getAttribute("viewBox");
|
|
35240
|
+
var viewBoxRect;
|
|
35241
|
+
if (viewBox) {
|
|
35242
|
+
var viewBoxArr = splitNumberSequence(viewBox);
|
|
35243
|
+
if (viewBoxArr.length >= 4 && (viewBoxRect = {
|
|
35244
|
+
x: parseFloat(viewBoxArr[0] || 0),
|
|
35245
|
+
y: parseFloat(viewBoxArr[1] || 0),
|
|
35246
|
+
width: parseFloat(viewBoxArr[2]),
|
|
35247
|
+
height: parseFloat(viewBoxArr[3])
|
|
35248
|
+
}, width || height)) {
|
|
35249
|
+
var boundingRect = {
|
|
35250
|
+
x: 0,
|
|
35251
|
+
y: 0,
|
|
35252
|
+
width: width,
|
|
35253
|
+
height: height
|
|
35254
|
+
},
|
|
35255
|
+
scaleX = boundingRect.width / viewBoxRect.width,
|
|
35256
|
+
scaleY = boundingRect.height / viewBoxRect.height,
|
|
35257
|
+
scale = Math.min(scaleX, scaleY),
|
|
35258
|
+
transLateX = -(viewBoxRect.x + viewBoxRect.width / 2) * scale + (boundingRect.x + boundingRect.width / 2),
|
|
35259
|
+
transLateY = -(viewBoxRect.y + viewBoxRect.height / 2) * scale + (boundingRect.y + boundingRect.height / 2),
|
|
35260
|
+
viewBoxTransform = new Matrix().translate(transLateX, transLateY).scale(scale, scale);
|
|
35261
|
+
root.transform = viewBoxTransform;
|
|
35262
|
+
}
|
|
35263
|
+
}
|
|
35264
|
+
return traverse(svg, root, elements), {
|
|
35265
|
+
root: root,
|
|
35266
|
+
width: width,
|
|
35267
|
+
height: height,
|
|
35268
|
+
elements: elements,
|
|
35269
|
+
viewBoxRect: viewBoxRect
|
|
35270
|
+
};
|
|
35271
|
+
}
|
|
35272
|
+
function parseInheritAttributes(parsedElement) {
|
|
35273
|
+
var inheritedAttrs;
|
|
35274
|
+
var parent = parsedElement.parent,
|
|
35275
|
+
attributes = parsedElement.attributes,
|
|
35276
|
+
parse = function parse(parent) {
|
|
35277
|
+
return parent ? validInheritAttributes.reduce(function (acc, attrName) {
|
|
35278
|
+
var camelAttrName = toCamelCase(attrName);
|
|
35279
|
+
return isValid$3(parent[camelAttrName]) && (acc[camelAttrName] = parent[camelAttrName]), acc;
|
|
35280
|
+
}, {}) : {};
|
|
35281
|
+
};
|
|
35282
|
+
return parent ? (parent._inheritStyle || (parent._inheritStyle = parse(parent.attributes)), inheritedAttrs = merge$2({}, parent._inheritStyle, parse(attributes))) : inheritedAttrs = parse(attributes), inheritedAttrs;
|
|
35283
|
+
}
|
|
35284
|
+
function parseAttributes(el) {
|
|
35285
|
+
var _a, _b, _c;
|
|
35286
|
+
var attrs = {},
|
|
35287
|
+
attributes = null !== (_a = el.attributes) && void 0 !== _a ? _a : {},
|
|
35288
|
+
style = null !== (_b = el.style) && void 0 !== _b ? _b : {};
|
|
35289
|
+
for (var i = 0; i < validAttributes.length; i++) {
|
|
35290
|
+
var attrName = validAttributes[i],
|
|
35291
|
+
attrValue = isValid$3(style[attrName]) && "" !== style[attrName] ? style[attrName] : null === (_c = attributes[attrName]) || void 0 === _c ? void 0 : _c.value;
|
|
35292
|
+
isValid$3(attrValue) && (attrs[toCamelCase(attrName)] = isNaN(+attrValue) ? attrValue : parseFloat(attrValue));
|
|
35293
|
+
}
|
|
35294
|
+
return "none" === style.display && (attrs.visible = !1), ["fontSize", "strokeWidth", "width", "height"].forEach(function (attr) {
|
|
35295
|
+
var attrValue = attrs[attr];
|
|
35296
|
+
isString$3(attrs[attr]) && (attrs[attr] = parseFloat(attrValue));
|
|
35297
|
+
}), attrs;
|
|
35298
|
+
}
|
|
35299
|
+
function parseNode(node, parent) {
|
|
35300
|
+
var _a, _b, _c, _d, _e;
|
|
35301
|
+
var tagName = null === (_a = node.tagName) || void 0 === _a ? void 0 : _a.toLowerCase();
|
|
35302
|
+
if (3 === node.nodeType || "text" === tagName || "tspan" === tagName) return parseText(node, parent);
|
|
35303
|
+
if (!validTagName.includes(tagName)) return null;
|
|
35304
|
+
var parsed = {
|
|
35305
|
+
tagName: tagName,
|
|
35306
|
+
graphicType: tagNameToType[tagName],
|
|
35307
|
+
attributes: parseAttributes(node),
|
|
35308
|
+
parent: parent,
|
|
35309
|
+
name: null !== (_b = node.getAttribute("name")) && void 0 !== _b ? _b : null === (_c = null == parent ? void 0 : parent.attributes) || void 0 === _c ? void 0 : _c.name,
|
|
35310
|
+
id: null !== (_d = node.getAttribute("id")) && void 0 !== _d ? _d : "".concat(tagName, "-").concat(idx++),
|
|
35311
|
+
transform: parseTransform$1(node)
|
|
35312
|
+
};
|
|
35313
|
+
return parsed._inheritStyle = parseInheritAttributes(parsed), parent && !isValid$3(parsed.name) && (parsed._nameFromParent = null !== (_e = parent.name) && void 0 !== _e ? _e : parent._nameFromParent), parsed;
|
|
35314
|
+
}
|
|
35315
|
+
function parseText(node, parent) {
|
|
35316
|
+
var _a, _b, _c, _d, _e, _f;
|
|
35317
|
+
if (!parent) return null;
|
|
35318
|
+
var tagName = null === (_a = node.tagName) || void 0 === _a ? void 0 : _a.toLowerCase();
|
|
35319
|
+
if (!tagName && "group" !== parent.graphicType) return null;
|
|
35320
|
+
var nodeAsGroup = "text" === tagName || "tspan" === tagName,
|
|
35321
|
+
elType = nodeAsGroup ? "group" : "text",
|
|
35322
|
+
value = nodeAsGroup || null === (_b = node.textContent) || void 0 === _b ? void 0 : _b.replace(/\n/g, " ").replace(/\s+/g, " ");
|
|
35323
|
+
if (" " === value) return null;
|
|
35324
|
+
var parsed;
|
|
35325
|
+
return parsed = nodeAsGroup ? {
|
|
35326
|
+
tagName: tagName,
|
|
35327
|
+
graphicType: elType,
|
|
35328
|
+
attributes: parseAttributes(node),
|
|
35329
|
+
parent: parent,
|
|
35330
|
+
name: node.getAttribute("name"),
|
|
35331
|
+
id: null !== (_c = node.getAttribute("id")) && void 0 !== _c ? _c : "".concat(tagName, "-").concat(idx++),
|
|
35332
|
+
transform: parseTransform$1(node),
|
|
35333
|
+
value: value
|
|
35334
|
+
} : {
|
|
35335
|
+
tagName: tagName,
|
|
35336
|
+
graphicType: "text",
|
|
35337
|
+
attributes: parseAttributes(node),
|
|
35338
|
+
parent: parent,
|
|
35339
|
+
name: null == parent ? void 0 : parent.name,
|
|
35340
|
+
id: null !== (_e = null === (_d = node.getAttribute) || void 0 === _d ? void 0 : _d.call(node, "id")) && void 0 !== _e ? _e : "".concat(tagName, "-").concat(idx++),
|
|
35341
|
+
value: value
|
|
35342
|
+
}, parsed._inheritStyle = parseInheritAttributes(parsed), isValid$3(parsed.name) || (parsed._nameFromParent = null !== (_f = parent.name) && void 0 !== _f ? _f : parent._nameFromParent), nodeAsGroup ? parent._textGroupStyle ? parsed._textGroupStyle = merge$2({}, parent._textGroupStyle, parseAttributes(node)) : parsed._textGroupStyle = parseAttributes(node) : parsed.attributes = parsed._inheritStyle, parsed;
|
|
35343
|
+
}
|
|
35344
|
+
function parseTransform$1(node) {
|
|
35345
|
+
var _a, _b;
|
|
35346
|
+
var transforms = null === (_a = node.transform) || void 0 === _a ? void 0 : _a.baseVal;
|
|
35347
|
+
if (!transforms) return null;
|
|
35348
|
+
var matrix = null === (_b = transforms.consolidate()) || void 0 === _b ? void 0 : _b.matrix;
|
|
35349
|
+
if (!matrix) return null;
|
|
35350
|
+
var a = matrix.a,
|
|
35351
|
+
b = matrix.b,
|
|
35352
|
+
c = matrix.c,
|
|
35353
|
+
d = matrix.d,
|
|
35354
|
+
e = matrix.e,
|
|
35355
|
+
f = matrix.f;
|
|
35356
|
+
return new Matrix(a, b, c, d, e, f);
|
|
35357
|
+
}
|
|
35358
|
+
function traverse(node, parsedParent) {
|
|
35359
|
+
var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
35360
|
+
var _a;
|
|
35361
|
+
if (!node) return;
|
|
35362
|
+
var parseResult;
|
|
35363
|
+
"svg" !== node.nodeName && (parseResult = parseNode(node, parsedParent)), parseResult && result.push(parseResult);
|
|
35364
|
+
var child = validGroupNode.includes(null === (_a = node.tagName) || void 0 === _a ? void 0 : _a.toLocaleLowerCase()) ? node.firstChild : null;
|
|
35365
|
+
for (; child;) traverse(child, null != parseResult ? parseResult : parsedParent, result), child = child.nextSibling;
|
|
35366
|
+
}
|
|
35367
|
+
|
|
35086
35368
|
var idIndex = 0;
|
|
35087
35369
|
var maxId = 1e8;
|
|
35088
35370
|
function getUUID() {
|
|
@@ -36894,6 +37176,20 @@
|
|
|
36894
37176
|
};
|
|
36895
37177
|
var _tBounds = new AABBBounds();
|
|
36896
37178
|
loadPoptipComponent();
|
|
37179
|
+
var tlStr = "M -0.5 -0.5, L -0.5 0.5, L 0.5 -0.5, Z",
|
|
37180
|
+
blStr = "M -0.5 -0.5, L -0.5 0.5, L 0.5 0.5, Z",
|
|
37181
|
+
trStr = "M -0.5 -0.5, L 0.5 -0.5, L 0.5 0.5, Z",
|
|
37182
|
+
brStr = "M 0.5 -0.5, L 0.5 0.5, L -0.5 0.5, Z",
|
|
37183
|
+
conciseSymbolMap = {
|
|
37184
|
+
tl: tlStr,
|
|
37185
|
+
tr: trStr,
|
|
37186
|
+
bl: blStr,
|
|
37187
|
+
br: brStr,
|
|
37188
|
+
lt: tlStr,
|
|
37189
|
+
lb: blStr,
|
|
37190
|
+
rt: trStr,
|
|
37191
|
+
rb: brStr
|
|
37192
|
+
};
|
|
36897
37193
|
var PopTip = /*#__PURE__*/function (_AbstractComponent) {
|
|
36898
37194
|
function PopTip(attributes, options) {
|
|
36899
37195
|
var _this;
|
|
@@ -36905,15 +37201,20 @@
|
|
|
36905
37201
|
return _createClass(PopTip, [{
|
|
36906
37202
|
key: "render",
|
|
36907
37203
|
value: function render() {
|
|
36908
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
37204
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
36909
37205
|
var _this$attribute = this.attribute,
|
|
36910
37206
|
_this$attribute$title = _this$attribute.titleStyle,
|
|
36911
37207
|
titleStyle = _this$attribute$title === void 0 ? {} : _this$attribute$title,
|
|
36912
37208
|
position = _this$attribute.position,
|
|
36913
37209
|
_this$attribute$conte = _this$attribute.contentStyle,
|
|
36914
37210
|
contentStyle = _this$attribute$conte === void 0 ? {} : _this$attribute$conte,
|
|
36915
|
-
|
|
36916
|
-
|
|
37211
|
+
panel = _this$attribute.panel,
|
|
37212
|
+
logoSymbol = _this$attribute.logoSymbol,
|
|
37213
|
+
logoText = _this$attribute.logoText,
|
|
37214
|
+
_this$attribute$logoT = _this$attribute.logoTextStyle,
|
|
37215
|
+
logoTextStyle = _this$attribute$logoT === void 0 ? {} : _this$attribute$logoT,
|
|
37216
|
+
_this$attribute$trian = _this$attribute.triangleMode,
|
|
37217
|
+
triangleMode = _this$attribute$trian === void 0 ? "default" : _this$attribute$trian,
|
|
36917
37218
|
_this$attribute$space = _this$attribute.space,
|
|
36918
37219
|
space = _this$attribute$space === void 0 ? 4 : _this$attribute$space,
|
|
36919
37220
|
_this$attribute$minWi = _this$attribute.minWidth,
|
|
@@ -36940,8 +37241,9 @@
|
|
|
36940
37241
|
x: 0,
|
|
36941
37242
|
y: 0,
|
|
36942
37243
|
zIndex: 1
|
|
36943
|
-
}, "group")
|
|
36944
|
-
|
|
37244
|
+
}, "group");
|
|
37245
|
+
this.group = group;
|
|
37246
|
+
var maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3],
|
|
36945
37247
|
titleVisible = isValid$3(title) && !1 !== visible,
|
|
36946
37248
|
titleAttrs = Object.assign(Object.assign({
|
|
36947
37249
|
text: isArray$3(title) ? title : [title],
|
|
@@ -36978,13 +37280,24 @@
|
|
|
36978
37280
|
var contentBounds = contentShape.AABBBounds,
|
|
36979
37281
|
contentHeight = contentBounds.height(),
|
|
36980
37282
|
contentWidth = contentBounds.width();
|
|
36981
|
-
contentVisible && (height += contentHeight);
|
|
37283
|
+
contentVisible && (height += contentHeight), this.titleShape = titleShape, this.contentShape = contentShape;
|
|
36982
37284
|
var popTipWidth = max$1(titleWidth + parsedPadding[1] + parsedPadding[3], contentWidth + parsedPadding[1] + parsedPadding[3]);
|
|
36983
37285
|
popTipWidth > maxWidth ? popTipWidth = maxWidth : popTipWidth < minWidth && (popTipWidth = minWidth);
|
|
36984
37286
|
var poptipHeight = parsedPadding[0] + parsedPadding[2] + height;
|
|
36985
37287
|
var bgVisible = panel.visible,
|
|
36986
|
-
|
|
36987
|
-
|
|
37288
|
+
square = panel.square,
|
|
37289
|
+
backgroundStyle = __rest$v(panel, ["visible", "square"]);
|
|
37290
|
+
if (square) {
|
|
37291
|
+
var maxWH = max$1(popTipWidth, poptipHeight);
|
|
37292
|
+
popTipWidth = maxWH;
|
|
37293
|
+
var deltaH = maxWH - poptipHeight;
|
|
37294
|
+
poptipHeight = maxWH, titleShape.setAttributes({
|
|
37295
|
+
dy: deltaH / 2
|
|
37296
|
+
}), contentShape.setAttributes({
|
|
37297
|
+
dy: deltaH / 2
|
|
37298
|
+
});
|
|
37299
|
+
}
|
|
37300
|
+
var symbolSize = null !== (_a = backgroundStyle.size) && void 0 !== _a ? _a : 12,
|
|
36988
37301
|
spaceSize = isArray$3(symbolSize) ? [symbolSize[0] + (null !== (_b = backgroundStyle.space) && void 0 !== _b ? _b : 0), symbolSize[1] + (null !== (_c = backgroundStyle.space) && void 0 !== _c ? _c : 0)] : symbolSize + (null !== (_d = backgroundStyle.space) && void 0 !== _d ? _d : 0),
|
|
36989
37302
|
lineWidth = null !== (_e = backgroundStyle.lineWidth) && void 0 !== _e ? _e : 1,
|
|
36990
37303
|
range = this.stage ? [null !== (_f = this.stage.viewWidth) && void 0 !== _f ? _f : this.stage.width, null !== (_g = this.stage.viewHeight) && void 0 !== _g ? _g : this.stage.height] : void 0;
|
|
@@ -37004,42 +37317,76 @@
|
|
|
37004
37317
|
var maxBBoxI,
|
|
37005
37318
|
maxBBoxSize = -1 / 0;
|
|
37006
37319
|
for (var i = 0; i < this.positionList.length + 1; i++) {
|
|
37007
|
-
var p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position
|
|
37008
|
-
|
|
37320
|
+
var p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position;
|
|
37321
|
+
var symbolType = "arrow2Left",
|
|
37322
|
+
offsetX = (isArray$3(symbolSize) ? symbolSize[0] : symbolSize) / 4,
|
|
37323
|
+
offsetY = 0;
|
|
37324
|
+
"top" === p || "bottom" === p || "left" === p || "right" === p ? symbolType = "arrow2Left" : "concise" === triangleMode && (symbolType = conciseSymbolMap[p], offsetX = ["tl", "bl", "rt", "rb"].includes(position) ? (isArray$3(symbolSize) ? symbolSize[0] : symbolSize) / 2 : -(isArray$3(symbolSize) ? symbolSize[0] : symbolSize) / 2, offsetY = ["tl", "tr", "lb", "rb"].includes(position) ? -(isArray$3(symbolSize) ? symbolSize[1] : symbolSize) / 2 : (isArray$3(symbolSize) ? symbolSize[1] : symbolSize) / 2);
|
|
37325
|
+
var _this$getAngleAndOffs = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray$3(spaceSize) ? spaceSize : [spaceSize, spaceSize - lineWidth], symbolType),
|
|
37009
37326
|
angle = _this$getAngleAndOffs.angle,
|
|
37010
37327
|
offset = _this$getAngleAndOffs.offset;
|
|
37011
|
-
_this$getAngleAndOffs.rectOffset;
|
|
37012
37328
|
if (isBoolean$3(bgVisible)) {
|
|
37013
|
-
var
|
|
37014
|
-
|
|
37015
|
-
|
|
37016
|
-
|
|
37017
|
-
|
|
37018
|
-
|
|
37019
|
-
|
|
37020
|
-
|
|
37021
|
-
|
|
37022
|
-
|
|
37023
|
-
|
|
37024
|
-
|
|
37025
|
-
|
|
37026
|
-
|
|
37027
|
-
|
|
37028
|
-
isEmpty(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel)
|
|
37029
|
-
|
|
37329
|
+
var bgSymbol = group.createOrUpdateChild("poptip-symbol-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
37330
|
+
visible: bgVisible && (contentVisible || titleVisible),
|
|
37331
|
+
x: offsetX,
|
|
37332
|
+
y: offsetY,
|
|
37333
|
+
strokeBoundsBuffer: -1,
|
|
37334
|
+
boundsPadding: -2,
|
|
37335
|
+
anchor: [0, 0],
|
|
37336
|
+
symbolType: symbolType,
|
|
37337
|
+
angle: angle,
|
|
37338
|
+
dx: offset[0],
|
|
37339
|
+
dy: offset[1] - (null !== (_j = backgroundStyle.space) && void 0 !== _j ? _j : 0),
|
|
37340
|
+
size: symbolSize,
|
|
37341
|
+
zIndex: 9
|
|
37342
|
+
}), "symbol");
|
|
37343
|
+
var bgRect = void 0;
|
|
37344
|
+
isEmpty(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel), bgRect = panel.panelSymbolType ? group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
37345
|
+
visible: bgVisible && (contentVisible || titleVisible),
|
|
37346
|
+
x: 0,
|
|
37347
|
+
y: 0,
|
|
37348
|
+
symbolType: "rect",
|
|
37349
|
+
size: [popTipWidth, poptipHeight],
|
|
37350
|
+
zIndex: -8
|
|
37351
|
+
}), "symbol") : group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
37030
37352
|
visible: bgVisible && (contentVisible || titleVisible),
|
|
37031
37353
|
x: 0,
|
|
37032
37354
|
y: 0,
|
|
37033
37355
|
width: popTipWidth,
|
|
37034
37356
|
height: poptipHeight,
|
|
37035
37357
|
zIndex: -8
|
|
37036
|
-
}), "rect");
|
|
37037
|
-
isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
|
|
37358
|
+
}), "rect"), isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
|
|
37038
37359
|
}
|
|
37039
37360
|
if (group.setAttributes({
|
|
37040
37361
|
x: -offset[0] + dx,
|
|
37041
|
-
y: -offset[1] + dy
|
|
37042
|
-
|
|
37362
|
+
y: -offset[1] + dy,
|
|
37363
|
+
anchor: [offsetX, offsetY]
|
|
37364
|
+
}), logoSymbol) {
|
|
37365
|
+
var _logoSymbol$size = logoSymbol.size,
|
|
37366
|
+
size = _logoSymbol$size === void 0 ? 12 : _logoSymbol$size,
|
|
37367
|
+
sizeArray = isArray$3(size) ? size : [size, size];
|
|
37368
|
+
"auto" === sizeArray[1] && (sizeArray[1] = poptipHeight), "auto" === sizeArray[0] && (sizeArray[0] = poptipHeight);
|
|
37369
|
+
var sizeW = sizeArray[0];
|
|
37370
|
+
group.createOrUpdateChild("poptip-logo", Object.assign(Object.assign({}, logoSymbol), {
|
|
37371
|
+
x: 0,
|
|
37372
|
+
y: poptipHeight / 2,
|
|
37373
|
+
visible: bgVisible && (contentVisible || titleVisible),
|
|
37374
|
+
zIndex: 10,
|
|
37375
|
+
size: sizeArray
|
|
37376
|
+
}), "symbol"), group.setAttributes({
|
|
37377
|
+
x: -offset[0] + dx + sizeW / 2,
|
|
37378
|
+
y: -offset[1] + dy
|
|
37379
|
+
}), logoText && group.createOrUpdateChild("poptip-logo-text", Object.assign(Object.assign({}, logoTextStyle), {
|
|
37380
|
+
x: 0,
|
|
37381
|
+
y: poptipHeight / 2,
|
|
37382
|
+
visible: bgVisible && (contentVisible || titleVisible),
|
|
37383
|
+
text: logoText,
|
|
37384
|
+
textAlign: "center",
|
|
37385
|
+
textBaseline: "middle",
|
|
37386
|
+
zIndex: 10
|
|
37387
|
+
}), "text");
|
|
37388
|
+
}
|
|
37389
|
+
if (!layout || !range) break;
|
|
37043
37390
|
{
|
|
37044
37391
|
_tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
|
|
37045
37392
|
var _b2 = _tBounds,
|
|
@@ -37047,91 +37394,125 @@
|
|
|
37047
37394
|
if (rectInsideAnotherRect(_b2, stageBounds, !1)) break;
|
|
37048
37395
|
{
|
|
37049
37396
|
var bbox = getRectIntersect(_b2, stageBounds, !1),
|
|
37050
|
-
|
|
37051
|
-
|
|
37397
|
+
_size = (bbox.x2 - bbox.x1) * (bbox.y2 - bbox.y1);
|
|
37398
|
+
_size > maxBBoxSize && (maxBBoxSize = _size, maxBBoxI = i);
|
|
37052
37399
|
}
|
|
37053
37400
|
}
|
|
37054
37401
|
}
|
|
37055
37402
|
}
|
|
37056
37403
|
}, {
|
|
37057
37404
|
key: "getAngleAndOffset",
|
|
37058
|
-
value: function getAngleAndOffset(position, width, height, size) {
|
|
37059
|
-
var sizeH = size[1] / 2;
|
|
37405
|
+
value: function getAngleAndOffset(position, width, height, size, symbolType) {
|
|
37406
|
+
var sizeH = "arrow2Left" === symbolType ? size[1] / 2 : size[1];
|
|
37060
37407
|
switch (position) {
|
|
37061
37408
|
case "tl":
|
|
37062
37409
|
return {
|
|
37063
|
-
angle: pi$1 / 2 * 3,
|
|
37064
|
-
offset: [width / 4, height + sizeH],
|
|
37065
|
-
rectOffset: [-width / 4, -height - size[1]]
|
|
37410
|
+
angle: "arrow2Left" === symbolType ? pi$1 / 2 * 3 : 0,
|
|
37411
|
+
offset: "arrow2Left" === symbolType ? [width / 4, height + sizeH] : [0, height + sizeH]
|
|
37066
37412
|
};
|
|
37067
37413
|
case "top":
|
|
37068
37414
|
return {
|
|
37069
37415
|
angle: pi$1 / 2 * 3,
|
|
37070
|
-
offset: [width / 2, height + sizeH]
|
|
37071
|
-
rectOffset: [0, -height - size[1]]
|
|
37416
|
+
offset: [width / 2, height + sizeH]
|
|
37072
37417
|
};
|
|
37073
37418
|
case "tr":
|
|
37074
37419
|
return {
|
|
37075
|
-
angle: pi$1 / 2 * 3,
|
|
37076
|
-
offset: [width / 4 * 3, height + sizeH],
|
|
37077
|
-
rectOffset: [width / 4 * 3, -height - size[1]]
|
|
37420
|
+
angle: "arrow2Left" === symbolType ? pi$1 / 2 * 3 : 0,
|
|
37421
|
+
offset: "arrow2Left" === symbolType ? [width / 4 * 3, height + sizeH] : [width, height + sizeH]
|
|
37078
37422
|
};
|
|
37079
37423
|
case "rt":
|
|
37080
37424
|
return {
|
|
37081
37425
|
angle: 0,
|
|
37082
|
-
offset: [-sizeH, height / 5],
|
|
37083
|
-
rectOffset: [width / 4 * 3, -height - size[1]]
|
|
37426
|
+
offset: "arrow2Left" === symbolType ? [-sizeH, height / 5] : [-sizeH, 0]
|
|
37084
37427
|
};
|
|
37085
37428
|
case "right":
|
|
37086
37429
|
return {
|
|
37087
37430
|
angle: 0,
|
|
37088
|
-
offset: [-sizeH, height / 2]
|
|
37089
|
-
rectOffset: [width / 4 * 3, -height - size[1]]
|
|
37431
|
+
offset: [-sizeH, height / 2]
|
|
37090
37432
|
};
|
|
37091
37433
|
case "rb":
|
|
37092
37434
|
return {
|
|
37093
37435
|
angle: 0,
|
|
37094
|
-
offset: [-sizeH, height / 5 * 4],
|
|
37095
|
-
rectOffset: [width / 4 * 3, -height - size[1]]
|
|
37436
|
+
offset: "arrow2Left" === symbolType ? [-sizeH, height / 5 * 4] : [-sizeH, height]
|
|
37096
37437
|
};
|
|
37097
37438
|
case "bl":
|
|
37098
37439
|
return {
|
|
37099
|
-
angle: pi$1 / 2,
|
|
37100
|
-
offset: [width / 4, -sizeH],
|
|
37101
|
-
rectOffset: [-width / 4, -height - size[1]]
|
|
37440
|
+
angle: "arrow2Left" === symbolType ? pi$1 / 2 : 0,
|
|
37441
|
+
offset: "arrow2Left" === symbolType ? [width / 4, -sizeH] : [0, -sizeH]
|
|
37102
37442
|
};
|
|
37103
37443
|
case "bottom":
|
|
37104
37444
|
return {
|
|
37105
37445
|
angle: pi$1 / 2,
|
|
37106
|
-
offset: [width / 2, -sizeH]
|
|
37107
|
-
rectOffset: [0, -height - size[1]]
|
|
37446
|
+
offset: [width / 2, -sizeH]
|
|
37108
37447
|
};
|
|
37109
37448
|
case "br":
|
|
37110
37449
|
return {
|
|
37111
|
-
angle: pi$1 / 2,
|
|
37112
|
-
offset: [width / 4 * 3, -sizeH],
|
|
37113
|
-
rectOffset: [width / 4 * 3, -height - size[1]]
|
|
37450
|
+
angle: "arrow2Left" === symbolType ? pi$1 / 2 : 0,
|
|
37451
|
+
offset: "arrow2Left" === symbolType ? [width / 4 * 3, -sizeH] : [width, -sizeH]
|
|
37114
37452
|
};
|
|
37115
37453
|
case "lt":
|
|
37116
37454
|
return {
|
|
37117
|
-
angle: pi$1,
|
|
37118
|
-
offset: [width + sizeH, height / 5],
|
|
37119
|
-
rectOffset: [-width / 4, -height - size[1]]
|
|
37455
|
+
angle: "arrow2Left" === symbolType ? pi$1 : 0,
|
|
37456
|
+
offset: "arrow2Left" === symbolType ? [width + sizeH, height / 5] : [width + sizeH, 0]
|
|
37120
37457
|
};
|
|
37121
37458
|
case "left":
|
|
37122
37459
|
return {
|
|
37123
37460
|
angle: pi$1,
|
|
37124
|
-
offset: [width + sizeH, height / 2]
|
|
37125
|
-
rectOffset: [0, -height - size[1]]
|
|
37461
|
+
offset: [width + sizeH, height / 2]
|
|
37126
37462
|
};
|
|
37127
37463
|
case "lb":
|
|
37128
37464
|
return {
|
|
37129
|
-
angle: pi$1,
|
|
37130
|
-
offset: [width + sizeH, height / 5 * 4],
|
|
37131
|
-
rectOffset: [width / 4 * 3, -height - size[1]]
|
|
37465
|
+
angle: "arrow2Left" === symbolType ? pi$1 : 0,
|
|
37466
|
+
offset: "arrow2Left" === symbolType ? [width + sizeH, height / 5 * 4] : [width + sizeH, height]
|
|
37132
37467
|
};
|
|
37133
37468
|
}
|
|
37134
37469
|
}
|
|
37470
|
+
}, {
|
|
37471
|
+
key: "appearAnimate",
|
|
37472
|
+
value: function appearAnimate(animateConfig) {
|
|
37473
|
+
var _animateConfig$durati = animateConfig.duration,
|
|
37474
|
+
duration = _animateConfig$durati === void 0 ? 1e3 : _animateConfig$durati,
|
|
37475
|
+
_animateConfig$easing = animateConfig.easing,
|
|
37476
|
+
easing = _animateConfig$easing === void 0 ? "quadOut" : _animateConfig$easing;
|
|
37477
|
+
if (this.setAttributes({
|
|
37478
|
+
scaleX: 0,
|
|
37479
|
+
scaleY: 0
|
|
37480
|
+
}), this.animate().to({
|
|
37481
|
+
scaleX: 1,
|
|
37482
|
+
scaleY: 1
|
|
37483
|
+
}, duration / 3 * 2, easing), this.titleShape && this.titleShape.animate().play(new InputText({
|
|
37484
|
+
text: ""
|
|
37485
|
+
}, {
|
|
37486
|
+
text: this.titleShape.attribute.text
|
|
37487
|
+
}, duration, easing)), this.contentShape && this.contentShape.animate().play(new InputText({
|
|
37488
|
+
text: ""
|
|
37489
|
+
}, {
|
|
37490
|
+
text: this.contentShape.attribute.text
|
|
37491
|
+
}, duration, easing)), animateConfig.wave) {
|
|
37492
|
+
var dur = duration / 6;
|
|
37493
|
+
this.group.animate().to({
|
|
37494
|
+
angle: animateConfig.wave
|
|
37495
|
+
}, dur, easing).to({
|
|
37496
|
+
angle: -animateConfig.wave
|
|
37497
|
+
}, 2 * dur, easing).to({
|
|
37498
|
+
angle: animateConfig.wave
|
|
37499
|
+
}, 2 * dur, easing).to({
|
|
37500
|
+
angle: 0
|
|
37501
|
+
}, dur, easing);
|
|
37502
|
+
}
|
|
37503
|
+
}
|
|
37504
|
+
}, {
|
|
37505
|
+
key: "disappearAnimate",
|
|
37506
|
+
value: function disappearAnimate(animateConfig) {
|
|
37507
|
+
var _animateConfig$durati2 = animateConfig.duration,
|
|
37508
|
+
duration = _animateConfig$durati2 === void 0 ? 1e3 : _animateConfig$durati2,
|
|
37509
|
+
_animateConfig$easing2 = animateConfig.easing,
|
|
37510
|
+
easing = _animateConfig$easing2 === void 0 ? "quadOut" : _animateConfig$easing2;
|
|
37511
|
+
this.animate().to({
|
|
37512
|
+
scaleX: 0,
|
|
37513
|
+
scaleY: 0
|
|
37514
|
+
}, duration, easing);
|
|
37515
|
+
}
|
|
37135
37516
|
}]);
|
|
37136
37517
|
}(AbstractComponent);
|
|
37137
37518
|
PopTip.defaultAttributes = {
|
|
@@ -37151,6 +37532,7 @@
|
|
|
37151
37532
|
textAlign: "left",
|
|
37152
37533
|
textBaseline: "top"
|
|
37153
37534
|
},
|
|
37535
|
+
panel: {},
|
|
37154
37536
|
maxWidthPercent: .8,
|
|
37155
37537
|
space: 8,
|
|
37156
37538
|
padding: 10
|
|
@@ -50925,6 +51307,312 @@
|
|
|
50925
51307
|
clipRange: 0
|
|
50926
51308
|
};
|
|
50927
51309
|
|
|
51310
|
+
var StoryLabelItem = /*#__PURE__*/function (_AbstractComponent) {
|
|
51311
|
+
function StoryLabelItem(attributes, options) {
|
|
51312
|
+
_classCallCheck(this, StoryLabelItem);
|
|
51313
|
+
return _callSuper(this, StoryLabelItem, [(null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, StoryLabelItem.defaultAttributes, attributes)]);
|
|
51314
|
+
}
|
|
51315
|
+
_inherits(StoryLabelItem, _AbstractComponent);
|
|
51316
|
+
return _createClass(StoryLabelItem, [{
|
|
51317
|
+
key: "render",
|
|
51318
|
+
value: function render() {
|
|
51319
|
+
var _this$attribute = this.attribute,
|
|
51320
|
+
contentOffsetX = _this$attribute.contentOffsetX,
|
|
51321
|
+
contentOffsetY = _this$attribute.contentOffsetY,
|
|
51322
|
+
lineStyle = _this$attribute.lineStyle,
|
|
51323
|
+
symbolStartStyle = _this$attribute.symbolStartStyle,
|
|
51324
|
+
symbolEndStyle = _this$attribute.symbolEndStyle,
|
|
51325
|
+
symbolStartOuterStyle = _this$attribute.symbolStartOuterStyle,
|
|
51326
|
+
titleTopText = _this$attribute.titleTop,
|
|
51327
|
+
titleBottomText = _this$attribute.titleBottom,
|
|
51328
|
+
titleTopStyle = _this$attribute.titleTopStyle,
|
|
51329
|
+
titleBottomStyle = _this$attribute.titleBottomStyle,
|
|
51330
|
+
titleSpace = _this$attribute.titleSpace,
|
|
51331
|
+
titleTopPanelStyle = _this$attribute.titleTopPanelStyle,
|
|
51332
|
+
titleBottomPanelStyle = _this$attribute.titleBottomPanelStyle,
|
|
51333
|
+
theme = _this$attribute.theme,
|
|
51334
|
+
group = this.createOrUpdateChild("label-item-container", {
|
|
51335
|
+
x: 0,
|
|
51336
|
+
y: 0,
|
|
51337
|
+
zIndex: 1
|
|
51338
|
+
}, "group"),
|
|
51339
|
+
symbolStart = group.createOrUpdateChild("label-item-symbol-start", Object.assign({
|
|
51340
|
+
x: 0,
|
|
51341
|
+
y: 0
|
|
51342
|
+
}, symbolStartStyle), "symbol"),
|
|
51343
|
+
symbolEnd = group.createOrUpdateChild("label-item-symbol-end", Object.assign({
|
|
51344
|
+
x: contentOffsetX,
|
|
51345
|
+
y: contentOffsetY
|
|
51346
|
+
}, symbolEndStyle), "symbol"),
|
|
51347
|
+
symbolStartOut = group.createOrUpdateChild("label-item-symbol-start-out", Object.assign({
|
|
51348
|
+
x: 0,
|
|
51349
|
+
y: 0
|
|
51350
|
+
}, symbolStartOuterStyle), "symbol"),
|
|
51351
|
+
spaceW = titleSpace[0],
|
|
51352
|
+
spaceH = titleSpace[1],
|
|
51353
|
+
titleTopGroup = group.createOrUpdateChild("label-item-title-top-group", {
|
|
51354
|
+
x: contentOffsetX,
|
|
51355
|
+
y: contentOffsetY,
|
|
51356
|
+
clip: !0
|
|
51357
|
+
}, "group"),
|
|
51358
|
+
titleTop = titleTopGroup.createOrUpdateChild("label-item-title-top", Object.assign(Object.assign({
|
|
51359
|
+
x: spaceW,
|
|
51360
|
+
y: -spaceH,
|
|
51361
|
+
text: titleTopText
|
|
51362
|
+
}, titleTopStyle), {
|
|
51363
|
+
textBaseline: "bottom",
|
|
51364
|
+
textAlign: "left",
|
|
51365
|
+
zIndex: 10
|
|
51366
|
+
}), "text"),
|
|
51367
|
+
titleTopBounds = titleTop.AABBBounds;
|
|
51368
|
+
contentOffsetX > 0 && titleTopGroup.setAttributes({
|
|
51369
|
+
x: contentOffsetX - titleTopBounds.width() - 2 * spaceW
|
|
51370
|
+
}), titleTopGroup.setAttributes({
|
|
51371
|
+
width: titleTopBounds.width() + 2 * spaceW,
|
|
51372
|
+
height: -titleTopBounds.height() - 2 * spaceH
|
|
51373
|
+
});
|
|
51374
|
+
var titleTopPanel = titleTopGroup.createOrUpdateChild("label-item-title-top-panel", Object.assign(Object.assign({}, titleTopPanelStyle), {
|
|
51375
|
+
x: titleTopPanelStyle.padding.left,
|
|
51376
|
+
y: (titleTopGroup.attribute.height > 0 ? 0 : titleTopGroup.attribute.height) + titleTopPanelStyle.padding.top,
|
|
51377
|
+
width: titleTopGroup.attribute.width - titleTopPanelStyle.padding.left - titleTopPanelStyle.padding.right,
|
|
51378
|
+
height: (titleTopGroup.attribute.height > 0 ? 1 : -1) * titleTopGroup.attribute.height - titleTopPanelStyle.padding.bottom - titleTopPanelStyle.padding.top,
|
|
51379
|
+
scaleCenter: [titleTopGroup.attribute.width / 2, titleTopGroup.attribute.height / 2]
|
|
51380
|
+
}), "rect");
|
|
51381
|
+
this._titleTopPanel = titleTopPanel;
|
|
51382
|
+
var titleBottomGroup = group.createOrUpdateChild("label-item-title-bottom-group", {
|
|
51383
|
+
x: contentOffsetX,
|
|
51384
|
+
y: contentOffsetY,
|
|
51385
|
+
clip: !0
|
|
51386
|
+
}, "group"),
|
|
51387
|
+
titleBottom = titleBottomGroup.createOrUpdateChild("label-item-title-bottom", Object.assign(Object.assign({
|
|
51388
|
+
x: spaceW,
|
|
51389
|
+
y: spaceH,
|
|
51390
|
+
text: titleBottomText
|
|
51391
|
+
}, titleBottomStyle), {
|
|
51392
|
+
textBaseline: "top",
|
|
51393
|
+
textAlign: "left",
|
|
51394
|
+
zIndex: 10
|
|
51395
|
+
}), "text"),
|
|
51396
|
+
titleBottomBounds = titleBottom.AABBBounds;
|
|
51397
|
+
contentOffsetX > 0 && titleBottomGroup.setAttributes({
|
|
51398
|
+
x: contentOffsetX - titleBottomBounds.width() - 2 * spaceW
|
|
51399
|
+
}), titleBottomGroup.setAttributes({
|
|
51400
|
+
width: titleBottomBounds.width() + 2 * spaceW,
|
|
51401
|
+
height: titleTopBounds.height() + 2 * spaceH
|
|
51402
|
+
});
|
|
51403
|
+
var titleBottomPanel = titleBottomGroup.createOrUpdateChild("label-item-title-bottom-panel", Object.assign(Object.assign({}, titleBottomPanelStyle), {
|
|
51404
|
+
x: titleBottomPanelStyle.padding.left,
|
|
51405
|
+
y: (titleBottomGroup.attribute.height > 0 ? 0 : titleBottomGroup.attribute.height) + titleBottomPanelStyle.padding.top,
|
|
51406
|
+
width: titleBottomGroup.attribute.width - titleBottomPanelStyle.padding.left - titleBottomPanelStyle.padding.right,
|
|
51407
|
+
height: (titleBottomGroup.attribute.height > 0 ? 1 : -1) * titleBottomGroup.attribute.height - titleBottomPanelStyle.padding.bottom - titleBottomPanelStyle.padding.top,
|
|
51408
|
+
scaleCenter: [titleBottomGroup.attribute.width / 2, titleBottomGroup.attribute.height / 2]
|
|
51409
|
+
}), "rect");
|
|
51410
|
+
this._titleBottomPanel = titleBottomPanel;
|
|
51411
|
+
var maxTextWidth = Math.max(titleTop.AABBBounds.width(), titleBottom.AABBBounds.width()) + 2 * spaceW,
|
|
51412
|
+
points = [{
|
|
51413
|
+
x: 0,
|
|
51414
|
+
y: 0
|
|
51415
|
+
}, contentOffsetX > 0 ? {
|
|
51416
|
+
x: contentOffsetX - maxTextWidth,
|
|
51417
|
+
y: contentOffsetY
|
|
51418
|
+
} : {
|
|
51419
|
+
x: contentOffsetX + maxTextWidth,
|
|
51420
|
+
y: contentOffsetY
|
|
51421
|
+
}, {
|
|
51422
|
+
x: contentOffsetX,
|
|
51423
|
+
y: contentOffsetY
|
|
51424
|
+
}];
|
|
51425
|
+
if ("simple" === theme) {
|
|
51426
|
+
points.pop();
|
|
51427
|
+
var p = points[1];
|
|
51428
|
+
symbolEnd.setAttributes(p);
|
|
51429
|
+
}
|
|
51430
|
+
var line = group.createOrUpdateChild("label-item-line", Object.assign(Object.assign({
|
|
51431
|
+
x: 0,
|
|
51432
|
+
y: 0
|
|
51433
|
+
}, lineStyle), {
|
|
51434
|
+
points: points
|
|
51435
|
+
}), "line");
|
|
51436
|
+
this._symbolEnd = symbolEnd, this._symbolStart = symbolStart, this._symbolStartOuter = symbolStartOut, this._titleTop = titleTop, this._titleBottom = titleBottom, this._line = line;
|
|
51437
|
+
}
|
|
51438
|
+
}, {
|
|
51439
|
+
key: "appearAnimate",
|
|
51440
|
+
value: function appearAnimate(animateConfig) {
|
|
51441
|
+
var _animateConfig$durati = animateConfig.duration,
|
|
51442
|
+
duration = _animateConfig$durati === void 0 ? 1e3 : _animateConfig$durati,
|
|
51443
|
+
_animateConfig$easing = animateConfig.easing,
|
|
51444
|
+
easing = _animateConfig$easing === void 0 ? "quadOut" : _animateConfig$easing,
|
|
51445
|
+
_animateConfig$symbol = animateConfig.symbolStartOuterType,
|
|
51446
|
+
symbolStartOuterType = _animateConfig$symbol === void 0 ? "scale" : _animateConfig$symbol,
|
|
51447
|
+
_animateConfig$titleT = animateConfig.titleType,
|
|
51448
|
+
titleType = _animateConfig$titleT === void 0 ? "typewriter" : _animateConfig$titleT,
|
|
51449
|
+
_animateConfig$titleP = animateConfig.titlePanelType,
|
|
51450
|
+
titlePanelType = _animateConfig$titleP === void 0 ? "scale" : _animateConfig$titleP,
|
|
51451
|
+
symbolTime = duration / 10;
|
|
51452
|
+
var symbolStartOuterFrom, symbolStartOuterTo;
|
|
51453
|
+
if (this._symbolStart.setAttributes({
|
|
51454
|
+
scaleX: 0,
|
|
51455
|
+
scaleY: 0
|
|
51456
|
+
}), this._symbolStart.animate().to({
|
|
51457
|
+
scaleX: 1,
|
|
51458
|
+
scaleY: 1
|
|
51459
|
+
}, 5 * symbolTime, easing), "scale" === symbolStartOuterType ? (symbolStartOuterFrom = {
|
|
51460
|
+
scaleX: 0,
|
|
51461
|
+
scaleY: 0
|
|
51462
|
+
}, symbolStartOuterTo = {
|
|
51463
|
+
scaleX: 1,
|
|
51464
|
+
scaleY: 1
|
|
51465
|
+
}) : (symbolStartOuterFrom = {
|
|
51466
|
+
clipRange: 0
|
|
51467
|
+
}, symbolStartOuterTo = {
|
|
51468
|
+
clipRange: 1
|
|
51469
|
+
}), this._symbolStartOuter.setAttributes(symbolStartOuterFrom), this._symbolStartOuter.animate().to(symbolStartOuterTo, 5 * symbolTime, easing), this._symbolEnd.setAttributes({
|
|
51470
|
+
scaleX: 0,
|
|
51471
|
+
scaleY: 0
|
|
51472
|
+
}), this._symbolEnd.animate().wait(8 * symbolTime).to({
|
|
51473
|
+
scaleX: 1,
|
|
51474
|
+
scaleY: 1
|
|
51475
|
+
}, 2 * symbolTime, easing), this._line.setAttributes({
|
|
51476
|
+
clipRange: 0
|
|
51477
|
+
}), this._line.animate().to({
|
|
51478
|
+
clipRange: 1
|
|
51479
|
+
}, 9 * symbolTime, easing), "typewriter" === titleType) {
|
|
51480
|
+
var titleTopText = this._titleTop.attribute.text;
|
|
51481
|
+
this._titleTop.setAttributes({
|
|
51482
|
+
text: ""
|
|
51483
|
+
}), this._titleTop.animate().wait(5 * symbolTime).play(new InputText({
|
|
51484
|
+
text: ""
|
|
51485
|
+
}, {
|
|
51486
|
+
text: titleTopText
|
|
51487
|
+
}, 4 * symbolTime, "linear"));
|
|
51488
|
+
var titleBottomText = this._titleBottom.attribute.text;
|
|
51489
|
+
this._titleBottom.setAttributes({
|
|
51490
|
+
text: ""
|
|
51491
|
+
}), this._titleBottom.animate().wait(5 * symbolTime).play(new InputText({
|
|
51492
|
+
text: ""
|
|
51493
|
+
}, {
|
|
51494
|
+
text: titleBottomText
|
|
51495
|
+
}, 4 * symbolTime, "linear"));
|
|
51496
|
+
} else this._titleTop.setAttributes({
|
|
51497
|
+
dy: this._titleTop.AABBBounds.height() + 10
|
|
51498
|
+
}), this._titleTop.animate().wait(5 * symbolTime).to({
|
|
51499
|
+
dy: 0
|
|
51500
|
+
}, 4 * symbolTime, "linear"), this._titleBottom.setAttributes({
|
|
51501
|
+
dy: -(10 + this._titleBottom.AABBBounds.height())
|
|
51502
|
+
}), this._titleBottom.animate().wait(5 * symbolTime).to({
|
|
51503
|
+
dy: 0
|
|
51504
|
+
}, 4 * symbolTime, "linear");
|
|
51505
|
+
"scale" === titlePanelType ? [this._titleTopPanel, this._titleBottomPanel].forEach(function (panel) {
|
|
51506
|
+
var scaleX = panel.attribute.scaleX;
|
|
51507
|
+
panel.setAttributes({
|
|
51508
|
+
scaleX: 0
|
|
51509
|
+
}), panel.animate().to({
|
|
51510
|
+
scaleX: scaleX
|
|
51511
|
+
}, duration, "circInOut");
|
|
51512
|
+
}) : "stroke" === titlePanelType && [this._titleTopPanel, this._titleBottomPanel].forEach(function (panel) {
|
|
51513
|
+
var b = panel.AABBBounds,
|
|
51514
|
+
totalLen = 2 * (b.width() + b.height());
|
|
51515
|
+
panel.setAttributes({
|
|
51516
|
+
lineDash: [0, 10 * totalLen]
|
|
51517
|
+
}), panel.animate().to({
|
|
51518
|
+
lineDash: [totalLen, 10 * totalLen]
|
|
51519
|
+
}, duration, "quadOut");
|
|
51520
|
+
});
|
|
51521
|
+
}
|
|
51522
|
+
}, {
|
|
51523
|
+
key: "disappearAnimate",
|
|
51524
|
+
value: function disappearAnimate(animateConfig) {
|
|
51525
|
+
if ("scale" === animateConfig.mode) {
|
|
51526
|
+
var _animateConfig$durati2 = animateConfig.duration,
|
|
51527
|
+
duration = _animateConfig$durati2 === void 0 ? 1e3 : _animateConfig$durati2,
|
|
51528
|
+
_animateConfig$easing2 = animateConfig.easing,
|
|
51529
|
+
easing = _animateConfig$easing2 === void 0 ? "quadOut" : _animateConfig$easing2;
|
|
51530
|
+
this.animate().to({
|
|
51531
|
+
scaleX: 0,
|
|
51532
|
+
scaleY: 0
|
|
51533
|
+
}, duration, easing);
|
|
51534
|
+
} else {
|
|
51535
|
+
var _animateConfig$durati3 = animateConfig.duration,
|
|
51536
|
+
_duration = _animateConfig$durati3 === void 0 ? 1e3 : _animateConfig$durati3,
|
|
51537
|
+
_animateConfig$easing3 = animateConfig.easing,
|
|
51538
|
+
_easing = _animateConfig$easing3 === void 0 ? "quadOut" : _animateConfig$easing3;
|
|
51539
|
+
this._line.animate().to({
|
|
51540
|
+
clipRange: 0
|
|
51541
|
+
}, _duration, _easing), this._symbolStart.animate().wait(_duration / 2).to({
|
|
51542
|
+
scaleX: 0,
|
|
51543
|
+
scaleY: 0
|
|
51544
|
+
}, _duration / 2, _easing), this._symbolEnd.animate().to({
|
|
51545
|
+
scaleX: 0,
|
|
51546
|
+
scaleY: 0
|
|
51547
|
+
}, _duration, _easing), this._titleTop.animate().to({
|
|
51548
|
+
dy: this._titleTop.AABBBounds.height() + 10
|
|
51549
|
+
}, _duration / 2, _easing), this._titleBottom.animate().to({
|
|
51550
|
+
dy: -(10 + this._titleBottom.AABBBounds.height())
|
|
51551
|
+
}, _duration / 2, _easing), this._symbolStartOuter.animate().wait(_duration / 2).to({
|
|
51552
|
+
clipRange: 0
|
|
51553
|
+
}, _duration / 2, _easing), this._titleTopPanel.animate().to({
|
|
51554
|
+
scaleX: 0
|
|
51555
|
+
}, _duration, "circInOut"), this._titleBottomPanel.animate().to({
|
|
51556
|
+
scaleX: 0
|
|
51557
|
+
}, _duration, "circInOut");
|
|
51558
|
+
}
|
|
51559
|
+
}
|
|
51560
|
+
}]);
|
|
51561
|
+
}(AbstractComponent);
|
|
51562
|
+
StoryLabelItem.defaultAttributes = {
|
|
51563
|
+
contentOffsetX: 100,
|
|
51564
|
+
contentOffsetY: -60,
|
|
51565
|
+
titleTopStyle: {
|
|
51566
|
+
fontSize: 12,
|
|
51567
|
+
fill: "white"
|
|
51568
|
+
},
|
|
51569
|
+
titleBottomStyle: {
|
|
51570
|
+
fontSize: 12,
|
|
51571
|
+
fill: "white"
|
|
51572
|
+
},
|
|
51573
|
+
lineStyle: {
|
|
51574
|
+
stroke: "white",
|
|
51575
|
+
lineWidth: 1
|
|
51576
|
+
},
|
|
51577
|
+
symbolStartStyle: {
|
|
51578
|
+
symbolType: "circle",
|
|
51579
|
+
size: 3,
|
|
51580
|
+
fill: "white"
|
|
51581
|
+
},
|
|
51582
|
+
symbolEndStyle: {
|
|
51583
|
+
symbolType: "circle",
|
|
51584
|
+
size: 3,
|
|
51585
|
+
fill: "white"
|
|
51586
|
+
},
|
|
51587
|
+
symbolStartOuterStyle: {
|
|
51588
|
+
symbolType: "M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0",
|
|
51589
|
+
size: 8,
|
|
51590
|
+
stroke: "white"
|
|
51591
|
+
},
|
|
51592
|
+
titleSpace: [2, 2],
|
|
51593
|
+
titleTopPanelStyle: {
|
|
51594
|
+
visible: !1,
|
|
51595
|
+
padding: {
|
|
51596
|
+
left: 0,
|
|
51597
|
+
right: 0,
|
|
51598
|
+
bottom: 2,
|
|
51599
|
+
top: 2
|
|
51600
|
+
},
|
|
51601
|
+
cornerRadius: 3
|
|
51602
|
+
},
|
|
51603
|
+
titleBottomPanelStyle: {
|
|
51604
|
+
visible: !1,
|
|
51605
|
+
padding: {
|
|
51606
|
+
left: 0,
|
|
51607
|
+
right: 0,
|
|
51608
|
+
bottom: 2,
|
|
51609
|
+
top: 2
|
|
51610
|
+
},
|
|
51611
|
+
cornerRadius: 3
|
|
51612
|
+
},
|
|
51613
|
+
theme: "default"
|
|
51614
|
+
};
|
|
51615
|
+
|
|
50928
51616
|
var isClose = isNumberClose;
|
|
50929
51617
|
function normalizeStartEndAngle(start, end) {
|
|
50930
51618
|
var startAngle = 0,
|
|
@@ -55076,7 +55764,7 @@
|
|
|
55076
55764
|
graphicItem && (graphicItem[BridgeElementKey] = null, graphicItem.release(), graphicItem.parent && graphicItem.parent.removeChild(graphicItem));
|
|
55077
55765
|
};
|
|
55078
55766
|
|
|
55079
|
-
var commonAttributes = ["fillOpacity"];
|
|
55767
|
+
var commonAttributes$1 = ["fillOpacity"];
|
|
55080
55768
|
var transformCommonAttribute = function transformCommonAttribute(graphicAttributes, changedKey, nextAttrs) {
|
|
55081
55769
|
var _a;
|
|
55082
55770
|
return "fillOpacity" === changedKey ? (graphicAttributes.fillOpacity = null !== (_a = nextAttrs.fillOpacity) && void 0 !== _a ? _a : 1, ["fillOpacity"]) : [];
|
|
@@ -55157,10 +55845,10 @@
|
|
|
55157
55845
|
} else transform.transform(graphicAttributes, nextAttrs, null);
|
|
55158
55846
|
tags[index] = !0, isTransformed = !0;
|
|
55159
55847
|
}
|
|
55160
|
-
}), isTransformed || (commonAttributes.includes(key) ? transformCommonAttribute(graphicAttributes, key, nextAttrs) : graphicAttributes[key] = nextAttrs[key]);
|
|
55848
|
+
}), isTransformed || (commonAttributes$1.includes(key) ? transformCommonAttribute(graphicAttributes, key, nextAttrs) : graphicAttributes[key] = nextAttrs[key]);
|
|
55161
55849
|
});
|
|
55162
55850
|
} else changedKeys.forEach(function (key) {
|
|
55163
|
-
commonAttributes.includes(key) ? transformCommonAttribute(graphicAttributes, key, nextAttrs) : graphicAttributes[key] = nextAttrs[key];
|
|
55851
|
+
commonAttributes$1.includes(key) ? transformCommonAttribute(graphicAttributes, key, nextAttrs) : graphicAttributes[key] = nextAttrs[key];
|
|
55164
55852
|
});
|
|
55165
55853
|
return graphicAttributes;
|
|
55166
55854
|
};
|
|
@@ -56367,6 +57055,84 @@
|
|
|
56367
57055
|
filterType: "groupKey"
|
|
56368
57056
|
};
|
|
56369
57057
|
|
|
57058
|
+
var ElementHighlightByGraphicName = /*#__PURE__*/function (_ElementHighlight) {
|
|
57059
|
+
function ElementHighlightByGraphicName(view, options) {
|
|
57060
|
+
var _this;
|
|
57061
|
+
_classCallCheck(this, ElementHighlightByGraphicName);
|
|
57062
|
+
_this = _callSuper(this, ElementHighlightByGraphicName, [view, options]), _this.type = ElementHighlightByGraphicName.type, _this.handleStart = function (e) {
|
|
57063
|
+
if (e && e.element && _this._marks.includes(e.element.mark)) {
|
|
57064
|
+
if (_this.options.shouldStart ? _this.options.shouldStart(e) : _this._filterByName(e)) {
|
|
57065
|
+
var itemKey = _this._parseTargetKey(e, e.element);
|
|
57066
|
+
_this.start(itemKey);
|
|
57067
|
+
}
|
|
57068
|
+
}
|
|
57069
|
+
}, _this.handleReset = function (e) {
|
|
57070
|
+
e && e.element && _this._marks.includes(e.element.mark) && _this.reset();
|
|
57071
|
+
}, _this.options = Object.assign({}, ElementHighlightByGraphicName.defaultOptions, options), _this._marks = view.getMarksBySelector(_this.options.selector);
|
|
57072
|
+
return _this;
|
|
57073
|
+
}
|
|
57074
|
+
_inherits(ElementHighlightByGraphicName, _ElementHighlight);
|
|
57075
|
+
return _createClass(ElementHighlightByGraphicName, [{
|
|
57076
|
+
key: "_filterByName",
|
|
57077
|
+
value: function _filterByName(e) {
|
|
57078
|
+
var _a;
|
|
57079
|
+
return !!(null === (_a = null == e ? void 0 : e.target) || void 0 === _a ? void 0 : _a.name);
|
|
57080
|
+
}
|
|
57081
|
+
}, {
|
|
57082
|
+
key: "_parseTargetKey",
|
|
57083
|
+
value: function _parseTargetKey(e, element) {
|
|
57084
|
+
return e.target.name;
|
|
57085
|
+
}
|
|
57086
|
+
}, {
|
|
57087
|
+
key: "start",
|
|
57088
|
+
value: function start(itemKey) {
|
|
57089
|
+
var _this2 = this;
|
|
57090
|
+
isNil$1(itemKey) || this._marks.forEach(function (mark) {
|
|
57091
|
+
mark.elements.forEach(function (el) {
|
|
57092
|
+
var _a;
|
|
57093
|
+
(null === (_a = el.getGraphicItem()) || void 0 === _a ? void 0 : _a.name) === itemKey ? el.updateStates(_defineProperty(_defineProperty({}, _this2.options.blurState, !1), _this2.options.highlightState, !0)) : el.updateStates(_defineProperty(_defineProperty({}, _this2.options.blurState, !0), _this2.options.highlightState, !1));
|
|
57094
|
+
});
|
|
57095
|
+
});
|
|
57096
|
+
}
|
|
57097
|
+
}, {
|
|
57098
|
+
key: "reset",
|
|
57099
|
+
value: function reset() {
|
|
57100
|
+
var states = [this.options.blurState, this.options.highlightState];
|
|
57101
|
+
this._marks.forEach(function (mark) {
|
|
57102
|
+
mark.elements.forEach(function (el) {
|
|
57103
|
+
el.removeState(states);
|
|
57104
|
+
});
|
|
57105
|
+
});
|
|
57106
|
+
}
|
|
57107
|
+
}]);
|
|
57108
|
+
}(ElementHighlight);
|
|
57109
|
+
ElementHighlightByGraphicName.type = "element-highlight-by-graphic-name";
|
|
57110
|
+
|
|
57111
|
+
var ElementSelectByGraphicName = /*#__PURE__*/function (_ElementSelect) {
|
|
57112
|
+
function ElementSelectByGraphicName() {
|
|
57113
|
+
var _this;
|
|
57114
|
+
_classCallCheck(this, ElementSelectByGraphicName);
|
|
57115
|
+
_this = _callSuper(this, ElementSelectByGraphicName, arguments), _this.type = ElementSelectByGraphicName.type;
|
|
57116
|
+
return _this;
|
|
57117
|
+
}
|
|
57118
|
+
_inherits(ElementSelectByGraphicName, _ElementSelect);
|
|
57119
|
+
return _createClass(ElementSelectByGraphicName, [{
|
|
57120
|
+
key: "start",
|
|
57121
|
+
value: function start(element) {
|
|
57122
|
+
var _this2 = this;
|
|
57123
|
+
var _a;
|
|
57124
|
+
var name = null === (_a = element.getGraphicItem()) || void 0 === _a ? void 0 : _a.name;
|
|
57125
|
+
name && this._marks.forEach(function (mark) {
|
|
57126
|
+
mark.elements.forEach(function (el) {
|
|
57127
|
+
var _a;
|
|
57128
|
+
(null === (_a = el.getGraphicItem()) || void 0 === _a ? void 0 : _a.name) === name && _superPropGet(ElementSelectByGraphicName, "start", _this2, 3)([el]);
|
|
57129
|
+
});
|
|
57130
|
+
});
|
|
57131
|
+
}
|
|
57132
|
+
}]);
|
|
57133
|
+
}(ElementSelect);
|
|
57134
|
+
ElementSelectByGraphicName.type = "element-select-by-graphic-name";
|
|
57135
|
+
|
|
56370
57136
|
function getBandWidthOfScale(scale) {
|
|
56371
57137
|
if (scale) return scale.type === ScaleEnum.Band ? scale.bandwidth() : scale.type === ScaleEnum.Point ? scale.step() : void 0;
|
|
56372
57138
|
}
|
|
@@ -56464,6 +57230,12 @@
|
|
|
56464
57230
|
var registerElementHighlightByName = function registerElementHighlightByName() {
|
|
56465
57231
|
Factory.registerInteraction(ElementHighlightByName.type, ElementHighlightByName);
|
|
56466
57232
|
};
|
|
57233
|
+
var registerElementHighlightByGraphicName = function registerElementHighlightByGraphicName() {
|
|
57234
|
+
Factory.registerInteraction(ElementHighlightByGraphicName.type, ElementHighlightByGraphicName);
|
|
57235
|
+
};
|
|
57236
|
+
var registerElementSelectByGraphicName = function registerElementSelectByGraphicName() {
|
|
57237
|
+
Factory.registerInteraction(ElementSelectByGraphicName.type, ElementSelectByGraphicName);
|
|
57238
|
+
};
|
|
56467
57239
|
|
|
56468
57240
|
var parseOptionValue = function parseOptionValue(value, params) {
|
|
56469
57241
|
return isGrammar(value) ? value.output() : value && isObject$4(value) ? isFunction$3(value.callback) ? function (datum) {
|
|
@@ -69542,6 +70314,20 @@
|
|
|
69542
70314
|
}(BasePluginService);
|
|
69543
70315
|
|
|
69544
70316
|
var svgSourceMap = new Map();
|
|
70317
|
+
var svgDataSet;
|
|
70318
|
+
function initSVGDataSet() {
|
|
70319
|
+
svgDataSet || (svgDataSet = new DataSet(), registerDataSetInstanceParser(svgDataSet, "svg", svgParser));
|
|
70320
|
+
}
|
|
70321
|
+
function registerSVGSource(key, source) {
|
|
70322
|
+
svgSourceMap.has(key) && warn("svg source key of '".concat(key, "' already exists, will be overwritten.")), initSVGDataSet();
|
|
70323
|
+
var dataView = new DataView(svgDataSet);
|
|
70324
|
+
dataView.parse(source, {
|
|
70325
|
+
type: "svg"
|
|
70326
|
+
}), svgSourceMap.set(key, dataView);
|
|
70327
|
+
}
|
|
70328
|
+
function unregisterSVGSource(key) {
|
|
70329
|
+
svgSourceMap.has(key) ? svgSourceMap["delete"](key) : warn("map type of '".concat(key, "' does not exists."));
|
|
70330
|
+
}
|
|
69545
70331
|
function getSVGSource(type) {
|
|
69546
70332
|
return svgSourceMap.get(type);
|
|
69547
70333
|
}
|
|
@@ -108919,6 +109705,701 @@
|
|
|
108919
109705
|
registerMosaicSeries(), Factory$1.registerChart(MosaicChart.type, MosaicChart);
|
|
108920
109706
|
};
|
|
108921
109707
|
|
|
109708
|
+
var PictogramChartSpecTransformer = /*#__PURE__*/function (_BaseChartSpecTransfo) {
|
|
109709
|
+
function PictogramChartSpecTransformer() {
|
|
109710
|
+
_classCallCheck(this, PictogramChartSpecTransformer);
|
|
109711
|
+
return _callSuper(this, PictogramChartSpecTransformer, arguments);
|
|
109712
|
+
}
|
|
109713
|
+
_inherits(PictogramChartSpecTransformer, _BaseChartSpecTransfo);
|
|
109714
|
+
return _createClass(PictogramChartSpecTransformer, [{
|
|
109715
|
+
key: "_isValidSeries",
|
|
109716
|
+
value: function _isValidSeries(type) {
|
|
109717
|
+
return type === SeriesTypeEnum.pictogram;
|
|
109718
|
+
}
|
|
109719
|
+
}, {
|
|
109720
|
+
key: "_getDefaultSeriesSpec",
|
|
109721
|
+
value: function _getDefaultSeriesSpec(spec) {
|
|
109722
|
+
return Object.assign(Object.assign({}, _superPropGet(PictogramChartSpecTransformer, "_getDefaultSeriesSpec", this, 3)([spec])), {
|
|
109723
|
+
type: spec.type,
|
|
109724
|
+
nameField: spec.nameField,
|
|
109725
|
+
valueField: spec.valueField,
|
|
109726
|
+
seriesField: spec.seriesField,
|
|
109727
|
+
svg: spec.svg,
|
|
109728
|
+
pictogram: spec.pictogram,
|
|
109729
|
+
defaultFillColor: spec.defaultFillColor
|
|
109730
|
+
});
|
|
109731
|
+
}
|
|
109732
|
+
}, {
|
|
109733
|
+
key: "transformSpec",
|
|
109734
|
+
value: function transformSpec(spec) {
|
|
109735
|
+
var _this = this;
|
|
109736
|
+
_superPropGet(PictogramChartSpecTransformer, "transformSpec", this, 3)([spec]), spec.region.forEach(function (r) {
|
|
109737
|
+
r.coordinate = "geo";
|
|
109738
|
+
});
|
|
109739
|
+
var defaultSeriesSpec = this._getDefaultSeriesSpec(spec);
|
|
109740
|
+
spec.series && 0 !== spec.series.length ? spec.series.forEach(function (s) {
|
|
109741
|
+
_this._isValidSeries(s.type) && Object.keys(defaultSeriesSpec).forEach(function (k) {
|
|
109742
|
+
k in s || (s[k] = defaultSeriesSpec[k]);
|
|
109743
|
+
});
|
|
109744
|
+
}) : spec.series = [defaultSeriesSpec];
|
|
109745
|
+
}
|
|
109746
|
+
}]);
|
|
109747
|
+
}(BaseChartSpecTransformer);
|
|
109748
|
+
|
|
109749
|
+
var PictogramSeriesMark = Object.assign(Object.assign({}, baseSeriesMark), {
|
|
109750
|
+
pictogram: {
|
|
109751
|
+
name: "pictogram",
|
|
109752
|
+
type: "group"
|
|
109753
|
+
}
|
|
109754
|
+
});
|
|
109755
|
+
|
|
109756
|
+
var PictogramSeriesSpecTransformer = /*#__PURE__*/function (_BaseSeriesSpecTransf) {
|
|
109757
|
+
function PictogramSeriesSpecTransformer() {
|
|
109758
|
+
_classCallCheck(this, PictogramSeriesSpecTransformer);
|
|
109759
|
+
return _callSuper(this, PictogramSeriesSpecTransformer, arguments);
|
|
109760
|
+
}
|
|
109761
|
+
_inherits(PictogramSeriesSpecTransformer, _BaseSeriesSpecTransf);
|
|
109762
|
+
return _createClass(PictogramSeriesSpecTransformer, [{
|
|
109763
|
+
key: "_getDefaultSpecFromChart",
|
|
109764
|
+
value: function _getDefaultSpecFromChart(chartSpec) {
|
|
109765
|
+
var _a, _b, _c;
|
|
109766
|
+
var spec = null !== (_a = _superPropGet(PictogramSeriesSpecTransformer, "_getDefaultSpecFromChart", this, 3)([chartSpec])) && void 0 !== _a ? _a : {},
|
|
109767
|
+
svg = chartSpec.svg,
|
|
109768
|
+
elements = null === (_c = null === (_b = svgSourceMap.get(svg)) || void 0 === _b ? void 0 : _b.latestData) || void 0 === _c ? void 0 : _c.elements;
|
|
109769
|
+
if (elements && elements.length) {
|
|
109770
|
+
elements.map(function (e) {
|
|
109771
|
+
return e.name;
|
|
109772
|
+
}).filter(function (n) {
|
|
109773
|
+
return isValid$3(n);
|
|
109774
|
+
}).forEach(function (name) {
|
|
109775
|
+
chartSpec[name] && (spec[name] = chartSpec[name]);
|
|
109776
|
+
});
|
|
109777
|
+
}
|
|
109778
|
+
return spec;
|
|
109779
|
+
}
|
|
109780
|
+
}]);
|
|
109781
|
+
}(BaseSeriesSpecTransformer);
|
|
109782
|
+
|
|
109783
|
+
var PictogramSeriesTooltipHelper = /*#__PURE__*/function (_BaseSeriesTooltipHel) {
|
|
109784
|
+
function PictogramSeriesTooltipHelper() {
|
|
109785
|
+
var _this;
|
|
109786
|
+
_classCallCheck(this, PictogramSeriesTooltipHelper);
|
|
109787
|
+
_this = _callSuper(this, PictogramSeriesTooltipHelper, arguments), _this.dimensionTooltipTitleCallback = function (datum) {
|
|
109788
|
+
var _a;
|
|
109789
|
+
var series = _this.series;
|
|
109790
|
+
return null !== (_a = _this._getDimensionData(datum)) && void 0 !== _a ? _a : series.getDatumName(datum);
|
|
109791
|
+
}, _this.markTooltipValueCallback = function (datum, params) {
|
|
109792
|
+
var measureFields = _this._seriesCacheInfo.measureFields;
|
|
109793
|
+
if (measureFields[0] && datum.data) return datum.data[measureFields[0]];
|
|
109794
|
+
}, _this.markTooltipKeyCallback = function (datum) {
|
|
109795
|
+
var _a;
|
|
109796
|
+
return null === (_a = datum.data) || void 0 === _a ? void 0 : _a[_this.series.getDimensionField()[0]];
|
|
109797
|
+
};
|
|
109798
|
+
return _this;
|
|
109799
|
+
}
|
|
109800
|
+
_inherits(PictogramSeriesTooltipHelper, _BaseSeriesTooltipHel);
|
|
109801
|
+
return _createClass(PictogramSeriesTooltipHelper);
|
|
109802
|
+
}(BaseSeriesTooltipHelper);
|
|
109803
|
+
|
|
109804
|
+
function isValidStrokeOrFill(attr) {
|
|
109805
|
+
var _a;
|
|
109806
|
+
return isValid$3(attr) && "none" !== attr && !(null === (_a = attr.includes) || void 0 === _a ? void 0 : _a.call(attr, "url"));
|
|
109807
|
+
}
|
|
109808
|
+
var getLineWidth = function getLineWidth(attributes) {
|
|
109809
|
+
var strokeWidth = parseFloat(attributes.strokeWidth);
|
|
109810
|
+
if (!isNaN(strokeWidth)) return strokeWidth;
|
|
109811
|
+
var stroke = attributes.stroke;
|
|
109812
|
+
return stroke && isValidStrokeOrFill(stroke) ? 1 : 0;
|
|
109813
|
+
},
|
|
109814
|
+
getFill = function getFill(attributes, defaultFill) {
|
|
109815
|
+
var _a;
|
|
109816
|
+
var fill = null !== (_a = attributes.fill) && void 0 !== _a ? _a : defaultFill;
|
|
109817
|
+
return fill && isValidStrokeOrFill(fill) ? fill : void 0;
|
|
109818
|
+
},
|
|
109819
|
+
getStroke = function getStroke(attributes, defaultStroke) {
|
|
109820
|
+
var _a;
|
|
109821
|
+
var stroke = null !== (_a = attributes.stroke) && void 0 !== _a ? _a : defaultStroke;
|
|
109822
|
+
return !(!stroke || !isValidStrokeOrFill(stroke)) && stroke;
|
|
109823
|
+
},
|
|
109824
|
+
commonAttributes = function commonAttributes(attributes) {
|
|
109825
|
+
return Object.assign(Object.assign({}, attributes), {
|
|
109826
|
+
x: parseFloat(attributes.x) || void 0,
|
|
109827
|
+
y: parseFloat(attributes.y) || void 0,
|
|
109828
|
+
fillStrokeOrder: !1,
|
|
109829
|
+
fill: getFill(attributes),
|
|
109830
|
+
lineWidth: getLineWidth(attributes),
|
|
109831
|
+
stroke: getStroke(attributes)
|
|
109832
|
+
});
|
|
109833
|
+
};
|
|
109834
|
+
var graphicAttributeTransform = {
|
|
109835
|
+
group: function group(attributes) {
|
|
109836
|
+
var common = commonAttributes(attributes);
|
|
109837
|
+
return Object.assign(Object.assign({}, common), {
|
|
109838
|
+
visibleAll: !1 !== common.visible
|
|
109839
|
+
});
|
|
109840
|
+
},
|
|
109841
|
+
rule: function rule(attributes) {
|
|
109842
|
+
return Object.assign(Object.assign({}, commonAttributes(attributes)), {
|
|
109843
|
+
x: parseFloat(attributes.x1),
|
|
109844
|
+
y: parseFloat(attributes.y1),
|
|
109845
|
+
x1: parseFloat(attributes.x2),
|
|
109846
|
+
y1: parseFloat(attributes.y2)
|
|
109847
|
+
});
|
|
109848
|
+
},
|
|
109849
|
+
rect: function rect(attributes) {
|
|
109850
|
+
return Object.assign(Object.assign({}, commonAttributes(attributes)), {
|
|
109851
|
+
fill: getFill(attributes, "#000"),
|
|
109852
|
+
width: parseFloat(attributes.width),
|
|
109853
|
+
height: parseFloat(attributes.height)
|
|
109854
|
+
});
|
|
109855
|
+
},
|
|
109856
|
+
polygon: function polygon(attributes) {
|
|
109857
|
+
return Object.assign(Object.assign({}, commonAttributes(attributes)), {
|
|
109858
|
+
fill: getFill(attributes, "#000"),
|
|
109859
|
+
points: attributes.points.trim().split(/\s+/).map(function (pair) {
|
|
109860
|
+
var _pair$split$map = pair.split(",").map(Number),
|
|
109861
|
+
_pair$split$map2 = _slicedToArray(_pair$split$map, 2),
|
|
109862
|
+
x = _pair$split$map2[0],
|
|
109863
|
+
y = _pair$split$map2[1];
|
|
109864
|
+
return {
|
|
109865
|
+
x: x,
|
|
109866
|
+
y: y
|
|
109867
|
+
};
|
|
109868
|
+
})
|
|
109869
|
+
});
|
|
109870
|
+
},
|
|
109871
|
+
line: function line(attributes) {
|
|
109872
|
+
return Object.assign(Object.assign({}, commonAttributes(attributes)), {
|
|
109873
|
+
points: attributes.points.trim().split(/\s+/).map(function (pair) {
|
|
109874
|
+
var _pair$split$map3 = pair.split(",").map(Number),
|
|
109875
|
+
_pair$split$map4 = _slicedToArray(_pair$split$map3, 2),
|
|
109876
|
+
x = _pair$split$map4[0],
|
|
109877
|
+
y = _pair$split$map4[1];
|
|
109878
|
+
return {
|
|
109879
|
+
x: x,
|
|
109880
|
+
y: y
|
|
109881
|
+
};
|
|
109882
|
+
})
|
|
109883
|
+
});
|
|
109884
|
+
},
|
|
109885
|
+
path: function path(attributes) {
|
|
109886
|
+
return Object.assign(Object.assign({}, commonAttributes(attributes)), {
|
|
109887
|
+
path: attributes.d,
|
|
109888
|
+
fillStrokeOrder: !1
|
|
109889
|
+
});
|
|
109890
|
+
},
|
|
109891
|
+
arc: function arc(attributes) {
|
|
109892
|
+
var _a;
|
|
109893
|
+
return Object.assign(Object.assign({}, commonAttributes(attributes)), {
|
|
109894
|
+
outerRadius: null !== (_a = attributes.r) && void 0 !== _a ? _a : attributes.ry,
|
|
109895
|
+
x: parseFloat(attributes.cx),
|
|
109896
|
+
y: parseFloat(attributes.cy),
|
|
109897
|
+
startAngle: 0,
|
|
109898
|
+
endAngle: 2 * Math.PI,
|
|
109899
|
+
scaleX: parseFloat(attributes.rx) / parseFloat(attributes.ry) || 1,
|
|
109900
|
+
fill: getFill(attributes, "#000")
|
|
109901
|
+
});
|
|
109902
|
+
},
|
|
109903
|
+
text: function text(attributes, value) {
|
|
109904
|
+
var _a, _b;
|
|
109905
|
+
return Object.assign(Object.assign({}, commonAttributes(attributes)), {
|
|
109906
|
+
text: value,
|
|
109907
|
+
textAlign: null !== (_a = attributes.textAlign) && void 0 !== _a ? _a : "left",
|
|
109908
|
+
textBaseLine: null !== (_b = attributes.textAnchor) && void 0 !== _b ? _b : "middle",
|
|
109909
|
+
anchor: [0, 0],
|
|
109910
|
+
fill: getFill(attributes, "#000")
|
|
109911
|
+
});
|
|
109912
|
+
}
|
|
109913
|
+
};
|
|
109914
|
+
var pictogram = function pictogram(data) {
|
|
109915
|
+
var _a, _b;
|
|
109916
|
+
if (!data || !data[0]) return {};
|
|
109917
|
+
var elements = data[0].latestData.elements;
|
|
109918
|
+
if (elements && elements.length) {
|
|
109919
|
+
elements.forEach(function (el, index) {
|
|
109920
|
+
var _a;
|
|
109921
|
+
el[DEFAULT_DATA_INDEX] = index, el._uniqueId = "".concat(el.id, "-").concat(index), el.data = void 0;
|
|
109922
|
+
var type = el.graphicType,
|
|
109923
|
+
transform = el.transform;
|
|
109924
|
+
var finalAttributes = {
|
|
109925
|
+
visible: "hidden" !== el.attributes.visibility && "collapse" !== el.attributes.visibility
|
|
109926
|
+
};
|
|
109927
|
+
"text" === el.graphicType ? merge$2(finalAttributes, el._inheritStyle, null === (_a = el.parent) || void 0 === _a ? void 0 : _a._textGroupStyle, el.attributes) : "group" !== el.graphicType && merge$2(finalAttributes, el._inheritStyle, el.attributes), graphicAttributeTransform[type] ? el._finalAttributes = graphicAttributeTransform[type](finalAttributes, el.value) : el._finalAttributes = finalAttributes, transform && (el._finalAttributes.postMatrix = Object.assign({}, transform));
|
|
109928
|
+
});
|
|
109929
|
+
var texts = elements.filter(function (el) {
|
|
109930
|
+
return "text" === el.tagName;
|
|
109931
|
+
});
|
|
109932
|
+
var _loop = function _loop() {
|
|
109933
|
+
var textId = texts[i]._uniqueId,
|
|
109934
|
+
children = elements.filter(function (el) {
|
|
109935
|
+
var result = !1,
|
|
109936
|
+
parent = el.parent;
|
|
109937
|
+
for (; parent;) {
|
|
109938
|
+
if (parent._uniqueId === textId) {
|
|
109939
|
+
result = !0;
|
|
109940
|
+
break;
|
|
109941
|
+
}
|
|
109942
|
+
parent = parent.parent;
|
|
109943
|
+
}
|
|
109944
|
+
return result;
|
|
109945
|
+
});
|
|
109946
|
+
if (children && children.length) {
|
|
109947
|
+
var startX = null !== (_b = null === (_a = texts[i]._textGroupStyle) || void 0 === _a ? void 0 : _a.x) && void 0 !== _b ? _b : 0,
|
|
109948
|
+
curX = startX;
|
|
109949
|
+
for (var j = 0; j < children.length; j++) {
|
|
109950
|
+
var currentChild = children[j];
|
|
109951
|
+
if ("group" === currentChild.graphicType) curX = startX;else if (currentChild.value && void 0 === currentChild.parent._textGroupStyle.x) {
|
|
109952
|
+
var lastText = children.slice(0, j).reverse().find(function (c) {
|
|
109953
|
+
return "text" === c.graphicType && c.value;
|
|
109954
|
+
});
|
|
109955
|
+
if (lastText) {
|
|
109956
|
+
curX += measureText(lastText.value, lastText._finalAttributes).width;
|
|
109957
|
+
}
|
|
109958
|
+
currentChild._finalAttributes.x = curX;
|
|
109959
|
+
}
|
|
109960
|
+
}
|
|
109961
|
+
}
|
|
109962
|
+
};
|
|
109963
|
+
for (var i = 0; i < texts.length; i++) {
|
|
109964
|
+
_loop();
|
|
109965
|
+
}
|
|
109966
|
+
}
|
|
109967
|
+
return elements;
|
|
109968
|
+
};
|
|
109969
|
+
|
|
109970
|
+
var PictogramSeries = /*#__PURE__*/function (_GeoSeries) {
|
|
109971
|
+
function PictogramSeries() {
|
|
109972
|
+
var _this;
|
|
109973
|
+
_classCallCheck(this, PictogramSeries);
|
|
109974
|
+
_this = _callSuper(this, PictogramSeries, arguments), _this.type = SeriesTypeEnum.pictogram;
|
|
109975
|
+
return _this;
|
|
109976
|
+
}
|
|
109977
|
+
_inherits(PictogramSeries, _GeoSeries);
|
|
109978
|
+
return _createClass(PictogramSeries, [{
|
|
109979
|
+
key: "setAttrFromSpec",
|
|
109980
|
+
value: function setAttrFromSpec() {
|
|
109981
|
+
var _a, _b, _c;
|
|
109982
|
+
_superPropGet(PictogramSeries, "setAttrFromSpec", this, 3)([]), this.svg = this._spec.svg, this._nameField = this._spec.nameField, this._valueField = this._spec.valueField, this.svg || null === (_a = this._option) || void 0 === _a || _a.onError("svg source is not specified !"), this._parsedSvgResult = null === (_b = getSVGSource(this.svg)) || void 0 === _b ? void 0 : _b.latestData, this._parsedSvgResult || null === (_c = this._option) || void 0 === _c || _c.onError("'".concat(this.svg, "' is not registered !"));
|
|
109983
|
+
}
|
|
109984
|
+
}, {
|
|
109985
|
+
key: "getDatumCenter",
|
|
109986
|
+
value: function getDatumCenter(datum) {
|
|
109987
|
+
return [Number.NaN, Number.NaN];
|
|
109988
|
+
}
|
|
109989
|
+
}, {
|
|
109990
|
+
key: "getDatumName",
|
|
109991
|
+
value: function getDatumName(datum) {
|
|
109992
|
+
return datum.name || datum._nameFromParent;
|
|
109993
|
+
}
|
|
109994
|
+
}, {
|
|
109995
|
+
key: "getMarksWithoutRoot",
|
|
109996
|
+
value: function getMarksWithoutRoot() {
|
|
109997
|
+
var _this2 = this;
|
|
109998
|
+
return this.getMarks().filter(function (m) {
|
|
109999
|
+
return m.name && !m.name.includes("seriesGroup") && !m.name.includes("root") && m !== _this2._pictogramMark;
|
|
110000
|
+
});
|
|
110001
|
+
}
|
|
110002
|
+
}, {
|
|
110003
|
+
key: "_buildMarkAttributeContext",
|
|
110004
|
+
value: function _buildMarkAttributeContext() {
|
|
110005
|
+
_superPropGet(PictogramSeries, "_buildMarkAttributeContext", this, 3)([]), this._markAttributeContext.getTransformMatrix = this.getRootMatrix.bind(this), this._markAttributeContext.coordToPosition = this.coordToPosition.bind(this), this._markAttributeContext.dataToPosition = this.dataToPosition.bind(this);
|
|
110006
|
+
}
|
|
110007
|
+
}, {
|
|
110008
|
+
key: "_defaultHoverConfig",
|
|
110009
|
+
value: function _defaultHoverConfig(selector, finalHoverSpec) {
|
|
110010
|
+
return {
|
|
110011
|
+
seriesId: this.id,
|
|
110012
|
+
regionId: this._region.id,
|
|
110013
|
+
selector: selector,
|
|
110014
|
+
type: "element-highlight-by-graphic-name",
|
|
110015
|
+
trigger: finalHoverSpec.trigger,
|
|
110016
|
+
triggerOff: "pointerout",
|
|
110017
|
+
blurState: STATE_VALUE_ENUM.STATE_HOVER_REVERSE,
|
|
110018
|
+
highlightState: STATE_VALUE_ENUM.STATE_HOVER
|
|
110019
|
+
};
|
|
110020
|
+
}
|
|
110021
|
+
}, {
|
|
110022
|
+
key: "_defaultSelectConfig",
|
|
110023
|
+
value: function _defaultSelectConfig(selector, finalSelectSpec) {
|
|
110024
|
+
var isMultiple = "multiple" === finalSelectSpec.mode,
|
|
110025
|
+
triggerOff = isValid$3(finalSelectSpec.triggerOff) ? finalSelectSpec.triggerOff : isMultiple ? ["empty", "self"] : ["empty", finalSelectSpec.trigger];
|
|
110026
|
+
return {
|
|
110027
|
+
type: "element-select-by-graphic-name",
|
|
110028
|
+
seriesId: this.id,
|
|
110029
|
+
regionId: this._region.id,
|
|
110030
|
+
selector: selector,
|
|
110031
|
+
trigger: finalSelectSpec.trigger,
|
|
110032
|
+
triggerOff: triggerOff,
|
|
110033
|
+
reverseState: STATE_VALUE_ENUM.STATE_SELECTED_REVERSE,
|
|
110034
|
+
state: STATE_VALUE_ENUM.STATE_SELECTED,
|
|
110035
|
+
isMultiple: isMultiple
|
|
110036
|
+
};
|
|
110037
|
+
}
|
|
110038
|
+
}, {
|
|
110039
|
+
key: "initMark",
|
|
110040
|
+
value: function initMark() {
|
|
110041
|
+
var _this3 = this;
|
|
110042
|
+
var _a;
|
|
110043
|
+
if (this._pictogramMark = this._createMark(PictogramSeries.mark.pictogram, {
|
|
110044
|
+
groupKey: this.getDimensionField()[0],
|
|
110045
|
+
isSeriesMark: !0,
|
|
110046
|
+
skipBeforeLayouted: !0,
|
|
110047
|
+
dataView: this._mapViewData.getDataView(),
|
|
110048
|
+
dataProductId: this._mapViewData.getProductId()
|
|
110049
|
+
}, {
|
|
110050
|
+
morph: shouldMarkDoMorph(this._spec, PictogramSeries.mark.pictogram.name)
|
|
110051
|
+
}), this._pictogramMark) {
|
|
110052
|
+
this._pictogramMark.setUserId(PictogramSeries.mark.pictogram.name);
|
|
110053
|
+
var _iterator = _createForOfIteratorHelper(this._mapViewData.getDataView().latestData),
|
|
110054
|
+
_step;
|
|
110055
|
+
try {
|
|
110056
|
+
var _loop = function _loop() {
|
|
110057
|
+
var element = _step.value;
|
|
110058
|
+
var type = element.graphicType,
|
|
110059
|
+
name = element.name,
|
|
110060
|
+
parent = element.parent,
|
|
110061
|
+
id = element.id,
|
|
110062
|
+
_nameFromParent = element._nameFromParent,
|
|
110063
|
+
_uniqueId = element._uniqueId,
|
|
110064
|
+
mark = _this3._createMark({
|
|
110065
|
+
type: type,
|
|
110066
|
+
name: null != name ? name : _nameFromParent
|
|
110067
|
+
}, {
|
|
110068
|
+
groupKey: _uniqueId,
|
|
110069
|
+
isSeriesMark: !1,
|
|
110070
|
+
skipBeforeLayouted: !0,
|
|
110071
|
+
dataView: _this3._mapViewData.getDataView(),
|
|
110072
|
+
dataProductId: _this3._mapViewData.getProductId(),
|
|
110073
|
+
parent: null !== (_a = _this3._pictogramMark.getMarkInUserId(null == parent ? void 0 : parent._uniqueId)) && void 0 !== _a ? _a : _this3._pictogramMark
|
|
110074
|
+
}, {
|
|
110075
|
+
morph: shouldMarkDoMorph(_this3._spec, PictogramSeries.mark.pictogram.name)
|
|
110076
|
+
});
|
|
110077
|
+
mark && (mark.setUserId(_uniqueId), "group" !== mark.type && mark.setMarkConfig({
|
|
110078
|
+
graphicName: mark.name
|
|
110079
|
+
}), mark.setTransform([{
|
|
110080
|
+
type: "filter",
|
|
110081
|
+
callback: function callback(datum) {
|
|
110082
|
+
return datum._uniqueId === _uniqueId;
|
|
110083
|
+
}
|
|
110084
|
+
}]));
|
|
110085
|
+
};
|
|
110086
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
110087
|
+
_loop();
|
|
110088
|
+
}
|
|
110089
|
+
} catch (err) {
|
|
110090
|
+
_iterator.e(err);
|
|
110091
|
+
} finally {
|
|
110092
|
+
_iterator.f();
|
|
110093
|
+
}
|
|
110094
|
+
this._initLabelMark();
|
|
110095
|
+
}
|
|
110096
|
+
}
|
|
110097
|
+
}, {
|
|
110098
|
+
key: "_initLabelMark",
|
|
110099
|
+
value: function _initLabelMark() {
|
|
110100
|
+
if (!0 !== this._spec.label.visible) return;
|
|
110101
|
+
var labelMark = this._createMark(PictogramSeries.mark.label, {
|
|
110102
|
+
isSeriesMark: !1,
|
|
110103
|
+
parent: this._pictogramMark,
|
|
110104
|
+
groupKey: "_uniqueId",
|
|
110105
|
+
skipBeforeLayouted: !0,
|
|
110106
|
+
depend: this.getMarksWithoutRoot()
|
|
110107
|
+
});
|
|
110108
|
+
labelMark && (this._labelMark = labelMark, this._labelMark.setDataView(this._mapViewData.getDataView()));
|
|
110109
|
+
}
|
|
110110
|
+
}, {
|
|
110111
|
+
key: "initLabelMarkStyle",
|
|
110112
|
+
value: function initLabelMarkStyle() {
|
|
110113
|
+
var _this4 = this;
|
|
110114
|
+
this._labelMark && this.setMarkStyle(this._labelMark, {
|
|
110115
|
+
visible: function visible(d) {
|
|
110116
|
+
return !!_this4._validElement(d);
|
|
110117
|
+
},
|
|
110118
|
+
x: function x(d) {
|
|
110119
|
+
var _a;
|
|
110120
|
+
return null === (_a = _this4.dataToPosition(d, !0)) || void 0 === _a ? void 0 : _a.x;
|
|
110121
|
+
},
|
|
110122
|
+
y: function y(d) {
|
|
110123
|
+
var _a;
|
|
110124
|
+
return null === (_a = _this4.dataToPosition(d, !0)) || void 0 === _a ? void 0 : _a.y;
|
|
110125
|
+
},
|
|
110126
|
+
text: function text(d) {
|
|
110127
|
+
return d[_this4.nameField];
|
|
110128
|
+
},
|
|
110129
|
+
textAlign: "center",
|
|
110130
|
+
textBaseline: "middle"
|
|
110131
|
+
}, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series);
|
|
110132
|
+
}
|
|
110133
|
+
}, {
|
|
110134
|
+
key: "initMarkStyle",
|
|
110135
|
+
value: function initMarkStyle() {
|
|
110136
|
+
var _this5 = this;
|
|
110137
|
+
var _this$_parsedSvgResul = this._parsedSvgResult,
|
|
110138
|
+
root = _this$_parsedSvgResul.root,
|
|
110139
|
+
viewBoxRect = _this$_parsedSvgResul.viewBoxRect,
|
|
110140
|
+
elements = this._mapViewData.getDataView().latestData;
|
|
110141
|
+
root && (this.setMarkStyle(this._pictogramMark, graphicAttributeTransform.group(root.attributes), "normal", AttributeLevel.Built_In), root.transform && this.setMarkStyle(this._pictogramMark, {
|
|
110142
|
+
postMatrix: function postMatrix() {
|
|
110143
|
+
return root.transform;
|
|
110144
|
+
}
|
|
110145
|
+
}, "normal", AttributeLevel.Built_In), viewBoxRect && this._pictogramMark.setMarkConfig({
|
|
110146
|
+
clip: !0,
|
|
110147
|
+
clipPath: [createRect(Object.assign(Object.assign({}, viewBoxRect), {
|
|
110148
|
+
fill: !0
|
|
110149
|
+
}))]
|
|
110150
|
+
}));
|
|
110151
|
+
var _iterator2 = _createForOfIteratorHelper(elements),
|
|
110152
|
+
_step2;
|
|
110153
|
+
try {
|
|
110154
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
110155
|
+
var element = _step2.value;
|
|
110156
|
+
var _uniqueId = element._uniqueId,
|
|
110157
|
+
attributes = element._finalAttributes,
|
|
110158
|
+
mark = this._pictogramMark.getMarkInUserId(_uniqueId),
|
|
110159
|
+
valid = this._validElement(element);
|
|
110160
|
+
mark && (this.setMarkStyle(mark, {
|
|
110161
|
+
keepStrokeScale: !0
|
|
110162
|
+
}, "normal", AttributeLevel.Built_In), valid ? (this.initMarkStyleWithSpec(mark, merge$2({}, this._spec.pictogram, this._spec[mark.name])), this.setMarkStyle(mark, attributes, "normal", AttributeLevel.Series), mark.setPostProcess("fill", function (result, datum) {
|
|
110163
|
+
return isValid$3(result) ? result : _this5._spec.defaultFillColor;
|
|
110164
|
+
})) : (mark.setMarkConfig({
|
|
110165
|
+
interactive: !1
|
|
110166
|
+
}), this.setMarkStyle(mark, attributes, "normal", AttributeLevel.Built_In)));
|
|
110167
|
+
}
|
|
110168
|
+
} catch (err) {
|
|
110169
|
+
_iterator2.e(err);
|
|
110170
|
+
} finally {
|
|
110171
|
+
_iterator2.f();
|
|
110172
|
+
}
|
|
110173
|
+
this.initLabelMarkStyle();
|
|
110174
|
+
}
|
|
110175
|
+
}, {
|
|
110176
|
+
key: "_validElement",
|
|
110177
|
+
value: function _validElement(element) {
|
|
110178
|
+
return element.name || element._nameFromParent;
|
|
110179
|
+
}
|
|
110180
|
+
}, {
|
|
110181
|
+
key: "initTooltip",
|
|
110182
|
+
value: function initTooltip() {
|
|
110183
|
+
var _this6 = this;
|
|
110184
|
+
this._tooltipHelper = new PictogramSeriesTooltipHelper(this), this.getMarksWithoutRoot().forEach(function (mark) {
|
|
110185
|
+
mark && mark.name && _this6._tooltipHelper.activeTriggerSet.mark.add(mark);
|
|
110186
|
+
});
|
|
110187
|
+
}
|
|
110188
|
+
}, {
|
|
110189
|
+
key: "dataToPosition",
|
|
110190
|
+
value: function dataToPosition(datum) {
|
|
110191
|
+
var global = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
110192
|
+
if (!datum) return null;
|
|
110193
|
+
var name = datum[this.nameField];
|
|
110194
|
+
if (!name) return null;
|
|
110195
|
+
var mark = this.getMarksWithoutRoot().filter(function (mark) {
|
|
110196
|
+
return mark.name === name;
|
|
110197
|
+
});
|
|
110198
|
+
if (!mark || 0 === mark.length) return null;
|
|
110199
|
+
var bounds = new Bounds$1();
|
|
110200
|
+
global ? mark.forEach(function (m) {
|
|
110201
|
+
bounds = bounds.union(m.getProduct().getGroupGraphicItem().globalAABBBounds);
|
|
110202
|
+
}) : mark.forEach(function (m) {
|
|
110203
|
+
bounds = bounds.union(m.getProduct().getBounds());
|
|
110204
|
+
});
|
|
110205
|
+
var point = {
|
|
110206
|
+
x: (bounds.x1 + bounds.x2) / 2,
|
|
110207
|
+
y: (bounds.y1 + bounds.y2) / 2
|
|
110208
|
+
};
|
|
110209
|
+
if (global) {
|
|
110210
|
+
var _this$getLayoutStartP = this.getLayoutStartPoint(),
|
|
110211
|
+
x = _this$getLayoutStartP.x,
|
|
110212
|
+
y = _this$getLayoutStartP.y;
|
|
110213
|
+
point.x -= x, point.y -= y;
|
|
110214
|
+
}
|
|
110215
|
+
return point;
|
|
110216
|
+
}
|
|
110217
|
+
}, {
|
|
110218
|
+
key: "coordToPosition",
|
|
110219
|
+
value: function coordToPosition(point) {
|
|
110220
|
+
if (!point) return null;
|
|
110221
|
+
var x = point.x,
|
|
110222
|
+
y = point.y,
|
|
110223
|
+
matrix = this.getRootMatrix();
|
|
110224
|
+
if (!matrix) return null;
|
|
110225
|
+
var position = {};
|
|
110226
|
+
return matrix.getInverse().transformPoint({
|
|
110227
|
+
x: x,
|
|
110228
|
+
y: y
|
|
110229
|
+
}, position), position;
|
|
110230
|
+
}
|
|
110231
|
+
}, {
|
|
110232
|
+
key: "getRootMatrix",
|
|
110233
|
+
value: function getRootMatrix() {
|
|
110234
|
+
var _a;
|
|
110235
|
+
return null === (_a = this.getPictogramRootGraphic()) || void 0 === _a ? void 0 : _a.transMatrix;
|
|
110236
|
+
}
|
|
110237
|
+
}, {
|
|
110238
|
+
key: "getPictogramRootGraphic",
|
|
110239
|
+
value: function getPictogramRootGraphic() {
|
|
110240
|
+
var _a;
|
|
110241
|
+
return null === (_a = this._pictogramMark.getProduct()) || void 0 === _a ? void 0 : _a.getGroupGraphicItem();
|
|
110242
|
+
}
|
|
110243
|
+
}, {
|
|
110244
|
+
key: "initData",
|
|
110245
|
+
value: function initData() {
|
|
110246
|
+
var _this7 = this;
|
|
110247
|
+
var _a, _b;
|
|
110248
|
+
_superPropGet(PictogramSeries, "initData", this, 3)([]);
|
|
110249
|
+
var parsedSvg = svgSourceMap.get(this.svg);
|
|
110250
|
+
parsedSvg || null === (_a = this._option) || void 0 === _a || _a.onError("no valid svg found!");
|
|
110251
|
+
var svgData = new DataView(this._dataSet, {
|
|
110252
|
+
name: "pictogram_".concat(this.id, "_data")
|
|
110253
|
+
});
|
|
110254
|
+
registerDataSetInstanceTransform(this._dataSet, "pictogram", pictogram), registerDataSetInstanceTransform(this._dataSet, "lookup", lookup), svgData.parse([parsedSvg], {
|
|
110255
|
+
type: "dataview"
|
|
110256
|
+
}).transform({
|
|
110257
|
+
type: "pictogram"
|
|
110258
|
+
}).transform({
|
|
110259
|
+
type: "lookup",
|
|
110260
|
+
options: {
|
|
110261
|
+
from: function from() {
|
|
110262
|
+
return _this7.getViewData().latestData;
|
|
110263
|
+
},
|
|
110264
|
+
key: "name",
|
|
110265
|
+
fields: this._nameField,
|
|
110266
|
+
set: function set(a, b) {
|
|
110267
|
+
b && (a.data = b);
|
|
110268
|
+
}
|
|
110269
|
+
}
|
|
110270
|
+
}).transform({
|
|
110271
|
+
type: "lookup",
|
|
110272
|
+
options: {
|
|
110273
|
+
from: function from() {
|
|
110274
|
+
return _this7.getViewData().latestData;
|
|
110275
|
+
},
|
|
110276
|
+
key: "_nameFromParent",
|
|
110277
|
+
fields: this._nameField,
|
|
110278
|
+
set: function set(a, b) {
|
|
110279
|
+
b && (a.data = b);
|
|
110280
|
+
}
|
|
110281
|
+
}
|
|
110282
|
+
}), null === (_b = this._data) || void 0 === _b || _b.getDataView().target.addListener("change", svgData.reRunAllTransform), this._mapViewData = new SeriesData(this._option, svgData);
|
|
110283
|
+
}
|
|
110284
|
+
}, {
|
|
110285
|
+
key: "mapViewDataUpdate",
|
|
110286
|
+
value: function mapViewDataUpdate() {
|
|
110287
|
+
this._mapViewData.updateData();
|
|
110288
|
+
}
|
|
110289
|
+
}, {
|
|
110290
|
+
key: "onLayoutEnd",
|
|
110291
|
+
value: function onLayoutEnd(ctx) {
|
|
110292
|
+
var _a;
|
|
110293
|
+
_superPropGet(PictogramSeries, "onLayoutEnd", this, 3)([ctx]), null === (_a = this._mapViewData) || void 0 === _a || _a.getDataView().reRunAllTransform();
|
|
110294
|
+
}
|
|
110295
|
+
}, {
|
|
110296
|
+
key: "updateSVGSize",
|
|
110297
|
+
value: function updateSVGSize() {
|
|
110298
|
+
var _this$getLayoutRect = this.getLayoutRect(),
|
|
110299
|
+
regionWidth = _this$getLayoutRect.width,
|
|
110300
|
+
regionHeight = _this$getLayoutRect.height,
|
|
110301
|
+
regionCenterX = regionWidth / 2,
|
|
110302
|
+
regionCenterY = regionHeight / 2,
|
|
110303
|
+
root = this.getPictogramRootGraphic();
|
|
110304
|
+
if (root) {
|
|
110305
|
+
var bounds = root.AABBBounds,
|
|
110306
|
+
_root$AABBBounds = root.AABBBounds,
|
|
110307
|
+
x1 = _root$AABBBounds.x1,
|
|
110308
|
+
x2 = _root$AABBBounds.x2,
|
|
110309
|
+
y1 = _root$AABBBounds.y1,
|
|
110310
|
+
y2 = _root$AABBBounds.y2,
|
|
110311
|
+
rootCenterX = (x1 + x2) / 2,
|
|
110312
|
+
rootCenterY = (y1 + y2) / 2,
|
|
110313
|
+
scaleX = regionWidth / bounds.width(),
|
|
110314
|
+
scaleY = regionHeight / bounds.height(),
|
|
110315
|
+
scale = Math.min(scaleX, scaleY);
|
|
110316
|
+
root.scale(scale, scale, {
|
|
110317
|
+
x: rootCenterX,
|
|
110318
|
+
y: rootCenterY
|
|
110319
|
+
}), root.translate(regionCenterX - rootCenterX, regionCenterY - rootCenterY);
|
|
110320
|
+
}
|
|
110321
|
+
}
|
|
110322
|
+
}, {
|
|
110323
|
+
key: "initEvent",
|
|
110324
|
+
value: function initEvent() {
|
|
110325
|
+
var _a;
|
|
110326
|
+
_superPropGet(PictogramSeries, "initEvent", this, 3)([]), null === (_a = this._mapViewData.getDataView()) || void 0 === _a || _a.target.addListener("change", this.mapViewDataUpdate.bind(this)), this.event.on(HOOK_EVENT.AFTER_MARK_LAYOUT_END, this.updateSVGSize.bind(this));
|
|
110327
|
+
}
|
|
110328
|
+
}, {
|
|
110329
|
+
key: "handleZoom",
|
|
110330
|
+
value: function handleZoom(e) {
|
|
110331
|
+
var scale = e.scale,
|
|
110332
|
+
scaleCenter = e.scaleCenter;
|
|
110333
|
+
if (1 === scale) return;
|
|
110334
|
+
var root = this.getPictogramRootGraphic();
|
|
110335
|
+
root && (root.attribute.postMatrix || root.setAttributes({
|
|
110336
|
+
postMatrix: new Matrix()
|
|
110337
|
+
}), root.scale(scale, scale, scaleCenter));
|
|
110338
|
+
}
|
|
110339
|
+
}, {
|
|
110340
|
+
key: "handlePan",
|
|
110341
|
+
value: function handlePan(e) {
|
|
110342
|
+
var delta = e.delta;
|
|
110343
|
+
if (0 === delta[0] && 0 === delta[1]) return;
|
|
110344
|
+
var root = this.getPictogramRootGraphic();
|
|
110345
|
+
root && (root.attribute.postMatrix || root.setAttributes({
|
|
110346
|
+
postMatrix: new Matrix()
|
|
110347
|
+
}), root.translate(delta[0], delta[1]));
|
|
110348
|
+
}
|
|
110349
|
+
}, {
|
|
110350
|
+
key: "getMarkData",
|
|
110351
|
+
value: function getMarkData(datum) {
|
|
110352
|
+
var _a;
|
|
110353
|
+
return null !== (_a = datum.data) && void 0 !== _a ? _a : {};
|
|
110354
|
+
}
|
|
110355
|
+
}, {
|
|
110356
|
+
key: "getMeasureField",
|
|
110357
|
+
value: function getMeasureField() {
|
|
110358
|
+
return [this.valueField];
|
|
110359
|
+
}
|
|
110360
|
+
}, {
|
|
110361
|
+
key: "getDimensionField",
|
|
110362
|
+
value: function getDimensionField() {
|
|
110363
|
+
return [this.nameField];
|
|
110364
|
+
}
|
|
110365
|
+
}, {
|
|
110366
|
+
key: "_getSeriesInfo",
|
|
110367
|
+
value: function _getSeriesInfo(field, keys) {
|
|
110368
|
+
var _this8 = this;
|
|
110369
|
+
var defaultShapeType = this.getDefaultShapeType();
|
|
110370
|
+
return keys.map(function (key) {
|
|
110371
|
+
return {
|
|
110372
|
+
key: key,
|
|
110373
|
+
originalKey: key,
|
|
110374
|
+
style: _this8.getSeriesStyle({
|
|
110375
|
+
data: _defineProperty({}, field, key)
|
|
110376
|
+
}),
|
|
110377
|
+
shapeType: defaultShapeType
|
|
110378
|
+
};
|
|
110379
|
+
});
|
|
110380
|
+
}
|
|
110381
|
+
}]);
|
|
110382
|
+
}(GeoSeries);
|
|
110383
|
+
PictogramSeries.type = SeriesTypeEnum.pictogram, PictogramSeries.mark = PictogramSeriesMark, PictogramSeries.transformerConstructor = PictogramSeriesSpecTransformer;
|
|
110384
|
+
var registerPictogramSeries = function registerPictogramSeries() {
|
|
110385
|
+
Factory$1.registerSeries(PictogramSeries.type, PictogramSeries), Factory$1.registerImplement("registerSVG", registerSVGSource), Factory$1.registerImplement("unregisterSVG", unregisterSVGSource), registerElementHighlightByGraphicName(), registerElementSelectByGraphicName();
|
|
110386
|
+
};
|
|
110387
|
+
|
|
110388
|
+
var PictogramChart = /*#__PURE__*/function (_BaseChart) {
|
|
110389
|
+
function PictogramChart() {
|
|
110390
|
+
var _this;
|
|
110391
|
+
_classCallCheck(this, PictogramChart);
|
|
110392
|
+
_this = _callSuper(this, PictogramChart, arguments), _this.transformerConstructor = PictogramChartSpecTransformer, _this.type = "pictogram", _this.seriesType = SeriesTypeEnum.pictogram;
|
|
110393
|
+
return _this;
|
|
110394
|
+
}
|
|
110395
|
+
_inherits(PictogramChart, _BaseChart);
|
|
110396
|
+
return _createClass(PictogramChart);
|
|
110397
|
+
}(BaseChart);
|
|
110398
|
+
PictogramChart.type = "pictogram", PictogramChart.seriesType = SeriesTypeEnum.pictogram, PictogramChart.transformerConstructor = PictogramChartSpecTransformer;
|
|
110399
|
+
var registerPictogramChart = function registerPictogramChart() {
|
|
110400
|
+
registerPictogramSeries(), Factory$1.registerChart(PictogramChart.type, PictogramChart);
|
|
110401
|
+
};
|
|
110402
|
+
|
|
108922
110403
|
var __rest$1 = undefined && undefined.__rest || function (s, e) {
|
|
108923
110404
|
var t = {};
|
|
108924
110405
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
@@ -110314,7 +111795,7 @@
|
|
|
110314
111795
|
}(CharacterChart);
|
|
110315
111796
|
VChartCharacter.type = "VChart";
|
|
110316
111797
|
var registerAllVChart = function registerAllVChart() {
|
|
110317
|
-
registerVennChart(), registerLiquidChart(), registerMosaicChart();
|
|
111798
|
+
registerVennChart(), registerLiquidChart(), registerMosaicChart(), registerPictogramChart();
|
|
110318
111799
|
};
|
|
110319
111800
|
|
|
110320
111801
|
var WaveAnimate = /*#__PURE__*/function (_ACustomAnimate) {
|
|
@@ -111110,7 +112591,10 @@
|
|
|
111110
112591
|
key: "transformTextAttrsToRichTextConfig",
|
|
111111
112592
|
value: function transformTextAttrsToRichTextConfig(textStyle, align) {
|
|
111112
112593
|
var textConfig = textStyle.textConfig;
|
|
111113
|
-
if (
|
|
112594
|
+
if (textConfig && textConfig.length || !textStyle.text) textConfig && textConfig.length && textConfig.forEach(function (item) {
|
|
112595
|
+
var _a;
|
|
112596
|
+
item.textAlign = align, item.lineHeight = null !== (_a = item.lineHeight) && void 0 !== _a ? _a : textStyle.lineHeight;
|
|
112597
|
+
});else {
|
|
111114
112598
|
var textList = Array.isArray(textStyle.text) ? textStyle.text : [textStyle.text];
|
|
111115
112599
|
textConfig = textList.map(function (item, i) {
|
|
111116
112600
|
return {
|
|
@@ -112503,7 +113987,9 @@
|
|
|
112503
113987
|
componentStyle = Object.assign({}, panelStyle);
|
|
112504
113988
|
["x", "y", "dx", "dy", "scaleX", "scaleY", "width", "height"].forEach(function (key) {
|
|
112505
113989
|
key in graphicStyle && (componentStyle[key] = graphicStyle[key], delete graphicStyle[key]);
|
|
112506
|
-
}), component && (component.styleAnimate ? component.styleAnimate(componentStyle, animation) : component.animate().to(componentStyle, duration, easing)), graphic && graphicStyle && (graphic.styleAnimate ? graphic.styleAnimate(graphicStyle, animation) : graphic.animate().to(graphicStyle, duration, easing)), text && textStyle && text.
|
|
113990
|
+
}), component && (component.styleAnimate ? component.styleAnimate(componentStyle, animation) : component.animate().to(componentStyle, duration, easing)), graphic && graphicStyle && (graphic.styleAnimate ? graphic.styleAnimate(graphicStyle, animation) : graphic.animate().to(graphicStyle, duration, easing)), text && textStyle && (textStyle.text && text.attribute.textConfig && (textStyle.textConfig = [Object.assign(Object.assign({}, (text.attribute.textConfig || [])[0]), {
|
|
113991
|
+
text: textStyle.text
|
|
113992
|
+
})]), text.animate().to(textStyle, duration, easing));
|
|
112507
113993
|
}
|
|
112508
113994
|
}]);
|
|
112509
113995
|
}(ActionProcessorItem);
|
|
@@ -113510,7 +114996,7 @@
|
|
|
113510
114996
|
registerTextVisibilityAction();
|
|
113511
114997
|
}
|
|
113512
114998
|
|
|
113513
|
-
var DefaultVisibility$
|
|
114999
|
+
var DefaultVisibility$4 = /*#__PURE__*/function (_BaseVisibility) {
|
|
113514
115000
|
function DefaultVisibility() {
|
|
113515
115001
|
_classCallCheck(this, DefaultVisibility);
|
|
113516
115002
|
return _callSuper(this, DefaultVisibility, arguments);
|
|
@@ -113534,7 +115020,7 @@
|
|
|
113534
115020
|
}
|
|
113535
115021
|
}]);
|
|
113536
115022
|
}(BaseVisibility);
|
|
113537
|
-
var defaultInstance$
|
|
115023
|
+
var defaultInstance$4 = new DefaultVisibility$4();
|
|
113538
115024
|
var TimelineVisibilityActionProcessor = /*#__PURE__*/function (_CommonVisibilityActi) {
|
|
113539
115025
|
function TimelineVisibilityActionProcessor() {
|
|
113540
115026
|
var _this;
|
|
@@ -113548,7 +115034,7 @@
|
|
|
113548
115034
|
value: function getEffectInstance() {
|
|
113549
115035
|
var effect = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "default";
|
|
113550
115036
|
var appear = arguments.length > 1 ? arguments[1] : undefined;
|
|
113551
|
-
return "default" === effect ? defaultInstance$
|
|
115037
|
+
return "default" === effect ? defaultInstance$4 : _superPropGet(TimelineVisibilityActionProcessor, "getEffectInstance", this, 3)([effect, appear]);
|
|
113552
115038
|
}
|
|
113553
115039
|
}]);
|
|
113554
115040
|
}(CommonVisibilityActionProcessor);
|
|
@@ -113613,7 +115099,7 @@
|
|
|
113613
115099
|
registerTimelineVisibilityAction();
|
|
113614
115100
|
}
|
|
113615
115101
|
|
|
113616
|
-
var DefaultVisibility$
|
|
115102
|
+
var DefaultVisibility$3 = /*#__PURE__*/function (_BaseVisibility) {
|
|
113617
115103
|
function DefaultVisibility() {
|
|
113618
115104
|
_classCallCheck(this, DefaultVisibility);
|
|
113619
115105
|
return _callSuper(this, DefaultVisibility, arguments);
|
|
@@ -113640,7 +115126,7 @@
|
|
|
113640
115126
|
}
|
|
113641
115127
|
}]);
|
|
113642
115128
|
}(BaseVisibility);
|
|
113643
|
-
var defaultInstance$
|
|
115129
|
+
var defaultInstance$3 = new DefaultVisibility$3();
|
|
113644
115130
|
var UnitVisibilityActionProcessor = /*#__PURE__*/function (_CommonVisibilityActi) {
|
|
113645
115131
|
function UnitVisibilityActionProcessor() {
|
|
113646
115132
|
var _this;
|
|
@@ -113654,7 +115140,7 @@
|
|
|
113654
115140
|
value: function getEffectInstance() {
|
|
113655
115141
|
var effect = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "default";
|
|
113656
115142
|
var appear = arguments.length > 1 ? arguments[1] : undefined;
|
|
113657
|
-
return "default" === effect ? defaultInstance$
|
|
115143
|
+
return "default" === effect ? defaultInstance$3 : _superPropGet(UnitVisibilityActionProcessor, "getEffectInstance", this, 3)([effect, appear]);
|
|
113658
115144
|
}
|
|
113659
115145
|
}]);
|
|
113660
115146
|
}(CommonVisibilityActionProcessor);
|
|
@@ -116535,7 +118021,7 @@
|
|
|
116535
118021
|
StoryFactory.registerCharacter(SinglePieCharacter.type, SinglePieCharacter);
|
|
116536
118022
|
}
|
|
116537
118023
|
|
|
116538
|
-
var DefaultVisibility = /*#__PURE__*/function (_BaseVisibility) {
|
|
118024
|
+
var DefaultVisibility$2 = /*#__PURE__*/function (_BaseVisibility) {
|
|
116539
118025
|
function DefaultVisibility() {
|
|
116540
118026
|
_classCallCheck(this, DefaultVisibility);
|
|
116541
118027
|
return _callSuper(this, DefaultVisibility, arguments);
|
|
@@ -116573,7 +118059,7 @@
|
|
|
116573
118059
|
}
|
|
116574
118060
|
}]);
|
|
116575
118061
|
}(BaseVisibility);
|
|
116576
|
-
var defaultInstance = new DefaultVisibility();
|
|
118062
|
+
var defaultInstance$2 = new DefaultVisibility$2();
|
|
116577
118063
|
var SinglePieVisibilityActionProcessor = /*#__PURE__*/function (_CommonVisibilityActi) {
|
|
116578
118064
|
function SinglePieVisibilityActionProcessor() {
|
|
116579
118065
|
var _this;
|
|
@@ -116585,7 +118071,7 @@
|
|
|
116585
118071
|
return _createClass(SinglePieVisibilityActionProcessor, [{
|
|
116586
118072
|
key: "getEffectInstance",
|
|
116587
118073
|
value: function getEffectInstance(effect, appear) {
|
|
116588
|
-
return "angle" === effect ? defaultInstance : _superPropGet(SinglePieVisibilityActionProcessor, "getEffectInstance", this, 3)([effect, appear]);
|
|
118074
|
+
return "angle" === effect ? defaultInstance$2 : _superPropGet(SinglePieVisibilityActionProcessor, "getEffectInstance", this, 3)([effect, appear]);
|
|
116589
118075
|
}
|
|
116590
118076
|
}]);
|
|
116591
118077
|
}(CommonVisibilityActionProcessor);
|
|
@@ -116703,6 +118189,311 @@
|
|
|
116703
118189
|
registerDynamicLinePlayAction(), registerDynamicLineVisibilityAction();
|
|
116704
118190
|
}
|
|
116705
118191
|
|
|
118192
|
+
var PopTipComponent$1 = /*#__PURE__*/function (_BaseComponentWithTex) {
|
|
118193
|
+
function PopTipComponent(attributes, options) {
|
|
118194
|
+
_classCallCheck(this, PopTipComponent);
|
|
118195
|
+
return _callSuper(this, PopTipComponent, [(null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, PopTipComponent.defaultAttributes, attributes)]);
|
|
118196
|
+
}
|
|
118197
|
+
_inherits(PopTipComponent, _BaseComponentWithTex);
|
|
118198
|
+
return _createClass(PopTipComponent, [{
|
|
118199
|
+
key: "render",
|
|
118200
|
+
value: function render() {
|
|
118201
|
+
_superPropGet(PopTipComponent, "render", this, 3)([]), this.renderPopTip();
|
|
118202
|
+
}
|
|
118203
|
+
}, {
|
|
118204
|
+
key: "renderPopTip",
|
|
118205
|
+
value: function renderPopTip() {
|
|
118206
|
+
var _this$attribute = this.attribute,
|
|
118207
|
+
graphic = _this$attribute.graphic,
|
|
118208
|
+
padding = _this$attribute.padding,
|
|
118209
|
+
width = _this$attribute.width,
|
|
118210
|
+
height = _this$attribute.height,
|
|
118211
|
+
attrs = Object.assign({}, graphic);
|
|
118212
|
+
attrs.x || (attrs.x = padding.left), attrs.y || (attrs.y = padding.top), attrs.width || (attrs.width = width - padding.left - padding.right), attrs.height || (attrs.height = height - padding.top - padding.bottom);
|
|
118213
|
+
var attribute = Object.assign(Object.assign({}, attrs), {
|
|
118214
|
+
scaleX: 1,
|
|
118215
|
+
scaleY: 1,
|
|
118216
|
+
angle: 0,
|
|
118217
|
+
postMatrix: null
|
|
118218
|
+
});
|
|
118219
|
+
if (this.vrComponent) this.vrComponent.setAttributes(attribute);else {
|
|
118220
|
+
var poptip = new PopTip(attribute);
|
|
118221
|
+
this.vrComponent = poptip, this.addChild(poptip);
|
|
118222
|
+
}
|
|
118223
|
+
}
|
|
118224
|
+
}]);
|
|
118225
|
+
}(BaseComponentWithText);
|
|
118226
|
+
PopTipComponent$1.defaultAttributes = {
|
|
118227
|
+
visible: !0,
|
|
118228
|
+
textStyle: {},
|
|
118229
|
+
width: 100,
|
|
118230
|
+
height: 100,
|
|
118231
|
+
padding: {
|
|
118232
|
+
top: 0,
|
|
118233
|
+
bottom: 0,
|
|
118234
|
+
left: 0,
|
|
118235
|
+
right: 0
|
|
118236
|
+
},
|
|
118237
|
+
graphic: {
|
|
118238
|
+
panel: {
|
|
118239
|
+
visible: !0
|
|
118240
|
+
}
|
|
118241
|
+
}
|
|
118242
|
+
};
|
|
118243
|
+
|
|
118244
|
+
var POPTIP = "PopTip";
|
|
118245
|
+
|
|
118246
|
+
var PopTipRuntime = /*#__PURE__*/function (_BaseRuntime) {
|
|
118247
|
+
function PopTipRuntime() {
|
|
118248
|
+
var _this;
|
|
118249
|
+
_classCallCheck(this, PopTipRuntime);
|
|
118250
|
+
_this = _callSuper(this, PopTipRuntime, arguments), _this.type = POPTIP;
|
|
118251
|
+
return _this;
|
|
118252
|
+
}
|
|
118253
|
+
_inherits(PopTipRuntime, _BaseRuntime);
|
|
118254
|
+
return _createClass(PopTipRuntime);
|
|
118255
|
+
}(BaseRuntime);
|
|
118256
|
+
|
|
118257
|
+
var PopTipCharacter = /*#__PURE__*/function (_CharacterComponent) {
|
|
118258
|
+
function PopTipCharacter() {
|
|
118259
|
+
_classCallCheck(this, PopTipCharacter);
|
|
118260
|
+
return _callSuper(this, PopTipCharacter, arguments);
|
|
118261
|
+
}
|
|
118262
|
+
_inherits(PopTipCharacter, _CharacterComponent);
|
|
118263
|
+
return _createClass(PopTipCharacter, [{
|
|
118264
|
+
key: "createAndAddGraphic",
|
|
118265
|
+
value: function createAndAddGraphic(attribute) {
|
|
118266
|
+
this._graphic = new PopTipComponent$1(attribute), this.canvas.addGraphic(this._graphic);
|
|
118267
|
+
}
|
|
118268
|
+
}, {
|
|
118269
|
+
key: "_initRuntime",
|
|
118270
|
+
value: function _initRuntime() {
|
|
118271
|
+
var _this = this;
|
|
118272
|
+
PopTipCharacter.RunTime.forEach(function (R) {
|
|
118273
|
+
_this._runtime.push(new R(_this));
|
|
118274
|
+
});
|
|
118275
|
+
}
|
|
118276
|
+
}, {
|
|
118277
|
+
key: "getDefaultAttribute",
|
|
118278
|
+
value: function getDefaultAttribute() {
|
|
118279
|
+
return Object.assign(Object.assign({}, _superPropGet(PopTipCharacter, "getDefaultAttribute", this, 3)([])), {
|
|
118280
|
+
width: 100,
|
|
118281
|
+
height: 100
|
|
118282
|
+
});
|
|
118283
|
+
}
|
|
118284
|
+
}, {
|
|
118285
|
+
key: "_clearGraphic",
|
|
118286
|
+
value: function _clearGraphic() {
|
|
118287
|
+
_superPropGet(PopTipCharacter, "_clearGraphic", this, 3)([]);
|
|
118288
|
+
}
|
|
118289
|
+
}, {
|
|
118290
|
+
key: "show",
|
|
118291
|
+
value: function show() {
|
|
118292
|
+
this._graphic.setAttribute("visibleAll", !0);
|
|
118293
|
+
}
|
|
118294
|
+
}, {
|
|
118295
|
+
key: "hide",
|
|
118296
|
+
value: function hide() {
|
|
118297
|
+
this._graphic.setAttribute("visibleAll", !1);
|
|
118298
|
+
}
|
|
118299
|
+
}]);
|
|
118300
|
+
}(CharacterComponent);
|
|
118301
|
+
PopTipCharacter.type = POPTIP, PopTipCharacter.RunTime = [PopTipRuntime];
|
|
118302
|
+
|
|
118303
|
+
function registerPopTip() {
|
|
118304
|
+
StoryFactory.registerCharacter(PopTipCharacter.type, PopTipCharacter);
|
|
118305
|
+
}
|
|
118306
|
+
|
|
118307
|
+
var DefaultVisibility$1 = /*#__PURE__*/function (_BaseVisibility) {
|
|
118308
|
+
function DefaultVisibility() {
|
|
118309
|
+
_classCallCheck(this, DefaultVisibility);
|
|
118310
|
+
return _callSuper(this, DefaultVisibility, arguments);
|
|
118311
|
+
}
|
|
118312
|
+
_inherits(DefaultVisibility, _BaseVisibility);
|
|
118313
|
+
return _createClass(DefaultVisibility, [{
|
|
118314
|
+
key: "_setInitAttributes",
|
|
118315
|
+
value: function _setInitAttributes(graphic, params, appear) {}
|
|
118316
|
+
}, {
|
|
118317
|
+
key: "_run",
|
|
118318
|
+
value: function _run(graphic, params, appear) {
|
|
118319
|
+
return appear && graphic && graphic.appearAnimate ? graphic.appearAnimate(params) : !appear && graphic && graphic.disappearAnimate && graphic.disappearAnimate(params), !0;
|
|
118320
|
+
}
|
|
118321
|
+
}]);
|
|
118322
|
+
}(BaseVisibility);
|
|
118323
|
+
var defaultInstance$1 = new DefaultVisibility$1();
|
|
118324
|
+
var PoptipVisibilityActionProcessor = /*#__PURE__*/function (_CommonVisibilityActi) {
|
|
118325
|
+
function PoptipVisibilityActionProcessor() {
|
|
118326
|
+
var _this;
|
|
118327
|
+
_classCallCheck(this, PoptipVisibilityActionProcessor);
|
|
118328
|
+
_this = _callSuper(this, PoptipVisibilityActionProcessor), _this.name = "appearOrDisAppear";
|
|
118329
|
+
return _this;
|
|
118330
|
+
}
|
|
118331
|
+
_inherits(PoptipVisibilityActionProcessor, _CommonVisibilityActi);
|
|
118332
|
+
return _createClass(PoptipVisibilityActionProcessor, [{
|
|
118333
|
+
key: "getEffectInstance",
|
|
118334
|
+
value: function getEffectInstance(effect, appear) {
|
|
118335
|
+
return "default" === effect ? defaultInstance$1 : _superPropGet(PoptipVisibilityActionProcessor, "getEffectInstance", this, 3)([effect, appear]);
|
|
118336
|
+
}
|
|
118337
|
+
}]);
|
|
118338
|
+
}(CommonVisibilityActionProcessor);
|
|
118339
|
+
function registerPopTipVisibilityAction() {
|
|
118340
|
+
globalProcessorRegistry.registerProcessor(POPTIP, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ACTION_TYPE.APPEAR, new PoptipVisibilityActionProcessor()), ACTION_TYPE.DISAPPEAR, new PoptipVisibilityActionProcessor()), ACTION_TYPE.STYLE, new CommonStyleActionProcessor()), ACTION_TYPE.MOVETO, new CommonMoveToActionProcessor()), ACTION_TYPE.SCALETO, new CommonScaleToActionProcessor()), ACTION_TYPE.BOUNCE, new CommonBounceActionProcessor()));
|
|
118341
|
+
}
|
|
118342
|
+
|
|
118343
|
+
function registerPopTipAction() {
|
|
118344
|
+
registerPopTipVisibilityAction();
|
|
118345
|
+
}
|
|
118346
|
+
|
|
118347
|
+
var PopTipComponent = /*#__PURE__*/function (_BaseComponentWithTex) {
|
|
118348
|
+
function PopTipComponent(attributes, options) {
|
|
118349
|
+
_classCallCheck(this, PopTipComponent);
|
|
118350
|
+
return _callSuper(this, PopTipComponent, [(null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, PopTipComponent.defaultAttributes, attributes)]);
|
|
118351
|
+
}
|
|
118352
|
+
_inherits(PopTipComponent, _BaseComponentWithTex);
|
|
118353
|
+
return _createClass(PopTipComponent, [{
|
|
118354
|
+
key: "render",
|
|
118355
|
+
value: function render() {
|
|
118356
|
+
_superPropGet(PopTipComponent, "render", this, 3)([]), this.renderPopTip();
|
|
118357
|
+
}
|
|
118358
|
+
}, {
|
|
118359
|
+
key: "renderPopTip",
|
|
118360
|
+
value: function renderPopTip() {
|
|
118361
|
+
var _this$attribute = this.attribute,
|
|
118362
|
+
graphic = _this$attribute.graphic,
|
|
118363
|
+
padding = _this$attribute.padding,
|
|
118364
|
+
width = _this$attribute.width,
|
|
118365
|
+
height = _this$attribute.height,
|
|
118366
|
+
attrs = Object.assign({}, graphic);
|
|
118367
|
+
attrs.x || (attrs.x = padding.left), attrs.y || (attrs.y = padding.top), attrs.width || (attrs.width = width - padding.left - padding.right), attrs.height || (attrs.height = height - padding.top - padding.bottom);
|
|
118368
|
+
var attribute = Object.assign(Object.assign({}, attrs), {
|
|
118369
|
+
scaleX: 1,
|
|
118370
|
+
scaleY: 1,
|
|
118371
|
+
angle: 0,
|
|
118372
|
+
postMatrix: null
|
|
118373
|
+
});
|
|
118374
|
+
if (this.vrComponent) this.vrComponent.setAttributes(attribute);else {
|
|
118375
|
+
var labelItem = new StoryLabelItem(attribute);
|
|
118376
|
+
this.vrComponent = labelItem, this.addChild(labelItem);
|
|
118377
|
+
}
|
|
118378
|
+
}
|
|
118379
|
+
}]);
|
|
118380
|
+
}(BaseComponentWithText);
|
|
118381
|
+
PopTipComponent.defaultAttributes = {
|
|
118382
|
+
visible: !0,
|
|
118383
|
+
textStyle: {},
|
|
118384
|
+
width: 100,
|
|
118385
|
+
height: 100,
|
|
118386
|
+
padding: {
|
|
118387
|
+
top: 0,
|
|
118388
|
+
bottom: 0,
|
|
118389
|
+
left: 0,
|
|
118390
|
+
right: 0
|
|
118391
|
+
}
|
|
118392
|
+
};
|
|
118393
|
+
|
|
118394
|
+
var LABEL_ITEM = "LabelItem";
|
|
118395
|
+
|
|
118396
|
+
var LabelItemRuntime = /*#__PURE__*/function (_BaseRuntime) {
|
|
118397
|
+
function LabelItemRuntime() {
|
|
118398
|
+
var _this;
|
|
118399
|
+
_classCallCheck(this, LabelItemRuntime);
|
|
118400
|
+
_this = _callSuper(this, LabelItemRuntime, arguments), _this.type = LABEL_ITEM;
|
|
118401
|
+
return _this;
|
|
118402
|
+
}
|
|
118403
|
+
_inherits(LabelItemRuntime, _BaseRuntime);
|
|
118404
|
+
return _createClass(LabelItemRuntime);
|
|
118405
|
+
}(BaseRuntime);
|
|
118406
|
+
|
|
118407
|
+
var LabelItemCharacter = /*#__PURE__*/function (_CharacterComponent) {
|
|
118408
|
+
function LabelItemCharacter() {
|
|
118409
|
+
_classCallCheck(this, LabelItemCharacter);
|
|
118410
|
+
return _callSuper(this, LabelItemCharacter, arguments);
|
|
118411
|
+
}
|
|
118412
|
+
_inherits(LabelItemCharacter, _CharacterComponent);
|
|
118413
|
+
return _createClass(LabelItemCharacter, [{
|
|
118414
|
+
key: "createAndAddGraphic",
|
|
118415
|
+
value: function createAndAddGraphic(attribute) {
|
|
118416
|
+
this._graphic = new PopTipComponent(attribute), this.canvas.addGraphic(this._graphic);
|
|
118417
|
+
}
|
|
118418
|
+
}, {
|
|
118419
|
+
key: "_initRuntime",
|
|
118420
|
+
value: function _initRuntime() {
|
|
118421
|
+
var _this = this;
|
|
118422
|
+
LabelItemCharacter.RunTime.forEach(function (R) {
|
|
118423
|
+
_this._runtime.push(new R(_this));
|
|
118424
|
+
});
|
|
118425
|
+
}
|
|
118426
|
+
}, {
|
|
118427
|
+
key: "getDefaultAttribute",
|
|
118428
|
+
value: function getDefaultAttribute() {
|
|
118429
|
+
return Object.assign(Object.assign({}, _superPropGet(LabelItemCharacter, "getDefaultAttribute", this, 3)([])), {
|
|
118430
|
+
width: 100,
|
|
118431
|
+
height: 100
|
|
118432
|
+
});
|
|
118433
|
+
}
|
|
118434
|
+
}, {
|
|
118435
|
+
key: "_clearGraphic",
|
|
118436
|
+
value: function _clearGraphic() {
|
|
118437
|
+
_superPropGet(LabelItemCharacter, "_clearGraphic", this, 3)([]);
|
|
118438
|
+
}
|
|
118439
|
+
}, {
|
|
118440
|
+
key: "show",
|
|
118441
|
+
value: function show() {
|
|
118442
|
+
this._graphic.setAttribute("visibleAll", !0);
|
|
118443
|
+
}
|
|
118444
|
+
}, {
|
|
118445
|
+
key: "hide",
|
|
118446
|
+
value: function hide() {
|
|
118447
|
+
this._graphic.setAttribute("visibleAll", !1);
|
|
118448
|
+
}
|
|
118449
|
+
}]);
|
|
118450
|
+
}(CharacterComponent);
|
|
118451
|
+
LabelItemCharacter.type = LABEL_ITEM, LabelItemCharacter.RunTime = [LabelItemRuntime];
|
|
118452
|
+
|
|
118453
|
+
function registerLabelItem() {
|
|
118454
|
+
StoryFactory.registerCharacter(LabelItemCharacter.type, LabelItemCharacter);
|
|
118455
|
+
}
|
|
118456
|
+
|
|
118457
|
+
var DefaultVisibility = /*#__PURE__*/function (_BaseVisibility) {
|
|
118458
|
+
function DefaultVisibility() {
|
|
118459
|
+
_classCallCheck(this, DefaultVisibility);
|
|
118460
|
+
return _callSuper(this, DefaultVisibility, arguments);
|
|
118461
|
+
}
|
|
118462
|
+
_inherits(DefaultVisibility, _BaseVisibility);
|
|
118463
|
+
return _createClass(DefaultVisibility, [{
|
|
118464
|
+
key: "_setInitAttributes",
|
|
118465
|
+
value: function _setInitAttributes(graphic, params, appear) {}
|
|
118466
|
+
}, {
|
|
118467
|
+
key: "_run",
|
|
118468
|
+
value: function _run(graphic, params, appear) {
|
|
118469
|
+
return appear && graphic && graphic.appearAnimate ? graphic.appearAnimate(params) : !appear && graphic && graphic.disappearAnimate && graphic.disappearAnimate(params), !0;
|
|
118470
|
+
}
|
|
118471
|
+
}]);
|
|
118472
|
+
}(BaseVisibility);
|
|
118473
|
+
var defaultInstance = new DefaultVisibility();
|
|
118474
|
+
var LabelItemVisibilityActionProcessor = /*#__PURE__*/function (_CommonVisibilityActi) {
|
|
118475
|
+
function LabelItemVisibilityActionProcessor() {
|
|
118476
|
+
var _this;
|
|
118477
|
+
_classCallCheck(this, LabelItemVisibilityActionProcessor);
|
|
118478
|
+
_this = _callSuper(this, LabelItemVisibilityActionProcessor), _this.name = "appearOrDisAppear";
|
|
118479
|
+
return _this;
|
|
118480
|
+
}
|
|
118481
|
+
_inherits(LabelItemVisibilityActionProcessor, _CommonVisibilityActi);
|
|
118482
|
+
return _createClass(LabelItemVisibilityActionProcessor, [{
|
|
118483
|
+
key: "getEffectInstance",
|
|
118484
|
+
value: function getEffectInstance(effect, appear) {
|
|
118485
|
+
return "default" === effect ? defaultInstance : _superPropGet(LabelItemVisibilityActionProcessor, "getEffectInstance", this, 3)([effect, appear]);
|
|
118486
|
+
}
|
|
118487
|
+
}]);
|
|
118488
|
+
}(CommonVisibilityActionProcessor);
|
|
118489
|
+
function registerLabelItemVisibilityAction() {
|
|
118490
|
+
globalProcessorRegistry.registerProcessor(LABEL_ITEM, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ACTION_TYPE.APPEAR, new LabelItemVisibilityActionProcessor()), ACTION_TYPE.DISAPPEAR, new LabelItemVisibilityActionProcessor()), ACTION_TYPE.STYLE, new CommonStyleActionProcessor()), ACTION_TYPE.MOVETO, new CommonMoveToActionProcessor()), ACTION_TYPE.SCALETO, new CommonScaleToActionProcessor()), ACTION_TYPE.BOUNCE, new CommonBounceActionProcessor()));
|
|
118491
|
+
}
|
|
118492
|
+
|
|
118493
|
+
function registerLabelItemAction() {
|
|
118494
|
+
registerLabelItemVisibilityAction();
|
|
118495
|
+
}
|
|
118496
|
+
|
|
116706
118497
|
function registerAll() {
|
|
116707
118498
|
registerGraphics();
|
|
116708
118499
|
registerCharacters();
|
|
@@ -116766,8 +118557,12 @@
|
|
|
116766
118557
|
exports.registerDynamicLineAction = registerDynamicLineAction;
|
|
116767
118558
|
exports.registerEasing = registerEasing;
|
|
116768
118559
|
exports.registerGraphics = registerGraphics;
|
|
118560
|
+
exports.registerLabelItem = registerLabelItem;
|
|
118561
|
+
exports.registerLabelItemAction = registerLabelItemAction;
|
|
116769
118562
|
exports.registerLottie = registerLottie;
|
|
116770
118563
|
exports.registerLottieAction = registerLottieAction;
|
|
118564
|
+
exports.registerPopTip = registerPopTip;
|
|
118565
|
+
exports.registerPopTipAction = registerPopTipAction;
|
|
116771
118566
|
exports.registerSinglePie = registerSinglePie;
|
|
116772
118567
|
exports.registerSinglePieAction = registerSinglePieAction;
|
|
116773
118568
|
exports.registerVChartAction = registerVChartAction;
|