@belonguniverseai/react-sdk 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/agent-grants.d.ts +23 -8
- package/dist/api/client.d.ts +53 -4
- package/dist/api/queries.d.ts +2 -0
- package/dist/app/call-summary.d.ts +30 -0
- package/dist/component/abnfDiagram-N423BO3Z-DR3fMT7g.js +90 -0
- package/dist/component/arc-DJkYOSuJ.js +86 -0
- package/dist/component/{architectureDiagram-3BPJPVTR-DYcaPx2M.js → architectureDiagram-T3A2C74G-BIp4IBPk.js} +1872 -1785
- package/dist/component/{blockDiagram-GPEHLZMM-BdjruLO5.js → blockDiagram-VBNYF7ZC-BqryGqC6.js} +895 -894
- package/dist/component/{c4Diagram-AAUBKEIU-Bd2ebSgB.js → c4Diagram-5PPSVZJV-GktlF-Di.js} +3 -3
- package/dist/component/{channel-CYFijF_t.js → channel-3CusDaXb.js} +2 -2
- package/dist/component/{chunk-ND2GUHAM-OX1-DIU1.js → chunk-2GRJ4B5K-DMTs6j_c.js} +5 -5
- package/dist/component/{chunk-QZHKN3VN-DLQ8oUCc.js → chunk-2Q5K7J3B-CIU34hPH.js} +2 -2
- package/dist/component/{chunk-AQP2D5EJ-D4G4syYu.js → chunk-5RXB4S5H-Ds3vF1Mv.js} +399 -378
- package/dist/component/{chunk-FMBD7UC4-CbRxWx_A.js → chunk-5VM5RSS4-DGxDkIm6.js} +2 -2
- package/dist/component/chunk-6Q2QTUOP-BI8oZt98.js +673 -0
- package/dist/component/{chunk-727SXJPM-A5r5oL1_.js → chunk-GF5L2VYU-D-36xUd5.js} +244 -239
- package/dist/component/{chunk-4BX2VUAB-DVpS0I_p.js → chunk-JWPE2WC7-8N_wQ762.js} +2 -2
- package/dist/component/{chunk-2J33WTMH-B06Y_xVy.js → chunk-KBJHAD2P-ChxxpkWc.js} +2 -2
- package/dist/component/chunk-RYQCIY6F-CSY-95OP.js +316 -0
- package/dist/component/{chunk-55IACEB6-DmZctFkK.js → chunk-XXDRQBXY-BQd9yyE1.js} +2 -2
- package/dist/component/{classDiagram-4FO5ZUOK-4S9mdFC1.js → classDiagram-JCYQIIEL-BOq63iUL.js} +3 -3
- package/dist/component/{classDiagram-v2-Q7XG4LA2-4S9mdFC1.js → classDiagram-v2-OCEON4UE-BOq63iUL.js} +3 -3
- package/dist/component/{cose-bilkent-S5V4N54A-BIrVaakt.js → cose-bilkent-JH36ORCC-B9x8cp5w.js} +2 -2
- package/dist/component/{wardley-L42UT6IY-HA1eSIS_.js → cynefin-VYW2F7L2-DAyxamLw.js} +9199 -7918
- package/dist/component/cynefinDiagram-MW4NZA55-OF6l99SS.js +302 -0
- package/dist/component/dagre-VZM6K2ZE-CELO1hFb.js +343 -0
- package/dist/component/diagram-7IWD3JNH-COzvm6E2.js +353 -0
- package/dist/component/{diagram-KO2AKTUF-Da1E68Eo.js → diagram-B4RE2ZJO-DR9KMRGw.js} +24 -24
- package/dist/component/{diagram-LMA3HP47-dRbk5sBa.js → diagram-LBJQPF4R-D47Zqm-k.js} +23 -23
- package/dist/component/{diagram-OG6HWLK6-CcKT8mhn.js → diagram-Q27KOJAE-Key1bw_Y.js} +197 -197
- package/dist/component/diagram-UB23O5K3-Cxf-sZnK.js +222 -0
- package/dist/component/ebnfDiagram-BXEA7PRR-C8uURt_x.js +112 -0
- package/dist/component/{erDiagram-TEJ5UH35-3ATYT9J-.js → erDiagram-JOGREHBK-CpCxe8Ib.js} +142 -131
- package/dist/component/{flowDiagram-I6XJVG4X-D9PLm9Od.js → flowDiagram-UKHOOZJN-urFG2I71.js} +268 -258
- package/dist/component/ganttDiagram-PKOTCBZU-8nA9faYf.js +2714 -0
- package/dist/component/{gitGraphDiagram-PVQCEYII-13gVhAGc.js → gitGraphDiagram-DS77QQ5N-u4cbNW8o.js} +33 -33
- package/dist/component/{graph-BZLHvygk.js → graph-CWpEkm4G.js} +35 -35
- package/dist/component/{highlighted-body-OFNGDK62-DCxRI4UV.js → highlighted-body-OFNGDK62-Bo-15uvJ.js} +2 -2
- package/dist/component/index.js +2 -2
- package/dist/component/{infoDiagram-5YYISTIA-DymxA7AN.js → infoDiagram-6WML65LV-ZAv4gZpA.js} +4 -4
- package/dist/component/{ishikawaDiagram-YF4QCWOH-C3sTn76C.js → ishikawaDiagram-WSZJBQD7-CvB6evSz.js} +27 -27
- package/dist/component/{journeyDiagram-JHISSGLW-Cq0hOAfJ.js → journeyDiagram-NVQOT4AX-M5BRYuPr.js} +5 -5
- package/dist/component/{kanban-definition-UN3LZRKU-5tBWjkp7.js → kanban-definition-27J2QSJJ-LL6GkmVe.js} +35 -35
- package/dist/component/layout-Br2UjHRU.js +1522 -0
- package/dist/component/{linear-BT4blD8s.js → linear-DVg61V66.js} +13 -13
- package/dist/component/map-CdwokNh2.js +227 -0
- package/dist/component/{mermaid-GHXKKRXX-DXPXjnb7.js → mermaid-GHXKKRXX-C2L7fCIM.js} +29577 -29128
- package/dist/component/{mindmap-definition-RKZ34NQL-DO-OuAQQ.js → mindmap-definition-FAOFIHXS-BBZzsLh7.js} +26 -26
- package/dist/component/pegDiagram-VL7TDLO6-BEG86cY8.js +98 -0
- package/dist/component/pieDiagram-7S7Q4E2Y-BTkrNjAi.js +210 -0
- package/dist/component/{quadrantDiagram-W4KKPZXB-CaJWg9ep.js → quadrantDiagram-CIZ2JOQS-BsjBAd4w.js} +14 -15
- package/dist/component/railroadDiagram-AXF67PYL-DuE0ZFxj.js +80 -0
- package/dist/component/{requirementDiagram-4Y6WPE33-CmZrtZqe.js → requirementDiagram-LRYGKXZP-CcshEEMy.js} +15 -15
- package/dist/component/{sankeyDiagram-5OEKKPKP-Cp95M1aj.js → sankeyDiagram-W5VNT64P-CFn011ig.js} +2 -2
- package/dist/component/{sequenceDiagram-3UESZ5HK-C0x0WvhR.js → sequenceDiagram-SI44F4Z6-DmMZNJDw.js} +960 -963
- package/dist/component/sizeCapture-X5ZJPWSS-Ce4PhIAO.js +49 -0
- package/dist/component/{stateDiagram-AJRCARHV-H10vaGL3.js → stateDiagram-OKZ733FA-DDVzQKaO.js} +5 -5
- package/dist/component/{stateDiagram-v2-BHNVJYJU-rj7ljkc-.js → stateDiagram-v2-UEYNNEHI-DeeW8PDA.js} +3 -3
- package/dist/component/swimlanes-SLNWSIFB-CZh2_vzg.js +5335 -0
- package/dist/component/swimlanesDiagram-ULZ7WXOC-Wb0Ri7qR.js +16 -0
- package/dist/component/{timeline-definition-PNZ67QCA-Cil1QaqZ.js → timeline-definition-Z64GVDOM-rfiLwdTR.js} +15 -15
- package/dist/component/vennDiagram-T6HMQDX7-D8l7hqNb.js +1581 -0
- package/dist/component/{wardleyDiagram-YWT4CUSO-Xq5Hnmio.js → wardleyDiagram-T6FBY63Y-7YqmpmtC.js} +15 -15
- package/dist/component/{xychartDiagram-2RQKCTM6-dinwR4Zm.js → xychartDiagram-ELKLHX3M-Dx2ECqt8.js} +464 -418
- package/dist/embed/voice/line-slots.d.ts +37 -2
- package/dist/embed/voice-call.d.ts +12 -0
- package/dist/i18n/messages/en.d.ts +1 -2
- package/dist/lib/web-storage.d.ts +8 -0
- package/dist/stream/belong-chat-transport.d.ts +1 -0
- package/dist/stream/belong-data-parts.d.ts +2 -0
- package/dist/stream/stream-state-store.d.ts +13 -0
- package/dist/types/public.d.ts +3 -0
- package/package.json +1 -1
- package/dist/component/arc-TLcl3N8_.js +0 -86
- package/dist/component/dagre-BM42HDAG-BoPUzTvD.js +0 -448
- package/dist/component/diagram-2AECGRRQ-PIXCGxIt.js +0 -220
- package/dist/component/diagram-5GNKFQAL-CbJxbGBh.js +0 -126
- package/dist/component/ganttDiagram-6RSMTGT7-F_XUzD1p.js +0 -2709
- package/dist/component/layout-Bu6nRdWm.js +0 -1731
- package/dist/component/pieDiagram-4H26LBE5-BkEktPwZ.js +0 -166
- package/dist/component/vennDiagram-CIIHVFJN-Dk8PKmfb.js +0 -1560
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { p as gt } from "./chunk-JWPE2WC7-8N_wQ762.js";
|
|
2
|
+
import { s as xt, g as bt, p as $t, o as wt, a as Ct, b as vt, _ as s, l as O, G as Dt, e as Tt, q as kt, D as U, z as Z, E as At, Z as ot } from "./mermaid-GHXKKRXX-C2L7fCIM.js";
|
|
3
|
+
import { p as Bt } from "./cynefin-VYW2F7L2-DAyxamLw.js";
|
|
4
|
+
globalThis.process = globalThis.process || { env: {} };
|
|
5
|
+
globalThis.global = globalThis.global || globalThis;
|
|
6
|
+
var rt = /* @__PURE__ */ s(() => ({
|
|
7
|
+
domains: /* @__PURE__ */ new Map(),
|
|
8
|
+
transitions: []
|
|
9
|
+
}), "createDefaultData"), G = rt(), St = /* @__PURE__ */ s(() => G.domains, "getDomains"), Mt = /* @__PURE__ */ s(() => G.transitions, "getTransitions"), zt = /* @__PURE__ */ s((t) => {
|
|
10
|
+
if (t)
|
|
11
|
+
for (const e of t) {
|
|
12
|
+
const n = e.domain, a = (e.items ?? []).map((c) => ({
|
|
13
|
+
label: c.label
|
|
14
|
+
}));
|
|
15
|
+
G.domains.set(n, {
|
|
16
|
+
name: n,
|
|
17
|
+
items: a
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}, "setDomains"), Lt = /* @__PURE__ */ s((t) => {
|
|
21
|
+
t && (G.transitions = t.filter((e) => e.from === e.to ? (O.warn(
|
|
22
|
+
`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`
|
|
23
|
+
), !1) : !0).map((e) => ({
|
|
24
|
+
from: e.from,
|
|
25
|
+
to: e.to,
|
|
26
|
+
label: e.label || void 0
|
|
27
|
+
})));
|
|
28
|
+
}, "setTransitions"), Nt = /* @__PURE__ */ s(() => U({
|
|
29
|
+
...At.cynefin,
|
|
30
|
+
...Z().cynefin
|
|
31
|
+
}), "getConfig"), Pt = /* @__PURE__ */ s(() => {
|
|
32
|
+
kt(), G = rt();
|
|
33
|
+
}, "clear"), Y = {
|
|
34
|
+
getDomains: St,
|
|
35
|
+
getTransitions: Mt,
|
|
36
|
+
setDomains: zt,
|
|
37
|
+
setTransitions: Lt,
|
|
38
|
+
getConfig: Nt,
|
|
39
|
+
clear: Pt,
|
|
40
|
+
setAccTitle: vt,
|
|
41
|
+
getAccTitle: Ct,
|
|
42
|
+
setDiagramTitle: wt,
|
|
43
|
+
getDiagramTitle: $t,
|
|
44
|
+
getAccDescription: bt,
|
|
45
|
+
setAccDescription: xt
|
|
46
|
+
}, It = /* @__PURE__ */ s((t) => {
|
|
47
|
+
gt(t, Y), Y.setDomains(t.domains), Y.setTransitions(t.transitions);
|
|
48
|
+
}, "populate"), Wt = {
|
|
49
|
+
parse: /* @__PURE__ */ s(async (t) => {
|
|
50
|
+
const e = await Bt("cynefin", t);
|
|
51
|
+
O.debug(e), It(e);
|
|
52
|
+
}, "parse")
|
|
53
|
+
};
|
|
54
|
+
function V(t) {
|
|
55
|
+
let e = t + 1831565813 | 0;
|
|
56
|
+
return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
57
|
+
}
|
|
58
|
+
s(V, "seededRandom");
|
|
59
|
+
function st(t) {
|
|
60
|
+
let e = 0;
|
|
61
|
+
for (let n = 0; n < t.length; n++) {
|
|
62
|
+
const a = t.charCodeAt(n);
|
|
63
|
+
e = (e << 5) - e + a, e |= 0;
|
|
64
|
+
}
|
|
65
|
+
return e;
|
|
66
|
+
}
|
|
67
|
+
s(st, "hashString");
|
|
68
|
+
function it(t, e) {
|
|
69
|
+
return typeof t == "number" && Number.isFinite(t) && t !== 0 ? t : st(e);
|
|
70
|
+
}
|
|
71
|
+
s(it, "resolveSeed");
|
|
72
|
+
function ct(t, e, n, a) {
|
|
73
|
+
const c = t / 2, m = a ?? t * 0.015, v = 7, W = e / v, d = [];
|
|
74
|
+
for (let o = 0; o <= v; o++) {
|
|
75
|
+
const p = V(n + o * 17) * m * 2 - m;
|
|
76
|
+
d.push({ x: c + p, y: o * W });
|
|
77
|
+
}
|
|
78
|
+
let D = `M${d[0].x},${d[0].y}`;
|
|
79
|
+
for (let o = 0; o < d.length - 1; o++) {
|
|
80
|
+
const p = d[o], i = d[o + 1], f = (p.y + i.y) / 2, $ = o % 2 === 0 ? 1 : -1, h = m * 1.5 * $ * V(n + o * 31 + 7), R = p.x + h, _ = f, E = i.x - h;
|
|
81
|
+
D += ` C${R},${_} ${E},${f} ${i.x},${i.y}`;
|
|
82
|
+
}
|
|
83
|
+
return D;
|
|
84
|
+
}
|
|
85
|
+
s(ct, "generateFoldPath");
|
|
86
|
+
function lt(t, e, n, a) {
|
|
87
|
+
const c = e / 2, m = a ?? e * 0.015, v = 7, W = t / v, d = [];
|
|
88
|
+
for (let o = 0; o <= v; o++) {
|
|
89
|
+
const p = V(n + o * 23) * m * 2 - m;
|
|
90
|
+
d.push({ x: o * W, y: c + p });
|
|
91
|
+
}
|
|
92
|
+
let D = `M${d[0].x},${d[0].y}`;
|
|
93
|
+
for (let o = 0; o < d.length - 1; o++) {
|
|
94
|
+
const p = d[o], i = d[o + 1], f = (p.x + i.x) / 2, $ = o % 2 === 0 ? 1 : -1, h = m * 1.5 * $ * V(n + o * 37 + 11), R = f, _ = p.y + h, E = f, z = i.y - h;
|
|
95
|
+
D += ` C${R},${_} ${E},${z} ${i.x},${i.y}`;
|
|
96
|
+
}
|
|
97
|
+
return D;
|
|
98
|
+
}
|
|
99
|
+
s(lt, "generateHorizontalBoundary");
|
|
100
|
+
function dt(t, e) {
|
|
101
|
+
const n = t / 2, a = e * 0.5, c = e, m = t * 0.03;
|
|
102
|
+
return [
|
|
103
|
+
`M${n},${a}`,
|
|
104
|
+
`C${n + m},${a + (c - a) * 0.2}`,
|
|
105
|
+
`${n - m * 1.5},${a + (c - a) * 0.55}`,
|
|
106
|
+
`${n + m * 0.5},${a + (c - a) * 0.75}`,
|
|
107
|
+
`C${n - m},${a + (c - a) * 0.85}`,
|
|
108
|
+
`${n + m * 0.3},${a + (c - a) * 0.95}`,
|
|
109
|
+
`${n},${c}`
|
|
110
|
+
].join(" ");
|
|
111
|
+
}
|
|
112
|
+
s(dt, "generateCliffPath");
|
|
113
|
+
function ft(t, e, n, a) {
|
|
114
|
+
return [
|
|
115
|
+
`M${t - n},${e}`,
|
|
116
|
+
`A${n},${a} 0 1,1 ${t + n},${e}`,
|
|
117
|
+
`A${n},${a} 0 1,1 ${t - n},${e}`,
|
|
118
|
+
"Z"
|
|
119
|
+
].join(" ");
|
|
120
|
+
}
|
|
121
|
+
s(ft, "generateConfusionPath");
|
|
122
|
+
var at = {
|
|
123
|
+
complex: { model: "Probe → Sense → Respond", practice: "Emergent Practices" },
|
|
124
|
+
complicated: { model: "Sense → Analyse → Respond", practice: "Good Practices" },
|
|
125
|
+
clear: { model: "Sense → Categorise → Respond", practice: "Best Practices" },
|
|
126
|
+
chaotic: { model: "Act → Sense → Respond", practice: "Novel Practices" },
|
|
127
|
+
confusion: { model: "", practice: "Disorder" }
|
|
128
|
+
}, Rt = /* @__PURE__ */ s((t, e) => {
|
|
129
|
+
const n = t / 2, a = e / 2;
|
|
130
|
+
return {
|
|
131
|
+
complex: { cx: n / 2, cy: a / 2, x: 0, y: 0, w: n, h: a },
|
|
132
|
+
complicated: { cx: n + n / 2, cy: a / 2, x: n, y: 0, w: n, h: a },
|
|
133
|
+
chaotic: { cx: n / 2, cy: a + a / 2, x: 0, y: a, w: n, h: a },
|
|
134
|
+
clear: { cx: n + n / 2, cy: a + a / 2, x: n, y: a, w: n, h: a },
|
|
135
|
+
confusion: { cx: n, cy: a, x: n * 0.7, y: a * 0.7, w: n * 0.6, h: a * 0.6 }
|
|
136
|
+
};
|
|
137
|
+
}, "getDomainLayouts"), _t = /* @__PURE__ */ s(() => {
|
|
138
|
+
const t = ot(), e = Z();
|
|
139
|
+
return U(t, e.themeVariables).cynefin;
|
|
140
|
+
}, "getCynefinDomainColors"), q = 3, Et = /* @__PURE__ */ s((t, e, n, a) => {
|
|
141
|
+
const c = a.db, m = c.getDomains(), v = c.getTransitions(), W = c.getDiagramTitle(), d = c.getAccTitle(), D = c.getAccDescription(), o = c.getConfig(), p = _t();
|
|
142
|
+
O.debug("Rendering Cynefin diagram");
|
|
143
|
+
const i = o.width, f = o.height, $ = o.padding, h = o.showDomainDescriptions, R = o.boundaryAmplitude, _ = i + $ * 2, E = f + $ * 2, z = {
|
|
144
|
+
complex: p.complexBg,
|
|
145
|
+
complicated: p.complicatedBg,
|
|
146
|
+
clear: p.clearBg,
|
|
147
|
+
chaotic: p.chaoticBg,
|
|
148
|
+
confusion: p.confusionBg
|
|
149
|
+
}, T = Dt(e);
|
|
150
|
+
Tt(T, E, _, o.useMaxWidth ?? !0), T.attr("viewBox", `0 0 ${_} ${E}`), d && T.append("title").text(d), D && T.append("desc").text(D);
|
|
151
|
+
const k = T.append("g").attr("transform", `translate(${$}, ${$})`), F = Rt(i, f), Q = it(o.seed, e), mt = k.append("g").attr("class", "cynefin-backgrounds"), X = ["complex", "complicated", "chaotic", "clear"];
|
|
152
|
+
for (const l of X) {
|
|
153
|
+
const r = F[l];
|
|
154
|
+
mt.append("rect").attr("class", "cynefinDomain").attr("x", r.x).attr("y", r.y).attr("width", r.w).attr("height", r.h).attr("fill", z[l]).attr("fill-opacity", 0.4).attr("stroke", "none");
|
|
155
|
+
}
|
|
156
|
+
const j = k.append("g").attr("class", "cynefin-boundaries");
|
|
157
|
+
j.append("path").attr("class", "cynefinBoundary").attr("d", ct(i, f, Q, R)).attr("fill", "none"), j.append("path").attr("class", "cynefinBoundary").attr("d", lt(i, f, Q + 100, R)).attr("fill", "none"), j.append("path").attr("class", "cynefinCliff").attr("d", dt(i, f)).attr("fill", "none");
|
|
158
|
+
const pt = i * 0.15, yt = f * 0.15;
|
|
159
|
+
k.append("path").attr("class", "cynefinConfusion").attr("d", ft(i / 2, f / 2, pt, yt)).attr("fill", z.confusion).attr("fill-opacity", 0.5);
|
|
160
|
+
const J = k.append("g").attr("class", "cynefin-labels");
|
|
161
|
+
for (const l of X) {
|
|
162
|
+
const r = F[l];
|
|
163
|
+
J.append("text").attr("class", "cynefinDomainLabel").attr("x", r.cx).attr("y", h ? r.cy - 30 : r.cy).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(l.charAt(0).toUpperCase() + l.slice(1));
|
|
164
|
+
}
|
|
165
|
+
if (J.append("text").attr("class", "cynefinDomainLabel").attr("x", i / 2).attr("y", h ? f / 2 - 10 : f / 2).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text("Confusion"), h) {
|
|
166
|
+
const l = k.append("g").attr("class", "cynefin-subtitles");
|
|
167
|
+
for (const r of X) {
|
|
168
|
+
const u = F[r], y = at[r];
|
|
169
|
+
l.append("text").attr("class", "cynefinSubtitle").attr("x", u.cx).attr("y", u.cy - 10).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(y.model), l.append("text").attr("class", "cynefinSubtitle").attr("x", u.cx).attr("y", u.cy + 5).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(y.practice);
|
|
170
|
+
}
|
|
171
|
+
l.append("text").attr("class", "cynefinSubtitle").attr("x", i / 2).attr("y", f / 2 + 8).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(at.confusion.practice);
|
|
172
|
+
}
|
|
173
|
+
const K = k.append("g").attr("class", "cynefin-items"), A = 26, tt = 10, ut = ["complex", "complicated", "chaotic", "clear", "confusion"];
|
|
174
|
+
for (const l of ut) {
|
|
175
|
+
const r = m.get(l);
|
|
176
|
+
if (!r || r.items.length === 0)
|
|
177
|
+
continue;
|
|
178
|
+
const u = F[l], y = l === "confusion";
|
|
179
|
+
let L = r.items, N = 0;
|
|
180
|
+
y && r.items.length > q && (N = r.items.length - q, L = r.items.slice(0, q));
|
|
181
|
+
let B;
|
|
182
|
+
if (y) {
|
|
183
|
+
const x = h ? 22 : 14;
|
|
184
|
+
B = u.cy + x;
|
|
185
|
+
} else
|
|
186
|
+
B = u.cy + (h ? 25 : 15);
|
|
187
|
+
if ([...L].forEach((x, S) => {
|
|
188
|
+
const w = B + S * (A + 4), M = K.append("g"), P = M.append("text").attr("class", "cynefinItemText").attr("x", 0).attr("y", A / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").text(x.label);
|
|
189
|
+
let b = x.label.length * 7;
|
|
190
|
+
const g = P.node();
|
|
191
|
+
if (g && typeof g.getBBox == "function") {
|
|
192
|
+
const H = g.getBBox();
|
|
193
|
+
H.width > 0 && (b = H.width);
|
|
194
|
+
}
|
|
195
|
+
const C = b + tt * 2, I = u.cx - C / 2;
|
|
196
|
+
M.attr("transform", `translate(${I}, ${w})`), M.insert("rect", "text").attr("class", "cynefinItem").attr("x", 0).attr("y", 0).attr("width", C).attr("height", A).attr("rx", 4).attr("ry", 4).attr("fill", z[l]).attr("fill-opacity", 0.95), P.attr("x", C / 2).attr("y", A / 2);
|
|
197
|
+
}), N > 0) {
|
|
198
|
+
const x = B + L.length * (A + 4), S = `+${N} more`, w = K.append("g"), M = w.append("text").attr("class", "cynefinItemText").attr("x", 0).attr("y", A / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").text(S);
|
|
199
|
+
let P = S.length * 7;
|
|
200
|
+
const b = M.node();
|
|
201
|
+
if (b && typeof b.getBBox == "function") {
|
|
202
|
+
const I = b.getBBox();
|
|
203
|
+
I.width > 0 && (P = I.width);
|
|
204
|
+
}
|
|
205
|
+
const g = P + tt * 2, C = u.cx - g / 2;
|
|
206
|
+
w.attr("transform", `translate(${C}, ${x})`), w.insert("rect", "text").attr("class", "cynefinItemOverflow").attr("x", 0).attr("y", 0).attr("width", g).attr("height", A).attr("rx", 4).attr("ry", 4).attr("fill", z[l]).attr("fill-opacity", 0.6), M.attr("x", g / 2).attr("y", A / 2);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (v.length > 0) {
|
|
210
|
+
const l = T.select("defs").empty() ? T.append("defs") : T.select("defs"), r = `cynefin-arrow-${e}`;
|
|
211
|
+
l.append("marker").attr("id", r).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerWidth", 6).attr("markerHeight", 6).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "cynefinArrowHead");
|
|
212
|
+
const u = k.append("g").attr("class", "cynefin-arrows");
|
|
213
|
+
v.forEach((y) => {
|
|
214
|
+
const L = F[y.from], N = F[y.to];
|
|
215
|
+
if (!L || !N)
|
|
216
|
+
return;
|
|
217
|
+
if (y.from === y.to) {
|
|
218
|
+
O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const B = L.cx, x = L.cy, S = N.cx, w = N.cy, M = (B + S) / 2, P = (x + w) / 2, b = S - B, g = w - x, C = Math.sqrt(b * b + g * g), I = C * 0.15, H = -g / C, ht = b / C, et = M + H * I, nt = P + ht * I;
|
|
222
|
+
u.append("path").attr("class", "cynefinArrowLine").attr("d", `M${B},${x} Q${et},${nt} ${S},${w}`).attr("fill", "none").attr("marker-end", `url(#${r})`), y.label && u.append("text").attr("class", "cynefinArrowLabel").attr("x", et).attr("y", nt - 6).attr("text-anchor", "middle").attr("dominant-baseline", "auto").text(y.label);
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
W && k.append("text").attr("class", "cynefinTitle").attr("x", i / 2).attr("y", -$ / 2).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(W);
|
|
226
|
+
}, "draw"), Ft = { draw: Et }, Vt = /* @__PURE__ */ s(() => {
|
|
227
|
+
const t = ot(), e = Z();
|
|
228
|
+
return U(t, e.themeVariables).cynefin;
|
|
229
|
+
}, "getCynefinTheme"), Gt = /* @__PURE__ */ s(() => {
|
|
230
|
+
const t = Vt();
|
|
231
|
+
return `
|
|
232
|
+
.cynefinDomain {
|
|
233
|
+
stroke: none;
|
|
234
|
+
}
|
|
235
|
+
.cynefinDomainLabel {
|
|
236
|
+
font-size: ${t.domainFontSize}px;
|
|
237
|
+
font-weight: bold;
|
|
238
|
+
fill: ${t.labelColor};
|
|
239
|
+
}
|
|
240
|
+
.cynefinSubtitle {
|
|
241
|
+
font-size: ${t.itemFontSize - 1}px;
|
|
242
|
+
fill: ${t.textColor};
|
|
243
|
+
font-style: italic;
|
|
244
|
+
}
|
|
245
|
+
.cynefinItem {
|
|
246
|
+
fill-opacity: 0.95;
|
|
247
|
+
stroke: ${t.boundaryColor};
|
|
248
|
+
stroke-width: 1;
|
|
249
|
+
}
|
|
250
|
+
.cynefinItemText {
|
|
251
|
+
font-size: ${t.itemFontSize}px;
|
|
252
|
+
fill: ${t.textColor};
|
|
253
|
+
}
|
|
254
|
+
.cynefinItemOverflow {
|
|
255
|
+
fill-opacity: 0.6;
|
|
256
|
+
stroke: ${t.boundaryColor};
|
|
257
|
+
stroke-width: 1;
|
|
258
|
+
stroke-dasharray: 3 2;
|
|
259
|
+
}
|
|
260
|
+
.cynefinBoundary {
|
|
261
|
+
stroke: ${t.boundaryColor};
|
|
262
|
+
stroke-width: ${t.boundaryWidth};
|
|
263
|
+
stroke-dasharray: 6 3;
|
|
264
|
+
}
|
|
265
|
+
.cynefinCliff {
|
|
266
|
+
stroke: ${t.cliffColor};
|
|
267
|
+
stroke-width: ${t.cliffWidth};
|
|
268
|
+
}
|
|
269
|
+
.cynefinConfusion {
|
|
270
|
+
stroke: ${t.boundaryColor};
|
|
271
|
+
stroke-width: 1.5;
|
|
272
|
+
stroke-dasharray: 4 2;
|
|
273
|
+
}
|
|
274
|
+
.cynefinArrowLine {
|
|
275
|
+
stroke: ${t.arrowColor};
|
|
276
|
+
stroke-width: ${t.arrowWidth};
|
|
277
|
+
fill: none;
|
|
278
|
+
}
|
|
279
|
+
.cynefinArrowHead {
|
|
280
|
+
fill: ${t.arrowColor};
|
|
281
|
+
stroke: none;
|
|
282
|
+
}
|
|
283
|
+
.cynefinArrowLabel {
|
|
284
|
+
font-size: ${t.itemFontSize - 1}px;
|
|
285
|
+
fill: ${t.textColor};
|
|
286
|
+
}
|
|
287
|
+
.cynefinTitle {
|
|
288
|
+
font-size: ${t.domainFontSize + 2}px;
|
|
289
|
+
font-weight: bold;
|
|
290
|
+
fill: ${t.labelColor};
|
|
291
|
+
}
|
|
292
|
+
`;
|
|
293
|
+
}, "styles"), Ht = Gt, jt = {
|
|
294
|
+
parser: Wt,
|
|
295
|
+
db: Y,
|
|
296
|
+
renderer: Ft,
|
|
297
|
+
styles: Ht
|
|
298
|
+
};
|
|
299
|
+
export {
|
|
300
|
+
jt as diagram
|
|
301
|
+
};
|
|
302
|
+
//# sourceMappingURL=cynefinDiagram-MW4NZA55-OF6l99SS.js.map
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import { c as O, w as I, a as J, f as P, b as E, s as v } from "./chunk-RYQCIY6F-CSY-95OP.js";
|
|
2
|
+
import { _ as w, ap as A, aq as D, ar as H, as as Y, l as c, c as _, at as j, au as W, aj as $, av as q, ak as R, ai as F, aw as z, ax as K, ay as T } from "./mermaid-GHXKKRXX-C2L7fCIM.js";
|
|
3
|
+
import { G as Q } from "./graph-CWpEkm4G.js";
|
|
4
|
+
import { l as U } from "./layout-Br2UjHRU.js";
|
|
5
|
+
globalThis.process = globalThis.process || { env: {} };
|
|
6
|
+
globalThis.global = globalThis.global || globalThis;
|
|
7
|
+
var G = /* @__PURE__ */ w((n, t, g) => Math.max(t, Math.min(g, n)), "clamp"), C = /* @__PURE__ */ w((n = "TB") => {
|
|
8
|
+
switch (n) {
|
|
9
|
+
case "BT":
|
|
10
|
+
return "bottom";
|
|
11
|
+
case "LR":
|
|
12
|
+
return "right";
|
|
13
|
+
case "RL":
|
|
14
|
+
return "left";
|
|
15
|
+
default:
|
|
16
|
+
return "top";
|
|
17
|
+
}
|
|
18
|
+
}, "getDefaultSelfLoopSide"), V = /* @__PURE__ */ w((n) => n === "flowchart" || n === "flowchart-v2" || n === "stateDiagram", "shouldMergeSelfLoopSegments"), Z = /* @__PURE__ */ w((n, t, g, y, l) => {
|
|
19
|
+
const o = [], r = /* @__PURE__ */ new Set();
|
|
20
|
+
if (g.forEach(({ start: i, end: s }) => {
|
|
21
|
+
i !== y && r.add(i), s !== y && r.add(s);
|
|
22
|
+
}), r.forEach((i) => {
|
|
23
|
+
const s = n.node(i);
|
|
24
|
+
typeof s?.x == "number" && typeof s?.y == "number" && o.push(s);
|
|
25
|
+
}), o.length === 0 && g.forEach(({ edge: i }) => {
|
|
26
|
+
(i.points ?? []).forEach((s) => {
|
|
27
|
+
typeof s?.x == "number" && typeof s?.y == "number" && o.push(s);
|
|
28
|
+
});
|
|
29
|
+
}), o.length === 0)
|
|
30
|
+
return C(l);
|
|
31
|
+
const f = o.reduce(
|
|
32
|
+
(i, s) => ({
|
|
33
|
+
x: i.x + s.x / o.length,
|
|
34
|
+
y: i.y + s.y / o.length
|
|
35
|
+
}),
|
|
36
|
+
{ x: 0, y: 0 }
|
|
37
|
+
), h = f.x - t.x, d = f.y - t.y;
|
|
38
|
+
return Math.abs(h) > Math.abs(d) ? h > 0 ? "right" : "left" : Math.abs(d) > 0 ? d > 0 ? "bottom" : "top" : C(l);
|
|
39
|
+
}, "getSelfLoopSide"), ee = /* @__PURE__ */ w((n, t = "top", g = 0, y = 0) => {
|
|
40
|
+
const l = n.x, o = n.y - g, r = n.width / 2, f = n.height / 2, h = Math.max(36, Math.min(100, n.width * 0.8)), d = G(Math.max(y, n.width * 0.35), 36, h), i = G(Math.min(n.width, n.height) * 0.45, 24, 48);
|
|
41
|
+
switch (t) {
|
|
42
|
+
case "bottom": {
|
|
43
|
+
const s = o + f;
|
|
44
|
+
return [
|
|
45
|
+
{ x: l - d / 2, y: s },
|
|
46
|
+
{ x: l - d / 2, y: s + i },
|
|
47
|
+
{ x: l + d / 2, y: s + i },
|
|
48
|
+
{ x: l + d / 2, y: s }
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
case "right": {
|
|
52
|
+
const s = l + r;
|
|
53
|
+
return [
|
|
54
|
+
{ x: s, y: o - d / 2 },
|
|
55
|
+
{ x: s + i, y: o - d / 2 },
|
|
56
|
+
{ x: s + i, y: o + d / 2 },
|
|
57
|
+
{ x: s, y: o + d / 2 }
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
case "left": {
|
|
61
|
+
const s = l - r;
|
|
62
|
+
return [
|
|
63
|
+
{ x: s, y: o - d / 2 },
|
|
64
|
+
{ x: s - i, y: o - d / 2 },
|
|
65
|
+
{ x: s - i, y: o + d / 2 },
|
|
66
|
+
{ x: s, y: o + d / 2 }
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
default: {
|
|
70
|
+
const s = o - f;
|
|
71
|
+
return [
|
|
72
|
+
{ x: l - d / 2, y: s },
|
|
73
|
+
{ x: l - d / 2, y: s - i },
|
|
74
|
+
{ x: l + d / 2, y: s - i },
|
|
75
|
+
{ x: l + d / 2, y: s }
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}, "getSelfLoopPoints"), te = /* @__PURE__ */ w((n, t, g = "top", y = 0, l = {}) => {
|
|
80
|
+
const r = n.x, f = n.y - y, h = l.width ?? 0, d = l.height ?? 0;
|
|
81
|
+
switch (g) {
|
|
82
|
+
case "bottom":
|
|
83
|
+
return { x: r, y: Math.max(...t.map((i) => i.y)) + d / 2 + 4 };
|
|
84
|
+
case "right":
|
|
85
|
+
return { x: Math.max(...t.map((i) => i.x)) + h / 2 + 4, y: f };
|
|
86
|
+
case "left":
|
|
87
|
+
return { x: Math.min(...t.map((i) => i.x)) - h / 2 - 4, y: f };
|
|
88
|
+
default:
|
|
89
|
+
return { x: r, y: Math.min(...t.map((i) => i.y)) - d / 2 - 4 };
|
|
90
|
+
}
|
|
91
|
+
}, "getSelfLoopLabelPosition"), se = /* @__PURE__ */ w((n, t = 0, { mergeSelfLoops: g = !0 } = {}) => {
|
|
92
|
+
const y = /* @__PURE__ */ new Map(), l = [], o = n.graph()?.rankdir;
|
|
93
|
+
return n.edges().forEach((r) => {
|
|
94
|
+
const f = n.edge(r);
|
|
95
|
+
if (g && f.selfLoop) {
|
|
96
|
+
const h = f.selfLoop.id;
|
|
97
|
+
y.has(h) || y.set(h, []), y.get(h).push({ edge: f, start: r.v, end: r.w });
|
|
98
|
+
} else
|
|
99
|
+
l.push({ edge: f, start: r.v, end: r.w });
|
|
100
|
+
}), y.forEach((r) => {
|
|
101
|
+
if (r.length !== 3) {
|
|
102
|
+
r.forEach((L) => l.push(L));
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
r.sort((L, a) => L.edge.selfLoop.order - a.edge.selfLoop.order);
|
|
106
|
+
const [f, h, d] = r, i = f.edge.originalEdge ?? h.edge.originalEdge ?? d.edge.originalEdge ?? h.edge, s = n.node(i.start);
|
|
107
|
+
if (!s) {
|
|
108
|
+
r.forEach((L) => l.push(L));
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const p = {
|
|
112
|
+
width: h.edge.width,
|
|
113
|
+
height: h.edge.height
|
|
114
|
+
}, m = Z(n, s, r, i.start, o), X = ee(s, m, t, p.width ?? 0), S = te(s, X, m, t, p), b = {
|
|
115
|
+
...h.edge,
|
|
116
|
+
...i,
|
|
117
|
+
id: i.id,
|
|
118
|
+
points: X,
|
|
119
|
+
start: i.start,
|
|
120
|
+
end: i.end,
|
|
121
|
+
x: S.x,
|
|
122
|
+
y: S.y,
|
|
123
|
+
width: p.width,
|
|
124
|
+
height: p.height,
|
|
125
|
+
labelStyle: h.edge.labelStyle,
|
|
126
|
+
fromCluster: f.edge.fromCluster ?? h.edge.fromCluster ?? d.edge.fromCluster,
|
|
127
|
+
toCluster: f.edge.toCluster ?? h.edge.toCluster ?? d.edge.toCluster
|
|
128
|
+
};
|
|
129
|
+
delete b.selfLoop, delete b.originalEdge, l.push({ edge: b, start: b.start, end: b.end });
|
|
130
|
+
}), l;
|
|
131
|
+
}, "getEdgesToRender"), k = /* @__PURE__ */ w(async (n, t, g, y, l, o) => {
|
|
132
|
+
c.warn("Graph in recursive render:XAX", I(t), l);
|
|
133
|
+
const r = t.graph().rankdir;
|
|
134
|
+
c.trace("Dir in recursive render - dir:", r);
|
|
135
|
+
const f = n.insert("g").attr("class", "root");
|
|
136
|
+
t.nodes() ? c.info("Recursive render XXX", t.nodes()) : c.info("No nodes found for", t), t.edges().length > 0 && c.info("Recursive edges", t.edge(t.edges()[0]));
|
|
137
|
+
const h = f.insert("g").attr("class", "clusters"), d = f.insert("g").attr("class", "edgePaths"), i = f.insert("g").attr("class", "edgeLabels"), s = f.insert("g").attr("class", "nodes"), p = V(g);
|
|
138
|
+
await Promise.all(
|
|
139
|
+
t.nodes().map(async function(a) {
|
|
140
|
+
const e = t.node(a);
|
|
141
|
+
if (l !== void 0) {
|
|
142
|
+
const u = JSON.parse(JSON.stringify(l.clusterData));
|
|
143
|
+
c.trace(
|
|
144
|
+
`Setting data for parent cluster XXX
|
|
145
|
+
Node.id = `,
|
|
146
|
+
a,
|
|
147
|
+
`
|
|
148
|
+
data=`,
|
|
149
|
+
u.height,
|
|
150
|
+
`
|
|
151
|
+
Parent cluster`,
|
|
152
|
+
l.height
|
|
153
|
+
), t.setNode(l.id, u), t.parent(a) || (c.trace("Setting parent", a, l.id), t.setParent(a, l.id, u));
|
|
154
|
+
}
|
|
155
|
+
if (c.info("(Insert) Node XXX" + a + ": " + JSON.stringify(t.node(a))), e?.clusterNode) {
|
|
156
|
+
c.info("Cluster identified XBX", a, e.width, t.node(a));
|
|
157
|
+
const { ranksep: u, nodesep: x } = t.graph();
|
|
158
|
+
e.graph.setGraph({
|
|
159
|
+
...e.graph.graph(),
|
|
160
|
+
ranksep: u + 25,
|
|
161
|
+
nodesep: x
|
|
162
|
+
});
|
|
163
|
+
const N = await k(
|
|
164
|
+
s,
|
|
165
|
+
e.graph,
|
|
166
|
+
g,
|
|
167
|
+
y,
|
|
168
|
+
t.node(a),
|
|
169
|
+
o
|
|
170
|
+
), M = N.elem;
|
|
171
|
+
j(e, M), e.diff = N.diff || 0, c.info(
|
|
172
|
+
"New compound node after recursive render XAX",
|
|
173
|
+
a,
|
|
174
|
+
"width",
|
|
175
|
+
// node,
|
|
176
|
+
e.width,
|
|
177
|
+
"height",
|
|
178
|
+
e.height
|
|
179
|
+
// node.x,
|
|
180
|
+
// node.y
|
|
181
|
+
), W(M, e);
|
|
182
|
+
} else
|
|
183
|
+
t.children(a).length > 0 ? (c.trace(
|
|
184
|
+
"Cluster - the non recursive path XBX",
|
|
185
|
+
a,
|
|
186
|
+
e.id,
|
|
187
|
+
e,
|
|
188
|
+
e.width,
|
|
189
|
+
"Graph:",
|
|
190
|
+
t
|
|
191
|
+
), c.trace(P(e.id, t)), E.set(e.id, { id: P(e.id, t), node: e })) : (c.trace("Node - the non recursive path XAX", a, s, t.node(a), r), await $(s, t.node(a), { config: o, dir: r }));
|
|
192
|
+
})
|
|
193
|
+
), await (/* @__PURE__ */ w(async () => {
|
|
194
|
+
const a = t.edges().map(async function(e) {
|
|
195
|
+
const u = t.edge(e.v, e.w, e.name);
|
|
196
|
+
if (c.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e)), c.info("Edge " + e.v + " -> " + e.w + ": ", e, " ", JSON.stringify(t.edge(e))), c.info(
|
|
197
|
+
"Fix",
|
|
198
|
+
E,
|
|
199
|
+
"ids:",
|
|
200
|
+
e.v,
|
|
201
|
+
e.w,
|
|
202
|
+
"Translating: ",
|
|
203
|
+
E.get(e.v),
|
|
204
|
+
E.get(e.w)
|
|
205
|
+
), p && u.selfLoop) {
|
|
206
|
+
if (u.selfLoop.order !== 1)
|
|
207
|
+
return;
|
|
208
|
+
const x = u.id;
|
|
209
|
+
u.id = u.selfLoop.id, await T(i, u), u.id = x;
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
await T(i, u);
|
|
213
|
+
});
|
|
214
|
+
await Promise.all(a);
|
|
215
|
+
}, "processEdges"))(), c.info("Graph before layout:", JSON.stringify(I(t))), c.info("############################################# XXX"), c.info("### Layout ### XXX"), c.info("############################################# XXX"), U(t), c.info("Graph after layout:", JSON.stringify(I(t)));
|
|
216
|
+
let X = 0, { subGraphTitleTotalMargin: S } = q(o);
|
|
217
|
+
await Promise.all(
|
|
218
|
+
v(t).map(async function(a) {
|
|
219
|
+
const e = t.node(a);
|
|
220
|
+
if (c.info(
|
|
221
|
+
"Position XBX => " + a + ": (" + e.x,
|
|
222
|
+
"," + e.y,
|
|
223
|
+
") width: ",
|
|
224
|
+
e.width,
|
|
225
|
+
" height: ",
|
|
226
|
+
e.height
|
|
227
|
+
), e?.clusterNode)
|
|
228
|
+
e.y += S, c.info(
|
|
229
|
+
"A tainted cluster node XBX1",
|
|
230
|
+
a,
|
|
231
|
+
e.id,
|
|
232
|
+
e.width,
|
|
233
|
+
e.height,
|
|
234
|
+
e.x,
|
|
235
|
+
e.y,
|
|
236
|
+
t.parent(a)
|
|
237
|
+
), E.get(e.id).node = e, R(e);
|
|
238
|
+
else if (t.children(a).length > 0) {
|
|
239
|
+
c.info(
|
|
240
|
+
"A pure cluster node XBX1",
|
|
241
|
+
a,
|
|
242
|
+
e.id,
|
|
243
|
+
e.x,
|
|
244
|
+
e.y,
|
|
245
|
+
e.width,
|
|
246
|
+
e.height,
|
|
247
|
+
t.parent(a)
|
|
248
|
+
), e.height += S, t.node(e.parentId);
|
|
249
|
+
const u = e?.padding / 2 || 0, x = e?.labelBBox?.height || 0, N = x - u || 0;
|
|
250
|
+
c.debug("OffsetY", N, "labelHeight", x, "halfPadding", u), await F(h, e), E.get(e.id).node = e;
|
|
251
|
+
} else {
|
|
252
|
+
const u = t.node(e.parentId);
|
|
253
|
+
e.y += S / 2, c.info(
|
|
254
|
+
"A regular node XBX1 - using the padding",
|
|
255
|
+
e.id,
|
|
256
|
+
"parent",
|
|
257
|
+
e.parentId,
|
|
258
|
+
e.width,
|
|
259
|
+
e.height,
|
|
260
|
+
e.x,
|
|
261
|
+
e.y,
|
|
262
|
+
"offsetY",
|
|
263
|
+
e.offsetY,
|
|
264
|
+
"parent",
|
|
265
|
+
u,
|
|
266
|
+
u?.offsetY,
|
|
267
|
+
e
|
|
268
|
+
), R(e);
|
|
269
|
+
}
|
|
270
|
+
})
|
|
271
|
+
);
|
|
272
|
+
const b = S / 2;
|
|
273
|
+
return se(t, b, { mergeSelfLoops: p }).forEach(function({ edge: a, start: e, end: u }) {
|
|
274
|
+
c.info("Edge " + e + " -> " + u + ": " + JSON.stringify(a), a), a.points.forEach((B) => B.y += b);
|
|
275
|
+
const x = t.node(e), N = t.node(u), M = z(d, a, E, g, x, N, y);
|
|
276
|
+
K(a, M);
|
|
277
|
+
}), t.nodes().forEach(function(a) {
|
|
278
|
+
const e = t.node(a);
|
|
279
|
+
c.info(a, e.type, e.diff), e.isGroup && (X = e.diff);
|
|
280
|
+
}), c.warn("Returning from recursive render XAX", f, X), { elem: f, diff: X };
|
|
281
|
+
}, "recursiveRender"), ae = /* @__PURE__ */ w(async (n, t) => {
|
|
282
|
+
const g = new Q({
|
|
283
|
+
multigraph: !0,
|
|
284
|
+
compound: !0
|
|
285
|
+
}).setGraph({
|
|
286
|
+
rankdir: n.direction,
|
|
287
|
+
nodesep: n.config?.nodeSpacing || n.config?.flowchart?.nodeSpacing || n.nodeSpacing,
|
|
288
|
+
ranksep: n.config?.rankSpacing || n.config?.flowchart?.rankSpacing || n.rankSpacing,
|
|
289
|
+
marginx: 8,
|
|
290
|
+
marginy: 8
|
|
291
|
+
}).setDefaultEdgeLabel(function() {
|
|
292
|
+
return {};
|
|
293
|
+
}), y = t.select("g");
|
|
294
|
+
A(y, n.markers, n.type, n.diagramId), D(), H(), Y(), O(), n.nodes.forEach((o) => {
|
|
295
|
+
g.setNode(o.id, { ...o }), o.parentId && g.setParent(o.id, o.parentId);
|
|
296
|
+
}), c.debug("Edges:", n.edges), n.edges.forEach((o) => {
|
|
297
|
+
if (o.start === o.end) {
|
|
298
|
+
const r = o.start, f = r + "---" + r + "---1", h = r + "---" + r + "---2", d = g.node(r);
|
|
299
|
+
g.setNode(f, {
|
|
300
|
+
domId: f,
|
|
301
|
+
id: f,
|
|
302
|
+
parentId: d.parentId,
|
|
303
|
+
labelStyle: "",
|
|
304
|
+
label: "",
|
|
305
|
+
padding: 0,
|
|
306
|
+
shape: "labelRect",
|
|
307
|
+
// shape: 'rect',
|
|
308
|
+
style: "",
|
|
309
|
+
width: 10,
|
|
310
|
+
height: 10
|
|
311
|
+
}), g.setParent(f, d.parentId), g.setNode(h, {
|
|
312
|
+
domId: h,
|
|
313
|
+
id: h,
|
|
314
|
+
parentId: d.parentId,
|
|
315
|
+
labelStyle: "",
|
|
316
|
+
padding: 0,
|
|
317
|
+
// shape: 'rect',
|
|
318
|
+
shape: "labelRect",
|
|
319
|
+
label: "",
|
|
320
|
+
style: "",
|
|
321
|
+
width: 10,
|
|
322
|
+
height: 10
|
|
323
|
+
}), g.setParent(h, d.parentId);
|
|
324
|
+
const i = structuredClone(o), s = structuredClone(o), p = structuredClone(o), m = structuredClone(o);
|
|
325
|
+
s.originalEdge = i, s.selfLoop = { id: i.id, order: 0 }, p.originalEdge = i, p.selfLoop = { id: i.id, order: 1 }, m.originalEdge = i, m.selfLoop = { id: i.id, order: 2 }, s.label = "", s.arrowTypeEnd = "none", s.endLabelLeft = "", s.endLabelRight = "", s.startLabelLeft = "", s.id = r + "-cyclic-special-1", p.startLabelRight = "", p.startLabelLeft = "", p.endLabelLeft = "", p.endLabelRight = "", p.arrowTypeStart = "none", p.arrowTypeEnd = "none", p.id = r + "-cyclic-special-mid", m.label = "", m.startLabelRight = "", m.startLabelLeft = "", m.arrowTypeStart = "none", d.isGroup && (s.fromCluster = r, m.toCluster = r), m.id = r + "-cyclic-special-2", m.arrowTypeStart = "none", g.setEdge(r, f, s, r + "-cyclic-special-0"), g.setEdge(f, h, p, r + "-cyclic-special-1"), g.setEdge(h, r, m, r + "-cyclic-special-2");
|
|
326
|
+
} else
|
|
327
|
+
g.setEdge(o.start, o.end, { ...o }, o.id);
|
|
328
|
+
}), c.warn("Graph at first:", JSON.stringify(I(g))), J(g), c.warn("Graph after XAX:", JSON.stringify(I(g)));
|
|
329
|
+
const l = _();
|
|
330
|
+
await k(
|
|
331
|
+
y,
|
|
332
|
+
g,
|
|
333
|
+
n.type,
|
|
334
|
+
n.diagramId,
|
|
335
|
+
void 0,
|
|
336
|
+
l
|
|
337
|
+
);
|
|
338
|
+
}, "render");
|
|
339
|
+
export {
|
|
340
|
+
se as getEdgesToRender,
|
|
341
|
+
ae as render
|
|
342
|
+
};
|
|
343
|
+
//# sourceMappingURL=dagre-VZM6K2ZE-CELO1hFb.js.map
|