schematex 0.2.5 → 0.3.2
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/README.md +4 -3
- package/dist/ai/ai-sdk.cjs +25 -25
- package/dist/ai/ai-sdk.d.cts +2 -2
- package/dist/ai/ai-sdk.d.ts +2 -2
- package/dist/ai/ai-sdk.js +20 -20
- package/dist/ai/index.cjs +28 -28
- package/dist/ai/index.d.cts +3 -3
- package/dist/ai/index.d.ts +3 -3
- package/dist/ai/index.js +20 -20
- package/dist/{api-bQZ98gkJ.d.cts → api-BuFilDQB.d.cts} +1 -1
- package/dist/{api-bQZ98gkJ.d.ts → api-BuFilDQB.d.ts} +1 -1
- package/dist/browser.cjs +22 -22
- package/dist/browser.d.cts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +20 -20
- package/dist/{chunk-J2LVOWVY.js → chunk-2J2QWNGI.js} +46 -24
- package/dist/chunk-2J2QWNGI.js.map +1 -0
- package/dist/{chunk-MCFQAUQV.cjs → chunk-2UJAVPA4.cjs} +58 -39
- package/dist/chunk-2UJAVPA4.cjs.map +1 -0
- package/dist/{chunk-5AEN2PLB.cjs → chunk-3YXXZ4LT.cjs} +33 -33
- package/dist/{chunk-5AEN2PLB.cjs.map → chunk-3YXXZ4LT.cjs.map} +1 -1
- package/dist/{chunk-RP5UATRA.js → chunk-56LXBM45.js} +4 -4
- package/dist/{chunk-RP5UATRA.js.map → chunk-56LXBM45.js.map} +1 -1
- package/dist/{chunk-OC22GGQN.js → chunk-6BKUD5EJ.js} +54 -4
- package/dist/chunk-6BKUD5EJ.js.map +1 -0
- package/dist/{chunk-ULYRO2KY.cjs → chunk-75BMFCP5.cjs} +44 -44
- package/dist/{chunk-ULYRO2KY.cjs.map → chunk-75BMFCP5.cjs.map} +1 -1
- package/dist/{chunk-ZNDIGQJD.js → chunk-7BEJHG43.js} +3 -3
- package/dist/{chunk-ZNDIGQJD.js.map → chunk-7BEJHG43.js.map} +1 -1
- package/dist/{chunk-WYFXOXVK.cjs → chunk-7MVDN5UC.cjs} +35 -35
- package/dist/{chunk-WYFXOXVK.cjs.map → chunk-7MVDN5UC.cjs.map} +1 -1
- package/dist/{chunk-JDTB7IKL.js → chunk-BJ65PKDU.js} +3 -3
- package/dist/{chunk-JDTB7IKL.js.map → chunk-BJ65PKDU.js.map} +1 -1
- package/dist/{chunk-FE6GAUNW.js → chunk-BJWMPPEA.js} +5 -5
- package/dist/{chunk-FE6GAUNW.js.map → chunk-BJWMPPEA.js.map} +1 -1
- package/dist/{chunk-MJGDP3CS.cjs → chunk-BUN3CRMP.cjs} +488 -109
- package/dist/chunk-BUN3CRMP.cjs.map +1 -0
- package/dist/{chunk-COLTVQWR.cjs → chunk-C3IVD7DI.cjs} +25 -25
- package/dist/{chunk-COLTVQWR.cjs.map → chunk-C3IVD7DI.cjs.map} +1 -1
- package/dist/{chunk-3YZ6FPQW.cjs → chunk-EYHD7LV3.cjs} +131 -131
- package/dist/{chunk-3YZ6FPQW.cjs.map → chunk-EYHD7LV3.cjs.map} +1 -1
- package/dist/{chunk-UGCUNADI.js → chunk-F6OROIHS.js} +35 -16
- package/dist/chunk-F6OROIHS.js.map +1 -0
- package/dist/{chunk-UAGSCTYI.cjs → chunk-GYTWJ6VB.cjs} +85 -63
- package/dist/chunk-GYTWJ6VB.cjs.map +1 -0
- package/dist/{chunk-MR5HU5WU.js → chunk-H4CJTKEH.js} +50 -4
- package/dist/chunk-H4CJTKEH.js.map +1 -0
- package/dist/{chunk-45KP67RR.js → chunk-HIQPEAL7.js} +5 -5
- package/dist/chunk-HIQPEAL7.js.map +1 -0
- package/dist/{chunk-LR4X4ZRG.js → chunk-IT2TVXC7.js} +20 -16
- package/dist/chunk-IT2TVXC7.js.map +1 -0
- package/dist/{chunk-2JDVJRR3.cjs → chunk-K5QG53GT.cjs} +28 -28
- package/dist/chunk-K5QG53GT.cjs.map +1 -0
- package/dist/{chunk-B37IKTI7.cjs → chunk-KUXOHLGC.cjs} +97 -47
- package/dist/chunk-KUXOHLGC.cjs.map +1 -0
- package/dist/{chunk-A5D2IMOX.cjs → chunk-L2KUGWFR.cjs} +47 -47
- package/dist/{chunk-A5D2IMOX.cjs.map → chunk-L2KUGWFR.cjs.map} +1 -1
- package/dist/{chunk-HDKDQAEQ.cjs → chunk-LFZZ4NCP.cjs} +14 -2
- package/dist/chunk-LFZZ4NCP.cjs.map +1 -0
- package/dist/{chunk-U6L3FAML.js → chunk-M3R6RCXY.js} +3 -3
- package/dist/{chunk-U6L3FAML.js.map → chunk-M3R6RCXY.js.map} +1 -1
- package/dist/{chunk-5YYAYW67.js → chunk-M5ZC3LFJ.js} +3 -3
- package/dist/{chunk-5YYAYW67.js.map → chunk-M5ZC3LFJ.js.map} +1 -1
- package/dist/{chunk-B6INLQBU.cjs → chunk-MKKFIPKU.cjs} +46 -46
- package/dist/{chunk-B6INLQBU.cjs.map → chunk-MKKFIPKU.cjs.map} +1 -1
- package/dist/{chunk-M5B2UUNW.js → chunk-NFT6VW73.js} +4 -4
- package/dist/{chunk-M5B2UUNW.js.map → chunk-NFT6VW73.js.map} +1 -1
- package/dist/{chunk-X7RPFTTR.cjs → chunk-OK5RYX55.cjs} +26 -26
- package/dist/{chunk-X7RPFTTR.cjs.map → chunk-OK5RYX55.cjs.map} +1 -1
- package/dist/{chunk-VPKCW4PB.js → chunk-RNGYXGHS.js} +2854 -42
- package/dist/chunk-RNGYXGHS.js.map +1 -0
- package/dist/{chunk-DPQYGWCT.cjs → chunk-RODV6PC4.cjs} +52 -6
- package/dist/chunk-RODV6PC4.cjs.map +1 -0
- package/dist/{chunk-H2OEUBPO.js → chunk-SE23X5OE.js} +441 -62
- package/dist/chunk-SE23X5OE.js.map +1 -0
- package/dist/{chunk-FCGHV6ZK.js → chunk-SFSZUOFT.js} +4 -4
- package/dist/{chunk-FCGHV6ZK.js.map → chunk-SFSZUOFT.js.map} +1 -1
- package/dist/{chunk-E65ITQXV.cjs → chunk-UK7JF5QB.cjs} +52 -48
- package/dist/chunk-UK7JF5QB.cjs.map +1 -0
- package/dist/{chunk-QSQX77S2.cjs → chunk-W7GIQTJV.cjs} +21 -21
- package/dist/{chunk-QSQX77S2.cjs.map → chunk-W7GIQTJV.cjs.map} +1 -1
- package/dist/{chunk-KLJEK547.js → chunk-WHJXRLFD.js} +14 -3
- package/dist/chunk-WHJXRLFD.js.map +1 -0
- package/dist/{chunk-YQANC7HQ.js → chunk-X4F6VVEJ.js} +3 -3
- package/dist/{chunk-YQANC7HQ.js.map → chunk-X4F6VVEJ.js.map} +1 -1
- package/dist/{chunk-ZNOD4VZT.cjs → chunk-XI6JOG76.cjs} +46 -46
- package/dist/{chunk-ZNOD4VZT.cjs.map → chunk-XI6JOG76.cjs.map} +1 -1
- package/dist/{chunk-4S2WILLW.cjs → chunk-XUEROLSB.cjs} +72 -19
- package/dist/chunk-XUEROLSB.cjs.map +1 -0
- package/dist/{chunk-MSYBSOU2.cjs → chunk-YTEEZV6J.cjs} +3055 -241
- package/dist/chunk-YTEEZV6J.cjs.map +1 -0
- package/dist/{chunk-PGALHQFF.js → chunk-ZNLEUL7T.js} +60 -7
- package/dist/chunk-ZNLEUL7T.js.map +1 -0
- package/dist/{chunk-DNZFOCV7.js → chunk-ZTSO3S4P.js} +3 -3
- package/dist/{chunk-DNZFOCV7.js.map → chunk-ZTSO3S4P.js.map} +1 -1
- package/dist/diagrams/blockdiagram/index.cjs +6 -6
- package/dist/diagrams/blockdiagram/index.d.cts +1 -1
- package/dist/diagrams/blockdiagram/index.d.ts +1 -1
- package/dist/diagrams/blockdiagram/index.js +2 -2
- package/dist/diagrams/circuit/index.cjs +8 -8
- package/dist/diagrams/circuit/index.d.cts +1 -1
- package/dist/diagrams/circuit/index.d.ts +1 -1
- package/dist/diagrams/circuit/index.js +2 -2
- package/dist/diagrams/ecomap/index.cjs +8 -8
- package/dist/diagrams/ecomap/index.d.cts +1 -1
- package/dist/diagrams/ecomap/index.d.ts +1 -1
- package/dist/diagrams/ecomap/index.js +3 -3
- package/dist/diagrams/entity/index.cjs +6 -6
- package/dist/diagrams/entity/index.d.cts +1 -1
- package/dist/diagrams/entity/index.d.ts +1 -1
- package/dist/diagrams/entity/index.js +2 -2
- package/dist/diagrams/fishbone/index.cjs +8 -8
- package/dist/diagrams/fishbone/index.d.cts +1 -1
- package/dist/diagrams/fishbone/index.d.ts +1 -1
- package/dist/diagrams/fishbone/index.js +2 -2
- package/dist/diagrams/flowchart/index.cjs +8 -8
- package/dist/diagrams/flowchart/index.d.cts +2 -2
- package/dist/diagrams/flowchart/index.d.ts +2 -2
- package/dist/diagrams/flowchart/index.js +2 -2
- package/dist/diagrams/genogram/index.cjs +10 -10
- package/dist/diagrams/genogram/index.d.cts +1 -1
- package/dist/diagrams/genogram/index.d.ts +1 -1
- package/dist/diagrams/genogram/index.js +3 -3
- package/dist/diagrams/ladder/index.cjs +6 -6
- package/dist/diagrams/ladder/index.d.cts +1 -1
- package/dist/diagrams/ladder/index.d.ts +1 -1
- package/dist/diagrams/ladder/index.js +2 -2
- package/dist/diagrams/logic/index.cjs +6 -6
- package/dist/diagrams/logic/index.d.cts +1 -1
- package/dist/diagrams/logic/index.d.ts +1 -1
- package/dist/diagrams/logic/index.js +2 -2
- package/dist/diagrams/orgchart/index.cjs +7 -7
- package/dist/diagrams/orgchart/index.d.cts +1 -1
- package/dist/diagrams/orgchart/index.d.ts +1 -1
- package/dist/diagrams/orgchart/index.js +2 -2
- package/dist/diagrams/pedigree/index.cjs +8 -8
- package/dist/diagrams/pedigree/index.d.cts +1 -1
- package/dist/diagrams/pedigree/index.d.ts +1 -1
- package/dist/diagrams/pedigree/index.js +3 -3
- package/dist/diagrams/phylo/index.cjs +7 -7
- package/dist/diagrams/phylo/index.d.cts +1 -1
- package/dist/diagrams/phylo/index.d.ts +1 -1
- package/dist/diagrams/phylo/index.js +2 -2
- package/dist/diagrams/sld/index.cjs +6 -6
- package/dist/diagrams/sld/index.d.cts +1 -1
- package/dist/diagrams/sld/index.d.ts +1 -1
- package/dist/diagrams/sld/index.js +2 -2
- package/dist/diagrams/sociogram/index.cjs +7 -7
- package/dist/diagrams/sociogram/index.d.cts +1 -1
- package/dist/diagrams/sociogram/index.d.ts +1 -1
- package/dist/diagrams/sociogram/index.js +3 -3
- package/dist/diagrams/timing/index.cjs +5 -5
- package/dist/diagrams/timing/index.d.cts +1 -1
- package/dist/diagrams/timing/index.d.ts +1 -1
- package/dist/diagrams/timing/index.js +2 -2
- package/dist/diagrams/venn/index.cjs +9 -9
- package/dist/diagrams/venn/index.d.cts +1 -1
- package/dist/diagrams/venn/index.d.ts +1 -1
- package/dist/diagrams/venn/index.js +2 -2
- package/dist/{index-BTZEka65.d.cts → index-BrLxEzSQ.d.cts} +1 -1
- package/dist/{index-DcU88F9i.d.ts → index-dWDwG6BW.d.ts} +1 -1
- package/dist/index.cjs +47 -39
- package/dist/index.d.cts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +19 -19
- package/dist/react.cjs +20 -20
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +19 -19
- package/dist/react.js.map +1 -1
- package/dist/{types-C4LnMEcB.d.cts → types-BtiUg7Gx.d.cts} +25 -4
- package/dist/{types-C4LnMEcB.d.ts → types-BtiUg7Gx.d.ts} +25 -4
- package/package.json +2 -2
- package/dist/chunk-2JDVJRR3.cjs.map +0 -1
- package/dist/chunk-45KP67RR.js.map +0 -1
- package/dist/chunk-4S2WILLW.cjs.map +0 -1
- package/dist/chunk-B37IKTI7.cjs.map +0 -1
- package/dist/chunk-DPQYGWCT.cjs.map +0 -1
- package/dist/chunk-E65ITQXV.cjs.map +0 -1
- package/dist/chunk-H2OEUBPO.js.map +0 -1
- package/dist/chunk-HDKDQAEQ.cjs.map +0 -1
- package/dist/chunk-J2LVOWVY.js.map +0 -1
- package/dist/chunk-KLJEK547.js.map +0 -1
- package/dist/chunk-LR4X4ZRG.js.map +0 -1
- package/dist/chunk-MCFQAUQV.cjs.map +0 -1
- package/dist/chunk-MJGDP3CS.cjs.map +0 -1
- package/dist/chunk-MR5HU5WU.js.map +0 -1
- package/dist/chunk-MSYBSOU2.cjs.map +0 -1
- package/dist/chunk-OC22GGQN.js.map +0 -1
- package/dist/chunk-PGALHQFF.js.map +0 -1
- package/dist/chunk-UAGSCTYI.cjs.map +0 -1
- package/dist/chunk-UGCUNADI.js.map +0 -1
- package/dist/chunk-VPKCW4PB.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveFlowchartTheme } from './chunk-2VNMKOUO.js';
|
|
2
|
-
import { text, title, desc, el, defs, group, svgRoot, rect, path, polygon, circle, line } from './chunk-
|
|
2
|
+
import { text, title, desc, el, defs, group, svgRoot, rect, multilineText, path, polygon, circle, line } from './chunk-WHJXRLFD.js';
|
|
3
3
|
|
|
4
4
|
// src/diagrams/flowchart/parser.ts
|
|
5
5
|
var FlowchartParseError = class extends Error {
|
|
@@ -15,76 +15,81 @@ var FlowchartParseError = class extends Error {
|
|
|
15
15
|
source;
|
|
16
16
|
};
|
|
17
17
|
var DIRECTIONS = /* @__PURE__ */ new Set(["TB", "TD", "BT", "LR", "RL"]);
|
|
18
|
+
function unquoteLabel(s) {
|
|
19
|
+
const t = s.trim();
|
|
20
|
+
if (t.length >= 2 && t.startsWith('"') && t.endsWith('"')) return t.slice(1, -1);
|
|
21
|
+
return t;
|
|
22
|
+
}
|
|
18
23
|
function parseShapeSuffix(line2, pos) {
|
|
19
24
|
const ch = line2[pos];
|
|
20
25
|
if (ch === void 0) return null;
|
|
21
26
|
if (ch === ">") {
|
|
22
27
|
const end = line2.indexOf("]", pos + 1);
|
|
23
28
|
if (end < 0) return null;
|
|
24
|
-
return { shape: "asymmetric", label: line2.slice(pos + 1, end)
|
|
29
|
+
return { shape: "asymmetric", label: unquoteLabel(line2.slice(pos + 1, end)), end: end + 1 };
|
|
25
30
|
}
|
|
26
31
|
if (ch === "(" && line2[pos + 1] === "(" && line2[pos + 2] === "(") {
|
|
27
32
|
const end = line2.indexOf(")))", pos + 3);
|
|
28
33
|
if (end < 0) return null;
|
|
29
|
-
return { shape: "double-circle", label: line2.slice(pos + 3, end)
|
|
34
|
+
return { shape: "double-circle", label: unquoteLabel(line2.slice(pos + 3, end)), end: end + 3 };
|
|
30
35
|
}
|
|
31
36
|
if (ch === "(" && line2[pos + 1] === "[") {
|
|
32
37
|
const end = line2.indexOf("])", pos + 2);
|
|
33
38
|
if (end < 0) return null;
|
|
34
|
-
return { shape: "stadium", label: line2.slice(pos + 2, end)
|
|
39
|
+
return { shape: "stadium", label: unquoteLabel(line2.slice(pos + 2, end)), end: end + 2 };
|
|
35
40
|
}
|
|
36
41
|
if (ch === "(" && line2[pos + 1] === "(") {
|
|
37
42
|
const end = line2.indexOf("))", pos + 2);
|
|
38
43
|
if (end < 0) return null;
|
|
39
|
-
return { shape: "circle", label: line2.slice(pos + 2, end)
|
|
44
|
+
return { shape: "circle", label: unquoteLabel(line2.slice(pos + 2, end)), end: end + 2 };
|
|
40
45
|
}
|
|
41
46
|
if (ch === "[" && line2[pos + 1] === "[") {
|
|
42
47
|
const end = line2.indexOf("]]", pos + 2);
|
|
43
48
|
if (end < 0) return null;
|
|
44
|
-
return { shape: "subroutine", label: line2.slice(pos + 2, end)
|
|
49
|
+
return { shape: "subroutine", label: unquoteLabel(line2.slice(pos + 2, end)), end: end + 2 };
|
|
45
50
|
}
|
|
46
51
|
if (ch === "[" && line2[pos + 1] === "(") {
|
|
47
52
|
const end = line2.indexOf(")]", pos + 2);
|
|
48
53
|
if (end < 0) return null;
|
|
49
|
-
return { shape: "cylinder", label: line2.slice(pos + 2, end)
|
|
54
|
+
return { shape: "cylinder", label: unquoteLabel(line2.slice(pos + 2, end)), end: end + 2 };
|
|
50
55
|
}
|
|
51
56
|
if (ch === "{" && line2[pos + 1] === "{") {
|
|
52
57
|
const end = line2.indexOf("}}", pos + 2);
|
|
53
58
|
if (end < 0) return null;
|
|
54
|
-
return { shape: "hexagon", label: line2.slice(pos + 2, end)
|
|
59
|
+
return { shape: "hexagon", label: unquoteLabel(line2.slice(pos + 2, end)), end: end + 2 };
|
|
55
60
|
}
|
|
56
61
|
if (ch === "[" && line2[pos + 1] === "/") {
|
|
57
62
|
const endSlash = line2.indexOf("\\]", pos + 2);
|
|
58
63
|
if (endSlash >= 0) {
|
|
59
|
-
return { shape: "trapezoid", label: line2.slice(pos + 2, endSlash)
|
|
64
|
+
return { shape: "trapezoid", label: unquoteLabel(line2.slice(pos + 2, endSlash)), end: endSlash + 2 };
|
|
60
65
|
}
|
|
61
66
|
const end = line2.indexOf("/]", pos + 2);
|
|
62
67
|
if (end < 0) return null;
|
|
63
|
-
return { shape: "parallelogram", label: line2.slice(pos + 2, end)
|
|
68
|
+
return { shape: "parallelogram", label: unquoteLabel(line2.slice(pos + 2, end)), end: end + 2 };
|
|
64
69
|
}
|
|
65
70
|
if (ch === "[" && line2[pos + 1] === "\\") {
|
|
66
71
|
const endFwd = line2.indexOf("/]", pos + 2);
|
|
67
72
|
if (endFwd >= 0) {
|
|
68
|
-
return { shape: "trapezoid-alt", label: line2.slice(pos + 2, endFwd)
|
|
73
|
+
return { shape: "trapezoid-alt", label: unquoteLabel(line2.slice(pos + 2, endFwd)), end: endFwd + 2 };
|
|
69
74
|
}
|
|
70
75
|
const end = line2.indexOf("\\]", pos + 2);
|
|
71
76
|
if (end < 0) return null;
|
|
72
|
-
return { shape: "parallelogram-alt", label: line2.slice(pos + 2, end)
|
|
77
|
+
return { shape: "parallelogram-alt", label: unquoteLabel(line2.slice(pos + 2, end)), end: end + 2 };
|
|
73
78
|
}
|
|
74
79
|
if (ch === "[") {
|
|
75
80
|
const end = line2.indexOf("]", pos + 1);
|
|
76
81
|
if (end < 0) return null;
|
|
77
|
-
return { shape: "rect", label: line2.slice(pos + 1, end)
|
|
82
|
+
return { shape: "rect", label: unquoteLabel(line2.slice(pos + 1, end)), end: end + 1 };
|
|
78
83
|
}
|
|
79
84
|
if (ch === "(") {
|
|
80
85
|
const end = line2.indexOf(")", pos + 1);
|
|
81
86
|
if (end < 0) return null;
|
|
82
|
-
return { shape: "round", label: line2.slice(pos + 1, end)
|
|
87
|
+
return { shape: "round", label: unquoteLabel(line2.slice(pos + 1, end)), end: end + 1 };
|
|
83
88
|
}
|
|
84
89
|
if (ch === "{") {
|
|
85
90
|
const end = line2.indexOf("}", pos + 1);
|
|
86
91
|
if (end < 0) return null;
|
|
87
|
-
return { shape: "diamond", label: line2.slice(pos + 1, end)
|
|
92
|
+
return { shape: "diamond", label: unquoteLabel(line2.slice(pos + 1, end)), end: end + 1 };
|
|
88
93
|
}
|
|
89
94
|
return null;
|
|
90
95
|
}
|
|
@@ -168,7 +173,7 @@ function parsePipeLabel(line2, pos) {
|
|
|
168
173
|
if (line2[pos] !== "|") return null;
|
|
169
174
|
const end = line2.indexOf("|", pos + 1);
|
|
170
175
|
if (end < 0) return null;
|
|
171
|
-
return { label: line2.slice(pos + 1, end)
|
|
176
|
+
return { label: unquoteLabel(line2.slice(pos + 1, end)), end: end + 1 };
|
|
172
177
|
}
|
|
173
178
|
function skipSpaces(line2, pos) {
|
|
174
179
|
while (pos < line2.length && (line2[pos] === " " || line2[pos] === " ")) pos++;
|
|
@@ -1415,8 +1420,8 @@ function layoutFlowchart(ast) {
|
|
|
1415
1420
|
const hasClusters = ast.subgraphs.length > 0;
|
|
1416
1421
|
const CLUSTER_OVERHEAD_TITLE = hasClusters ? CLUSTER_GEO.pad + CLUSTER_GEO.titleH : 0;
|
|
1417
1422
|
const CLUSTER_OVERHEAD_SIDE = hasClusters ? CLUSTER_GEO.pad : 0;
|
|
1418
|
-
const extraTopPad = isHorizontal ?
|
|
1419
|
-
const extraLeftPad = isHorizontal ? CLUSTER_OVERHEAD_TITLE : CLUSTER_OVERHEAD_SIDE;
|
|
1423
|
+
const extraTopPad = !isHorizontal && dir !== "BT" ? CLUSTER_OVERHEAD_TITLE : CLUSTER_OVERHEAD_SIDE;
|
|
1424
|
+
const extraLeftPad = isHorizontal && dir !== "RL" ? CLUSTER_OVERHEAD_TITLE : CLUSTER_OVERHEAD_SIDE;
|
|
1420
1425
|
const topLevelOf = (sgId) => {
|
|
1421
1426
|
let cur = sgId;
|
|
1422
1427
|
let safety = 32;
|
|
@@ -1507,8 +1512,8 @@ function layoutFlowchart(ast) {
|
|
|
1507
1512
|
});
|
|
1508
1513
|
}
|
|
1509
1514
|
}
|
|
1510
|
-
const extraRightPad = isHorizontal ?
|
|
1511
|
-
const extraBottomPad = isHorizontal ?
|
|
1515
|
+
const extraRightPad = isHorizontal && dir === "RL" ? CLUSTER_OVERHEAD_TITLE : CLUSTER_OVERHEAD_SIDE;
|
|
1516
|
+
const extraBottomPad = !isHorizontal && dir === "BT" ? CLUSTER_OVERHEAD_TITLE : CLUSTER_OVERHEAD_SIDE;
|
|
1512
1517
|
const canvasW = maxX - minX + 2 * padding + extraLeftPad + extraRightPad;
|
|
1513
1518
|
const lastLayer = layerCenterY.length - 1;
|
|
1514
1519
|
const canvasH = lastLayer >= 0 ? layerCenterY[lastLayer] + layerHeights[lastLayer] / 2 + padding + extraBottomPad : 2 * padding;
|
|
@@ -1551,6 +1556,22 @@ function layoutFlowchart(ast) {
|
|
|
1551
1556
|
if (!isHorizontal) dummyCenter.set(id, p);
|
|
1552
1557
|
else dummyCenter.set(id, { x: p.y, y: p.x });
|
|
1553
1558
|
}
|
|
1559
|
+
if (dir === "BT" || dir === "RL") {
|
|
1560
|
+
const flipY = dir === "BT";
|
|
1561
|
+
const flipX = dir === "RL";
|
|
1562
|
+
for (const n of outNodes) {
|
|
1563
|
+
if (flipY) n.y = outHeight - n.y - n.height;
|
|
1564
|
+
if (flipX) n.x = outWidth - n.x - n.width;
|
|
1565
|
+
}
|
|
1566
|
+
for (const c of nodeCenter.values()) {
|
|
1567
|
+
if (flipY) c.y = outHeight - c.y;
|
|
1568
|
+
if (flipX) c.x = outWidth - c.x;
|
|
1569
|
+
}
|
|
1570
|
+
for (const c of dummyCenter.values()) {
|
|
1571
|
+
if (flipY) c.y = outHeight - c.y;
|
|
1572
|
+
if (flipX) c.x = outWidth - c.x;
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1554
1575
|
const outEdges = updatedEdges.map((le) => {
|
|
1555
1576
|
const chain = le.chain.length > 0 ? le.chain : [le.from, le.to];
|
|
1556
1577
|
const points = [];
|
|
@@ -1858,7 +1879,7 @@ function renderCluster(lc) {
|
|
|
1858
1879
|
function renderNode(ln) {
|
|
1859
1880
|
const n = ln.node;
|
|
1860
1881
|
const shapeEl = shapeSVG(n.shape, ln.width, ln.height);
|
|
1861
|
-
const label =
|
|
1882
|
+
const label = multilineText(
|
|
1862
1883
|
{
|
|
1863
1884
|
x: ln.width / 2,
|
|
1864
1885
|
y: ln.height / 2,
|
|
@@ -1868,7 +1889,8 @@ function renderNode(ln) {
|
|
|
1868
1889
|
},
|
|
1869
1890
|
n.label
|
|
1870
1891
|
);
|
|
1871
|
-
const
|
|
1892
|
+
const plainLabel = n.label.replace(/<br\s*\/?>/gi, " ").replace(/<\/?[bi]>/gi, "");
|
|
1893
|
+
const nodeTitle = title(plainLabel);
|
|
1872
1894
|
const classAttr = ["sx-fc-node-g", ...(n.classes ?? []).map((c) => `sx-fc-class-${c}`)].join(" ");
|
|
1873
1895
|
return group(
|
|
1874
1896
|
{
|
|
@@ -2022,5 +2044,5 @@ var flowchart = {
|
|
|
2022
2044
|
};
|
|
2023
2045
|
|
|
2024
2046
|
export { FC_CONST, flowchart, layoutFlowchart, parseFlowchart, renderFlowchart, renderFlowchartAST };
|
|
2025
|
-
//# sourceMappingURL=chunk-
|
|
2026
|
-
//# sourceMappingURL=chunk-
|
|
2047
|
+
//# sourceMappingURL=chunk-2J2QWNGI.js.map
|
|
2048
|
+
//# sourceMappingURL=chunk-2J2QWNGI.js.map
|