@visactor/vchart-extension 2.1.0-alpha.17 → 2.1.0-alpha.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +0 -2148
- package/build/index.min.js +2 -2
- package/cjs/charts/axis-3d/index.js +1 -2
- package/cjs/charts/axis-3d/linear-axis.js +2 -1
- package/cjs/charts/bar-3d/chart-spec-transformer.js +1 -1
- package/cjs/charts/bar-3d/chart.js +1 -1
- package/cjs/charts/bar-3d/constant.js +1 -1
- package/cjs/charts/bar-3d/index.js +1 -1
- package/cjs/charts/bar-3d/interface.js +2 -1
- package/cjs/charts/bar-3d/series-spec-transformer.js +1 -1
- package/cjs/charts/bar-3d/series.js +1 -1
- package/cjs/charts/bar-3d/theme.js +1 -1
- package/cjs/charts/candlestick/candlestick-transformer.js +1 -1
- package/cjs/charts/candlestick/candlestick.js +1 -1
- package/cjs/charts/candlestick/index.js +1 -1
- package/cjs/charts/candlestick/interface.js +1 -1
- package/cjs/charts/candlestick/util.js +1 -1
- package/cjs/charts/combination-candlestick/combination-candlestick-transformer.js +1 -1
- package/cjs/charts/combination-candlestick/combination-candlestick.js +1 -1
- package/cjs/charts/combination-candlestick/constant.js +1 -1
- package/cjs/charts/combination-candlestick/index.js +1 -1
- package/cjs/charts/combination-candlestick/interface.js +1 -1
- package/cjs/charts/conversion-funnel/arrow-data-transform.js +2 -1
- package/cjs/charts/conversion-funnel/constants.js +1 -1
- package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js +1 -1
- package/cjs/charts/conversion-funnel/conversion-funnel.js +1 -1
- package/cjs/charts/conversion-funnel/index.js +1 -1
- package/cjs/charts/conversion-funnel/interface.js +1 -1
- package/cjs/charts/conversion-funnel/util.js +1 -1
- package/cjs/charts/funnel-3d/chart.js +1 -1
- package/cjs/charts/funnel-3d/constant.js +1 -1
- package/cjs/charts/funnel-3d/index.js +1 -1
- package/cjs/charts/funnel-3d/interface.js +1 -1
- package/cjs/charts/funnel-3d/series-spec-transformer.js +1 -1
- package/cjs/charts/funnel-3d/series.js +1 -1
- package/cjs/charts/funnel-3d/theme.js +1 -1
- package/cjs/charts/histogram-3d/chart.js +1 -1
- package/cjs/charts/image-cloud/series/image-cloud.d.ts +1 -1
- package/cjs/components/bar-link/bar-link.js +1 -1
- package/cjs/components/bar-link/constant.js +1 -1
- package/cjs/components/bar-link/index.js +1 -1
- package/cjs/components/bar-link/type.js +1 -1
- package/cjs/components/bar-link/util.js +1 -1
- package/cjs/components/bar-regression-line/index.js +1 -1
- package/cjs/components/bar-regression-line/type.js +1 -1
- package/cjs/components/extension-mark-sync-state/extension-mark-sync-state.js +1 -1
- package/cjs/components/extension-mark-sync-state/index.js +1 -1
- package/cjs/components/extension-mark-sync-state/type.js +1 -1
- package/cjs/components/histogram-regression-line/index.js +1 -1
- package/cjs/components/histogram-regression-line/type.js +1 -1
- package/cjs/components/map-label/index.js +1 -1
- package/cjs/components/map-label/layout.js +1 -1
- package/cjs/components/map-label/map-label-transformer.js +1 -2
- package/cjs/components/map-label/map-label.d.ts +1 -1
- package/cjs/components/map-label/map-label.js +1 -1
- package/cjs/components/map-label/theme.js +1 -1
- package/cjs/components/map-label/type.js +1 -1
- package/cjs/components/regression-line/index.js +1 -1
- package/cjs/components/regression-line/regression-line.js +1 -1
- package/cjs/components/regression-line/type.js +1 -1
- package/cjs/components/scatter-regression-line/index.js +1 -1
- package/cjs/components/scatter-regression-line/type.js +1 -1
- package/cjs/components/series-break/constant.js +1 -1
- package/cjs/components/series-break/index.js +1 -1
- package/cjs/components/series-break/series-break.js +1 -1
- package/cjs/components/series-break/type.js +1 -1
- package/cjs/components/series-break/util.js +1 -2
- package/cjs/components/series-label/constant.js +1 -1
- package/cjs/components/series-label/index.js +1 -1
- package/cjs/components/series-label/series-label.js +1 -1
- package/cjs/components/series-label/type.js +1 -1
- package/cjs/components/series-label/util.js +1 -1
- package/cjs/index.d.ts +0 -1
- package/cjs/index.js +5 -5
- package/cjs/index.js.map +1 -1
- package/esm/charts/axis-3d/index.js +1 -2
- package/esm/charts/axis-3d/linear-axis.js +2 -1
- package/esm/charts/bar-3d/chart-spec-transformer.js +1 -1
- package/esm/charts/bar-3d/chart.js +1 -1
- package/esm/charts/bar-3d/constant.js +1 -1
- package/esm/charts/bar-3d/index.js +1 -1
- package/esm/charts/bar-3d/interface.js +2 -1
- package/esm/charts/bar-3d/series-spec-transformer.js +1 -1
- package/esm/charts/bar-3d/series.js +1 -1
- package/esm/charts/bar-3d/theme.js +1 -1
- package/esm/charts/candlestick/candlestick-transformer.js +1 -1
- package/esm/charts/candlestick/candlestick.js +1 -1
- package/esm/charts/candlestick/index.js +1 -1
- package/esm/charts/candlestick/interface.js +1 -1
- package/esm/charts/candlestick/util.js +1 -1
- package/esm/charts/combination-candlestick/combination-candlestick-transformer.js +1 -1
- package/esm/charts/combination-candlestick/combination-candlestick.js +1 -1
- package/esm/charts/combination-candlestick/constant.js +1 -1
- package/esm/charts/combination-candlestick/index.js +1 -1
- package/esm/charts/combination-candlestick/interface.js +1 -1
- package/esm/charts/conversion-funnel/arrow-data-transform.js +2 -1
- package/esm/charts/conversion-funnel/constants.js +1 -1
- package/esm/charts/conversion-funnel/conversion-funnel-transformer.js +1 -1
- package/esm/charts/conversion-funnel/conversion-funnel.js +1 -1
- package/esm/charts/conversion-funnel/index.js +1 -1
- package/esm/charts/conversion-funnel/interface.js +1 -1
- package/esm/charts/conversion-funnel/util.js +1 -1
- package/esm/charts/funnel-3d/chart.js +1 -1
- package/esm/charts/funnel-3d/constant.js +1 -1
- package/esm/charts/funnel-3d/index.js +1 -1
- package/esm/charts/funnel-3d/interface.js +1 -1
- package/esm/charts/funnel-3d/series-spec-transformer.js +1 -1
- package/esm/charts/funnel-3d/series.js +1 -1
- package/esm/charts/funnel-3d/theme.js +1 -1
- package/esm/charts/histogram-3d/chart.js +1 -1
- package/esm/charts/image-cloud/series/image-cloud.d.ts +1 -1
- package/esm/components/bar-link/bar-link.js +1 -1
- package/esm/components/bar-link/constant.js +1 -1
- package/esm/components/bar-link/index.js +1 -1
- package/esm/components/bar-link/type.js +1 -1
- package/esm/components/bar-link/util.js +1 -1
- package/esm/components/bar-regression-line/index.js +1 -1
- package/esm/components/bar-regression-line/type.js +1 -1
- package/esm/components/extension-mark-sync-state/extension-mark-sync-state.js +1 -1
- package/esm/components/extension-mark-sync-state/index.js +1 -1
- package/esm/components/extension-mark-sync-state/type.js +1 -1
- package/esm/components/histogram-regression-line/index.js +1 -1
- package/esm/components/histogram-regression-line/type.js +1 -1
- package/esm/components/map-label/index.js +1 -1
- package/esm/components/map-label/layout.js +1 -1
- package/esm/components/map-label/map-label-transformer.js +1 -2
- package/esm/components/map-label/map-label.d.ts +1 -1
- package/esm/components/map-label/map-label.js +1 -1
- package/esm/components/map-label/theme.js +1 -1
- package/esm/components/map-label/type.js +1 -1
- package/esm/components/regression-line/index.js +1 -1
- package/esm/components/regression-line/regression-line.js +1 -1
- package/esm/components/regression-line/type.js +1 -1
- package/esm/components/scatter-regression-line/index.js +1 -1
- package/esm/components/scatter-regression-line/type.js +1 -1
- package/esm/components/series-break/constant.js +1 -1
- package/esm/components/series-break/index.js +1 -1
- package/esm/components/series-break/series-break.js +1 -1
- package/esm/components/series-break/type.js +1 -1
- package/esm/components/series-break/util.js +1 -2
- package/esm/components/series-label/constant.js +1 -1
- package/esm/components/series-label/index.js +1 -1
- package/esm/components/series-label/series-label.js +1 -1
- package/esm/components/series-label/type.js +1 -1
- package/esm/components/series-label/util.js +1 -1
- package/esm/index.d.ts +0 -1
- package/esm/index.js +0 -2
- package/esm/index.js.map +1 -1
- package/package.json +7 -7
- package/cjs/charts/storyline/index.d.ts +0 -4
- package/cjs/charts/storyline/index.js +0 -22
- package/cjs/charts/storyline/index.js.map +0 -1
- package/cjs/charts/storyline/interface.d.ts +0 -67
- package/cjs/charts/storyline/interface.js +0 -6
- package/cjs/charts/storyline/interface.js.map +0 -1
- package/cjs/charts/storyline/layout.d.ts +0 -53
- package/cjs/charts/storyline/layout.js +0 -208
- package/cjs/charts/storyline/layout.js.map +0 -1
- package/cjs/charts/storyline/layouts/arc.d.ts +0 -5
- package/cjs/charts/storyline/layouts/arc.js +0 -295
- package/cjs/charts/storyline/layouts/arc.js.map +0 -1
- package/cjs/charts/storyline/layouts/clock.d.ts +0 -5
- package/cjs/charts/storyline/layouts/clock.js +0 -246
- package/cjs/charts/storyline/layouts/clock.js.map +0 -1
- package/cjs/charts/storyline/layouts/common.d.ts +0 -89
- package/cjs/charts/storyline/layouts/common.js +0 -291
- package/cjs/charts/storyline/layouts/common.js.map +0 -1
- package/cjs/charts/storyline/layouts/default.d.ts +0 -4
- package/cjs/charts/storyline/layouts/default.js +0 -181
- package/cjs/charts/storyline/layouts/default.js.map +0 -1
- package/cjs/charts/storyline/layouts/ladder.d.ts +0 -5
- package/cjs/charts/storyline/layouts/ladder.js +0 -205
- package/cjs/charts/storyline/layouts/ladder.js.map +0 -1
- package/cjs/charts/storyline/layouts/landscape.d.ts +0 -4
- package/cjs/charts/storyline/layouts/landscape.js +0 -256
- package/cjs/charts/storyline/layouts/landscape.js.map +0 -1
- package/cjs/charts/storyline/layouts/portrait.d.ts +0 -4
- package/cjs/charts/storyline/layouts/portrait.js +0 -215
- package/cjs/charts/storyline/layouts/portrait.js.map +0 -1
- package/cjs/charts/storyline/layouts/wing.d.ts +0 -4
- package/cjs/charts/storyline/layouts/wing.js +0 -215
- package/cjs/charts/storyline/layouts/wing.js.map +0 -1
- package/cjs/charts/storyline/storyline-transformer.d.ts +0 -4
- package/cjs/charts/storyline/storyline-transformer.js +0 -78
- package/cjs/charts/storyline/storyline-transformer.js.map +0 -1
- package/cjs/charts/storyline/storyline.d.ts +0 -16
- package/cjs/charts/storyline/storyline.js +0 -36
- package/cjs/charts/storyline/storyline.js.map +0 -1
- package/esm/charts/storyline/index.d.ts +0 -4
- package/esm/charts/storyline/index.js +0 -8
- package/esm/charts/storyline/index.js.map +0 -1
- package/esm/charts/storyline/interface.d.ts +0 -67
- package/esm/charts/storyline/interface.js +0 -2
- package/esm/charts/storyline/interface.js.map +0 -1
- package/esm/charts/storyline/layout.d.ts +0 -53
- package/esm/charts/storyline/layout.js +0 -198
- package/esm/charts/storyline/layout.js.map +0 -1
- package/esm/charts/storyline/layouts/arc.d.ts +0 -5
- package/esm/charts/storyline/layouts/arc.js +0 -286
- package/esm/charts/storyline/layouts/arc.js.map +0 -1
- package/esm/charts/storyline/layouts/clock.d.ts +0 -5
- package/esm/charts/storyline/layouts/clock.js +0 -240
- package/esm/charts/storyline/layouts/clock.js.map +0 -1
- package/esm/charts/storyline/layouts/common.d.ts +0 -89
- package/esm/charts/storyline/layouts/common.js +0 -257
- package/esm/charts/storyline/layouts/common.js.map +0 -1
- package/esm/charts/storyline/layouts/default.d.ts +0 -4
- package/esm/charts/storyline/layouts/default.js +0 -174
- package/esm/charts/storyline/layouts/default.js.map +0 -1
- package/esm/charts/storyline/layouts/ladder.d.ts +0 -5
- package/esm/charts/storyline/layouts/ladder.js +0 -196
- package/esm/charts/storyline/layouts/ladder.js.map +0 -1
- package/esm/charts/storyline/layouts/landscape.d.ts +0 -4
- package/esm/charts/storyline/layouts/landscape.js +0 -252
- package/esm/charts/storyline/layouts/landscape.js.map +0 -1
- package/esm/charts/storyline/layouts/portrait.d.ts +0 -4
- package/esm/charts/storyline/layouts/portrait.js +0 -212
- package/esm/charts/storyline/layouts/portrait.js.map +0 -1
- package/esm/charts/storyline/layouts/wing.d.ts +0 -4
- package/esm/charts/storyline/layouts/wing.js +0 -210
- package/esm/charts/storyline/layouts/wing.js.map +0 -1
- package/esm/charts/storyline/storyline-transformer.d.ts +0 -4
- package/esm/charts/storyline/storyline-transformer.js +0 -76
- package/esm/charts/storyline/storyline-transformer.js.map +0 -1
- package/esm/charts/storyline/storyline.d.ts +0 -16
- package/esm/charts/storyline/storyline.js +0 -29
- package/esm/charts/storyline/storyline.js.map +0 -1
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: !0
|
|
5
|
-
}), exports.buildArcBlockMark = exports.buildArcCenterImageMark = exports.buildArcMark = void 0;
|
|
6
|
-
|
|
7
|
-
const vchart_1 = require("@visactor/vchart"), common_1 = require("./common"), ARC_BLOCK_IMAGE_SIZE = 140, ARC_TEXT_GAP_FROM_IMAGE = 10, ARC_TITLE_LINE_HEIGHT = 19, ARC_CONTENT_LINE_HEIGHT = 17, ARC_CONTENT_FONT_SIZE = 12, ARC_TEXT_BOX_HEIGHT = 240, ARC_TITLE_TO_CONTENT_GAP = 4, ARC_TEXT_LEFT_PADDING = 20, ARC_TEXT_BOX_MIN_WIDTH = 200, ARC_CENTER_IMAGE_SIZE_RATIO = .4, ARC_GAP_FROM_CENTER_IMAGE = 200, isDownArc = spec => "down" === (0,
|
|
8
|
-
common_1.normalizeLayout)(spec.layout).direction, getArcCenterImageRect = (spec, ctx) => {
|
|
9
|
-
var _a, _b, _c, _e, _f;
|
|
10
|
-
const {width: width, height: height, startX: startX, startY: startY} = (0, common_1.getRegionGeometry)(ctx), padding = (0,
|
|
11
|
-
common_1.normalizePadding)(null === (_a = spec.block) || void 0 === _a ? void 0 : _a.padding), innerWidth = Math.max(width - padding.left - padding.right, 1), innerHeight = Math.max(height - padding.top - padding.bottom, 1), baseSize = .4 * Math.min(innerWidth, innerHeight), w = Math.max(null !== (_c = null === (_b = spec.centerImage) || void 0 === _b ? void 0 : _b.width) && void 0 !== _c ? _c : baseSize, 80), h = Math.max(null !== (_f = null === (_e = spec.centerImage) || void 0 === _e ? void 0 : _e.height) && void 0 !== _f ? _f : baseSize, 80);
|
|
12
|
-
return {
|
|
13
|
-
x: startX + padding.left + innerWidth / 2 - w / 2,
|
|
14
|
-
y: isDownArc(spec) ? startY + padding.top : startY + padding.top + innerHeight - h,
|
|
15
|
-
width: w,
|
|
16
|
-
height: h
|
|
17
|
-
};
|
|
18
|
-
}, getArcGeometry = (spec, ctx) => {
|
|
19
|
-
var _a, _b, _c, _e;
|
|
20
|
-
const {width: width, startX: startX} = (0, common_1.getRegionGeometry)(ctx), blockPadding = (0,
|
|
21
|
-
common_1.normalizePadding)(null === (_a = spec.block) || void 0 === _a ? void 0 : _a.padding), innerWidth = Math.max(width - blockPadding.left - blockPadding.right, 1), blockWidth = (0,
|
|
22
|
-
common_1.resolveBlockWidth)(spec, width), layoutOpt = (0, common_1.normalizeLayout)(spec.layout), isDown = "down" === layoutOpt.direction, startAngle = null !== (_b = layoutOpt.startAngle) && void 0 !== _b ? _b : isDown ? 20 : 200, endAngle = null !== (_c = layoutOpt.endAngle) && void 0 !== _c ? _c : isDown ? 160 : 340, ratio = null !== (_e = layoutOpt.radiusRatio) && void 0 !== _e ? _e : .88, rx = Math.max((innerWidth - blockWidth) / 2, 1) * ratio, centerRect = getArcCenterImageRect(spec, ctx), centerTop = centerRect.y, centerBottom = centerRect.y + centerRect.height, sinStart = Math.sin(startAngle / 180 * Math.PI);
|
|
23
|
-
let cy, ry;
|
|
24
|
-
if (isDown) {
|
|
25
|
-
const denom = Math.max(1 - sinStart, .05);
|
|
26
|
-
ry = (centerRect.height + 200) / denom, cy = centerTop - ry * sinStart;
|
|
27
|
-
} else {
|
|
28
|
-
const denom = Math.max(1 + sinStart, .05);
|
|
29
|
-
ry = (centerRect.height + 200) / denom, cy = centerBottom - ry * sinStart;
|
|
30
|
-
}
|
|
31
|
-
return {
|
|
32
|
-
cx: startX + blockPadding.left + innerWidth / 2,
|
|
33
|
-
cy: cy,
|
|
34
|
-
rx: rx,
|
|
35
|
-
ry: ry,
|
|
36
|
-
startAngle: startAngle,
|
|
37
|
-
endAngle: endAngle,
|
|
38
|
-
centerTop: centerTop,
|
|
39
|
-
centerBottom: centerBottom
|
|
40
|
-
};
|
|
41
|
-
}, getArcBlockCenter = (spec, ctx, index) => {
|
|
42
|
-
var _a, _b, _c, _e;
|
|
43
|
-
const arc = getArcGeometry(spec, ctx), count = null !== (_b = null === (_a = spec.data) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0;
|
|
44
|
-
if (count <= 0) return {
|
|
45
|
-
x: arc.cx,
|
|
46
|
-
y: arc.cy
|
|
47
|
-
};
|
|
48
|
-
const t = 1 === count ? .5 : index / (count - 1), angle = (arc.startAngle + (arc.endAngle - arc.startAngle) * t) / 180 * Math.PI, px = arc.cx + Math.cos(angle) * arc.rx, py = arc.cy + Math.sin(angle) * arc.ry, nxRaw = Math.cos(angle) / arc.rx, nyRaw = Math.sin(angle) / arc.ry, nLen = Math.hypot(nxRaw, nyRaw) || 1, nx = nxRaw / nLen, ny = nyRaw / nLen, offset = (null !== (_e = null === (_c = spec.image) || void 0 === _c ? void 0 : _c.height) && void 0 !== _e ? _e : 140) / 2;
|
|
49
|
-
return {
|
|
50
|
-
x: px + nx * offset,
|
|
51
|
-
y: py + ny * offset
|
|
52
|
-
};
|
|
53
|
-
}, buildArcMark = spec => {
|
|
54
|
-
var _a;
|
|
55
|
-
if (!0 !== (null === (_a = spec.line) || void 0 === _a ? void 0 : _a.visible)) return null;
|
|
56
|
-
const themeColor = (0, common_1.getThemeColor)(spec);
|
|
57
|
-
return {
|
|
58
|
-
type: "group",
|
|
59
|
-
name: "storyline-arc",
|
|
60
|
-
zIndex: vchart_1.LayoutZIndex.Mark,
|
|
61
|
-
children: [ {
|
|
62
|
-
type: "path",
|
|
63
|
-
name: "storyline-arc-path",
|
|
64
|
-
interactive: !1,
|
|
65
|
-
style: {
|
|
66
|
-
stroke: themeColor,
|
|
67
|
-
lineWidth: 2,
|
|
68
|
-
lineCap: "round",
|
|
69
|
-
fill: "transparent",
|
|
70
|
-
fillOpacity: 0,
|
|
71
|
-
path: (_d, ctx) => {
|
|
72
|
-
const arc = getArcGeometry(spec, ctx), span = arc.endAngle - arc.startAngle, segments = [];
|
|
73
|
-
for (let i = 0; i <= 64; i++) {
|
|
74
|
-
const t = i / 64, angle = (arc.startAngle + span * t) / 180 * Math.PI, x = arc.cx + Math.cos(angle) * arc.rx, y = arc.cy + Math.sin(angle) * arc.ry;
|
|
75
|
-
segments.push(`${0 === i ? "M" : "L"} ${x.toFixed(2)} ${y.toFixed(2)}`);
|
|
76
|
-
}
|
|
77
|
-
return segments.join(" ");
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
} ]
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
exports.buildArcMark = buildArcMark;
|
|
85
|
-
|
|
86
|
-
const buildArcCenterImageMark = spec => {
|
|
87
|
-
var _a, _b, _c, _e;
|
|
88
|
-
if (!(!1 !== (null === (_a = spec.centerImage) || void 0 === _a ? void 0 : _a.visible))) return null;
|
|
89
|
-
const themeColor = (0, common_1.getThemeColor)(spec), hasImage = !!(null === (_b = spec.centerImage) || void 0 === _b ? void 0 : _b.image), symbolGradient = {
|
|
90
|
-
gradient: "linear",
|
|
91
|
-
x0: .5,
|
|
92
|
-
y0: 0,
|
|
93
|
-
x1: .5,
|
|
94
|
-
y1: 1,
|
|
95
|
-
stops: [ {
|
|
96
|
-
offset: 0,
|
|
97
|
-
color: (0, common_1.withAlpha)(themeColor, .15)
|
|
98
|
-
}, {
|
|
99
|
-
offset: 1,
|
|
100
|
-
color: themeColor
|
|
101
|
-
} ]
|
|
102
|
-
};
|
|
103
|
-
return {
|
|
104
|
-
type: "group",
|
|
105
|
-
name: "storyline-arc-center",
|
|
106
|
-
zIndex: vchart_1.LayoutZIndex.Mark,
|
|
107
|
-
children: [ {
|
|
108
|
-
type: "symbol",
|
|
109
|
-
name: "storyline-arc-center-symbol",
|
|
110
|
-
interactive: !1,
|
|
111
|
-
style: {
|
|
112
|
-
x: (_d, ctx) => {
|
|
113
|
-
const r = getArcCenterImageRect(spec, ctx);
|
|
114
|
-
return r.x + r.width / 2;
|
|
115
|
-
},
|
|
116
|
-
y: (_d, ctx) => {
|
|
117
|
-
const r = getArcCenterImageRect(spec, ctx);
|
|
118
|
-
return r.y + r.height / 2;
|
|
119
|
-
},
|
|
120
|
-
size: (_d, ctx) => {
|
|
121
|
-
const r = getArcCenterImageRect(spec, ctx);
|
|
122
|
-
return 1.1 * Math.max(r.width, r.height);
|
|
123
|
-
},
|
|
124
|
-
symbolType: "circle",
|
|
125
|
-
fill: symbolGradient,
|
|
126
|
-
stroke: themeColor,
|
|
127
|
-
lineWidth: 2
|
|
128
|
-
}
|
|
129
|
-
}, hasImage ? Object.assign(Object.assign({
|
|
130
|
-
type: "image",
|
|
131
|
-
name: "storyline-arc-center-image",
|
|
132
|
-
interactive: !1
|
|
133
|
-
}, spec.centerImage), {
|
|
134
|
-
style: Object.assign({
|
|
135
|
-
x: (_d, ctx) => getArcCenterImageRect(spec, ctx).x,
|
|
136
|
-
y: (_d, ctx) => getArcCenterImageRect(spec, ctx).y,
|
|
137
|
-
width: (_d, ctx) => getArcCenterImageRect(spec, ctx).width,
|
|
138
|
-
height: (_d, ctx) => getArcCenterImageRect(spec, ctx).height,
|
|
139
|
-
image: null === (_c = spec.centerImage) || void 0 === _c ? void 0 : _c.image,
|
|
140
|
-
repeatX: "no-repeat",
|
|
141
|
-
repeatY: "no-repeat",
|
|
142
|
-
imageMode: "cover",
|
|
143
|
-
imagePosition: "center",
|
|
144
|
-
anchor: (_d, ctx) => {
|
|
145
|
-
const r = getArcCenterImageRect(spec, ctx);
|
|
146
|
-
return [ r.x + r.width / 2, r.y + r.height / 2 ];
|
|
147
|
-
},
|
|
148
|
-
dx: (_d, ctx) => {
|
|
149
|
-
var _a, _b;
|
|
150
|
-
const r = getArcCenterImageRect(spec, ctx), userWidth = null === (_b = null === (_a = spec.centerImage) || void 0 === _a ? void 0 : _a.style) || void 0 === _b ? void 0 : _b.width, w = "number" == typeof userWidth ? userWidth : r.width;
|
|
151
|
-
return (r.width - w) / 2;
|
|
152
|
-
},
|
|
153
|
-
dy: (_d, ctx) => {
|
|
154
|
-
var _a, _b;
|
|
155
|
-
const r = getArcCenterImageRect(spec, ctx), userHeight = null === (_b = null === (_a = spec.centerImage) || void 0 === _a ? void 0 : _a.style) || void 0 === _b ? void 0 : _b.height, h = "number" == typeof userHeight ? userHeight : r.height;
|
|
156
|
-
return (r.height - h) / 2;
|
|
157
|
-
}
|
|
158
|
-
}, null === (_e = spec.centerImage) || void 0 === _e ? void 0 : _e.style)
|
|
159
|
-
}) : null ].filter(Boolean)
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
exports.buildArcCenterImageMark = buildArcCenterImageMark;
|
|
164
|
-
|
|
165
|
-
const getArcBlockMetrics = spec => {
|
|
166
|
-
var _a, _b, _c, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
167
|
-
const titleFontSize = Number(null !== (_c = null === (_b = null === (_a = spec.title) || void 0 === _a ? void 0 : _a.style) || void 0 === _b ? void 0 : _b.fontSize) && void 0 !== _c ? _c : 18), titleLineHeight = Number(null !== (_g = null === (_f = null === (_e = spec.title) || void 0 === _e ? void 0 : _e.style) || void 0 === _f ? void 0 : _f.lineHeight) && void 0 !== _g ? _g : Math.max(19, Math.round(1.35 * titleFontSize))), contentFontSize = Number(null !== (_k = null === (_j = null === (_h = spec.content) || void 0 === _h ? void 0 : _h.style) || void 0 === _j ? void 0 : _j.fontSize) && void 0 !== _k ? _k : 12), contentLineHeight = Number(null !== (_o = null === (_m = null === (_l = spec.content) || void 0 === _l ? void 0 : _l.style) || void 0 === _m ? void 0 : _m.lineHeight) && void 0 !== _o ? _o : 17), contentHeight = Math.max(240 - titleLineHeight - 4, contentLineHeight), imageWidth = null !== (_q = null === (_p = spec.image) || void 0 === _p ? void 0 : _p.width) && void 0 !== _q ? _q : 140, imageHeight = null !== (_s = null === (_r = spec.image) || void 0 === _r ? void 0 : _r.height) && void 0 !== _s ? _s : 140, isDown = isDownArc(spec), imageBox = {
|
|
168
|
-
x: -imageWidth / 2,
|
|
169
|
-
y: -imageHeight / 2,
|
|
170
|
-
width: imageWidth,
|
|
171
|
-
height: imageHeight
|
|
172
|
-
}, textBoxWidth = Math.max(imageWidth - 20, 200), textBox = {
|
|
173
|
-
x: -imageWidth / 2 + 20,
|
|
174
|
-
y: isDown ? imageBox.y + imageHeight + 10 : imageBox.y - 10 - 240,
|
|
175
|
-
width: textBoxWidth,
|
|
176
|
-
height: 240
|
|
177
|
-
};
|
|
178
|
-
return {
|
|
179
|
-
titleFontSize: titleFontSize,
|
|
180
|
-
titleLineHeight: titleLineHeight,
|
|
181
|
-
contentFontSize: contentFontSize,
|
|
182
|
-
contentLineHeight: contentLineHeight,
|
|
183
|
-
imageBox: imageBox,
|
|
184
|
-
textBox: textBox,
|
|
185
|
-
contentBox: {
|
|
186
|
-
x: textBox.x,
|
|
187
|
-
y: textBox.y + titleLineHeight + 4,
|
|
188
|
-
width: textBox.width,
|
|
189
|
-
height: contentHeight
|
|
190
|
-
},
|
|
191
|
-
isDown: isDown
|
|
192
|
-
};
|
|
193
|
-
}, buildArcBlockMark = (spec, block, index) => {
|
|
194
|
-
var _a, _b, _c, _e;
|
|
195
|
-
const hasImage = !!block.image, contentText = Array.isArray(block.content) ? block.content : block.content ? [ block.content ] : [], themeColor = (0,
|
|
196
|
-
common_1.getThemeColor)(spec), metrics = getArcBlockMetrics(spec), connectorY = metrics.isDown ? metrics.imageBox.y + metrics.imageBox.height : metrics.textBox.y, connectorHeight = metrics.isDown ? Math.max(metrics.textBox.y + metrics.textBox.height - (metrics.imageBox.y + metrics.imageBox.height), 0) : Math.max(metrics.imageBox.y - metrics.textBox.y, 0);
|
|
197
|
-
return {
|
|
198
|
-
type: "group",
|
|
199
|
-
id: `storyline-block-${null !== (_a = block.id) && void 0 !== _a ? _a : index}`,
|
|
200
|
-
name: `storyline-block-${index}`,
|
|
201
|
-
zIndex: vchart_1.LayoutZIndex.Mark + 1,
|
|
202
|
-
style: {
|
|
203
|
-
x: (_d, ctx) => getArcBlockCenter(spec, ctx, index).x,
|
|
204
|
-
y: (_d, ctx) => getArcBlockCenter(spec, ctx, index).y
|
|
205
|
-
},
|
|
206
|
-
children: [ {
|
|
207
|
-
type: "rect",
|
|
208
|
-
name: `storyline-block-connector-${index}`,
|
|
209
|
-
interactive: !1,
|
|
210
|
-
style: {
|
|
211
|
-
x: metrics.imageBox.x,
|
|
212
|
-
y: connectorY,
|
|
213
|
-
width: 2,
|
|
214
|
-
height: connectorHeight,
|
|
215
|
-
fill: themeColor,
|
|
216
|
-
fillOpacity: .6
|
|
217
|
-
}
|
|
218
|
-
}, hasImage ? Object.assign(Object.assign({
|
|
219
|
-
type: "image",
|
|
220
|
-
name: `storyline-block-image-${index}`,
|
|
221
|
-
interactive: !1
|
|
222
|
-
}, (0, common_1.omitImageLayoutSpec)(spec.image)), {
|
|
223
|
-
style: Object.assign({
|
|
224
|
-
x: metrics.imageBox.x,
|
|
225
|
-
y: metrics.imageBox.y,
|
|
226
|
-
width: metrics.imageBox.width,
|
|
227
|
-
height: metrics.imageBox.height,
|
|
228
|
-
image: block.image,
|
|
229
|
-
repeatX: "no-repeat",
|
|
230
|
-
repeatY: "no-repeat",
|
|
231
|
-
imageMode: "cover",
|
|
232
|
-
imagePosition: "center"
|
|
233
|
-
}, null === (_b = spec.image) || void 0 === _b ? void 0 : _b.style)
|
|
234
|
-
}) : {
|
|
235
|
-
type: "rect",
|
|
236
|
-
name: `storyline-block-image-bg-${index}`,
|
|
237
|
-
interactive: !1,
|
|
238
|
-
style: {
|
|
239
|
-
x: metrics.imageBox.x,
|
|
240
|
-
y: metrics.imageBox.y,
|
|
241
|
-
width: metrics.imageBox.width,
|
|
242
|
-
height: metrics.imageBox.height,
|
|
243
|
-
cornerRadius: Math.min(metrics.imageBox.width, metrics.imageBox.height) / 2,
|
|
244
|
-
fill: "#ffffff",
|
|
245
|
-
stroke: themeColor,
|
|
246
|
-
lineWidth: 2
|
|
247
|
-
}
|
|
248
|
-
}, block.title ? Object.assign(Object.assign({
|
|
249
|
-
type: "text",
|
|
250
|
-
name: `storyline-block-title-${index}`,
|
|
251
|
-
interactive: !1
|
|
252
|
-
}, spec.title), {
|
|
253
|
-
style: Object.assign({
|
|
254
|
-
x: metrics.textBox.x,
|
|
255
|
-
y: metrics.textBox.y,
|
|
256
|
-
text: block.title,
|
|
257
|
-
maxLineWidth: metrics.textBox.width,
|
|
258
|
-
fontSize: metrics.titleFontSize,
|
|
259
|
-
lineHeight: metrics.titleLineHeight,
|
|
260
|
-
fontWeight: "bold",
|
|
261
|
-
fill: "#1f2430",
|
|
262
|
-
stroke: "#fff",
|
|
263
|
-
lineWidth: 5,
|
|
264
|
-
lineJoin: "round",
|
|
265
|
-
textAlign: "left",
|
|
266
|
-
textBaseline: "top"
|
|
267
|
-
}, null === (_c = spec.title) || void 0 === _c ? void 0 : _c.style)
|
|
268
|
-
}) : null, contentText.length ? Object.assign(Object.assign({
|
|
269
|
-
type: "text",
|
|
270
|
-
name: `storyline-block-content-${index}`,
|
|
271
|
-
interactive: !1
|
|
272
|
-
}, spec.content), {
|
|
273
|
-
textType: "rich",
|
|
274
|
-
style: Object.assign({
|
|
275
|
-
x: metrics.contentBox.x,
|
|
276
|
-
y: metrics.contentBox.y,
|
|
277
|
-
width: metrics.contentBox.width,
|
|
278
|
-
height: metrics.contentBox.height,
|
|
279
|
-
maxLineWidth: metrics.contentBox.width,
|
|
280
|
-
heightLimit: metrics.contentBox.height,
|
|
281
|
-
text: (0, common_1.buildRichContent)(contentText, spec),
|
|
282
|
-
fontSize: 12,
|
|
283
|
-
lineHeight: 17,
|
|
284
|
-
textAlign: "left",
|
|
285
|
-
textBaseline: "top",
|
|
286
|
-
wordBreak: "break-word",
|
|
287
|
-
ellipsis: "...",
|
|
288
|
-
fill: "#596173"
|
|
289
|
-
}, null === (_e = spec.content) || void 0 === _e ? void 0 : _e.style)
|
|
290
|
-
}) : null ].filter(Boolean)
|
|
291
|
-
};
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
exports.buildArcBlockMark = buildArcBlockMark;
|
|
295
|
-
//# sourceMappingURL=arc.js.map
|
|
@@ -1 +0,0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,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,KAAK,EACnB,SAAS,EAAE,YAAY,EACvB,QAAQ,EAAE,KAAK,EACf,IAAI,EAAE,SAAS,IACZ,MAAA,IAAI,CAAC,OAAO,0CAAE,KAAK,IAEG;gBAC/B,CAAC,CAAC,IAAI;SACT,CAAC,MAAM,CAAC,OAAO,CAA2B;KAC5C,CAAC;AACJ,CAAC,CAAC;AAhIW,QAAA,iBAAiB,qBAgI5B","file":"arc.js","sourcesContent":["import type { IExtensionGroupMarkSpec } from '@visactor/vchart';\nimport { LayoutZIndex } from '@visactor/vchart';\nimport type { IStorylineBlock, IStorylineSpec } from '../interface';\nimport {\n type ICustomMarkSpec,\n type LayoutContext,\n type StorylinePoint,\n buildRichContent,\n getRegionGeometry,\n getThemeColor,\n normalizeLayout,\n normalizePadding,\n omitImageLayoutSpec,\n resolveBlockWidth,\n withAlpha\n} from './common';\n\n// arc 布局:弧形排列 + centerImage(穹顶 / 碗形二合一)\n// - direction = 'up'(默认):穹顶 —— centerImage 贴底,弧线在 centerImage 上方\n// - direction = 'down':碗形 —— centerImage 贴顶,弧线在 centerImage 下方\n// image 默认为圆形,ARC_BLOCK_IMAGE_SIZE 即圆的直径\nconst ARC_BLOCK_IMAGE_SIZE = 140;\nconst ARC_TEXT_GAP_FROM_IMAGE = 10;\nconst ARC_TITLE_LINE_HEIGHT = 19;\nconst ARC_CONTENT_LINE_HEIGHT = 17;\nconst ARC_CONTENT_FONT_SIZE = 12;\n// title + content 区域总高度(默认 240px,溢出由富文本 heightLimit + ellipsis 自动截断)\nconst ARC_TEXT_BOX_HEIGHT = 240;\nconst ARC_TITLE_TO_CONTENT_GAP = 4;\n// 引导线与 title/content 之间的水平间距\nconst ARC_TEXT_LEFT_PADDING = 20;\n// title/content 区域的最小宽度,确保文字有足够展示空间,不受 image 宽度限制\nconst ARC_TEXT_BOX_MIN_WIDTH = 200;\n// centerImage 边长相对 inner 短边的比例(强制正方形,避免 cover 模式裁切图片)\nconst ARC_CENTER_IMAGE_SIZE_RATIO = 0.4;\n// 弧线最高/最低点距离 centerImage 顶部/底部的距离\nconst ARC_GAP_FROM_CENTER_IMAGE = 200;\n\nconst isDownArc = (spec: IStorylineSpec) => normalizeLayout(spec.layout).direction === 'down';\n\n/**\n * 计算 arc 布局 centerImage 的 box:水平居中。\n * - up(dome):垂直贴底(位于 inner 区域底部)\n * - down(bowl):垂直贴顶(位于 inner 区域顶部)\n */\nconst getArcCenterImageRect = (spec: IStorylineSpec, ctx: LayoutContext) => {\n const { width, height, startX, startY } = getRegionGeometry(ctx);\n const padding = normalizePadding(spec.block?.padding);\n const innerWidth = Math.max(width - padding.left - padding.right, 1);\n const innerHeight = Math.max(height - padding.top - padding.bottom, 1);\n // 取 inner 短边作为基准,使 rect 始终为正方形(cover 模式下不会裁切方形图片)\n const baseSize = Math.min(innerWidth, innerHeight) * ARC_CENTER_IMAGE_SIZE_RATIO;\n const w = Math.max(spec.centerImage?.width ?? baseSize, 80);\n const h = Math.max(spec.centerImage?.height ?? baseSize, 80);\n const cx = startX + padding.left + innerWidth / 2;\n const isDown = isDownArc(spec);\n const top = isDown\n ? // bowl:紧贴顶部\n startY + padding.top\n : // dome:紧贴底部\n startY + padding.top + innerHeight - h;\n return { x: cx - w / 2, y: top, width: w, height: h };\n};\n\n/**\n * 计算 arc 弧线的几何参数:\n * - cx / rx / startAngle / endAngle 与 layout.ts 中 arcCenters 一致;\n * - cy 与 ry 由两条对齐约束反推,使弧线起/终点 y 与 centerImage 端面对齐,\n * 弧线极值点(顶点 / 底点)距离 centerImage 远端 ARC_GAP_FROM_CENTER_IMAGE。\n *\n * up(dome):startAngle = 200°、endAngle = 340°(弧线在 centerImage 上方)\n * cy + ry * sin(startAngle) = centerImageBottom\n * cy - ry = centerImageTop - GAP\n * → ry = (centerImageHeight + GAP) / (1 + sin(startAngle))\n * cy = centerImageBottom - ry * sin(startAngle)\n *\n * down(bowl):startAngle = 20°、endAngle = 160°(弧线在 centerImage 下方)\n * cy + ry * sin(startAngle) = centerImageTop\n * cy + ry = centerImageBottom + GAP\n * → ry = (GAP + centerImageHeight) / (1 - sin(startAngle))\n * cy = centerImageTop - ry * sin(startAngle)\n */\nconst getArcGeometry = (spec: IStorylineSpec, ctx: LayoutContext) => {\n const { width, startX } = getRegionGeometry(ctx);\n const blockPadding = normalizePadding(spec.block?.padding);\n const innerWidth = Math.max(width - blockPadding.left - blockPadding.right, 1);\n const blockWidth = resolveBlockWidth(spec, width);\n const layoutOpt = normalizeLayout(spec.layout);\n const isDown = layoutOpt.direction === 'down';\n // 默认弧线起止角与 layout.ts 中一致\n const startAngle = layoutOpt.startAngle ?? (isDown ? 20 : 200);\n const endAngle = layoutOpt.endAngle ?? (isDown ? 160 : 340);\n const ratio = layoutOpt.radiusRatio ?? 0.88;\n const rx = Math.max((innerWidth - blockWidth) / 2, 1) * ratio;\n const centerRect = getArcCenterImageRect(spec, ctx);\n const centerTop = centerRect.y;\n const centerBottom = centerRect.y + centerRect.height;\n const sinStart = Math.sin((startAngle / 180) * Math.PI);\n let cy: number;\n let ry: number;\n if (isDown) {\n // bowl:sinStart 接近 1 时 ry → ∞;这里限制下界以防 startAngle 配置异常\n const denom = Math.max(1 - sinStart, 0.05);\n ry = (centerRect.height + ARC_GAP_FROM_CENTER_IMAGE) / denom;\n cy = centerTop - ry * sinStart;\n } else {\n // dome:sinStart 接近 -1 时 ry → ∞\n const denom = Math.max(1 + sinStart, 0.05);\n ry = (centerRect.height + ARC_GAP_FROM_CENTER_IMAGE) / denom;\n cy = centerBottom - ry * sinStart;\n }\n return {\n cx: startX + blockPadding.left + innerWidth / 2,\n cy,\n rx,\n ry,\n startAngle,\n endAngle,\n centerTop,\n centerBottom\n };\n};\n\n/**\n * 在 arc 弧线上按 index 采样 block 中心,与 arc 完全同步。\n * 同时让 block 沿弧线径向向外偏移 imageHeight/2,\n * 使 image 内边贴在弧线上,image + text 整体位于弧线外侧。\n */\nconst getArcBlockCenter = (spec: IStorylineSpec, ctx: LayoutContext, index: number): StorylinePoint => {\n const arc = getArcGeometry(spec, ctx);\n const count = spec.data?.length ?? 0;\n if (count <= 0) {\n return { x: arc.cx, y: arc.cy };\n }\n const t = count === 1 ? 0.5 : index / (count - 1);\n const angle = ((arc.startAngle + (arc.endAngle - arc.startAngle) * t) / 180) * Math.PI;\n const px = arc.cx + Math.cos(angle) * arc.rx;\n const py = arc.cy + Math.sin(angle) * arc.ry;\n // 椭圆在 (px,py) 处的外法向量 ∝ (cos(angle)/rx, sin(angle)/ry)\n const nxRaw = Math.cos(angle) / arc.rx;\n const nyRaw = Math.sin(angle) / arc.ry;\n const nLen = Math.hypot(nxRaw, nyRaw) || 1;\n const nx = nxRaw / nLen;\n const ny = nyRaw / nLen;\n const imageHeight = spec.image?.height ?? ARC_BLOCK_IMAGE_SIZE;\n const offset = imageHeight / 2;\n return { x: px + nx * offset, y: py + ny * offset };\n};\n\n/**\n * 贯穿所有 block 的弧线 mark(path 通过沿椭圆采样实现,与 arc block 的弧形布局完全重合)\n *\n * 默认不展示,仅当用户在 spec.line.visible 显式置为 true 时才渲染。\n */\nexport const buildArcMark = (spec: IStorylineSpec): IExtensionGroupMarkSpec | null => {\n if (spec.line?.visible !== true) {\n return null;\n }\n const themeColor = getThemeColor(spec);\n return {\n type: 'group' as any,\n name: 'storyline-arc',\n zIndex: LayoutZIndex.Mark,\n children: [\n {\n type: 'path',\n name: 'storyline-arc-path',\n interactive: false,\n style: {\n stroke: themeColor,\n lineWidth: 2,\n lineCap: 'round',\n fill: 'transparent',\n fillOpacity: 0,\n path: (_d: unknown, ctx: LayoutContext) => {\n const arc = getArcGeometry(spec, ctx);\n const span = arc.endAngle - arc.startAngle;\n const samples = 64;\n const segments: string[] = [];\n for (let i = 0; i <= samples; i++) {\n const t = i / samples;\n const angle = ((arc.startAngle + span * t) / 180) * Math.PI;\n const x = arc.cx + Math.cos(angle) * arc.rx;\n const y = arc.cy + Math.sin(angle) * arc.ry;\n segments.push(`${i === 0 ? 'M' : 'L'} ${x.toFixed(2)} ${y.toFixed(2)}`);\n }\n return segments.join(' ');\n }\n }\n } as ICustomMarkSpec<'path'>\n ]\n };\n};\n\nexport const buildArcCenterImageMark = (spec: IStorylineSpec): IExtensionGroupMarkSpec | null => {\n const visible = spec.centerImage?.visible !== false;\n if (!visible) {\n return null;\n }\n const themeColor = getThemeColor(spec);\n const hasImage = !!spec.centerImage?.image;\n // 主题色生成的线性渐变(顶部偏淡 → 底部主题色),作为 centerImage 位置的 symbol 填充\n const symbolGradient = {\n gradient: 'linear',\n x0: 0.5,\n y0: 0,\n x1: 0.5,\n y1: 1,\n stops: [\n { offset: 0, color: withAlpha(themeColor, 0.15) },\n { offset: 1, color: themeColor }\n ]\n };\n return {\n type: 'group' as any,\n name: 'storyline-arc-center',\n zIndex: LayoutZIndex.Mark,\n children: [\n {\n type: 'symbol',\n name: 'storyline-arc-center-symbol',\n interactive: false,\n style: {\n x: (_d: unknown, ctx: LayoutContext) => {\n const r = getArcCenterImageRect(spec, ctx);\n return r.x + r.width / 2;\n },\n y: (_d: unknown, ctx: LayoutContext) => {\n const r = getArcCenterImageRect(spec, ctx);\n return r.y + r.height / 2;\n },\n size: (_d: unknown, ctx: LayoutContext) => {\n const r = getArcCenterImageRect(spec, ctx);\n return Math.max(r.width, r.height) * 1.1;\n },\n symbolType: 'circle',\n fill: symbolGradient,\n stroke: themeColor,\n lineWidth: 2\n }\n } as ICustomMarkSpec<'symbol'>,\n hasImage\n ? ({\n type: 'image',\n name: 'storyline-arc-center-image',\n interactive: false,\n ...spec.centerImage,\n style: {\n x: (_d: unknown, ctx: LayoutContext) => getArcCenterImageRect(spec, ctx).x,\n y: (_d: unknown, ctx: LayoutContext) => getArcCenterImageRect(spec, ctx).y,\n width: (_d: unknown, ctx: LayoutContext) => getArcCenterImageRect(spec, ctx).width,\n height: (_d: unknown, ctx: LayoutContext) => getArcCenterImageRect(spec, ctx).height,\n image: spec.centerImage?.image,\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n imageMode: 'cover',\n imagePosition: 'center',\n // 默认锚点设为 image 中心,让 scaleX/scaleY 从中心缩放\n anchor: (_d: unknown, ctx: LayoutContext) => {\n const r = getArcCenterImageRect(spec, ctx);\n return [r.x + r.width / 2, r.y + r.height / 2];\n },\n // 若用户在 style 里覆盖了 width/height,自动追加 dx/dy 让图片仍以 rect 中心为中心\n dx: (_d: unknown, ctx: LayoutContext) => {\n const r = getArcCenterImageRect(spec, ctx);\n const userWidth = (spec.centerImage?.style as { width?: number } | undefined)?.width;\n const w = typeof userWidth === 'number' ? userWidth : r.width;\n return (r.width - w) / 2;\n },\n dy: (_d: unknown, ctx: LayoutContext) => {\n const r = getArcCenterImageRect(spec, ctx);\n const userHeight = (spec.centerImage?.style as { height?: number } | undefined)?.height;\n const h = typeof userHeight === 'number' ? userHeight : r.height;\n return (r.height - h) / 2;\n },\n ...spec.centerImage?.style\n }\n } as ICustomMarkSpec<'image'>)\n : null\n ].filter(Boolean) as ICustomMarkSpec<any>[]\n };\n};\n\nconst getArcBlockMetrics = (spec: IStorylineSpec) => {\n const titleFontSize = Number((spec.title?.style as any)?.fontSize ?? 18);\n const titleLineHeight = Number(\n (spec.title?.style as any)?.lineHeight ?? Math.max(ARC_TITLE_LINE_HEIGHT, Math.round(titleFontSize * 1.35))\n );\n const contentFontSize = Number((spec.content?.style as any)?.fontSize ?? ARC_CONTENT_FONT_SIZE);\n const contentLineHeight = Number((spec.content?.style as any)?.lineHeight ?? ARC_CONTENT_LINE_HEIGHT);\n const titleToContentGap = ARC_TITLE_TO_CONTENT_GAP;\n // text 区域总高度固定为 ARC_TEXT_BOX_HEIGHT,content 占除 title 与间距外的全部高度\n const textHeight = ARC_TEXT_BOX_HEIGHT;\n const contentHeight = Math.max(textHeight - titleLineHeight - titleToContentGap, contentLineHeight);\n\n const imageWidth = spec.image?.width ?? ARC_BLOCK_IMAGE_SIZE;\n const imageHeight = spec.image?.height ?? ARC_BLOCK_IMAGE_SIZE;\n\n const isDown = isDownArc(spec);\n\n // image 位于 block 中心,title/content:\n // - up(dome):在 image 上方;\n // - down(bowl):在 image 下方\n const imageBox = {\n x: -imageWidth / 2,\n y: -imageHeight / 2,\n width: imageWidth,\n height: imageHeight\n };\n const textBoxWidth = Math.max(imageWidth - ARC_TEXT_LEFT_PADDING, ARC_TEXT_BOX_MIN_WIDTH);\n const textBox = {\n x: -imageWidth / 2 + ARC_TEXT_LEFT_PADDING,\n y: isDown ? imageBox.y + imageHeight + ARC_TEXT_GAP_FROM_IMAGE : imageBox.y - ARC_TEXT_GAP_FROM_IMAGE - textHeight,\n width: textBoxWidth,\n height: textHeight\n };\n const contentBox = {\n x: textBox.x,\n y: textBox.y + titleLineHeight + titleToContentGap,\n width: textBox.width,\n height: contentHeight\n };\n return {\n titleFontSize,\n titleLineHeight,\n contentFontSize,\n contentLineHeight,\n imageBox,\n textBox,\n contentBox,\n isDown\n };\n};\n\nexport const buildArcBlockMark = (\n spec: IStorylineSpec,\n block: IStorylineBlock,\n index: number\n): IExtensionGroupMarkSpec => {\n const hasImage = !!block.image;\n const contentText = Array.isArray(block.content) ? block.content : block.content ? [block.content] : [];\n const themeColor = getThemeColor(spec);\n const metrics = getArcBlockMetrics(spec);\n\n // 引导线 rect:贯穿 image 端面 → text 远端\n // - up(dome):从 textBox.y 到 imageBox.y(text 在 image 上方)\n // - down(bowl):从 imageBox 底端 到 textBox 底端(text 在 image 下方)\n const connectorY = metrics.isDown ? metrics.imageBox.y + metrics.imageBox.height : metrics.textBox.y;\n const connectorHeight = metrics.isDown\n ? Math.max(metrics.textBox.y + metrics.textBox.height - (metrics.imageBox.y + metrics.imageBox.height), 0)\n : Math.max(metrics.imageBox.y - metrics.textBox.y, 0);\n\n return {\n type: 'group' as any,\n id: `storyline-block-${block.id ?? index}`,\n name: `storyline-block-${index}`,\n zIndex: LayoutZIndex.Mark + 1,\n style: {\n x: (_d: unknown, ctx: LayoutContext) => getArcBlockCenter(spec, ctx, index).x,\n y: (_d: unknown, ctx: LayoutContext) => getArcBlockCenter(spec, ctx, index).y\n },\n children: [\n // title / content 左侧的垂直引导线\n {\n type: 'rect',\n name: `storyline-block-connector-${index}`,\n interactive: false,\n style: {\n x: metrics.imageBox.x,\n y: connectorY,\n width: 2,\n height: connectorHeight,\n fill: themeColor,\n fillOpacity: 0.6\n }\n } as ICustomMarkSpec<'rect'>,\n hasImage\n ? ({\n type: 'image',\n name: `storyline-block-image-${index}`,\n interactive: false,\n ...omitImageLayoutSpec(spec.image),\n style: {\n x: metrics.imageBox.x,\n y: metrics.imageBox.y,\n width: metrics.imageBox.width,\n height: metrics.imageBox.height,\n image: block.image,\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n imageMode: 'cover',\n imagePosition: 'center',\n ...spec.image?.style\n }\n } as ICustomMarkSpec<'image'>)\n : ({\n type: 'rect',\n name: `storyline-block-image-bg-${index}`,\n interactive: false,\n style: {\n x: metrics.imageBox.x,\n y: metrics.imageBox.y,\n width: metrics.imageBox.width,\n height: metrics.imageBox.height,\n cornerRadius: Math.min(metrics.imageBox.width, metrics.imageBox.height) / 2,\n fill: '#ffffff',\n stroke: themeColor,\n lineWidth: 2\n }\n } as ICustomMarkSpec<'rect'>),\n block.title\n ? ({\n type: 'text',\n name: `storyline-block-title-${index}`,\n interactive: false,\n ...spec.title,\n style: {\n x: metrics.textBox.x,\n y: metrics.textBox.y,\n text: block.title,\n maxLineWidth: metrics.textBox.width,\n fontSize: metrics.titleFontSize,\n lineHeight: metrics.titleLineHeight,\n fontWeight: 'bold',\n fill: '#1f2430',\n stroke: '#fff',\n lineWidth: 5,\n lineJoin: 'round',\n textAlign: 'left',\n textBaseline: 'top',\n ...spec.title?.style\n }\n } as ICustomMarkSpec<'text'>)\n : null,\n contentText.length\n ? ({\n type: 'text',\n name: `storyline-block-content-${index}`,\n interactive: false,\n ...spec.content,\n textType: 'rich',\n style: {\n x: metrics.contentBox.x,\n y: metrics.contentBox.y,\n width: metrics.contentBox.width,\n height: metrics.contentBox.height,\n maxLineWidth: metrics.contentBox.width,\n heightLimit: metrics.contentBox.height,\n text: buildRichContent(contentText, spec),\n fontSize: ARC_CONTENT_FONT_SIZE,\n lineHeight: ARC_CONTENT_LINE_HEIGHT,\n textAlign: 'left',\n textBaseline: 'top',\n wordBreak: 'break-word',\n ellipsis: '...',\n fill: '#596173',\n ...spec.content?.style\n }\n } as ICustomMarkSpec<'text'>)\n : null\n ].filter(Boolean) as ICustomMarkSpec<any>[]\n };\n};\n"]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { IExtensionGroupMarkSpec } from '@visactor/vchart';
|
|
2
|
-
import type { IStorylineBlock, IStorylineSpec } from '../interface';
|
|
3
|
-
export declare const buildClockCenterImageMark: (spec: IStorylineSpec) => IExtensionGroupMarkSpec | null;
|
|
4
|
-
export declare const buildClockArcMark: (spec: IStorylineSpec) => IExtensionGroupMarkSpec | null;
|
|
5
|
-
export declare const buildClockBlockMark: (spec: IStorylineSpec, block: IStorylineBlock, index: number) => IExtensionGroupMarkSpec;
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: !0
|
|
5
|
-
}), exports.buildClockBlockMark = exports.buildClockArcMark = exports.buildClockCenterImageMark = void 0;
|
|
6
|
-
|
|
7
|
-
const vchart_1 = require("@visactor/vchart"), common_1 = require("./common"), CLOCK_CENTER_RADIUS_RATIO = .5, CLOCK_CENTER_IMAGE_INSET_RATIO = .86, CLOCK_ORBIT_RATIO = .58, CLOCK_DOT_RATIO = .58, CLOCK_TEXT_INNER_RATIO = .7, CLOCK_TEXT_MAX_WIDTH = 200, CLOCK_DOT_DIAMETER_RATIO = .24, CLOCK_LEAD_LINE_GAP = 6, CLOCK_TEXT_GAP_FROM_LEAD = 8, CLOCK_ORBIT_DASH = [ 4, 4 ], CLOCK_TITLE_FONT_SIZE = 18, CLOCK_TITLE_LINE_HEIGHT = 24, CLOCK_CONTENT_FONT_SIZE = 11, CLOCK_CONTENT_LINE_HEIGHT = 15, getClockGeometry = (spec, ctx) => {
|
|
8
|
-
var _a, _b, _c;
|
|
9
|
-
const {width: width, height: height, startX: startX, startY: startY} = (0, common_1.getRegionGeometry)(ctx), padding = (0,
|
|
10
|
-
common_1.normalizePadding)(null === (_a = spec.block) || void 0 === _a ? void 0 : _a.padding), innerWidth = Math.max(width - padding.left - padding.right, 1), innerHeight = Math.max(height - padding.top - padding.bottom, 1), cx = startX + padding.left + innerWidth / 2, cy = startY + padding.top + innerHeight / 2, R = Math.max(Math.min(innerWidth, innerHeight) / 2, 1), count = null !== (_c = null === (_b = spec.data) || void 0 === _b ? void 0 : _b.length) && void 0 !== _c ? _c : 0;
|
|
11
|
-
return {
|
|
12
|
-
cx: cx,
|
|
13
|
-
cy: cy,
|
|
14
|
-
R: R,
|
|
15
|
-
count: count,
|
|
16
|
-
step: count > 0 ? 2 * Math.PI / count : 0
|
|
17
|
-
};
|
|
18
|
-
}, getClockBlockAngle = (geom, index) => -Math.PI / 2 + geom.step * (index + .5), polar = (cx, cy, r, angle) => ({
|
|
19
|
-
x: cx + Math.cos(angle) * r,
|
|
20
|
-
y: cy + Math.sin(angle) * r
|
|
21
|
-
}), isOnLeftHalf = angle => Math.cos(angle) < 0, buildClockCenterImageMark = spec => {
|
|
22
|
-
var _a, _b, _c, _e;
|
|
23
|
-
if (!1 === (null === (_a = spec.centerImage) || void 0 === _a ? void 0 : _a.visible)) return null;
|
|
24
|
-
const themeColor = (0, common_1.getThemeColor)(spec), hasImage = !!(null === (_b = spec.centerImage) || void 0 === _b ? void 0 : _b.image);
|
|
25
|
-
return {
|
|
26
|
-
type: "group",
|
|
27
|
-
name: "storyline-clock-center",
|
|
28
|
-
zIndex: vchart_1.LayoutZIndex.Mark + 2,
|
|
29
|
-
children: [ {
|
|
30
|
-
type: "symbol",
|
|
31
|
-
name: "storyline-clock-center-halo",
|
|
32
|
-
interactive: !1,
|
|
33
|
-
style: {
|
|
34
|
-
x: (_d, ctx) => getClockGeometry(spec, ctx).cx,
|
|
35
|
-
y: (_d, ctx) => getClockGeometry(spec, ctx).cy,
|
|
36
|
-
size: (_d, ctx) => .5 * getClockGeometry(spec, ctx).R * 2.16,
|
|
37
|
-
symbolType: "circle",
|
|
38
|
-
fill: (0, common_1.withAlpha)(themeColor, .28),
|
|
39
|
-
stroke: "transparent"
|
|
40
|
-
}
|
|
41
|
-
}, hasImage ? {
|
|
42
|
-
type: "image",
|
|
43
|
-
name: "storyline-clock-center-image",
|
|
44
|
-
interactive: !1,
|
|
45
|
-
style: Object.assign({
|
|
46
|
-
x: (_d, ctx) => {
|
|
47
|
-
const g = getClockGeometry(spec, ctx);
|
|
48
|
-
return g.cx - .5 * g.R * .86;
|
|
49
|
-
},
|
|
50
|
-
y: (_d, ctx) => {
|
|
51
|
-
const g = getClockGeometry(spec, ctx);
|
|
52
|
-
return g.cy - .5 * g.R * .86;
|
|
53
|
-
},
|
|
54
|
-
width: (_d, ctx) => .5 * getClockGeometry(spec, ctx).R * .86 * 2,
|
|
55
|
-
height: (_d, ctx) => .5 * getClockGeometry(spec, ctx).R * .86 * 2,
|
|
56
|
-
image: null === (_c = spec.centerImage) || void 0 === _c ? void 0 : _c.image,
|
|
57
|
-
repeatX: "no-repeat",
|
|
58
|
-
repeatY: "no-repeat",
|
|
59
|
-
imageMode: "cover",
|
|
60
|
-
imagePosition: "center",
|
|
61
|
-
anchor: (_d, ctx) => {
|
|
62
|
-
const g = getClockGeometry(spec, ctx);
|
|
63
|
-
return [ g.cx, g.cy ];
|
|
64
|
-
},
|
|
65
|
-
dx: (_d, ctx) => {
|
|
66
|
-
var _a, _b;
|
|
67
|
-
const rectW = .5 * getClockGeometry(spec, ctx).R * .86 * 2, userWidth = null === (_b = null === (_a = spec.centerImage) || void 0 === _a ? void 0 : _a.style) || void 0 === _b ? void 0 : _b.width;
|
|
68
|
-
return (rectW - ("number" == typeof userWidth ? userWidth : rectW)) / 2;
|
|
69
|
-
},
|
|
70
|
-
dy: (_d, ctx) => {
|
|
71
|
-
var _a, _b;
|
|
72
|
-
const rectH = .5 * getClockGeometry(spec, ctx).R * .86 * 2, userHeight = null === (_b = null === (_a = spec.centerImage) || void 0 === _a ? void 0 : _a.style) || void 0 === _b ? void 0 : _b.height;
|
|
73
|
-
return (rectH - ("number" == typeof userHeight ? userHeight : rectH)) / 2;
|
|
74
|
-
}
|
|
75
|
-
}, null === (_e = spec.centerImage) || void 0 === _e ? void 0 : _e.style)
|
|
76
|
-
} : {
|
|
77
|
-
type: "symbol",
|
|
78
|
-
name: "storyline-clock-center-placeholder",
|
|
79
|
-
interactive: !1,
|
|
80
|
-
style: {
|
|
81
|
-
x: (_d, ctx) => getClockGeometry(spec, ctx).cx,
|
|
82
|
-
y: (_d, ctx) => getClockGeometry(spec, ctx).cy,
|
|
83
|
-
size: (_d, ctx) => .5 * getClockGeometry(spec, ctx).R * 2,
|
|
84
|
-
symbolType: "circle",
|
|
85
|
-
fill: "#ffffff",
|
|
86
|
-
stroke: themeColor,
|
|
87
|
-
lineWidth: 2
|
|
88
|
-
}
|
|
89
|
-
} ].filter(Boolean)
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
exports.buildClockCenterImageMark = buildClockCenterImageMark;
|
|
94
|
-
|
|
95
|
-
const buildClockArcMark = spec => {
|
|
96
|
-
const themeColor = (0, common_1.getThemeColor)(spec);
|
|
97
|
-
return {
|
|
98
|
-
type: "group",
|
|
99
|
-
name: "storyline-clock-orbit",
|
|
100
|
-
zIndex: vchart_1.LayoutZIndex.Mark,
|
|
101
|
-
children: [ {
|
|
102
|
-
type: "path",
|
|
103
|
-
name: "storyline-clock-orbit-path",
|
|
104
|
-
interactive: !1,
|
|
105
|
-
style: {
|
|
106
|
-
path: (_d, ctx) => {
|
|
107
|
-
const g = getClockGeometry(spec, ctx), r = .58 * g.R;
|
|
108
|
-
return [ `M ${(g.cx + r).toFixed(2)} ${g.cy.toFixed(2)}`, `A ${r.toFixed(2)} ${r.toFixed(2)} 0 1 1 ${(g.cx - r).toFixed(2)} ${g.cy.toFixed(2)}`, `A ${r.toFixed(2)} ${r.toFixed(2)} 0 1 1 ${(g.cx + r).toFixed(2)} ${g.cy.toFixed(2)}` ].join(" ");
|
|
109
|
-
},
|
|
110
|
-
stroke: (0, common_1.withAlpha)(themeColor, .7),
|
|
111
|
-
lineWidth: 1,
|
|
112
|
-
lineDash: CLOCK_ORBIT_DASH,
|
|
113
|
-
fill: "transparent",
|
|
114
|
-
fillOpacity: 0
|
|
115
|
-
}
|
|
116
|
-
} ]
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
exports.buildClockArcMark = buildClockArcMark;
|
|
121
|
-
|
|
122
|
-
const getClockDotCenter = (spec, ctx, index) => {
|
|
123
|
-
const g = getClockGeometry(spec, ctx), angle = getClockBlockAngle(g, index), r = .58 * g.R;
|
|
124
|
-
return Object.assign(Object.assign({}, polar(g.cx, g.cy, r, angle)), {
|
|
125
|
-
diameter: .24 * g.R,
|
|
126
|
-
angle: angle
|
|
127
|
-
});
|
|
128
|
-
}, getClockLeadLine = (spec, ctx, index) => {
|
|
129
|
-
const g = getClockGeometry(spec, ctx), angle = getClockBlockAngle(g, index), dotR = .24 * g.R / 2;
|
|
130
|
-
return {
|
|
131
|
-
start: polar(g.cx, g.cy, .58 * g.R + dotR + 6, angle),
|
|
132
|
-
end: polar(g.cx, g.cy, .7 * g.R - 8, angle)
|
|
133
|
-
};
|
|
134
|
-
}, getClockTextRect = (spec, ctx, index) => {
|
|
135
|
-
var _a;
|
|
136
|
-
const g = getClockGeometry(spec, ctx), {width: regionWidth, startX: startX} = (0,
|
|
137
|
-
common_1.getRegionGeometry)(ctx), padding = (0, common_1.normalizePadding)(null === (_a = spec.block) || void 0 === _a ? void 0 : _a.padding), angle = getClockBlockAngle(g, index), onLeft = isOnLeftHalf(angle), rInner = .7 * g.R, innerPoint = polar(g.cx, g.cy, rInner, angle), leftEdge = startX + padding.left, rightEdge = startX + regionWidth - padding.right, width = onLeft ? Math.min(Math.max(innerPoint.x - leftEdge, 80), 200) : Math.min(Math.max(rightEdge - innerPoint.x, 80), 200);
|
|
138
|
-
return {
|
|
139
|
-
x: innerPoint.x,
|
|
140
|
-
y: innerPoint.y,
|
|
141
|
-
width: width,
|
|
142
|
-
onLeft: onLeft,
|
|
143
|
-
anchorY: innerPoint.y
|
|
144
|
-
};
|
|
145
|
-
}, buildClockBlockMark = (spec, block, index) => {
|
|
146
|
-
var _a, _b, _c;
|
|
147
|
-
const hasImage = !!block.image, themeColor = (0, common_1.getThemeColor)(spec), contentText = Array.isArray(block.content) ? block.content : block.content ? [ block.content ] : [], children = [ {
|
|
148
|
-
type: "path",
|
|
149
|
-
name: `storyline-clock-lead-${index}`,
|
|
150
|
-
interactive: !1,
|
|
151
|
-
style: {
|
|
152
|
-
path: (_d, ctx) => {
|
|
153
|
-
const {start: start, end: end} = getClockLeadLine(spec, ctx, index);
|
|
154
|
-
return `M ${start.x.toFixed(2)} ${start.y.toFixed(2)} L ${end.x.toFixed(2)} ${end.y.toFixed(2)}`;
|
|
155
|
-
},
|
|
156
|
-
stroke: (0, common_1.withAlpha)(themeColor, .7),
|
|
157
|
-
lineWidth: 1,
|
|
158
|
-
lineDash: [ 3, 3 ],
|
|
159
|
-
fill: "transparent",
|
|
160
|
-
fillOpacity: 0
|
|
161
|
-
}
|
|
162
|
-
}, hasImage ? {
|
|
163
|
-
type: "image",
|
|
164
|
-
name: `storyline-clock-dot-${index}`,
|
|
165
|
-
interactive: !1,
|
|
166
|
-
style: {
|
|
167
|
-
x: (_d, ctx) => {
|
|
168
|
-
const dot = getClockDotCenter(spec, ctx, index);
|
|
169
|
-
return dot.x - dot.diameter / 2;
|
|
170
|
-
},
|
|
171
|
-
y: (_d, ctx) => {
|
|
172
|
-
const dot = getClockDotCenter(spec, ctx, index);
|
|
173
|
-
return dot.y - dot.diameter / 2;
|
|
174
|
-
},
|
|
175
|
-
width: (_d, ctx) => getClockDotCenter(spec, ctx, index).diameter,
|
|
176
|
-
height: (_d, ctx) => getClockDotCenter(spec, ctx, index).diameter,
|
|
177
|
-
image: block.image,
|
|
178
|
-
repeatX: "no-repeat",
|
|
179
|
-
repeatY: "no-repeat",
|
|
180
|
-
imageMode: "cover",
|
|
181
|
-
imagePosition: "center"
|
|
182
|
-
}
|
|
183
|
-
} : {
|
|
184
|
-
type: "symbol",
|
|
185
|
-
name: `storyline-clock-dot-${index}`,
|
|
186
|
-
interactive: !1,
|
|
187
|
-
style: {
|
|
188
|
-
x: (_d, ctx) => getClockDotCenter(spec, ctx, index).x,
|
|
189
|
-
y: (_d, ctx) => getClockDotCenter(spec, ctx, index).y,
|
|
190
|
-
size: (_d, ctx) => getClockDotCenter(spec, ctx, index).diameter,
|
|
191
|
-
symbolType: "circle",
|
|
192
|
-
fill: themeColor,
|
|
193
|
-
stroke: "#ffffff",
|
|
194
|
-
lineWidth: 1.5
|
|
195
|
-
}
|
|
196
|
-
}, block.title ? Object.assign(Object.assign({
|
|
197
|
-
type: "text",
|
|
198
|
-
name: `storyline-clock-title-${index}`,
|
|
199
|
-
interactive: !1
|
|
200
|
-
}, spec.title), {
|
|
201
|
-
style: Object.assign({
|
|
202
|
-
x: (_d, ctx) => getClockTextRect(spec, ctx, index).x,
|
|
203
|
-
y: (_d, ctx) => getClockTextRect(spec, ctx, index).anchorY - 24,
|
|
204
|
-
text: block.title,
|
|
205
|
-
maxLineWidth: (_d, ctx) => getClockTextRect(spec, ctx, index).width,
|
|
206
|
-
fontSize: 18,
|
|
207
|
-
lineHeight: 24,
|
|
208
|
-
fontWeight: "bold",
|
|
209
|
-
fill: themeColor,
|
|
210
|
-
stroke: "#fff",
|
|
211
|
-
lineWidth: 5,
|
|
212
|
-
lineJoin: "round",
|
|
213
|
-
textAlign: (_d, ctx) => getClockTextRect(spec, ctx, index).onLeft ? "right" : "left",
|
|
214
|
-
textBaseline: "top"
|
|
215
|
-
}, null === (_a = spec.title) || void 0 === _a ? void 0 : _a.style)
|
|
216
|
-
}) : null, contentText.length ? Object.assign(Object.assign({
|
|
217
|
-
type: "text",
|
|
218
|
-
name: `storyline-clock-content-${index}`,
|
|
219
|
-
interactive: !1
|
|
220
|
-
}, spec.content), {
|
|
221
|
-
textType: "rich",
|
|
222
|
-
style: Object.assign({
|
|
223
|
-
x: (_d, ctx) => getClockTextRect(spec, ctx, index).x,
|
|
224
|
-
y: (_d, ctx) => getClockTextRect(spec, ctx, index).anchorY + 4,
|
|
225
|
-
width: (_d, ctx) => getClockTextRect(spec, ctx, index).width,
|
|
226
|
-
maxLineWidth: (_d, ctx) => getClockTextRect(spec, ctx, index).width,
|
|
227
|
-
text: (0, common_1.buildRichContent)(contentText, spec),
|
|
228
|
-
fontSize: 11,
|
|
229
|
-
lineHeight: 15,
|
|
230
|
-
fill: "#3a3f4d",
|
|
231
|
-
textAlign: (_d, ctx) => getClockTextRect(spec, ctx, index).onLeft ? "right" : "left",
|
|
232
|
-
textBaseline: "top",
|
|
233
|
-
wordBreak: "break-word"
|
|
234
|
-
}, null === (_b = spec.content) || void 0 === _b ? void 0 : _b.style)
|
|
235
|
-
}) : null ];
|
|
236
|
-
return {
|
|
237
|
-
type: "group",
|
|
238
|
-
id: `storyline-block-${null !== (_c = block.id) && void 0 !== _c ? _c : index}`,
|
|
239
|
-
name: `storyline-block-${index}`,
|
|
240
|
-
zIndex: vchart_1.LayoutZIndex.Mark + 1,
|
|
241
|
-
children: children.filter(Boolean)
|
|
242
|
-
};
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
exports.buildClockBlockMark = buildClockBlockMark;
|
|
246
|
-
//# sourceMappingURL=clock.js.map
|