@layers-app/editor 0.4.1 → 0.5.1
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 +37 -1
- package/package.json +10 -10
- package/dist/index.cjs +0 -2
- package/dist/index.d.ts +0 -315
- package/dist/index.js +0 -13
- package/dist/layers.-23sKdPr.js +0 -10
- package/dist/layers.2Zh_Eqge.js +0 -118
- package/dist/layers.52famHy6.js +0 -1
- package/dist/layers.6xiY7Dmk.js +0 -10
- package/dist/layers.7JqFgE4-.js +0 -15
- package/dist/layers.7aWFCBDk.js +0 -36
- package/dist/layers.9--aZzKT.js +0 -41
- package/dist/layers.99J97lec.js +0 -40
- package/dist/layers.9QK1wiQj.js +0 -1
- package/dist/layers.9pNaFvaX.js +0 -1
- package/dist/layers.B16HCOzz.js +0 -11
- package/dist/layers.B19hGmey.js +0 -1
- package/dist/layers.B1GsQlw2.js +0 -202
- package/dist/layers.B1VWPJr7.js +0 -61
- package/dist/layers.B2AGu32C.js +0 -11692
- package/dist/layers.B3D4g2HH.js +0 -1
- package/dist/layers.B4Jcovwh.js +0 -160
- package/dist/layers.B4o4Yght.js +0 -39
- package/dist/layers.B51TBzz6.js +0 -1
- package/dist/layers.B5HV5CkN.js +0 -6
- package/dist/layers.B5VQ5ysd.js +0 -230
- package/dist/layers.B7uv8aVq.js +0 -39
- package/dist/layers.B9ypkXfB.js +0 -1
- package/dist/layers.BATSJhNp.js +0 -10
- package/dist/layers.BAe6u370.js +0 -793
- package/dist/layers.BAtv1CM7.js +0 -1
- package/dist/layers.BCMyc6dl.js +0 -1
- package/dist/layers.BChBzZgi.js +0 -139
- package/dist/layers.BCtnSgBi.js +0 -139
- package/dist/layers.BGXN8iGN.js +0 -36
- package/dist/layers.BH9NvW2c.js +0 -1
- package/dist/layers.BHEN4Zl8.js +0 -9
- package/dist/layers.BI-S-U1z.js +0 -34
- package/dist/layers.BIATzXuT.js +0 -5
- package/dist/layers.BId9R-tt.js +0 -9
- package/dist/layers.BIeVwYKL.js +0 -1
- package/dist/layers.BIj1zRV6.js +0 -8
- package/dist/layers.BK7Umu5k.js +0 -40
- package/dist/layers.BL7PsAnh.js +0 -40
- package/dist/layers.BLha5Ags.js +0 -1
- package/dist/layers.BNcxqXDY.js +0 -2
- package/dist/layers.BOY6DvLj.js +0 -41
- package/dist/layers.BQ5pHr1t.js +0 -9
- package/dist/layers.BR9erYvc.js +0 -425
- package/dist/layers.BSTBZrFn.js +0 -1
- package/dist/layers.BTjqsj2D.js +0 -32
- package/dist/layers.BU0ouPbJ.js +0 -40
- package/dist/layers.BVLHr0fv.js +0 -21938
- package/dist/layers.BVhV_yLo.js +0 -59
- package/dist/layers.BWppdp8z.js +0 -37
- package/dist/layers.BXGZ-IPG.js +0 -37
- package/dist/layers.BXIQjroR.js +0 -8
- package/dist/layers.BXe2f2v0.js +0 -10
- package/dist/layers.BaREUEpY.js +0 -1
- package/dist/layers.BbCfEXyj.js +0 -55
- package/dist/layers.BdxgA5Mh.js +0 -40
- package/dist/layers.BeXV53PI.js +0 -38
- package/dist/layers.Bf4maS9l.js +0 -41
- package/dist/layers.BgOa2ZQq.js +0 -7
- package/dist/layers.BgXRgBMD.js +0 -9
- package/dist/layers.Bgx4q6Yl.js +0 -1
- package/dist/layers.BiJ8hfRt.js +0 -1510
- package/dist/layers.BiK_NhRx.js +0 -13
- package/dist/layers.BjIrZvhA.js +0 -41
- package/dist/layers.BkDwnhF3.js +0 -39
- package/dist/layers.BkZl0e9Y.js +0 -10
- package/dist/layers.BkkBEMI4.js +0 -122
- package/dist/layers.Bl2uWPK5.js +0 -35
- package/dist/layers.BldgpPoA.js +0 -21763
- package/dist/layers.BmdNYA8O.js +0 -39
- package/dist/layers.BoUDsd20.js +0 -84
- package/dist/layers.BpilXLfW.js +0 -6
- package/dist/layers.Bqy_BDRk.js +0 -960
- package/dist/layers.BvQfT02S.js +0 -9
- package/dist/layers.BxCLnc_z.js +0 -52
- package/dist/layers.Bxuc5Ku1.js +0 -6
- package/dist/layers.Bxx3QiqH.js +0 -5
- package/dist/layers.BzufRV9o.js +0 -4
- package/dist/layers.C-S1uftF.js +0 -1
- package/dist/layers.C00McVdb.js +0 -116
- package/dist/layers.C3-Awt80.js +0 -186
- package/dist/layers.C46xOyCn.js +0 -1
- package/dist/layers.C4Z2eV4H.js +0 -437
- package/dist/layers.C5fqgGR6.js +0 -33
- package/dist/layers.C5pjkDUm.js +0 -8
- package/dist/layers.C5th-3Bk.js +0 -4
- package/dist/layers.C5vdiuk-.js +0 -1
- package/dist/layers.C6FZDcP0.js +0 -5
- package/dist/layers.C6ueRaWn.js +0 -1
- package/dist/layers.C6vMG-T6.js +0 -39
- package/dist/layers.C7lIplJU.js +0 -247
- package/dist/layers.C7md-mpb.js +0 -373
- package/dist/layers.C8Lyyff8.js +0 -39
- package/dist/layers.C8WU47YC.js +0 -7
- package/dist/layers.C8_lu5UH.js +0 -23
- package/dist/layers.CAZF51iw.js +0 -769
- package/dist/layers.CDmsB9ui.js +0 -9
- package/dist/layers.CENOzW4d.js +0 -32
- package/dist/layers.CESONz7C.js +0 -35
- package/dist/layers.CEW7Z5oj.js +0 -40
- package/dist/layers.CHE9Vv0w.js +0 -2966
- package/dist/layers.CHMDrzTP.js +0 -1
- package/dist/layers.CHZsXQcr.js +0 -1
- package/dist/layers.CIkcRflS.js +0 -32
- package/dist/layers.CJdGap0M.js +0 -40
- package/dist/layers.CJgtfrlM.js +0 -9
- package/dist/layers.CK15u90j.js +0 -32
- package/dist/layers.CKyZ6fil.js +0 -220
- package/dist/layers.COAF7f8g.js +0 -1
- package/dist/layers.CP7ZgLdQ.js +0 -802
- package/dist/layers.CQ_KfkMs.js +0 -1
- package/dist/layers.CSKgny-q.js +0 -1359
- package/dist/layers.CX4-2iW9.js +0 -8
- package/dist/layers.CX4mdDUE.js +0 -40
- package/dist/layers.CXFcyuib.js +0 -51
- package/dist/layers.CXnC6LGK.js +0 -1
- package/dist/layers.CXoz8wje.js +0 -11
- package/dist/layers.CZianMah.js +0 -33
- package/dist/layers.CbrkK8Nl.js +0 -6
- package/dist/layers.CdPjGs2x.js +0 -32
- package/dist/layers.CdZEenM8.js +0 -8
- package/dist/layers.CeESKes4.js +0 -37
- package/dist/layers.CebNnxUV.js +0 -185
- package/dist/layers.Cg0Puk92.js +0 -40
- package/dist/layers.ChG4YWfr.js +0 -1034
- package/dist/layers.ChLLCYeV.js +0 -7
- package/dist/layers.Cj5o49qm.js +0 -7
- package/dist/layers.Ck_m9yBu.js +0 -41
- package/dist/layers.Cl9YbTGP.js +0 -1
- package/dist/layers.Clo5oIEO.js +0 -70
- package/dist/layers.Cmeg2JEe.js +0 -10
- package/dist/layers.CqVTtuYm.js +0 -6
- package/dist/layers.Cs24L6er.js +0 -261
- package/dist/layers.Ctcl9I58.js +0 -10
- package/dist/layers.Cuf8LL65.js +0 -4
- package/dist/layers.CusXQPSP.js +0 -41
- package/dist/layers.CyaiBxcg.js +0 -1
- package/dist/layers.D-4MyOv6.js +0 -1126
- package/dist/layers.D0fuzbA_.js +0 -1580
- package/dist/layers.D0t24lyP.js +0 -1619
- package/dist/layers.D0zn4_Mx.js +0 -1
- package/dist/layers.D37kPodI.js +0 -7
- package/dist/layers.D3PBqBbY.js +0 -4
- package/dist/layers.D3eSioXs.js +0 -1
- package/dist/layers.D4fGb2cV.js +0 -1272
- package/dist/layers.D56jgM5P.js +0 -803
- package/dist/layers.D7jGxypv.js +0 -8
- package/dist/layers.DBgQS_TD.js +0 -39
- package/dist/layers.DE8kdoob.js +0 -8
- package/dist/layers.DEMbeDH5.js +0 -96
- package/dist/layers.DGfERl47.js +0 -39
- package/dist/layers.DGhEo4ps.js +0 -6
- package/dist/layers.DHbgl38J.js +0 -1
- package/dist/layers.DIW19mY0.js +0 -2235
- package/dist/layers.DIsd_eLu.js +0 -931
- package/dist/layers.DKhnUElF.js +0 -3
- package/dist/layers.DLwuMfdd.js +0 -84
- package/dist/layers.DMXwnUhk.js +0 -10
- package/dist/layers.DMkBISW1.js +0 -1
- package/dist/layers.DN9HoVxI.js +0 -18
- package/dist/layers.DOjcR2u6.js +0 -44
- package/dist/layers.DOrgOHBr.js +0 -1
- package/dist/layers.DRd1i4Pe.js +0 -2
- package/dist/layers.DSiVxrm-.js +0 -9
- package/dist/layers.DV0u_-wO.js +0 -1
- package/dist/layers.DYJhYqR2.js +0 -1089
- package/dist/layers.DYR-z4Xd.js +0 -65
- package/dist/layers.D_KjhW7m.js +0 -9
- package/dist/layers.DaA4pT9g.js +0 -42
- package/dist/layers.DbaKVP5e.js +0 -1
- package/dist/layers.DcGuLvyP.js +0 -1
- package/dist/layers.DczwzPio.js +0 -1
- package/dist/layers.DdULzc5-.js +0 -42
- package/dist/layers.De4i5Pzr.js +0 -423
- package/dist/layers.Dg_ubB5o.js +0 -38
- package/dist/layers.DhtUpSvn.js +0 -7
- package/dist/layers.DiAtOpGJ.js +0 -38
- package/dist/layers.DjUOC4st.js +0 -16
- package/dist/layers.DlH0lUyY.js +0 -7
- package/dist/layers.Dms1jgA7.js +0 -7
- package/dist/layers.DnvdN9TC.js +0 -9
- package/dist/layers.Doo3HAhr.js +0 -42
- package/dist/layers.Dpl-_pRd.js +0 -282
- package/dist/layers.Dq7WsWG1.js +0 -8
- package/dist/layers.Dr-_us97.js +0 -5
- package/dist/layers.Dr9AgtBT.js +0 -1265
- package/dist/layers.DsIrXvQc.js +0 -36
- package/dist/layers.DuC5Q-Uc.js +0 -1
- package/dist/layers.Dwrpihyi.js +0 -9148
- package/dist/layers.Dx7QSKbZ.js +0 -257
- package/dist/layers.DxA6ocdw.js +0 -70
- package/dist/layers.Dy1naDTQ.js +0 -14
- package/dist/layers.DyIa2FAJ.js +0 -501
- package/dist/layers.DyrpParn.js +0 -42
- package/dist/layers.G0qyEFRn.js +0 -7
- package/dist/layers.HnnZ9X3g.js +0 -41
- package/dist/layers.Ih_DycCa.js +0 -904
- package/dist/layers.JWCLFILJ.js +0 -1
- package/dist/layers.MXTL7J0X.js +0 -45828
- package/dist/layers.N0KTyT8H.js +0 -10
- package/dist/layers.NLvydYLt.js +0 -19
- package/dist/layers.NQOujqxE.js +0 -207
- package/dist/layers.O7rgjuxq.js +0 -35
- package/dist/layers.OF4XgnEn.js +0 -320
- package/dist/layers.OqM7Ogm0.js +0 -6
- package/dist/layers.P0RFt4vw.js +0 -10
- package/dist/layers.PWkD3FXd.js +0 -32
- package/dist/layers.Q933nYVT.js +0 -14
- package/dist/layers.ShoHTpWp.js +0 -11
- package/dist/layers.TP-LPR2e.js +0 -1283
- package/dist/layers.U8d2vvil.js +0 -11
- package/dist/layers.UHdtuNW7.js +0 -6
- package/dist/layers.UPBrkQqm.js +0 -1088
- package/dist/layers.Y1n_hIuc.js +0 -1
- package/dist/layers._uHasBFO.js +0 -40
- package/dist/layers._uJVChzG.js +0 -48146
- package/dist/layers.b0h5ZBmD.js +0 -61
- package/dist/layers.b_l02tem.js +0 -319
- package/dist/layers.d0donhTp.js +0 -36
- package/dist/layers.fjvgvmUK.js +0 -37
- package/dist/layers.gSOgK4cv.js +0 -41
- package/dist/layers.h2SsCt7w.js +0 -8
- package/dist/layers.hzJoyUwS.js +0 -268
- package/dist/layers.j4D7aRnj.js +0 -42
- package/dist/layers.l7Uj4NoM.js +0 -8
- package/dist/layers.lCpg7dOn.js +0 -21
- package/dist/layers.mS0YwpDF.js +0 -2479
- package/dist/layers.oLym9I6R.js +0 -8
- package/dist/layers.pGJnLNqj.js +0 -285
- package/dist/layers.pRFngToG.js +0 -1
- package/dist/layers.rK-vslvx.js +0 -2
- package/dist/layers.rSvdeOjc.js +0 -84
- package/dist/layers.rwvkqrdF.js +0 -11
- package/dist/layers.wRnSjyfZ.js +0 -5
- package/dist/layers.xbymChc4.js +0 -790
- package/dist/layers.xlbtHZsv.js +0 -39
package/dist/layers.UPBrkQqm.js
DELETED
|
@@ -1,1088 +0,0 @@
|
|
|
1
|
-
import { l as g, r as lt, g as b, t as H, d as E, u as j, i as Q, v as V } from "./layers.Dwrpihyi.js";
|
|
2
|
-
import { c as st } from "./layers.CHE9Vv0w.js";
|
|
3
|
-
import { l as ct } from "./layers.CZianMah.js";
|
|
4
|
-
const ht = (a, t, e, i) => {
|
|
5
|
-
t.forEach((l) => {
|
|
6
|
-
wt[l](a, e, i);
|
|
7
|
-
});
|
|
8
|
-
}, ot = (a, t, e) => {
|
|
9
|
-
g.trace("Making markers for ", e), a.append("defs").append("marker").attr("id", e + "_" + t + "-extensionStart").attr("class", "marker extension " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), a.append("defs").append("marker").attr("id", e + "_" + t + "-extensionEnd").attr("class", "marker extension " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
|
|
10
|
-
}, yt = (a, t, e) => {
|
|
11
|
-
a.append("defs").append("marker").attr("id", e + "_" + t + "-compositionStart").attr("class", "marker composition " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), a.append("defs").append("marker").attr("id", e + "_" + t + "-compositionEnd").attr("class", "marker composition " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
12
|
-
}, pt = (a, t, e) => {
|
|
13
|
-
a.append("defs").append("marker").attr("id", e + "_" + t + "-aggregationStart").attr("class", "marker aggregation " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), a.append("defs").append("marker").attr("id", e + "_" + t + "-aggregationEnd").attr("class", "marker aggregation " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
14
|
-
}, ft = (a, t, e) => {
|
|
15
|
-
a.append("defs").append("marker").attr("id", e + "_" + t + "-dependencyStart").attr("class", "marker dependency " + t).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), a.append("defs").append("marker").attr("id", e + "_" + t + "-dependencyEnd").attr("class", "marker dependency " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
16
|
-
}, xt = (a, t, e) => {
|
|
17
|
-
a.append("defs").append("marker").attr("id", e + "_" + t + "-lollipopStart").attr("class", "marker lollipop " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6), a.append("defs").append("marker").attr("id", e + "_" + t + "-lollipopEnd").attr("class", "marker lollipop " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
|
|
18
|
-
}, dt = (a, t, e) => {
|
|
19
|
-
a.append("marker").attr("id", e + "_" + t + "-pointEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 6).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), a.append("marker").attr("id", e + "_" + t + "-pointStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
20
|
-
}, gt = (a, t, e) => {
|
|
21
|
-
a.append("marker").attr("id", e + "_" + t + "-circleEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), a.append("marker").attr("id", e + "_" + t + "-circleStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
22
|
-
}, ut = (a, t, e) => {
|
|
23
|
-
a.append("marker").attr("id", e + "_" + t + "-crossEnd").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), a.append("marker").attr("id", e + "_" + t + "-crossStart").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
|
|
24
|
-
}, bt = (a, t, e) => {
|
|
25
|
-
a.append("defs").append("marker").attr("id", e + "_" + t + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
|
|
26
|
-
}, wt = {
|
|
27
|
-
extension: ot,
|
|
28
|
-
composition: yt,
|
|
29
|
-
aggregation: pt,
|
|
30
|
-
dependency: ft,
|
|
31
|
-
lollipop: xt,
|
|
32
|
-
point: dt,
|
|
33
|
-
circle: gt,
|
|
34
|
-
cross: ut,
|
|
35
|
-
barb: bt
|
|
36
|
-
}, hr = ht;
|
|
37
|
-
function mt(a, t) {
|
|
38
|
-
t && a.attr("style", t);
|
|
39
|
-
}
|
|
40
|
-
function kt(a, t) {
|
|
41
|
-
const e = E(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), i = e.append("xhtml:div"), l = a.label, r = a.isNode ? "nodeLabel" : "edgeLabel";
|
|
42
|
-
return i.html(
|
|
43
|
-
Q(
|
|
44
|
-
'<span class="' + r + '" ' + (a.labelStyle ? 'style="' + a.labelStyle + '"' : "") + ">" + l + "</span>",
|
|
45
|
-
t
|
|
46
|
-
)
|
|
47
|
-
), mt(i, a.labelStyle), i.style("display", "inline-block"), i.style("white-space", "nowrap"), i.attr("xmlns", "http://www.w3.org/1999/xhtml"), e.node();
|
|
48
|
-
}
|
|
49
|
-
const vt = (a, t, e, i) => {
|
|
50
|
-
let l = a || "";
|
|
51
|
-
typeof l == "object" && (l = l[0]);
|
|
52
|
-
const r = b();
|
|
53
|
-
if (H(r.flowchart.htmlLabels)) {
|
|
54
|
-
l = l.replace(/\\n|\n/g, "<br />"), g.debug("vertexText" + l);
|
|
55
|
-
const s = {
|
|
56
|
-
isNode: i,
|
|
57
|
-
label: V(l).replace(
|
|
58
|
-
/fa[blrs]?:fa-[\w-]+/g,
|
|
59
|
-
// cspell: disable-line
|
|
60
|
-
(c) => `<i class='${c.replace(":", " ")}'></i>`
|
|
61
|
-
),
|
|
62
|
-
labelStyle: t.replace("fill:", "color:")
|
|
63
|
-
};
|
|
64
|
-
return kt(s, r);
|
|
65
|
-
} else {
|
|
66
|
-
const s = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
67
|
-
s.setAttribute("style", t.replace("color:", "fill:"));
|
|
68
|
-
let n = [];
|
|
69
|
-
typeof l == "string" ? n = l.split(/\\n|\n|<br\s*\/?>/gi) : Array.isArray(l) ? n = l : n = [];
|
|
70
|
-
for (const c of n) {
|
|
71
|
-
const o = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
72
|
-
o.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), o.setAttribute("dy", "1em"), o.setAttribute("x", "0"), e ? o.setAttribute("class", "title-row") : o.setAttribute("class", "row"), o.textContent = c.trim(), s.appendChild(o);
|
|
73
|
-
}
|
|
74
|
-
return s;
|
|
75
|
-
}
|
|
76
|
-
}, R = vt, M = async (a, t, e, i) => {
|
|
77
|
-
let l;
|
|
78
|
-
const r = t.useHtmlLabels || H(b().flowchart.htmlLabels);
|
|
79
|
-
e ? l = e : l = "node default";
|
|
80
|
-
const s = a.insert("g").attr("class", l).attr("id", t.domId || t.id), n = s.insert("g").attr("class", "label").attr("style", t.labelStyle);
|
|
81
|
-
let c;
|
|
82
|
-
t.labelText === void 0 ? c = "" : c = typeof t.labelText == "string" ? t.labelText : t.labelText[0];
|
|
83
|
-
const o = n.node();
|
|
84
|
-
let h;
|
|
85
|
-
t.labelType === "markdown" ? h = st(n, Q(V(c), b()), {
|
|
86
|
-
useHtmlLabels: r,
|
|
87
|
-
width: t.width || b().flowchart.wrappingWidth,
|
|
88
|
-
classes: "markdown-node-label"
|
|
89
|
-
}) : h = o.appendChild(
|
|
90
|
-
R(
|
|
91
|
-
Q(V(c), b()),
|
|
92
|
-
t.labelStyle,
|
|
93
|
-
!1,
|
|
94
|
-
i
|
|
95
|
-
)
|
|
96
|
-
);
|
|
97
|
-
let y = h.getBBox();
|
|
98
|
-
const f = t.padding / 2;
|
|
99
|
-
if (H(b().flowchart.htmlLabels)) {
|
|
100
|
-
const p = h.children[0], d = E(h), k = p.getElementsByTagName("img");
|
|
101
|
-
if (k) {
|
|
102
|
-
const x = c.replace(/<img[^>]*>/g, "").trim() === "";
|
|
103
|
-
await Promise.all(
|
|
104
|
-
[...k].map(
|
|
105
|
-
(u) => new Promise((S) => {
|
|
106
|
-
function B() {
|
|
107
|
-
if (u.style.display = "flex", u.style.flexDirection = "column", x) {
|
|
108
|
-
const C = b().fontSize ? b().fontSize : window.getComputedStyle(document.body).fontSize, D = parseInt(C, 10) * 5 + "px";
|
|
109
|
-
u.style.minWidth = D, u.style.maxWidth = D;
|
|
110
|
-
} else
|
|
111
|
-
u.style.width = "100%";
|
|
112
|
-
S(u);
|
|
113
|
-
}
|
|
114
|
-
setTimeout(() => {
|
|
115
|
-
u.complete && B();
|
|
116
|
-
}), u.addEventListener("error", B), u.addEventListener("load", B);
|
|
117
|
-
})
|
|
118
|
-
)
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
y = p.getBoundingClientRect(), d.attr("width", y.width), d.attr("height", y.height);
|
|
122
|
-
}
|
|
123
|
-
return r ? n.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")") : n.attr("transform", "translate(0, " + -y.height / 2 + ")"), t.centerLabel && n.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), n.insert("rect", ":first-child"), { shapeSvg: s, bbox: y, halfPadding: f, label: n };
|
|
124
|
-
}, m = (a, t) => {
|
|
125
|
-
const e = t.node().getBBox();
|
|
126
|
-
a.width = e.width, a.height = e.height;
|
|
127
|
-
};
|
|
128
|
-
function I(a, t, e, i) {
|
|
129
|
-
return a.insert("polygon", ":first-child").attr(
|
|
130
|
-
"points",
|
|
131
|
-
i.map(function(l) {
|
|
132
|
-
return l.x + "," + l.y;
|
|
133
|
-
}).join(" ")
|
|
134
|
-
).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + e / 2 + ")");
|
|
135
|
-
}
|
|
136
|
-
function Lt(a, t) {
|
|
137
|
-
return a.intersect(t);
|
|
138
|
-
}
|
|
139
|
-
function it(a, t, e, i) {
|
|
140
|
-
var l = a.x, r = a.y, s = l - i.x, n = r - i.y, c = Math.sqrt(t * t * n * n + e * e * s * s), o = Math.abs(t * e * s / c);
|
|
141
|
-
i.x < l && (o = -o);
|
|
142
|
-
var h = Math.abs(t * e * n / c);
|
|
143
|
-
return i.y < r && (h = -h), { x: l + o, y: r + h };
|
|
144
|
-
}
|
|
145
|
-
function St(a, t, e) {
|
|
146
|
-
return it(a, t, t, e);
|
|
147
|
-
}
|
|
148
|
-
function Mt(a, t, e, i) {
|
|
149
|
-
var l, r, s, n, c, o, h, y, f, p, d, k, x, u, S;
|
|
150
|
-
if (l = t.y - a.y, s = a.x - t.x, c = t.x * a.y - a.x * t.y, f = l * e.x + s * e.y + c, p = l * i.x + s * i.y + c, !(f !== 0 && p !== 0 && J(f, p)) && (r = i.y - e.y, n = e.x - i.x, o = i.x * e.y - e.x * i.y, h = r * a.x + n * a.y + o, y = r * t.x + n * t.y + o, !(h !== 0 && y !== 0 && J(h, y)) && (d = l * n - r * s, d !== 0)))
|
|
151
|
-
return k = Math.abs(d / 2), x = s * o - n * c, u = x < 0 ? (x - k) / d : (x + k) / d, x = r * c - l * o, S = x < 0 ? (x - k) / d : (x + k) / d, { x: u, y: S };
|
|
152
|
-
}
|
|
153
|
-
function J(a, t) {
|
|
154
|
-
return a * t > 0;
|
|
155
|
-
}
|
|
156
|
-
function Tt(a, t, e) {
|
|
157
|
-
var i = a.x, l = a.y, r = [], s = Number.POSITIVE_INFINITY, n = Number.POSITIVE_INFINITY;
|
|
158
|
-
typeof t.forEach == "function" ? t.forEach(function(d) {
|
|
159
|
-
s = Math.min(s, d.x), n = Math.min(n, d.y);
|
|
160
|
-
}) : (s = Math.min(s, t.x), n = Math.min(n, t.y));
|
|
161
|
-
for (var c = i - a.width / 2 - s, o = l - a.height / 2 - n, h = 0; h < t.length; h++) {
|
|
162
|
-
var y = t[h], f = t[h < t.length - 1 ? h + 1 : 0], p = Mt(
|
|
163
|
-
a,
|
|
164
|
-
e,
|
|
165
|
-
{ x: c + y.x, y: o + y.y },
|
|
166
|
-
{ x: c + f.x, y: o + f.y }
|
|
167
|
-
);
|
|
168
|
-
p && r.push(p);
|
|
169
|
-
}
|
|
170
|
-
return r.length ? (r.length > 1 && r.sort(function(d, k) {
|
|
171
|
-
var x = d.x - e.x, u = d.y - e.y, S = Math.sqrt(x * x + u * u), B = k.x - e.x, C = k.y - e.y, X = Math.sqrt(B * B + C * C);
|
|
172
|
-
return S < X ? -1 : S === X ? 0 : 1;
|
|
173
|
-
}), r[0]) : a;
|
|
174
|
-
}
|
|
175
|
-
const Bt = (a, t) => {
|
|
176
|
-
var e = a.x, i = a.y, l = t.x - e, r = t.y - i, s = a.width / 2, n = a.height / 2, c, o;
|
|
177
|
-
return Math.abs(r) * s > Math.abs(l) * n ? (r < 0 && (n = -n), c = r === 0 ? 0 : n * l / r, o = n) : (l < 0 && (s = -s), c = s, o = l === 0 ? 0 : s * r / l), { x: e + c, y: i + o };
|
|
178
|
-
}, Et = Bt, w = {
|
|
179
|
-
node: Lt,
|
|
180
|
-
circle: St,
|
|
181
|
-
ellipse: it,
|
|
182
|
-
polygon: Tt,
|
|
183
|
-
rect: Et
|
|
184
|
-
}, Ct = async (a, t) => {
|
|
185
|
-
t.useHtmlLabels || b().flowchart.htmlLabels || (t.centerLabel = !0);
|
|
186
|
-
const { shapeSvg: i, bbox: l, halfPadding: r } = await M(
|
|
187
|
-
a,
|
|
188
|
-
t,
|
|
189
|
-
"node " + t.classes,
|
|
190
|
-
!0
|
|
191
|
-
);
|
|
192
|
-
g.info("Classes = ", t.classes);
|
|
193
|
-
const s = i.insert("rect", ":first-child");
|
|
194
|
-
return s.attr("rx", t.rx).attr("ry", t.ry).attr("x", -l.width / 2 - r).attr("y", -l.height / 2 - r).attr("width", l.width + t.padding).attr("height", l.height + t.padding), m(t, s), t.intersect = function(n) {
|
|
195
|
-
return w.rect(t, n);
|
|
196
|
-
}, i;
|
|
197
|
-
}, $t = Ct, _t = (a) => {
|
|
198
|
-
const t = /* @__PURE__ */ new Set();
|
|
199
|
-
for (const e of a)
|
|
200
|
-
switch (e) {
|
|
201
|
-
case "x":
|
|
202
|
-
t.add("right"), t.add("left");
|
|
203
|
-
break;
|
|
204
|
-
case "y":
|
|
205
|
-
t.add("up"), t.add("down");
|
|
206
|
-
break;
|
|
207
|
-
default:
|
|
208
|
-
t.add(e);
|
|
209
|
-
break;
|
|
210
|
-
}
|
|
211
|
-
return t;
|
|
212
|
-
}, Rt = (a, t, e) => {
|
|
213
|
-
const i = _t(a), l = 2, r = t.height + 2 * e.padding, s = r / l, n = t.width + 2 * s + e.padding, c = e.padding / 2;
|
|
214
|
-
return i.has("right") && i.has("left") && i.has("up") && i.has("down") ? [
|
|
215
|
-
// Bottom
|
|
216
|
-
{ x: 0, y: 0 },
|
|
217
|
-
{ x: s, y: 0 },
|
|
218
|
-
{ x: n / 2, y: 2 * c },
|
|
219
|
-
{ x: n - s, y: 0 },
|
|
220
|
-
{ x: n, y: 0 },
|
|
221
|
-
// Right
|
|
222
|
-
{ x: n, y: -r / 3 },
|
|
223
|
-
{ x: n + 2 * c, y: -r / 2 },
|
|
224
|
-
{ x: n, y: -2 * r / 3 },
|
|
225
|
-
{ x: n, y: -r },
|
|
226
|
-
// Top
|
|
227
|
-
{ x: n - s, y: -r },
|
|
228
|
-
{ x: n / 2, y: -r - 2 * c },
|
|
229
|
-
{ x: s, y: -r },
|
|
230
|
-
// Left
|
|
231
|
-
{ x: 0, y: -r },
|
|
232
|
-
{ x: 0, y: -2 * r / 3 },
|
|
233
|
-
{ x: -2 * c, y: -r / 2 },
|
|
234
|
-
{ x: 0, y: -r / 3 }
|
|
235
|
-
] : i.has("right") && i.has("left") && i.has("up") ? [
|
|
236
|
-
{ x: s, y: 0 },
|
|
237
|
-
{ x: n - s, y: 0 },
|
|
238
|
-
{ x: n, y: -r / 2 },
|
|
239
|
-
{ x: n - s, y: -r },
|
|
240
|
-
{ x: s, y: -r },
|
|
241
|
-
{ x: 0, y: -r / 2 }
|
|
242
|
-
] : i.has("right") && i.has("left") && i.has("down") ? [
|
|
243
|
-
{ x: 0, y: 0 },
|
|
244
|
-
{ x: s, y: -r },
|
|
245
|
-
{ x: n - s, y: -r },
|
|
246
|
-
{ x: n, y: 0 }
|
|
247
|
-
] : i.has("right") && i.has("up") && i.has("down") ? [
|
|
248
|
-
{ x: 0, y: 0 },
|
|
249
|
-
{ x: n, y: -s },
|
|
250
|
-
{ x: n, y: -r + s },
|
|
251
|
-
{ x: 0, y: -r }
|
|
252
|
-
] : i.has("left") && i.has("up") && i.has("down") ? [
|
|
253
|
-
{ x: n, y: 0 },
|
|
254
|
-
{ x: 0, y: -s },
|
|
255
|
-
{ x: 0, y: -r + s },
|
|
256
|
-
{ x: n, y: -r }
|
|
257
|
-
] : i.has("right") && i.has("left") ? [
|
|
258
|
-
{ x: s, y: 0 },
|
|
259
|
-
{ x: s, y: -c },
|
|
260
|
-
{ x: n - s, y: -c },
|
|
261
|
-
{ x: n - s, y: 0 },
|
|
262
|
-
{ x: n, y: -r / 2 },
|
|
263
|
-
{ x: n - s, y: -r },
|
|
264
|
-
{ x: n - s, y: -r + c },
|
|
265
|
-
{ x: s, y: -r + c },
|
|
266
|
-
{ x: s, y: -r },
|
|
267
|
-
{ x: 0, y: -r / 2 }
|
|
268
|
-
] : i.has("up") && i.has("down") ? [
|
|
269
|
-
// Bottom center
|
|
270
|
-
{ x: n / 2, y: 0 },
|
|
271
|
-
// Left pont of bottom arrow
|
|
272
|
-
{ x: 0, y: -c },
|
|
273
|
-
{ x: s, y: -c },
|
|
274
|
-
// Left top over vertical section
|
|
275
|
-
{ x: s, y: -r + c },
|
|
276
|
-
{ x: 0, y: -r + c },
|
|
277
|
-
// Top of arrow
|
|
278
|
-
{ x: n / 2, y: -r },
|
|
279
|
-
{ x: n, y: -r + c },
|
|
280
|
-
// Top of right vertical bar
|
|
281
|
-
{ x: n - s, y: -r + c },
|
|
282
|
-
{ x: n - s, y: -c },
|
|
283
|
-
{ x: n, y: -c }
|
|
284
|
-
] : i.has("right") && i.has("up") ? [
|
|
285
|
-
{ x: 0, y: 0 },
|
|
286
|
-
{ x: n, y: -s },
|
|
287
|
-
{ x: 0, y: -r }
|
|
288
|
-
] : i.has("right") && i.has("down") ? [
|
|
289
|
-
{ x: 0, y: 0 },
|
|
290
|
-
{ x: n, y: 0 },
|
|
291
|
-
{ x: 0, y: -r }
|
|
292
|
-
] : i.has("left") && i.has("up") ? [
|
|
293
|
-
{ x: n, y: 0 },
|
|
294
|
-
{ x: 0, y: -s },
|
|
295
|
-
{ x: n, y: -r }
|
|
296
|
-
] : i.has("left") && i.has("down") ? [
|
|
297
|
-
{ x: n, y: 0 },
|
|
298
|
-
{ x: 0, y: 0 },
|
|
299
|
-
{ x: n, y: -r }
|
|
300
|
-
] : i.has("right") ? [
|
|
301
|
-
{ x: s, y: -c },
|
|
302
|
-
{ x: s, y: -c },
|
|
303
|
-
{ x: n - s, y: -c },
|
|
304
|
-
{ x: n - s, y: 0 },
|
|
305
|
-
{ x: n, y: -r / 2 },
|
|
306
|
-
{ x: n - s, y: -r },
|
|
307
|
-
{ x: n - s, y: -r + c },
|
|
308
|
-
// top left corner of arrow
|
|
309
|
-
{ x: s, y: -r + c },
|
|
310
|
-
{ x: s, y: -r + c }
|
|
311
|
-
] : i.has("left") ? [
|
|
312
|
-
{ x: s, y: 0 },
|
|
313
|
-
{ x: s, y: -c },
|
|
314
|
-
// Two points, the right corners
|
|
315
|
-
{ x: n - s, y: -c },
|
|
316
|
-
{ x: n - s, y: -r + c },
|
|
317
|
-
{ x: s, y: -r + c },
|
|
318
|
-
{ x: s, y: -r },
|
|
319
|
-
{ x: 0, y: -r / 2 }
|
|
320
|
-
] : i.has("up") ? [
|
|
321
|
-
// Bottom center
|
|
322
|
-
{ x: s, y: -c },
|
|
323
|
-
// Left top over vertical section
|
|
324
|
-
{ x: s, y: -r + c },
|
|
325
|
-
{ x: 0, y: -r + c },
|
|
326
|
-
// Top of arrow
|
|
327
|
-
{ x: n / 2, y: -r },
|
|
328
|
-
{ x: n, y: -r + c },
|
|
329
|
-
// Top of right vertical bar
|
|
330
|
-
{ x: n - s, y: -r + c },
|
|
331
|
-
{ x: n - s, y: -c }
|
|
332
|
-
] : i.has("down") ? [
|
|
333
|
-
// Bottom center
|
|
334
|
-
{ x: n / 2, y: 0 },
|
|
335
|
-
// Left pont of bottom arrow
|
|
336
|
-
{ x: 0, y: -c },
|
|
337
|
-
{ x: s, y: -c },
|
|
338
|
-
// Left top over vertical section
|
|
339
|
-
{ x: s, y: -r + c },
|
|
340
|
-
{ x: n - s, y: -r + c },
|
|
341
|
-
{ x: n - s, y: -c },
|
|
342
|
-
{ x: n, y: -c }
|
|
343
|
-
] : [{ x: 0, y: 0 }];
|
|
344
|
-
}, K = (a) => a ? " " + a : "", _ = (a, t) => `node default${K(a.classes)} ${K(
|
|
345
|
-
a.class
|
|
346
|
-
)}`, P = async (a, t) => {
|
|
347
|
-
const { shapeSvg: e, bbox: i } = await M(
|
|
348
|
-
a,
|
|
349
|
-
t,
|
|
350
|
-
_(t),
|
|
351
|
-
!0
|
|
352
|
-
), l = i.width + t.padding, r = i.height + t.padding, s = l + r, n = [
|
|
353
|
-
{ x: s / 2, y: 0 },
|
|
354
|
-
{ x: s, y: -s / 2 },
|
|
355
|
-
{ x: s / 2, y: -s },
|
|
356
|
-
{ x: 0, y: -s / 2 }
|
|
357
|
-
];
|
|
358
|
-
g.info("Question main (Circle)");
|
|
359
|
-
const c = I(e, s, s, n);
|
|
360
|
-
return c.attr("style", t.style), m(t, c), t.intersect = function(o) {
|
|
361
|
-
return g.warn("Intersect called"), w.polygon(t, n, o);
|
|
362
|
-
}, e;
|
|
363
|
-
}, Ht = (a, t) => {
|
|
364
|
-
const e = a.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = 28, l = [
|
|
365
|
-
{ x: 0, y: i / 2 },
|
|
366
|
-
{ x: i / 2, y: 0 },
|
|
367
|
-
{ x: 0, y: -i / 2 },
|
|
368
|
-
{ x: -i / 2, y: 0 }
|
|
369
|
-
];
|
|
370
|
-
return e.insert("polygon", ":first-child").attr(
|
|
371
|
-
"points",
|
|
372
|
-
l.map(function(s) {
|
|
373
|
-
return s.x + "," + s.y;
|
|
374
|
-
}).join(" ")
|
|
375
|
-
).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(s) {
|
|
376
|
-
return w.circle(t, 14, s);
|
|
377
|
-
}, e;
|
|
378
|
-
}, It = async (a, t) => {
|
|
379
|
-
const { shapeSvg: e, bbox: i } = await M(
|
|
380
|
-
a,
|
|
381
|
-
t,
|
|
382
|
-
_(t),
|
|
383
|
-
!0
|
|
384
|
-
), l = 4, r = i.height + t.padding, s = r / l, n = i.width + 2 * s + t.padding, c = [
|
|
385
|
-
{ x: s, y: 0 },
|
|
386
|
-
{ x: n - s, y: 0 },
|
|
387
|
-
{ x: n, y: -r / 2 },
|
|
388
|
-
{ x: n - s, y: -r },
|
|
389
|
-
{ x: s, y: -r },
|
|
390
|
-
{ x: 0, y: -r / 2 }
|
|
391
|
-
], o = I(e, n, r, c);
|
|
392
|
-
return o.attr("style", t.style), m(t, o), t.intersect = function(h) {
|
|
393
|
-
return w.polygon(t, c, h);
|
|
394
|
-
}, e;
|
|
395
|
-
}, Nt = async (a, t) => {
|
|
396
|
-
const { shapeSvg: e, bbox: i } = await M(a, t, void 0, !0), l = 2, r = i.height + 2 * t.padding, s = r / l, n = i.width + 2 * s + t.padding, c = Rt(t.directions, i, t), o = I(e, n, r, c);
|
|
397
|
-
return o.attr("style", t.style), m(t, o), t.intersect = function(h) {
|
|
398
|
-
return w.polygon(t, c, h);
|
|
399
|
-
}, e;
|
|
400
|
-
}, Ot = async (a, t) => {
|
|
401
|
-
const { shapeSvg: e, bbox: i } = await M(
|
|
402
|
-
a,
|
|
403
|
-
t,
|
|
404
|
-
_(t),
|
|
405
|
-
!0
|
|
406
|
-
), l = i.width + t.padding, r = i.height + t.padding, s = [
|
|
407
|
-
{ x: -r / 2, y: 0 },
|
|
408
|
-
{ x: l, y: 0 },
|
|
409
|
-
{ x: l, y: -r },
|
|
410
|
-
{ x: -r / 2, y: -r },
|
|
411
|
-
{ x: 0, y: -r / 2 }
|
|
412
|
-
];
|
|
413
|
-
return I(e, l, r, s).attr("style", t.style), t.width = l + r, t.height = r, t.intersect = function(c) {
|
|
414
|
-
return w.polygon(t, s, c);
|
|
415
|
-
}, e;
|
|
416
|
-
}, Wt = async (a, t) => {
|
|
417
|
-
const { shapeSvg: e, bbox: i } = await M(a, t, _(t), !0), l = i.width + t.padding, r = i.height + t.padding, s = [
|
|
418
|
-
{ x: -2 * r / 6, y: 0 },
|
|
419
|
-
{ x: l - r / 6, y: 0 },
|
|
420
|
-
{ x: l + 2 * r / 6, y: -r },
|
|
421
|
-
{ x: r / 6, y: -r }
|
|
422
|
-
], n = I(e, l, r, s);
|
|
423
|
-
return n.attr("style", t.style), m(t, n), t.intersect = function(c) {
|
|
424
|
-
return w.polygon(t, s, c);
|
|
425
|
-
}, e;
|
|
426
|
-
}, Xt = async (a, t) => {
|
|
427
|
-
const { shapeSvg: e, bbox: i } = await M(
|
|
428
|
-
a,
|
|
429
|
-
t,
|
|
430
|
-
_(t),
|
|
431
|
-
!0
|
|
432
|
-
), l = i.width + t.padding, r = i.height + t.padding, s = [
|
|
433
|
-
{ x: 2 * r / 6, y: 0 },
|
|
434
|
-
{ x: l + r / 6, y: 0 },
|
|
435
|
-
{ x: l - 2 * r / 6, y: -r },
|
|
436
|
-
{ x: -r / 6, y: -r }
|
|
437
|
-
], n = I(e, l, r, s);
|
|
438
|
-
return n.attr("style", t.style), m(t, n), t.intersect = function(c) {
|
|
439
|
-
return w.polygon(t, s, c);
|
|
440
|
-
}, e;
|
|
441
|
-
}, Yt = async (a, t) => {
|
|
442
|
-
const { shapeSvg: e, bbox: i } = await M(
|
|
443
|
-
a,
|
|
444
|
-
t,
|
|
445
|
-
_(t),
|
|
446
|
-
!0
|
|
447
|
-
), l = i.width + t.padding, r = i.height + t.padding, s = [
|
|
448
|
-
{ x: -2 * r / 6, y: 0 },
|
|
449
|
-
{ x: l + 2 * r / 6, y: 0 },
|
|
450
|
-
{ x: l - r / 6, y: -r },
|
|
451
|
-
{ x: r / 6, y: -r }
|
|
452
|
-
], n = I(e, l, r, s);
|
|
453
|
-
return n.attr("style", t.style), m(t, n), t.intersect = function(c) {
|
|
454
|
-
return w.polygon(t, s, c);
|
|
455
|
-
}, e;
|
|
456
|
-
}, Dt = async (a, t) => {
|
|
457
|
-
const { shapeSvg: e, bbox: i } = await M(
|
|
458
|
-
a,
|
|
459
|
-
t,
|
|
460
|
-
_(t),
|
|
461
|
-
!0
|
|
462
|
-
), l = i.width + t.padding, r = i.height + t.padding, s = [
|
|
463
|
-
{ x: r / 6, y: 0 },
|
|
464
|
-
{ x: l - r / 6, y: 0 },
|
|
465
|
-
{ x: l + 2 * r / 6, y: -r },
|
|
466
|
-
{ x: -2 * r / 6, y: -r }
|
|
467
|
-
], n = I(e, l, r, s);
|
|
468
|
-
return n.attr("style", t.style), m(t, n), t.intersect = function(c) {
|
|
469
|
-
return w.polygon(t, s, c);
|
|
470
|
-
}, e;
|
|
471
|
-
}, At = async (a, t) => {
|
|
472
|
-
const { shapeSvg: e, bbox: i } = await M(
|
|
473
|
-
a,
|
|
474
|
-
t,
|
|
475
|
-
_(t),
|
|
476
|
-
!0
|
|
477
|
-
), l = i.width + t.padding, r = i.height + t.padding, s = [
|
|
478
|
-
{ x: 0, y: 0 },
|
|
479
|
-
{ x: l + r / 2, y: 0 },
|
|
480
|
-
{ x: l, y: -r / 2 },
|
|
481
|
-
{ x: l + r / 2, y: -r },
|
|
482
|
-
{ x: 0, y: -r }
|
|
483
|
-
], n = I(e, l, r, s);
|
|
484
|
-
return n.attr("style", t.style), m(t, n), t.intersect = function(c) {
|
|
485
|
-
return w.polygon(t, s, c);
|
|
486
|
-
}, e;
|
|
487
|
-
}, jt = async (a, t) => {
|
|
488
|
-
const { shapeSvg: e, bbox: i } = await M(
|
|
489
|
-
a,
|
|
490
|
-
t,
|
|
491
|
-
_(t),
|
|
492
|
-
!0
|
|
493
|
-
), l = i.width + t.padding, r = l / 2, s = r / (2.5 + l / 50), n = i.height + s + t.padding, c = "M 0," + s + " a " + r + "," + s + " 0,0,0 " + l + " 0 a " + r + "," + s + " 0,0,0 " + -l + " 0 l 0," + n + " a " + r + "," + s + " 0,0,0 " + l + " 0 l 0," + -n, o = e.attr("label-offset-y", s).insert("path", ":first-child").attr("style", t.style).attr("d", c).attr("transform", "translate(" + -l / 2 + "," + -(n / 2 + s) + ")");
|
|
494
|
-
return m(t, o), t.intersect = function(h) {
|
|
495
|
-
const y = w.rect(t, h), f = y.x - t.x;
|
|
496
|
-
if (r != 0 && (Math.abs(f) < t.width / 2 || Math.abs(f) == t.width / 2 && Math.abs(y.y - t.y) > t.height / 2 - s)) {
|
|
497
|
-
let p = s * s * (1 - f * f / (r * r));
|
|
498
|
-
p != 0 && (p = Math.sqrt(p)), p = s - p, h.y - t.y > 0 && (p = -p), y.y += p;
|
|
499
|
-
}
|
|
500
|
-
return y;
|
|
501
|
-
}, e;
|
|
502
|
-
}, Ut = async (a, t) => {
|
|
503
|
-
const { shapeSvg: e, bbox: i, halfPadding: l } = await M(
|
|
504
|
-
a,
|
|
505
|
-
t,
|
|
506
|
-
"node " + t.classes + " " + t.class,
|
|
507
|
-
!0
|
|
508
|
-
), r = e.insert("rect", ":first-child"), s = t.positioned ? t.width : i.width + t.padding, n = t.positioned ? t.height : i.height + t.padding, c = t.positioned ? -s / 2 : -i.width / 2 - l, o = t.positioned ? -n / 2 : -i.height / 2 - l;
|
|
509
|
-
if (r.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", c).attr("y", o).attr("width", s).attr("height", n), t.props) {
|
|
510
|
-
const h = new Set(Object.keys(t.props));
|
|
511
|
-
t.props.borders && (q(r, t.props.borders, s, n), h.delete("borders")), h.forEach((y) => {
|
|
512
|
-
g.warn(`Unknown node property ${y}`);
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
return m(t, r), t.intersect = function(h) {
|
|
516
|
-
return w.rect(t, h);
|
|
517
|
-
}, e;
|
|
518
|
-
}, zt = async (a, t) => {
|
|
519
|
-
const { shapeSvg: e, bbox: i, halfPadding: l } = await M(
|
|
520
|
-
a,
|
|
521
|
-
t,
|
|
522
|
-
"node " + t.classes,
|
|
523
|
-
!0
|
|
524
|
-
), r = e.insert("rect", ":first-child"), s = t.positioned ? t.width : i.width + t.padding, n = t.positioned ? t.height : i.height + t.padding, c = t.positioned ? -s / 2 : -i.width / 2 - l, o = t.positioned ? -n / 2 : -i.height / 2 - l;
|
|
525
|
-
if (r.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", c).attr("y", o).attr("width", s).attr("height", n), t.props) {
|
|
526
|
-
const h = new Set(Object.keys(t.props));
|
|
527
|
-
t.props.borders && (q(r, t.props.borders, s, n), h.delete("borders")), h.forEach((y) => {
|
|
528
|
-
g.warn(`Unknown node property ${y}`);
|
|
529
|
-
});
|
|
530
|
-
}
|
|
531
|
-
return m(t, r), t.intersect = function(h) {
|
|
532
|
-
return w.rect(t, h);
|
|
533
|
-
}, e;
|
|
534
|
-
}, Zt = async (a, t) => {
|
|
535
|
-
const { shapeSvg: e } = await M(a, t, "label", !0);
|
|
536
|
-
g.trace("Classes = ", t.class);
|
|
537
|
-
const i = e.insert("rect", ":first-child"), l = 0, r = 0;
|
|
538
|
-
if (i.attr("width", l).attr("height", r), e.attr("class", "label edgeLabel"), t.props) {
|
|
539
|
-
const s = new Set(Object.keys(t.props));
|
|
540
|
-
t.props.borders && (q(i, t.props.borders, l, r), s.delete("borders")), s.forEach((n) => {
|
|
541
|
-
g.warn(`Unknown node property ${n}`);
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
return m(t, i), t.intersect = function(s) {
|
|
545
|
-
return w.rect(t, s);
|
|
546
|
-
}, e;
|
|
547
|
-
};
|
|
548
|
-
function q(a, t, e, i) {
|
|
549
|
-
const l = [], r = (n) => {
|
|
550
|
-
l.push(n, 0);
|
|
551
|
-
}, s = (n) => {
|
|
552
|
-
l.push(0, n);
|
|
553
|
-
};
|
|
554
|
-
t.includes("t") ? (g.debug("add top border"), r(e)) : s(e), t.includes("r") ? (g.debug("add right border"), r(i)) : s(i), t.includes("b") ? (g.debug("add bottom border"), r(e)) : s(e), t.includes("l") ? (g.debug("add left border"), r(i)) : s(i), a.attr("stroke-dasharray", l.join(" "));
|
|
555
|
-
}
|
|
556
|
-
const Gt = (a, t) => {
|
|
557
|
-
let e;
|
|
558
|
-
t.classes ? e = "node " + t.classes : e = "node default";
|
|
559
|
-
const i = a.insert("g").attr("class", e).attr("id", t.domId || t.id), l = i.insert("rect", ":first-child"), r = i.insert("line"), s = i.insert("g").attr("class", "label"), n = t.labelText.flat ? t.labelText.flat() : t.labelText;
|
|
560
|
-
let c = "";
|
|
561
|
-
typeof n == "object" ? c = n[0] : c = n, g.info("Label text abc79", c, n, typeof n == "object");
|
|
562
|
-
const o = s.node().appendChild(R(c, t.labelStyle, !0, !0));
|
|
563
|
-
let h = { width: 0, height: 0 };
|
|
564
|
-
if (H(b().flowchart.htmlLabels)) {
|
|
565
|
-
const k = o.children[0], x = E(o);
|
|
566
|
-
h = k.getBoundingClientRect(), x.attr("width", h.width), x.attr("height", h.height);
|
|
567
|
-
}
|
|
568
|
-
g.info("Text 2", n);
|
|
569
|
-
const y = n.slice(1, n.length);
|
|
570
|
-
let f = o.getBBox();
|
|
571
|
-
const p = s.node().appendChild(
|
|
572
|
-
R(y.join ? y.join("<br/>") : y, t.labelStyle, !0, !0)
|
|
573
|
-
);
|
|
574
|
-
if (H(b().flowchart.htmlLabels)) {
|
|
575
|
-
const k = p.children[0], x = E(p);
|
|
576
|
-
h = k.getBoundingClientRect(), x.attr("width", h.width), x.attr("height", h.height);
|
|
577
|
-
}
|
|
578
|
-
const d = t.padding / 2;
|
|
579
|
-
return E(p).attr(
|
|
580
|
-
"transform",
|
|
581
|
-
"translate( " + // (titleBox.width - bbox.width) / 2 +
|
|
582
|
-
(h.width > f.width ? 0 : (f.width - h.width) / 2) + ", " + (f.height + d + 5) + ")"
|
|
583
|
-
), E(o).attr(
|
|
584
|
-
"transform",
|
|
585
|
-
"translate( " + // (titleBox.width - bbox.width) / 2 +
|
|
586
|
-
(h.width < f.width ? 0 : -(f.width - h.width) / 2) + ", 0)"
|
|
587
|
-
), h = s.node().getBBox(), s.attr(
|
|
588
|
-
"transform",
|
|
589
|
-
"translate(" + -h.width / 2 + ", " + (-h.height / 2 - d + 3) + ")"
|
|
590
|
-
), l.attr("class", "outer title-state").attr("x", -h.width / 2 - d).attr("y", -h.height / 2 - d).attr("width", h.width + t.padding).attr("height", h.height + t.padding), r.attr("class", "divider").attr("x1", -h.width / 2 - d).attr("x2", h.width / 2 + d).attr("y1", -h.height / 2 - d + f.height + d).attr("y2", -h.height / 2 - d + f.height + d), m(t, l), t.intersect = function(k) {
|
|
591
|
-
return w.rect(t, k);
|
|
592
|
-
}, i;
|
|
593
|
-
}, Ft = async (a, t) => {
|
|
594
|
-
const { shapeSvg: e, bbox: i } = await M(
|
|
595
|
-
a,
|
|
596
|
-
t,
|
|
597
|
-
_(t),
|
|
598
|
-
!0
|
|
599
|
-
), l = i.height + t.padding, r = i.width + l / 4 + t.padding, s = e.insert("rect", ":first-child").attr("style", t.style).attr("rx", l / 2).attr("ry", l / 2).attr("x", -r / 2).attr("y", -l / 2).attr("width", r).attr("height", l);
|
|
600
|
-
return m(t, s), t.intersect = function(n) {
|
|
601
|
-
return w.rect(t, n);
|
|
602
|
-
}, e;
|
|
603
|
-
}, Qt = async (a, t) => {
|
|
604
|
-
const { shapeSvg: e, bbox: i, halfPadding: l } = await M(
|
|
605
|
-
a,
|
|
606
|
-
t,
|
|
607
|
-
_(t),
|
|
608
|
-
!0
|
|
609
|
-
), r = e.insert("circle", ":first-child");
|
|
610
|
-
return r.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), g.info("Circle main"), m(t, r), t.intersect = function(s) {
|
|
611
|
-
return g.info("Circle intersect", t, i.width / 2 + l, s), w.circle(t, i.width / 2 + l, s);
|
|
612
|
-
}, e;
|
|
613
|
-
}, Vt = async (a, t) => {
|
|
614
|
-
const { shapeSvg: e, bbox: i, halfPadding: l } = await M(
|
|
615
|
-
a,
|
|
616
|
-
t,
|
|
617
|
-
_(t),
|
|
618
|
-
!0
|
|
619
|
-
), r = 5, s = e.insert("g", ":first-child"), n = s.insert("circle"), c = s.insert("circle");
|
|
620
|
-
return s.attr("class", t.class), n.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l + r).attr("width", i.width + t.padding + r * 2).attr("height", i.height + t.padding + r * 2), c.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), g.info("DoubleCircle main"), m(t, n), t.intersect = function(o) {
|
|
621
|
-
return g.info("DoubleCircle intersect", t, i.width / 2 + l + r, o), w.circle(t, i.width / 2 + l + r, o);
|
|
622
|
-
}, e;
|
|
623
|
-
}, qt = async (a, t) => {
|
|
624
|
-
const { shapeSvg: e, bbox: i } = await M(
|
|
625
|
-
a,
|
|
626
|
-
t,
|
|
627
|
-
_(t),
|
|
628
|
-
!0
|
|
629
|
-
), l = i.width + t.padding, r = i.height + t.padding, s = [
|
|
630
|
-
{ x: 0, y: 0 },
|
|
631
|
-
{ x: l, y: 0 },
|
|
632
|
-
{ x: l, y: -r },
|
|
633
|
-
{ x: 0, y: -r },
|
|
634
|
-
{ x: 0, y: 0 },
|
|
635
|
-
{ x: -8, y: 0 },
|
|
636
|
-
{ x: l + 8, y: 0 },
|
|
637
|
-
{ x: l + 8, y: -r },
|
|
638
|
-
{ x: -8, y: -r },
|
|
639
|
-
{ x: -8, y: 0 }
|
|
640
|
-
], n = I(e, l, r, s);
|
|
641
|
-
return n.attr("style", t.style), m(t, n), t.intersect = function(c) {
|
|
642
|
-
return w.polygon(t, s, c);
|
|
643
|
-
}, e;
|
|
644
|
-
}, Jt = (a, t) => {
|
|
645
|
-
const e = a.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = e.insert("circle", ":first-child");
|
|
646
|
-
return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), m(t, i), t.intersect = function(l) {
|
|
647
|
-
return w.circle(t, 7, l);
|
|
648
|
-
}, e;
|
|
649
|
-
}, tt = (a, t, e) => {
|
|
650
|
-
const i = a.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
|
|
651
|
-
let l = 70, r = 10;
|
|
652
|
-
e === "LR" && (l = 10, r = 70);
|
|
653
|
-
const s = i.append("rect").attr("x", -1 * l / 2).attr("y", -1 * r / 2).attr("width", l).attr("height", r).attr("class", "fork-join");
|
|
654
|
-
return m(t, s), t.height = t.height + t.padding / 2, t.width = t.width + t.padding / 2, t.intersect = function(n) {
|
|
655
|
-
return w.rect(t, n);
|
|
656
|
-
}, i;
|
|
657
|
-
}, Kt = (a, t) => {
|
|
658
|
-
const e = a.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = e.insert("circle", ":first-child"), l = e.insert("circle", ":first-child");
|
|
659
|
-
return l.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), i.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), m(t, l), t.intersect = function(r) {
|
|
660
|
-
return w.circle(t, 7, r);
|
|
661
|
-
}, e;
|
|
662
|
-
}, Pt = (a, t) => {
|
|
663
|
-
const e = t.padding / 2, i = 4, l = 8;
|
|
664
|
-
let r;
|
|
665
|
-
t.classes ? r = "node " + t.classes : r = "node default";
|
|
666
|
-
const s = a.insert("g").attr("class", r).attr("id", t.domId || t.id), n = s.insert("rect", ":first-child"), c = s.insert("line"), o = s.insert("line");
|
|
667
|
-
let h = 0, y = i;
|
|
668
|
-
const f = s.insert("g").attr("class", "label");
|
|
669
|
-
let p = 0;
|
|
670
|
-
const d = t.classData.annotations && t.classData.annotations[0], k = t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", x = f.node().appendChild(R(k, t.labelStyle, !0, !0));
|
|
671
|
-
let u = x.getBBox();
|
|
672
|
-
if (H(b().flowchart.htmlLabels)) {
|
|
673
|
-
const v = x.children[0], L = E(x);
|
|
674
|
-
u = v.getBoundingClientRect(), L.attr("width", u.width), L.attr("height", u.height);
|
|
675
|
-
}
|
|
676
|
-
t.classData.annotations[0] && (y += u.height + i, h += u.width);
|
|
677
|
-
let S = t.classData.label;
|
|
678
|
-
t.classData.type !== void 0 && t.classData.type !== "" && (b().flowchart.htmlLabels ? S += "<" + t.classData.type + ">" : S += "<" + t.classData.type + ">");
|
|
679
|
-
const B = f.node().appendChild(R(S, t.labelStyle, !0, !0));
|
|
680
|
-
E(B).attr("class", "classTitle");
|
|
681
|
-
let C = B.getBBox();
|
|
682
|
-
if (H(b().flowchart.htmlLabels)) {
|
|
683
|
-
const v = B.children[0], L = E(B);
|
|
684
|
-
C = v.getBoundingClientRect(), L.attr("width", C.width), L.attr("height", C.height);
|
|
685
|
-
}
|
|
686
|
-
y += C.height + i, C.width > h && (h = C.width);
|
|
687
|
-
const X = [];
|
|
688
|
-
t.classData.members.forEach((v) => {
|
|
689
|
-
const L = v.getDisplayDetails();
|
|
690
|
-
let W = L.displayText;
|
|
691
|
-
b().flowchart.htmlLabels && (W = W.replace(/</g, "<").replace(/>/g, ">"));
|
|
692
|
-
const N = f.node().appendChild(
|
|
693
|
-
R(
|
|
694
|
-
W,
|
|
695
|
-
L.cssStyle ? L.cssStyle : t.labelStyle,
|
|
696
|
-
!0,
|
|
697
|
-
!0
|
|
698
|
-
)
|
|
699
|
-
);
|
|
700
|
-
let $ = N.getBBox();
|
|
701
|
-
if (H(b().flowchart.htmlLabels)) {
|
|
702
|
-
const F = N.children[0], A = E(N);
|
|
703
|
-
$ = F.getBoundingClientRect(), A.attr("width", $.width), A.attr("height", $.height);
|
|
704
|
-
}
|
|
705
|
-
$.width > h && (h = $.width), y += $.height + i, X.push(N);
|
|
706
|
-
}), y += l;
|
|
707
|
-
const D = [];
|
|
708
|
-
if (t.classData.methods.forEach((v) => {
|
|
709
|
-
const L = v.getDisplayDetails();
|
|
710
|
-
let W = L.displayText;
|
|
711
|
-
b().flowchart.htmlLabels && (W = W.replace(/</g, "<").replace(/>/g, ">"));
|
|
712
|
-
const N = f.node().appendChild(
|
|
713
|
-
R(
|
|
714
|
-
W,
|
|
715
|
-
L.cssStyle ? L.cssStyle : t.labelStyle,
|
|
716
|
-
!0,
|
|
717
|
-
!0
|
|
718
|
-
)
|
|
719
|
-
);
|
|
720
|
-
let $ = N.getBBox();
|
|
721
|
-
if (H(b().flowchart.htmlLabels)) {
|
|
722
|
-
const F = N.children[0], A = E(N);
|
|
723
|
-
$ = F.getBoundingClientRect(), A.attr("width", $.width), A.attr("height", $.height);
|
|
724
|
-
}
|
|
725
|
-
$.width > h && (h = $.width), y += $.height + i, D.push(N);
|
|
726
|
-
}), y += l, d) {
|
|
727
|
-
let v = (h - u.width) / 2;
|
|
728
|
-
E(x).attr(
|
|
729
|
-
"transform",
|
|
730
|
-
"translate( " + (-1 * h / 2 + v) + ", " + -1 * y / 2 + ")"
|
|
731
|
-
), p = u.height + i;
|
|
732
|
-
}
|
|
733
|
-
let nt = (h - C.width) / 2;
|
|
734
|
-
return E(B).attr(
|
|
735
|
-
"transform",
|
|
736
|
-
"translate( " + (-1 * h / 2 + nt) + ", " + (-1 * y / 2 + p) + ")"
|
|
737
|
-
), p += C.height + i, c.attr("class", "divider").attr("x1", -h / 2 - e).attr("x2", h / 2 + e).attr("y1", -y / 2 - e + l + p).attr("y2", -y / 2 - e + l + p), p += l, X.forEach((v) => {
|
|
738
|
-
E(v).attr(
|
|
739
|
-
"transform",
|
|
740
|
-
"translate( " + -h / 2 + ", " + (-1 * y / 2 + p + l / 2) + ")"
|
|
741
|
-
);
|
|
742
|
-
const L = v == null ? void 0 : v.getBBox();
|
|
743
|
-
p += ((L == null ? void 0 : L.height) ?? 0) + i;
|
|
744
|
-
}), p += l, o.attr("class", "divider").attr("x1", -h / 2 - e).attr("x2", h / 2 + e).attr("y1", -y / 2 - e + l + p).attr("y2", -y / 2 - e + l + p), p += l, D.forEach((v) => {
|
|
745
|
-
E(v).attr(
|
|
746
|
-
"transform",
|
|
747
|
-
"translate( " + -h / 2 + ", " + (-1 * y / 2 + p) + ")"
|
|
748
|
-
);
|
|
749
|
-
const L = v == null ? void 0 : v.getBBox();
|
|
750
|
-
p += ((L == null ? void 0 : L.height) ?? 0) + i;
|
|
751
|
-
}), n.attr("style", t.style).attr("class", "outer title-state").attr("x", -h / 2 - e).attr("y", -(y / 2) - e).attr("width", h + t.padding).attr("height", y + t.padding), m(t, n), t.intersect = function(v) {
|
|
752
|
-
return w.rect(t, v);
|
|
753
|
-
}, s;
|
|
754
|
-
}, rt = {
|
|
755
|
-
rhombus: P,
|
|
756
|
-
composite: zt,
|
|
757
|
-
question: P,
|
|
758
|
-
rect: Ut,
|
|
759
|
-
labelRect: Zt,
|
|
760
|
-
rectWithTitle: Gt,
|
|
761
|
-
choice: Ht,
|
|
762
|
-
circle: Qt,
|
|
763
|
-
doublecircle: Vt,
|
|
764
|
-
stadium: Ft,
|
|
765
|
-
hexagon: It,
|
|
766
|
-
block_arrow: Nt,
|
|
767
|
-
rect_left_inv_arrow: Ot,
|
|
768
|
-
lean_right: Wt,
|
|
769
|
-
lean_left: Xt,
|
|
770
|
-
trapezoid: Yt,
|
|
771
|
-
inv_trapezoid: Dt,
|
|
772
|
-
rect_right_inv_arrow: At,
|
|
773
|
-
cylinder: jt,
|
|
774
|
-
start: Jt,
|
|
775
|
-
end: Kt,
|
|
776
|
-
note: $t,
|
|
777
|
-
subroutine: qt,
|
|
778
|
-
fork: tt,
|
|
779
|
-
join: tt,
|
|
780
|
-
class_box: Pt
|
|
781
|
-
};
|
|
782
|
-
let Y = {};
|
|
783
|
-
const or = async (a, t, e) => {
|
|
784
|
-
let i, l;
|
|
785
|
-
if (t.link) {
|
|
786
|
-
let r;
|
|
787
|
-
b().securityLevel === "sandbox" ? r = "_top" : t.linkTarget && (r = t.linkTarget || "_blank"), i = a.insert("svg:a").attr("xlink:href", t.link).attr("target", r), l = await rt[t.shape](i, t, e);
|
|
788
|
-
} else
|
|
789
|
-
l = await rt[t.shape](a, t, e), i = l;
|
|
790
|
-
return t.tooltip && l.attr("title", t.tooltip), t.class && l.attr("class", "node default " + t.class), i.attr("data-node", "true"), i.attr("data-id", t.id), Y[t.id] = i, t.haveCallback && Y[t.id].attr("class", Y[t.id].attr("class") + " clickable"), i;
|
|
791
|
-
}, yr = (a, t) => {
|
|
792
|
-
Y[t.id] = a;
|
|
793
|
-
}, pr = () => {
|
|
794
|
-
Y = {};
|
|
795
|
-
}, fr = (a) => {
|
|
796
|
-
const t = Y[a.id];
|
|
797
|
-
g.trace(
|
|
798
|
-
"Transforming node",
|
|
799
|
-
a.diff,
|
|
800
|
-
a,
|
|
801
|
-
"translate(" + (a.x - a.width / 2 - 5) + ", " + a.width / 2 + ")"
|
|
802
|
-
);
|
|
803
|
-
const e = 8, i = a.diff || 0;
|
|
804
|
-
return a.clusterNode ? t.attr(
|
|
805
|
-
"transform",
|
|
806
|
-
"translate(" + (a.x + i - a.width / 2) + ", " + (a.y - a.height / 2 - e) + ")"
|
|
807
|
-
) : t.attr("transform", "translate(" + a.x + ", " + a.y + ")"), i;
|
|
808
|
-
}, tr = ({
|
|
809
|
-
flowchart: a
|
|
810
|
-
}) => {
|
|
811
|
-
var t, e;
|
|
812
|
-
const i = ((t = a == null ? void 0 : a.subGraphTitleMargin) == null ? void 0 : t.top) ?? 0, l = ((e = a == null ? void 0 : a.subGraphTitleMargin) == null ? void 0 : e.bottom) ?? 0, r = i + l;
|
|
813
|
-
return {
|
|
814
|
-
subGraphTitleTopMargin: i,
|
|
815
|
-
subGraphTitleBottomMargin: l,
|
|
816
|
-
subGraphTitleTotalMargin: r
|
|
817
|
-
};
|
|
818
|
-
}, O = {
|
|
819
|
-
aggregation: 18,
|
|
820
|
-
extension: 18,
|
|
821
|
-
composition: 18,
|
|
822
|
-
dependency: 6,
|
|
823
|
-
lollipop: 13.5,
|
|
824
|
-
arrow_point: 5.3
|
|
825
|
-
};
|
|
826
|
-
function U(a, t) {
|
|
827
|
-
if (a === void 0 || t === void 0)
|
|
828
|
-
return { angle: 0, deltaX: 0, deltaY: 0 };
|
|
829
|
-
a = Z(a), t = Z(t);
|
|
830
|
-
const [e, i] = [a.x, a.y], [l, r] = [t.x, t.y], s = l - e, n = r - i;
|
|
831
|
-
return { angle: Math.atan(n / s), deltaX: s, deltaY: n };
|
|
832
|
-
}
|
|
833
|
-
const Z = (a) => Array.isArray(a) ? { x: a[0], y: a[1] } : a, rr = (a) => ({
|
|
834
|
-
x: function(t, e, i) {
|
|
835
|
-
let l = 0;
|
|
836
|
-
if (e === 0 && Object.hasOwn(O, a.arrowTypeStart)) {
|
|
837
|
-
const { angle: r, deltaX: s } = U(i[0], i[1]);
|
|
838
|
-
l = O[a.arrowTypeStart] * Math.cos(r) * (s >= 0 ? 1 : -1);
|
|
839
|
-
} else if (e === i.length - 1 && Object.hasOwn(O, a.arrowTypeEnd)) {
|
|
840
|
-
const { angle: r, deltaX: s } = U(
|
|
841
|
-
i[i.length - 1],
|
|
842
|
-
i[i.length - 2]
|
|
843
|
-
);
|
|
844
|
-
l = O[a.arrowTypeEnd] * Math.cos(r) * (s >= 0 ? 1 : -1);
|
|
845
|
-
}
|
|
846
|
-
return Z(t).x + l;
|
|
847
|
-
},
|
|
848
|
-
y: function(t, e, i) {
|
|
849
|
-
let l = 0;
|
|
850
|
-
if (e === 0 && Object.hasOwn(O, a.arrowTypeStart)) {
|
|
851
|
-
const { angle: r, deltaY: s } = U(i[0], i[1]);
|
|
852
|
-
l = O[a.arrowTypeStart] * Math.abs(Math.sin(r)) * (s >= 0 ? 1 : -1);
|
|
853
|
-
} else if (e === i.length - 1 && Object.hasOwn(O, a.arrowTypeEnd)) {
|
|
854
|
-
const { angle: r, deltaY: s } = U(
|
|
855
|
-
i[i.length - 1],
|
|
856
|
-
i[i.length - 2]
|
|
857
|
-
);
|
|
858
|
-
l = O[a.arrowTypeEnd] * Math.abs(Math.sin(r)) * (s >= 0 ? 1 : -1);
|
|
859
|
-
}
|
|
860
|
-
return Z(t).y + l;
|
|
861
|
-
}
|
|
862
|
-
}), ar = (a, t, e, i, l) => {
|
|
863
|
-
t.arrowTypeStart && at(a, "start", t.arrowTypeStart, e, i, l), t.arrowTypeEnd && at(a, "end", t.arrowTypeEnd, e, i, l);
|
|
864
|
-
}, er = {
|
|
865
|
-
arrow_cross: "cross",
|
|
866
|
-
arrow_point: "point",
|
|
867
|
-
arrow_barb: "barb",
|
|
868
|
-
arrow_circle: "circle",
|
|
869
|
-
aggregation: "aggregation",
|
|
870
|
-
extension: "extension",
|
|
871
|
-
composition: "composition",
|
|
872
|
-
dependency: "dependency",
|
|
873
|
-
lollipop: "lollipop"
|
|
874
|
-
}, at = (a, t, e, i, l, r) => {
|
|
875
|
-
const s = er[e];
|
|
876
|
-
if (!s) {
|
|
877
|
-
g.warn(`Unknown arrow type: ${e}`);
|
|
878
|
-
return;
|
|
879
|
-
}
|
|
880
|
-
const n = t === "start" ? "Start" : "End";
|
|
881
|
-
a.attr(`marker-${t}`, `url(${i}#${l}_${r}-${s}${n})`);
|
|
882
|
-
};
|
|
883
|
-
let G = {}, T = {};
|
|
884
|
-
const xr = () => {
|
|
885
|
-
G = {}, T = {};
|
|
886
|
-
}, dr = (a, t) => {
|
|
887
|
-
const e = H(b().flowchart.htmlLabels), i = t.labelType === "markdown" ? st(a, t.label, {
|
|
888
|
-
style: t.labelStyle,
|
|
889
|
-
useHtmlLabels: e,
|
|
890
|
-
addSvgBackground: !0
|
|
891
|
-
}) : R(t.label, t.labelStyle), l = a.insert("g").attr("class", "edgeLabel"), r = l.insert("g").attr("class", "label");
|
|
892
|
-
r.node().appendChild(i);
|
|
893
|
-
let s = i.getBBox();
|
|
894
|
-
if (e) {
|
|
895
|
-
const c = i.children[0], o = E(i);
|
|
896
|
-
s = c.getBoundingClientRect(), o.attr("width", s.width), o.attr("height", s.height);
|
|
897
|
-
}
|
|
898
|
-
r.attr("transform", "translate(" + -s.width / 2 + ", " + -s.height / 2 + ")"), G[t.id] = l, t.width = s.width, t.height = s.height;
|
|
899
|
-
let n;
|
|
900
|
-
if (t.startLabelLeft) {
|
|
901
|
-
const c = R(t.startLabelLeft, t.labelStyle), o = a.insert("g").attr("class", "edgeTerminals"), h = o.insert("g").attr("class", "inner");
|
|
902
|
-
n = h.node().appendChild(c);
|
|
903
|
-
const y = c.getBBox();
|
|
904
|
-
h.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), T[t.id] || (T[t.id] = {}), T[t.id].startLeft = o, z(n, t.startLabelLeft);
|
|
905
|
-
}
|
|
906
|
-
if (t.startLabelRight) {
|
|
907
|
-
const c = R(t.startLabelRight, t.labelStyle), o = a.insert("g").attr("class", "edgeTerminals"), h = o.insert("g").attr("class", "inner");
|
|
908
|
-
n = o.node().appendChild(c), h.node().appendChild(c);
|
|
909
|
-
const y = c.getBBox();
|
|
910
|
-
h.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), T[t.id] || (T[t.id] = {}), T[t.id].startRight = o, z(n, t.startLabelRight);
|
|
911
|
-
}
|
|
912
|
-
if (t.endLabelLeft) {
|
|
913
|
-
const c = R(t.endLabelLeft, t.labelStyle), o = a.insert("g").attr("class", "edgeTerminals"), h = o.insert("g").attr("class", "inner");
|
|
914
|
-
n = h.node().appendChild(c);
|
|
915
|
-
const y = c.getBBox();
|
|
916
|
-
h.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), o.node().appendChild(c), T[t.id] || (T[t.id] = {}), T[t.id].endLeft = o, z(n, t.endLabelLeft);
|
|
917
|
-
}
|
|
918
|
-
if (t.endLabelRight) {
|
|
919
|
-
const c = R(t.endLabelRight, t.labelStyle), o = a.insert("g").attr("class", "edgeTerminals"), h = o.insert("g").attr("class", "inner");
|
|
920
|
-
n = h.node().appendChild(c);
|
|
921
|
-
const y = c.getBBox();
|
|
922
|
-
h.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), o.node().appendChild(c), T[t.id] || (T[t.id] = {}), T[t.id].endRight = o, z(n, t.endLabelRight);
|
|
923
|
-
}
|
|
924
|
-
return i;
|
|
925
|
-
};
|
|
926
|
-
function z(a, t) {
|
|
927
|
-
b().flowchart.htmlLabels && a && (a.style.width = t.length * 9 + "px", a.style.height = "12px");
|
|
928
|
-
}
|
|
929
|
-
const gr = (a, t) => {
|
|
930
|
-
g.debug("Moving label abc88 ", a.id, a.label, G[a.id], t);
|
|
931
|
-
let e = t.updatedPath ? t.updatedPath : t.originalPath;
|
|
932
|
-
const i = b(), { subGraphTitleTotalMargin: l } = tr(i);
|
|
933
|
-
if (a.label) {
|
|
934
|
-
const r = G[a.id];
|
|
935
|
-
let s = a.x, n = a.y;
|
|
936
|
-
if (e) {
|
|
937
|
-
const c = j.calcLabelPosition(e);
|
|
938
|
-
g.debug(
|
|
939
|
-
"Moving label " + a.label + " from (",
|
|
940
|
-
s,
|
|
941
|
-
",",
|
|
942
|
-
n,
|
|
943
|
-
") to (",
|
|
944
|
-
c.x,
|
|
945
|
-
",",
|
|
946
|
-
c.y,
|
|
947
|
-
") abc88"
|
|
948
|
-
), t.updatedPath && (s = c.x, n = c.y);
|
|
949
|
-
}
|
|
950
|
-
r.attr("transform", `translate(${s}, ${n + l / 2})`);
|
|
951
|
-
}
|
|
952
|
-
if (a.startLabelLeft) {
|
|
953
|
-
const r = T[a.id].startLeft;
|
|
954
|
-
let s = a.x, n = a.y;
|
|
955
|
-
if (e) {
|
|
956
|
-
const c = j.calcTerminalLabelPosition(a.arrowTypeStart ? 10 : 0, "start_left", e);
|
|
957
|
-
s = c.x, n = c.y;
|
|
958
|
-
}
|
|
959
|
-
r.attr("transform", `translate(${s}, ${n})`);
|
|
960
|
-
}
|
|
961
|
-
if (a.startLabelRight) {
|
|
962
|
-
const r = T[a.id].startRight;
|
|
963
|
-
let s = a.x, n = a.y;
|
|
964
|
-
if (e) {
|
|
965
|
-
const c = j.calcTerminalLabelPosition(
|
|
966
|
-
a.arrowTypeStart ? 10 : 0,
|
|
967
|
-
"start_right",
|
|
968
|
-
e
|
|
969
|
-
);
|
|
970
|
-
s = c.x, n = c.y;
|
|
971
|
-
}
|
|
972
|
-
r.attr("transform", `translate(${s}, ${n})`);
|
|
973
|
-
}
|
|
974
|
-
if (a.endLabelLeft) {
|
|
975
|
-
const r = T[a.id].endLeft;
|
|
976
|
-
let s = a.x, n = a.y;
|
|
977
|
-
if (e) {
|
|
978
|
-
const c = j.calcTerminalLabelPosition(a.arrowTypeEnd ? 10 : 0, "end_left", e);
|
|
979
|
-
s = c.x, n = c.y;
|
|
980
|
-
}
|
|
981
|
-
r.attr("transform", `translate(${s}, ${n})`);
|
|
982
|
-
}
|
|
983
|
-
if (a.endLabelRight) {
|
|
984
|
-
const r = T[a.id].endRight;
|
|
985
|
-
let s = a.x, n = a.y;
|
|
986
|
-
if (e) {
|
|
987
|
-
const c = j.calcTerminalLabelPosition(a.arrowTypeEnd ? 10 : 0, "end_right", e);
|
|
988
|
-
s = c.x, n = c.y;
|
|
989
|
-
}
|
|
990
|
-
r.attr("transform", `translate(${s}, ${n})`);
|
|
991
|
-
}
|
|
992
|
-
}, sr = (a, t) => {
|
|
993
|
-
const e = a.x, i = a.y, l = Math.abs(t.x - e), r = Math.abs(t.y - i), s = a.width / 2, n = a.height / 2;
|
|
994
|
-
return l >= s || r >= n;
|
|
995
|
-
}, ir = (a, t, e) => {
|
|
996
|
-
g.debug(`intersection calc abc89:
|
|
997
|
-
outsidePoint: ${JSON.stringify(t)}
|
|
998
|
-
insidePoint : ${JSON.stringify(e)}
|
|
999
|
-
node : x:${a.x} y:${a.y} w:${a.width} h:${a.height}`);
|
|
1000
|
-
const i = a.x, l = a.y, r = Math.abs(i - e.x), s = a.width / 2;
|
|
1001
|
-
let n = e.x < t.x ? s - r : s + r;
|
|
1002
|
-
const c = a.height / 2, o = Math.abs(t.y - e.y), h = Math.abs(t.x - e.x);
|
|
1003
|
-
if (Math.abs(l - t.y) * s > Math.abs(i - t.x) * c) {
|
|
1004
|
-
let y = e.y < t.y ? t.y - c - l : l - c - t.y;
|
|
1005
|
-
n = h * y / o;
|
|
1006
|
-
const f = {
|
|
1007
|
-
x: e.x < t.x ? e.x + n : e.x - h + n,
|
|
1008
|
-
y: e.y < t.y ? e.y + o - y : e.y - o + y
|
|
1009
|
-
};
|
|
1010
|
-
return n === 0 && (f.x = t.x, f.y = t.y), h === 0 && (f.x = t.x), o === 0 && (f.y = t.y), g.debug(`abc89 topp/bott calc, Q ${o}, q ${y}, R ${h}, r ${n}`, f), f;
|
|
1011
|
-
} else {
|
|
1012
|
-
e.x < t.x ? n = t.x - s - i : n = i - s - t.x;
|
|
1013
|
-
let y = o * n / h, f = e.x < t.x ? e.x + h - n : e.x - h + n, p = e.y < t.y ? e.y + y : e.y - y;
|
|
1014
|
-
return g.debug(`sides calc abc89, Q ${o}, q ${y}, R ${h}, r ${n}`, { _x: f, _y: p }), n === 0 && (f = t.x, p = t.y), h === 0 && (f = t.x), o === 0 && (p = t.y), { x: f, y: p };
|
|
1015
|
-
}
|
|
1016
|
-
}, et = (a, t) => {
|
|
1017
|
-
g.debug("abc88 cutPathAtIntersect", a, t);
|
|
1018
|
-
let e = [], i = a[0], l = !1;
|
|
1019
|
-
return a.forEach((r) => {
|
|
1020
|
-
if (!sr(t, r) && !l) {
|
|
1021
|
-
const s = ir(t, i, r);
|
|
1022
|
-
let n = !1;
|
|
1023
|
-
e.forEach((c) => {
|
|
1024
|
-
n = n || c.x === s.x && c.y === s.y;
|
|
1025
|
-
}), e.some((c) => c.x === s.x && c.y === s.y) || e.push(s), l = !0;
|
|
1026
|
-
} else
|
|
1027
|
-
i = r, l || e.push(r);
|
|
1028
|
-
}), e;
|
|
1029
|
-
}, ur = function(a, t, e, i, l, r, s) {
|
|
1030
|
-
let n = e.points;
|
|
1031
|
-
g.debug("abc88 InsertEdge: edge=", e, "e=", t);
|
|
1032
|
-
let c = !1;
|
|
1033
|
-
const o = r.node(t.v);
|
|
1034
|
-
var h = r.node(t.w);
|
|
1035
|
-
h != null && h.intersect && (o != null && o.intersect) && (n = n.slice(1, e.points.length - 1), n.unshift(o.intersect(n[0])), n.push(h.intersect(n[n.length - 1]))), e.toCluster && (g.debug("to cluster abc88", i[e.toCluster]), n = et(e.points, i[e.toCluster].node), c = !0), e.fromCluster && (g.debug("from cluster abc88", i[e.fromCluster]), n = et(n.reverse(), i[e.fromCluster].node).reverse(), c = !0);
|
|
1036
|
-
const y = n.filter((C) => !Number.isNaN(C.y));
|
|
1037
|
-
let f = lt;
|
|
1038
|
-
e.curve && (l === "graph" || l === "flowchart") && (f = e.curve);
|
|
1039
|
-
const { x: p, y: d } = rr(e), k = ct().x(p).y(d).curve(f);
|
|
1040
|
-
let x;
|
|
1041
|
-
switch (e.thickness) {
|
|
1042
|
-
case "normal":
|
|
1043
|
-
x = "edge-thickness-normal";
|
|
1044
|
-
break;
|
|
1045
|
-
case "thick":
|
|
1046
|
-
x = "edge-thickness-thick";
|
|
1047
|
-
break;
|
|
1048
|
-
case "invisible":
|
|
1049
|
-
x = "edge-thickness-thick";
|
|
1050
|
-
break;
|
|
1051
|
-
default:
|
|
1052
|
-
x = "";
|
|
1053
|
-
}
|
|
1054
|
-
switch (e.pattern) {
|
|
1055
|
-
case "solid":
|
|
1056
|
-
x += " edge-pattern-solid";
|
|
1057
|
-
break;
|
|
1058
|
-
case "dotted":
|
|
1059
|
-
x += " edge-pattern-dotted";
|
|
1060
|
-
break;
|
|
1061
|
-
case "dashed":
|
|
1062
|
-
x += " edge-pattern-dashed";
|
|
1063
|
-
break;
|
|
1064
|
-
}
|
|
1065
|
-
const u = a.append("path").attr("d", k(y)).attr("id", e.id).attr("class", " " + x + (e.classes ? " " + e.classes : "")).attr("style", e.style);
|
|
1066
|
-
let S = "";
|
|
1067
|
-
(b().flowchart.arrowMarkerAbsolute || b().state.arrowMarkerAbsolute) && (S = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, S = S.replace(/\(/g, "\\("), S = S.replace(/\)/g, "\\)")), ar(u, e, S, s, l);
|
|
1068
|
-
let B = {};
|
|
1069
|
-
return c && (B.updatedPath = n), B.originalPath = e.points, B;
|
|
1070
|
-
};
|
|
1071
|
-
export {
|
|
1072
|
-
or as a,
|
|
1073
|
-
dr as b,
|
|
1074
|
-
ur as c,
|
|
1075
|
-
gr as d,
|
|
1076
|
-
Et as e,
|
|
1077
|
-
R as f,
|
|
1078
|
-
tr as g,
|
|
1079
|
-
pr as h,
|
|
1080
|
-
hr as i,
|
|
1081
|
-
xr as j,
|
|
1082
|
-
rr as k,
|
|
1083
|
-
M as l,
|
|
1084
|
-
ar as m,
|
|
1085
|
-
fr as p,
|
|
1086
|
-
yr as s,
|
|
1087
|
-
m as u
|
|
1088
|
-
};
|