@layers-app/editor 0.4.1 → 0.5.0
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/dist/index.cjs +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{layers.C3-Awt80.js → layers.0GV8bqI4.js} +6 -6
- package/dist/{layers.B51TBzz6.js → layers.2-v72gXD.js} +1 -1
- package/dist/{layers.DBgQS_TD.js → layers.271NUg7u.js} +1 -1
- package/dist/{layers.C00McVdb.js → layers.2YgiancJ.js} +1 -1
- package/dist/{layers.DiAtOpGJ.js → layers.3DEO2eFX.js} +1 -1
- package/dist/{layers._uJVChzG.js → layers.3PKeLS62.js} +6 -6
- package/dist/{layers.Bxuc5Ku1.js → layers.6M02Y2O6.js} +1 -1
- package/dist/{layers.Ctcl9I58.js → layers.7DTJccah.js} +3 -3
- package/dist/{layers.BGXN8iGN.js → layers.7geZ_Z3x.js} +1 -1
- package/dist/{layers.Q933nYVT.js → layers.88aO_Zsd.js} +2 -2
- package/dist/{layers.BVhV_yLo.js → layers.8hFVbiPY.js} +12 -12
- package/dist/{layers.TP-LPR2e.js → layers.9KaBpXFA.js} +5 -5
- package/dist/layers.AIKsYMqL.js +8 -0
- package/dist/{layers.CEW7Z5oj.js → layers.B-0J3b5U.js} +1 -1
- package/dist/{layers.DMXwnUhk.js → layers.B4yEsxVs.js} +1 -1
- package/dist/{layers.DGfERl47.js → layers.B5Xhxhbr.js} +1 -1
- package/dist/{layers.C6ueRaWn.js → layers.B6jgTP72.js} +1 -1
- package/dist/{layers.Dr9AgtBT.js → layers.B8a2ydDI.js} +2 -2
- package/dist/layers.B9EoV4pJ.js +1 -0
- package/dist/{layers.BU0ouPbJ.js → layers.BAI7Z-Wd.js} +1 -1
- package/dist/{layers.NLvydYLt.js → layers.BB24KMYM.js} +6 -6
- package/dist/{layers.DlH0lUyY.js → layers.BBWAKePM.js} +1 -1
- package/dist/{layers.C6FZDcP0.js → layers.BBWcXYuR.js} +1 -1
- package/dist/{layers.BVLHr0fv.js → layers.BC3JkNtz.js} +4 -4
- package/dist/{layers.oLym9I6R.js → layers.BFKY-mk1.js} +1 -1
- package/dist/{layers.BeXV53PI.js → layers.BGnHNrIw.js} +1 -1
- package/dist/{layers.OqM7Ogm0.js → layers.BIF7gnlw.js} +1 -1
- package/dist/layers.BJDrjORS.js +244 -0
- package/dist/{layers.BdxgA5Mh.js → layers.BJtqK_fc.js} +1 -1
- package/dist/layers.BLMsv5-v.js +295 -0
- package/dist/layers.BLd2spTm.js +1 -0
- package/dist/{layers.CP7ZgLdQ.js → layers.BLj5XN2k.js} +4 -4
- package/dist/{layers.Dr-_us97.js → layers.BMzZVoyQ.js} +1 -1
- package/dist/{layers.9--aZzKT.js → layers.BN0X-mKK.js} +1 -1
- package/dist/{layers.D3PBqBbY.js → layers.BNP0J0MG.js} +1 -1
- package/dist/{layers.D37kPodI.js → layers.BQgrfzZU.js} +1 -1
- package/dist/{layers.CX4-2iW9.js → layers.BRFujA4d.js} +1 -1
- package/dist/{layers.BIATzXuT.js → layers.BSXvhEG5.js} +1 -1
- package/dist/{layers.j4D7aRnj.js → layers.BSzdascH.js} +1 -1
- package/dist/{layers.BXGZ-IPG.js → layers.BTsJAbTY.js} +1 -1
- package/dist/{layers.DsIrXvQc.js → layers.BUpmCmqT.js} +1 -1
- package/dist/{layers.Cmeg2JEe.js → layers.BVAnEpZl.js} +1 -1
- package/dist/{layers.DRd1i4Pe.js → layers.BW84v3Ox.js} +2 -2
- package/dist/layers.B_Lan92M.js +1 -0
- package/dist/{layers.l7Uj4NoM.js → layers.BaW-t_Zc.js} +1 -1
- package/dist/{layers.BR9erYvc.js → layers.BapT0txt.js} +1 -1
- package/dist/{layers.BK7Umu5k.js → layers.BdqQLuaK.js} +1 -1
- package/dist/{layers.CZianMah.js → layers.Bdwk_Ggl.js} +1 -1
- package/dist/{layers.DIW19mY0.js → layers.Bg7-KHZC.js} +3 -3
- package/dist/{layers._uHasBFO.js → layers.BkFD_pHb.js} +1 -1
- package/dist/{layers.C8WU47YC.js → layers.BlN6GnRT.js} +1 -1
- package/dist/{layers.C8Lyyff8.js → layers.Bm84E1I5.js} +1 -1
- package/dist/{layers.Doo3HAhr.js → layers.Bo3tMbEB.js} +1 -1
- package/dist/{layers.BATSJhNp.js → layers.BoOcWXFs.js} +1 -1
- package/dist/{layers.CusXQPSP.js → layers.BrHN_kMd.js} +1 -1
- package/dist/{layers.B4Jcovwh.js → layers.BruMG2wy.js} +1 -1
- package/dist/{layers.Cg0Puk92.js → layers.BsWPnWD1.js} +1 -1
- package/dist/{layers.99J97lec.js → layers.Bu9ZoRYM.js} +1 -1
- package/dist/{layers.DSiVxrm-.js → layers.BvjpCDHj.js} +1 -1
- package/dist/{layers.P0RFt4vw.js → layers.Bwb7QBBL.js} +1 -1
- package/dist/{layers.BoUDsd20.js → layers.Bx0DgrIz.js} +1 -1
- package/dist/{layers.CJdGap0M.js → layers.By8wynAO.js} +1 -1
- package/dist/{layers.B2AGu32C.js → layers.C0Lgw_Sx.js} +1107 -1111
- package/dist/{layers.Ih_DycCa.js → layers.C3me1AOA.js} +3 -3
- package/dist/{layers.DOjcR2u6.js → layers.C5XL_KJW.js} +1 -1
- package/dist/{layers.wRnSjyfZ.js → layers.C65tYhLf.js} +1 -1
- package/dist/{layers.DKhnUElF.js → layers.C67fBVg3.js} +1 -1
- package/dist/{layers.B7uv8aVq.js → layers.C6HmVi2T.js} +1 -1
- package/dist/{layers.BL7PsAnh.js → layers.C8oO_BiQ.js} +1 -1
- package/dist/{layers.CdPjGs2x.js → layers.C9AvvTRV.js} +1 -1
- package/dist/{layers.CXoz8wje.js → layers.CA3DQGmO.js} +1 -1
- package/dist/{layers.Clo5oIEO.js → layers.CCoWlQxf.js} +1 -1
- package/dist/{layers.CeESKes4.js → layers.CCy49ah1.js} +1 -1
- package/dist/{layers.OF4XgnEn.js → layers.CDftR5Kg.js} +2 -2
- package/dist/{layers.BHEN4Zl8.js → layers.CDw-iNbj.js} +1 -1
- package/dist/{layers.De4i5Pzr.js → layers.CEDfv2oj.js} +1 -1
- package/dist/{layers.DV0u_-wO.js → layers.CGeTu6ph.js} +1 -1
- package/dist/{layers.BOY6DvLj.js → layers.CJlWYRtk.js} +1 -1
- package/dist/{layers.DdULzc5-.js → layers.CKy_DRKv.js} +1 -1
- package/dist/{layers.Dx7QSKbZ.js → layers.COEorZbZ.js} +1 -1
- package/dist/{layers.CIkcRflS.js → layers.CP2_7vUR.js} +1 -1
- package/dist/{layers.rSvdeOjc.js → layers.CPEzOey-.js} +1 -1
- package/dist/{layers.hzJoyUwS.js → layers.CSY_lOK0.js} +6 -6
- package/dist/{layers.pRFngToG.js → layers.CT_bvOgC.js} +1 -1
- package/dist/{layers.CX4mdDUE.js → layers.CUWVPrVU.js} +1 -1
- package/dist/{layers.BChBzZgi.js → layers.CVCC2rNb.js} +1 -1
- package/dist/{layers.DE8kdoob.js → layers.CXbK6Z0C.js} +1 -1
- package/dist/{layers.gSOgK4cv.js → layers.CXzpm8-U.js} +1 -1
- package/dist/{layers.UPBrkQqm.js → layers.CYwLZCUi.js} +3 -3
- package/dist/{layers.CHMDrzTP.js → layers.CZ6FLSh1.js} +1 -1
- package/dist/{layers.7aWFCBDk.js → layers.CZzvHupu.js} +1 -1
- package/dist/{layers.C5th-3Bk.js → layers.CaZJgSbm.js} +1 -1
- package/dist/{layers.B5HV5CkN.js → layers.CcX1e4Cb.js} +1 -1
- package/dist/{layers.Bl2uWPK5.js → layers.CgHCxAKJ.js} +1 -1
- package/dist/{layers.HnnZ9X3g.js → layers.CgyRf-4B.js} +1 -1
- package/dist/{layers.rwvkqrdF.js → layers.ChtNiFGR.js} +1 -1
- package/dist/{layers.Cj5o49qm.js → layers.CiYt11kd.js} +1 -1
- package/dist/{layers.BI-S-U1z.js → layers.Cik9ty7R.js} +1 -1
- package/dist/{layers.PWkD3FXd.js → layers.Cizp88rb.js} +1 -1
- package/dist/{layers.MXTL7J0X.js → layers.Cjxg13wd.js} +24330 -23129
- package/dist/{layers.BkDwnhF3.js → layers.Cl6-9OBf.js} +1 -1
- package/dist/{layers.d0donhTp.js → layers.ClExSsZJ.js} +1 -1
- package/dist/{layers.BXIQjroR.js → layers.CqE1nYk3.js} +1 -1
- package/dist/{layers.G0qyEFRn.js → layers.CsNI3f74.js} +1 -1
- package/dist/{layers.C6vMG-T6.js → layers.CuAECIsO.js} +1 -1
- package/dist/{layers.BxCLnc_z.js → layers.CuVNrIcW.js} +1 -1
- package/dist/{layers.DYJhYqR2.js → layers.Cv-z4RwC.js} +1 -1
- package/dist/{layers.BWppdp8z.js → layers.CvPdAUZN.js} +1 -1
- package/dist/{layers.CyaiBxcg.js → layers.CvQiknH6.js} +1 -1
- package/dist/{layers.D0t24lyP.js → layers.Cwn1D7F6.js} +1 -1
- package/dist/{layers.CdZEenM8.js → layers.CyOP0v_-.js} +1 -1
- package/dist/{layers.BCtnSgBi.js → layers.CyvQNQUj.js} +1 -1
- package/dist/layers.Cyzu9PKQ.js +1 -0
- package/dist/{layers.BldgpPoA.js → layers.Cz4E3Gls.js} +8 -8
- package/dist/{layers.NQOujqxE.js → layers.D-rCo5dz.js} +1 -1
- package/dist/{layers.B5VQ5ysd.js → layers.D11yimAp.js} +7 -7
- package/dist/{layers.DczwzPio.js → layers.D1sBwAcX.js} +1 -1
- package/dist/{layers.BH9NvW2c.js → layers.D22AIgry.js} +1 -1
- package/dist/{layers.D3eSioXs.js → layers.D2Y56Lcj.js} +1 -1
- package/dist/{layers.Bf4maS9l.js → layers.D2sjiqI3.js} +1 -1
- package/dist/{layers.Dg_ubB5o.js → layers.D3OtVkCp.js} +1 -1
- package/dist/{layers.CbrkK8Nl.js → layers.D3pymTps.js} +1 -1
- package/dist/{layers.C4Z2eV4H.js → layers.D44d_6CD.js} +4 -4
- package/dist/layers.D4T8fTcj.js +1223 -0
- package/dist/{layers.N0KTyT8H.js → layers.D9umovmT.js} +1 -1
- package/dist/{layers.BkZl0e9Y.js → layers.DE-6jvOp.js} +1 -1
- package/dist/{layers.BzufRV9o.js → layers.DFWypiYS.js} +1 -1
- package/dist/{layers.DaA4pT9g.js → layers.DFZcoBfL.js} +1 -1
- package/dist/{layers.fjvgvmUK.js → layers.DGHPyPPP.js} +1 -1
- package/dist/{layers.BAe6u370.js → layers.DL_hhIIR.js} +3 -3
- package/dist/{layers.Cl9YbTGP.js → layers.DMkqdBNu.js} +1 -1
- package/dist/{layers.DYR-z4Xd.js → layers.DNpGJLyQ.js} +2 -2
- package/dist/{layers.CXFcyuib.js → layers.DPumOFMF.js} +1 -1
- package/dist/{layers.CSKgny-q.js → layers.DQ9duwtV.js} +5 -5
- package/dist/{layers.U8d2vvil.js → layers.DQSx2qqb.js} +1 -1
- package/dist/{layers.D_KjhW7m.js → layers.DRj2t11p.js} +1 -1
- package/dist/{layers.CKyZ6fil.js → layers.DWvD3vql.js} +6 -6
- package/dist/{layers.C5fqgGR6.js → layers.DXVNKM5t.js} +1 -1
- package/dist/{layers.-23sKdPr.js → layers.DXg_yjAg.js} +1 -1
- package/dist/{layers.UHdtuNW7.js → layers.DYXNu8ur.js} +1 -1
- package/dist/layers.Da3-MQaS.js +315 -0
- package/dist/{layers.Dwrpihyi.js → layers.DbEYtfVc.js} +2249 -2231
- package/dist/{layers.DyIa2FAJ.js → layers.Dc79Ci3K.js} +3 -3
- package/dist/{layers.C-S1uftF.js → layers.DdaAmsdK.js} +1 -1
- package/dist/{layers.CDmsB9ui.js → layers.DeGb7buU.js} +1 -1
- package/dist/{layers.mS0YwpDF.js → layers.DeUrAJLR.js} +4 -4
- package/dist/{layers.C46xOyCn.js → layers.DfLG2r9J.js} +1 -1
- package/dist/{layers.DuC5Q-Uc.js → layers.DfVTedYs.js} +1 -1
- package/dist/{layers.BLha5Ags.js → layers.DgM9vwax.js} +1 -1
- package/dist/layers.Dhzc98B1.js +1 -0
- package/dist/{layers.BId9R-tt.js → layers.Dit1Y-a1.js} +1 -1
- package/dist/{layers.BXe2f2v0.js → layers.Dj4g5Vb5.js} +1 -1
- package/dist/{layers.6xiY7Dmk.js → layers.DkOYepgq.js} +1 -1
- package/dist/{layers.Dq7WsWG1.js → layers.Dld8CjhI.js} +1 -1
- package/dist/{layers.DEMbeDH5.js → layers.Dlp-dPD8.js} +28 -28
- package/dist/{layers.DnvdN9TC.js → layers.DlrAk6DA.js} +1 -1
- package/dist/{layers.Bxx3QiqH.js → layers.Dm5fcqXE.js} +1 -1
- package/dist/{layers.CHE9Vv0w.js → layers.DpuQVg48.js} +1 -1
- package/dist/{layers.B16HCOzz.js → layers.DqT5Jouj.js} +1 -1
- package/dist/{layers.CJgtfrlM.js → layers.DrlOZ3DT.js} +1 -1
- package/dist/{layers.BQ5pHr1t.js → layers.DsSMSFyE.js} +1 -1
- package/dist/layers.DtcuZ6vs.js +187 -0
- package/dist/{layers.CAZF51iw.js → layers.DuGoIpLS.js} +5 -5
- package/dist/{layers.BTjqsj2D.js → layers.DxS_nrN5.js} +1 -1
- package/dist/{layers.xbymChc4.js → layers.DxhSwb8B.js} +320 -319
- package/dist/{layers.rK-vslvx.js → layers.DxwOJMY_.js} +1 -1
- package/dist/{layers.D0fuzbA_.js → layers.DyPFKCS6.js} +3 -3
- package/dist/{layers.Ck_m9yBu.js → layers.DyydDZDU.js} +1 -1
- package/dist/{layers.ChLLCYeV.js → layers.GaSOetZx.js} +1 -1
- package/dist/{layers.O7rgjuxq.js → layers.IAZiYFRK.js} +1 -1
- package/dist/layers.JgqeK3h7.js +1 -0
- package/dist/layers.K2rcpzhY.js +4 -0
- package/dist/{layers.BCMyc6dl.js → layers.KIWs25tZ.js} +1 -1
- package/dist/{layers.BiK_NhRx.js → layers.LLke4z7b.js} +1 -1
- package/dist/{layers.B1VWPJr7.js → layers.Marfmnqs.js} +1 -1
- package/dist/{layers.2Zh_Eqge.js → layers.OFho5MbN.js} +1 -1
- package/dist/layers.R8QN7W65.js +1 -0
- package/dist/{layers.CESONz7C.js → layers.RT_eBoD-.js} +1 -1
- package/dist/{layers.BgXRgBMD.js → layers.SbloXQp4.js} +1 -1
- package/dist/{layers.ShoHTpWp.js → layers.SvUN62A9.js} +1 -1
- package/dist/{layers.CENOzW4d.js → layers.TGEy1wS6.js} +1 -1
- package/dist/{layers.DhtUpSvn.js → layers.TdE-jeZL.js} +1 -1
- package/dist/{layers.C5pjkDUm.js → layers.UWRNxgT8.js} +1 -1
- package/dist/{layers.B4o4Yght.js → layers.VA5efHzM.js} +1 -1
- package/dist/layers._2_sfSMa.js +1 -0
- package/dist/{layers.D-4MyOv6.js → layers.ajIRcGd4.js} +1 -1
- package/dist/{layers.BvQfT02S.js → layers.cjE12qw2.js} +1 -1
- package/dist/{layers.BNcxqXDY.js → layers.dJvyCZ1b.js} +1 -1
- package/dist/{layers.h2SsCt7w.js → layers.da887to_.js} +1 -1
- package/dist/{layers.B9ypkXfB.js → layers.dhxVHEDE.js} +1 -1
- package/dist/{layers.BkkBEMI4.js → layers.ejvu1U9t.js} +1 -1
- package/dist/{layers.C7md-mpb.js → layers.epvyXTdV.js} +5 -5
- package/dist/layers.fm_nJlxH.js +6 -0
- package/dist/{layers.xlbtHZsv.js → layers.guGfRsPS.js} +1 -1
- package/dist/layers.hweLqW3I.js +261 -0
- package/dist/{layers.BmdNYA8O.js → layers.j04tfCKj.js} +1 -1
- package/dist/{layers.C5vdiuk-.js → layers.kzDq9Q-l.js} +1 -1
- package/dist/{layers.B1GsQlw2.js → layers.ldz4asX5.js} +6 -6
- package/dist/{layers.BaREUEpY.js → layers.ov1rbOW3.js} +1 -1
- package/dist/{layers.CK15u90j.js → layers.pHVqEwm3.js} +1 -1
- package/dist/{layers.D56jgM5P.js → layers.rgYI6gus.js} +2 -2
- package/dist/{layers.BjIrZvhA.js → layers.sTUiyAuM.js} +1 -1
- package/dist/{layers.DIsd_eLu.js → layers.uMaAjCOP.js} +5 -5
- package/dist/{layers.Dpl-_pRd.js → layers.vJ0fdhPp.js} +78 -78
- package/dist/{layers.ChG4YWfr.js → layers.vqKLXMfn.js} +1 -1
- package/dist/{layers.DyrpParn.js → layers.wSBHMHgW.js} +1 -1
- package/dist/{layers.Dms1jgA7.js → layers.yquOOwF7.js} +1 -1
- package/dist/{layers.Bqy_BDRk.js → layers.zJTwyIu5.js} +1 -1
- package/package.json +6 -7
- package/dist/layers.9QK1wiQj.js +0 -1
- package/dist/layers.BIj1zRV6.js +0 -8
- package/dist/layers.Bgx4q6Yl.js +0 -1
- package/dist/layers.C7lIplJU.js +0 -247
- package/dist/layers.COAF7f8g.js +0 -1
- package/dist/layers.CQ_KfkMs.js +0 -1
- package/dist/layers.CXnC6LGK.js +0 -1
- package/dist/layers.CebNnxUV.js +0 -185
- package/dist/layers.Cs24L6er.js +0 -261
- package/dist/layers.Cuf8LL65.js +0 -4
- package/dist/layers.D4fGb2cV.js +0 -1272
- package/dist/layers.DGhEo4ps.js +0 -6
- package/dist/layers.DHbgl38J.js +0 -1
- package/dist/layers.DcGuLvyP.js +0 -1
- package/dist/layers.Y1n_hIuc.js +0 -1
- package/dist/layers.b_l02tem.js +0 -319
- package/dist/layers.pGJnLNqj.js +0 -285
|
@@ -1,52 +1,53 @@
|
|
|
1
|
-
import { f as
|
|
2
|
-
import { d as
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "./layers.
|
|
9
|
-
|
|
1
|
+
import { f as $, p as St } from "./layers.ajIRcGd4.js";
|
|
2
|
+
import { d as x, a0 as G, l as M, g as D, Y as Lt, _ as V, $ as W, t as Z, V as tt, j as et } from "./layers.DbEYtfVc.js";
|
|
3
|
+
import * as rt from "lodash-es";
|
|
4
|
+
import { pick as _t, defaults as I } from "lodash-es";
|
|
5
|
+
import { l as Et } from "./layers.D4T8fTcj.js";
|
|
6
|
+
import { G as Tt } from "./layers.BJDrjORS.js";
|
|
7
|
+
import { b as T, c as at, i as nt, d as _, e as st, g as it, f as Nt, a as At, s as Pt } from "./layers.D44d_6CD.js";
|
|
8
|
+
import { l as Ct } from "./layers.Bdwk_Ggl.js";
|
|
9
|
+
import "./layers.Cz4E3Gls.js";
|
|
10
|
+
function It(r) {
|
|
10
11
|
if (!r.ok) throw new Error(r.status + " " + r.statusText);
|
|
11
12
|
return r.text();
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
return fetch(r, e).then(
|
|
14
|
+
function Bt(r, e) {
|
|
15
|
+
return fetch(r, e).then(It);
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
return (e, t) =>
|
|
17
|
+
function Mt(r) {
|
|
18
|
+
return (e, t) => Bt(e, t).then((n) => new DOMParser().parseFromString(n, r));
|
|
18
19
|
}
|
|
19
|
-
var
|
|
20
|
-
normal:
|
|
21
|
-
vee:
|
|
22
|
-
undirected:
|
|
20
|
+
var Dt = Mt("image/svg+xml"), z = {
|
|
21
|
+
normal: Gt,
|
|
22
|
+
vee: Ot,
|
|
23
|
+
undirected: Ut
|
|
23
24
|
};
|
|
24
|
-
function
|
|
25
|
-
|
|
25
|
+
function Rt(r) {
|
|
26
|
+
z = r;
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function Gt(r, e, t, n) {
|
|
28
29
|
var a = r.append("marker").attr("id", e).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"), s = a.append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
29
|
-
|
|
30
|
+
T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
+
function Ot(r, e, t, n) {
|
|
32
33
|
var a = r.append("marker").attr("id", e).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"), s = a.append("path").attr("d", "M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
33
|
-
|
|
34
|
+
T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function Ut(r, e, t, n) {
|
|
36
37
|
var a = r.append("marker").attr("id", e).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"), s = a.append("path").attr("d", "M 0 5 L 10 5").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
37
|
-
|
|
38
|
+
T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function $t(r, e) {
|
|
40
41
|
var t = r;
|
|
41
|
-
return t.node().appendChild(e.label),
|
|
42
|
+
return t.node().appendChild(e.label), T(t, e.labelStyle), t;
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
-
for (var t = r.append("text"), n =
|
|
44
|
+
function Wt(r, e) {
|
|
45
|
+
for (var t = r.append("text"), n = Vt(e.label).split(`
|
|
45
46
|
`), a = 0; a < n.length; a++)
|
|
46
47
|
t.append("tspan").attr("xml:space", "preserve").attr("dy", "1em").attr("x", "1").text(n[a]);
|
|
47
|
-
return
|
|
48
|
+
return T(t, e.labelStyle), t;
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
+
function Vt(r) {
|
|
50
51
|
for (var e = "", t = !1, n, a = 0; a < r.length; ++a)
|
|
51
52
|
if (n = r[a], t) {
|
|
52
53
|
switch (n) {
|
|
@@ -61,9 +62,9 @@ function Wt(r) {
|
|
|
61
62
|
} else n === "\\" ? t = !0 : e += n;
|
|
62
63
|
return e;
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
+
function q(r, e, t) {
|
|
65
66
|
var n = e.label, a = r.append("g");
|
|
66
|
-
e.labelType === "svg" ?
|
|
67
|
+
e.labelType === "svg" ? $t(a, e) : typeof n != "string" || e.labelType === "html" ? at(a, e) : Wt(a, e);
|
|
67
68
|
var s = a.node().getBBox(), i;
|
|
68
69
|
switch (t) {
|
|
69
70
|
case "top":
|
|
@@ -77,152 +78,152 @@ function K(r, e, t) {
|
|
|
77
78
|
}
|
|
78
79
|
return a.attr("transform", "translate(" + -s.width / 2 + "," + i + ")"), a;
|
|
79
80
|
}
|
|
80
|
-
var
|
|
81
|
+
var Y = function(r, e) {
|
|
81
82
|
var t = e.nodes().filter(function(s) {
|
|
82
|
-
return
|
|
83
|
+
return nt(e, s);
|
|
83
84
|
}), n = r.selectAll("g.cluster").data(t, function(s) {
|
|
84
85
|
return s;
|
|
85
86
|
});
|
|
86
|
-
|
|
87
|
+
_(n.exit(), e).style("opacity", 0).remove();
|
|
87
88
|
var a = n.enter().append("g").attr("class", "cluster").attr("id", function(s) {
|
|
88
89
|
var i = e.node(s);
|
|
89
90
|
return i.id;
|
|
90
91
|
}).style("opacity", 0).each(function(s) {
|
|
91
|
-
var i = e.node(s), o =
|
|
92
|
-
|
|
92
|
+
var i = e.node(s), o = x(this);
|
|
93
|
+
x(this).append("rect");
|
|
93
94
|
var c = o.append("g").attr("class", "label");
|
|
94
|
-
|
|
95
|
+
q(c, i, i.clusterLabelPos);
|
|
95
96
|
});
|
|
96
|
-
return n = n.merge(a), n =
|
|
97
|
-
var i = e.node(s), o =
|
|
98
|
-
|
|
97
|
+
return n = n.merge(a), n = _(n, e).style("opacity", 1), n.selectAll("rect").each(function(s) {
|
|
98
|
+
var i = e.node(s), o = x(this);
|
|
99
|
+
T(o, i.style);
|
|
99
100
|
}), n;
|
|
100
101
|
};
|
|
101
|
-
function
|
|
102
|
-
|
|
102
|
+
function zt(r) {
|
|
103
|
+
Y = r;
|
|
103
104
|
}
|
|
104
|
-
let
|
|
105
|
+
let H = function(r, e) {
|
|
105
106
|
var t = r.selectAll("g.edgeLabel").data(e.edges(), function(a) {
|
|
106
|
-
return
|
|
107
|
+
return st(a);
|
|
107
108
|
}).classed("update", !0);
|
|
108
109
|
t.exit().remove(), t.enter().append("g").classed("edgeLabel", !0).style("opacity", 0), t = r.selectAll("g.edgeLabel"), t.each(function(a) {
|
|
109
|
-
var s =
|
|
110
|
+
var s = x(this);
|
|
110
111
|
s.select(".label").remove();
|
|
111
|
-
var i = e.edge(a), o =
|
|
112
|
-
i.labelId && o.attr("id", i.labelId),
|
|
112
|
+
var i = e.edge(a), o = q(s, e.edge(a), 0).classed("label", !0), c = o.node().getBBox();
|
|
113
|
+
i.labelId && o.attr("id", i.labelId), Object.prototype.hasOwnProperty.call(i, "width") || (i.width = c.width), Object.prototype.hasOwnProperty.call(i, "height") || (i.height = c.height);
|
|
113
114
|
});
|
|
114
115
|
var n;
|
|
115
|
-
return t.exit ? n = t.exit() : n = t.selectAll(null),
|
|
116
|
+
return t.exit ? n = t.exit() : n = t.selectAll(null), _(n, e).style("opacity", 0).remove(), t;
|
|
116
117
|
};
|
|
117
|
-
function
|
|
118
|
-
|
|
118
|
+
function Yt(r) {
|
|
119
|
+
H = r;
|
|
119
120
|
}
|
|
120
|
-
function
|
|
121
|
+
function K(r, e) {
|
|
121
122
|
return r.intersect(e);
|
|
122
123
|
}
|
|
123
|
-
var
|
|
124
|
+
var X = function(r, e, t) {
|
|
124
125
|
var n = r.selectAll("g.edgePath").data(e.edges(), function(i) {
|
|
125
|
-
return
|
|
126
|
+
return st(i);
|
|
126
127
|
}).classed("update", !0), a = qt(n, e);
|
|
127
128
|
Qt(n, e);
|
|
128
129
|
var s = n.merge !== void 0 ? n.merge(a) : n;
|
|
129
|
-
return
|
|
130
|
-
var o =
|
|
131
|
-
c.elem = this, c.id && o.attr("id", c.id),
|
|
130
|
+
return _(s, e).style("opacity", 1), s.each(function(i) {
|
|
131
|
+
var o = x(this), c = e.edge(i);
|
|
132
|
+
c.elem = this, c.id && o.attr("id", c.id), it(
|
|
132
133
|
o,
|
|
133
134
|
c.class,
|
|
134
135
|
(o.classed("update") ? "update " : "") + "edgePath"
|
|
135
136
|
);
|
|
136
137
|
}), s.selectAll("path.path").each(function(i) {
|
|
137
138
|
var o = e.edge(i);
|
|
138
|
-
o.arrowheadId =
|
|
139
|
-
var c =
|
|
140
|
-
return "url(" +
|
|
139
|
+
o.arrowheadId = rt.uniqueId("arrowhead");
|
|
140
|
+
var c = x(this).attr("marker-end", function() {
|
|
141
|
+
return "url(" + Xt(location.href, o.arrowheadId) + ")";
|
|
141
142
|
}).style("fill", "none");
|
|
142
|
-
|
|
143
|
-
return
|
|
144
|
-
}),
|
|
143
|
+
_(c, e).attr("d", function(d) {
|
|
144
|
+
return Ft(e, d);
|
|
145
|
+
}), T(c, o.style);
|
|
145
146
|
}), s.selectAll("defs *").remove(), s.selectAll("defs").each(function(i) {
|
|
146
147
|
var o = e.edge(i), c = t[o.arrowhead];
|
|
147
|
-
c(
|
|
148
|
+
c(x(this), o.arrowheadId, o, "arrowhead");
|
|
148
149
|
}), s;
|
|
149
150
|
};
|
|
150
|
-
function
|
|
151
|
-
|
|
151
|
+
function Ht(r) {
|
|
152
|
+
X = r;
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
+
function Xt(r, e) {
|
|
154
155
|
var t = r.split("#")[0];
|
|
155
156
|
return t + "#" + e;
|
|
156
157
|
}
|
|
157
|
-
function
|
|
158
|
+
function Ft(r, e) {
|
|
158
159
|
var t = r.edge(e), n = r.node(e.v), a = r.node(e.w), s = t.points.slice(1, t.points.length - 1);
|
|
159
|
-
return s.unshift(
|
|
160
|
+
return s.unshift(K(n, s[0])), s.push(K(a, s[s.length - 1])), ot(t, s);
|
|
160
161
|
}
|
|
161
|
-
function
|
|
162
|
-
var t = (
|
|
162
|
+
function ot(r, e) {
|
|
163
|
+
var t = (Ct || Dt.line)().x(function(n) {
|
|
163
164
|
return n.x;
|
|
164
165
|
}).y(function(n) {
|
|
165
166
|
return n.y;
|
|
166
167
|
});
|
|
167
168
|
return (t.curve || t.interpolate)(r.curve), t(e);
|
|
168
169
|
}
|
|
169
|
-
function
|
|
170
|
+
function jt(r) {
|
|
170
171
|
var e = r.getBBox(), t = r.ownerSVGElement.getScreenCTM().inverse().multiply(r.getScreenCTM()).translate(e.width / 2, e.height / 2);
|
|
171
172
|
return { x: t.e, y: t.f };
|
|
172
173
|
}
|
|
173
174
|
function qt(r, e) {
|
|
174
175
|
var t = r.enter().append("g").attr("class", "edgePath").style("opacity", 0);
|
|
175
176
|
return t.append("path").attr("class", "path").attr("d", function(n) {
|
|
176
|
-
var a = e.edge(n), s = e.node(n.v).elem, i =
|
|
177
|
-
return
|
|
177
|
+
var a = e.edge(n), s = e.node(n.v).elem, i = rt.range(a.points.length).map(function() {
|
|
178
|
+
return jt(s);
|
|
178
179
|
});
|
|
179
|
-
return
|
|
180
|
+
return ot(a, i);
|
|
180
181
|
}), t.append("defs"), t;
|
|
181
182
|
}
|
|
182
183
|
function Qt(r, e) {
|
|
183
184
|
var t = r.exit();
|
|
184
|
-
|
|
185
|
+
_(t, e).style("opacity", 0).remove();
|
|
185
186
|
}
|
|
186
|
-
var
|
|
187
|
+
var F = function(r, e, t) {
|
|
187
188
|
var n = e.nodes().filter(function(i) {
|
|
188
|
-
return !
|
|
189
|
+
return !nt(e, i);
|
|
189
190
|
}), a = r.selectAll("g.node").data(n, function(i) {
|
|
190
191
|
return i;
|
|
191
192
|
}).classed("update", !0);
|
|
192
193
|
a.exit().remove(), a.enter().append("g").attr("class", "node").style("opacity", 0), a = r.selectAll("g.node"), a.each(function(i) {
|
|
193
|
-
var o = e.node(i), c =
|
|
194
|
-
|
|
194
|
+
var o = e.node(i), c = x(this);
|
|
195
|
+
it(
|
|
195
196
|
c,
|
|
196
197
|
o.class,
|
|
197
198
|
(c.classed("update") ? "update " : "") + "node"
|
|
198
199
|
), c.select("g.label").remove();
|
|
199
|
-
var d = c.append("g").attr("class", "label"), l =
|
|
200
|
-
o.elem = this, o.id && c.attr("id", o.id), o.labelId && d.attr("id", o.labelId),
|
|
200
|
+
var d = c.append("g").attr("class", "label"), l = q(d, o), y = t[o.shape], h = _t(l.node().getBBox(), "width", "height");
|
|
201
|
+
o.elem = this, o.id && c.attr("id", o.id), o.labelId && d.attr("id", o.labelId), Object.prototype.hasOwnProperty.call(o, "width") && (h.width = o.width), Object.prototype.hasOwnProperty.call(o, "height") && (h.height = o.height), h.width += o.paddingLeft + o.paddingRight, h.height += o.paddingTop + o.paddingBottom, d.attr(
|
|
201
202
|
"transform",
|
|
202
203
|
"translate(" + (o.paddingLeft - o.paddingRight) / 2 + "," + (o.paddingTop - o.paddingBottom) / 2 + ")"
|
|
203
204
|
);
|
|
204
|
-
var u =
|
|
205
|
+
var u = x(this);
|
|
205
206
|
u.select(".label-container").remove();
|
|
206
|
-
var
|
|
207
|
-
|
|
208
|
-
var
|
|
209
|
-
o.width =
|
|
207
|
+
var f = y(u, h, o).classed("label-container", !0);
|
|
208
|
+
T(f, o.style);
|
|
209
|
+
var g = f.node().getBBox();
|
|
210
|
+
o.width = g.width, o.height = g.height;
|
|
210
211
|
});
|
|
211
212
|
var s;
|
|
212
|
-
return a.exit ? s = a.exit() : s = a.selectAll(null),
|
|
213
|
+
return a.exit ? s = a.exit() : s = a.selectAll(null), _(s, e).style("opacity", 0).remove(), a;
|
|
213
214
|
};
|
|
214
215
|
function Kt(r) {
|
|
215
|
-
|
|
216
|
+
F = r;
|
|
216
217
|
}
|
|
217
218
|
function Jt(r, e) {
|
|
218
219
|
var t = r.filter(function() {
|
|
219
|
-
return !
|
|
220
|
+
return !x(this).classed("update");
|
|
220
221
|
});
|
|
221
222
|
function n(a) {
|
|
222
223
|
var s = e.node(a);
|
|
223
224
|
return "translate(" + s.x + "," + s.y + ")";
|
|
224
225
|
}
|
|
225
|
-
t.attr("transform", n),
|
|
226
|
+
t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n), _(t.selectAll("rect"), e).attr("width", function(a) {
|
|
226
227
|
return e.node(a).width;
|
|
227
228
|
}).attr("height", function(a) {
|
|
228
229
|
return e.node(a).height;
|
|
@@ -236,92 +237,92 @@ function Jt(r, e) {
|
|
|
236
237
|
}
|
|
237
238
|
function Zt(r, e) {
|
|
238
239
|
var t = r.filter(function() {
|
|
239
|
-
return !
|
|
240
|
+
return !x(this).classed("update");
|
|
240
241
|
});
|
|
241
242
|
function n(a) {
|
|
242
243
|
var s = e.edge(a);
|
|
243
|
-
return
|
|
244
|
+
return Object.prototype.hasOwnProperty.call(s, "x") ? "translate(" + s.x + "," + s.y + ")" : "";
|
|
244
245
|
}
|
|
245
|
-
t.attr("transform", n),
|
|
246
|
+
t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n);
|
|
246
247
|
}
|
|
247
|
-
function
|
|
248
|
+
function te(r, e) {
|
|
248
249
|
var t = r.filter(function() {
|
|
249
|
-
return !
|
|
250
|
+
return !x(this).classed("update");
|
|
250
251
|
});
|
|
251
252
|
function n(a) {
|
|
252
253
|
var s = e.node(a);
|
|
253
254
|
return "translate(" + s.x + "," + s.y + ")";
|
|
254
255
|
}
|
|
255
|
-
t.attr("transform", n),
|
|
256
|
+
t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n);
|
|
256
257
|
}
|
|
257
|
-
function
|
|
258
|
+
function lt(r, e, t, n) {
|
|
258
259
|
var a = r.x, s = r.y, i = a - n.x, o = s - n.y, c = Math.sqrt(e * e * o * o + t * t * i * i), d = Math.abs(e * t * i / c);
|
|
259
260
|
n.x < a && (d = -d);
|
|
260
261
|
var l = Math.abs(e * t * o / c);
|
|
261
262
|
return n.y < s && (l = -l), { x: a + d, y: s + l };
|
|
262
263
|
}
|
|
263
|
-
function
|
|
264
|
-
return
|
|
264
|
+
function ee(r, e, t) {
|
|
265
|
+
return lt(r, e, e, t);
|
|
265
266
|
}
|
|
266
|
-
function
|
|
267
|
-
var a, s, i, o, c, d, l,
|
|
268
|
-
if (a = e.y - r.y, i = r.x - e.x, c = e.x * r.y - r.x * e.y, h = a * t.x + i * t.y + c, u = a * n.x + i * n.y + c, !(h !== 0 && u !== 0 &&
|
|
269
|
-
return
|
|
267
|
+
function re(r, e, t, n) {
|
|
268
|
+
var a, s, i, o, c, d, l, y, h, u, f, g, p, v, k;
|
|
269
|
+
if (a = e.y - r.y, i = r.x - e.x, c = e.x * r.y - r.x * e.y, h = a * t.x + i * t.y + c, u = a * n.x + i * n.y + c, !(h !== 0 && u !== 0 && J(h, u)) && (s = n.y - t.y, o = t.x - n.x, d = n.x * t.y - t.x * n.y, l = s * r.x + o * r.y + d, y = s * e.x + o * e.y + d, !(l !== 0 && y !== 0 && J(l, y)) && (f = a * o - s * i, f !== 0)))
|
|
270
|
+
return g = Math.abs(f / 2), p = i * d - o * c, v = p < 0 ? (p - g) / f : (p + g) / f, p = s * c - a * d, k = p < 0 ? (p - g) / f : (p + g) / f, { x: v, y: k };
|
|
270
271
|
}
|
|
271
|
-
function
|
|
272
|
+
function J(r, e) {
|
|
272
273
|
return r * e > 0;
|
|
273
274
|
}
|
|
274
|
-
function
|
|
275
|
+
function E(r, e, t) {
|
|
275
276
|
var n = r.x, a = r.y, s = [], i = Number.POSITIVE_INFINITY, o = Number.POSITIVE_INFINITY;
|
|
276
|
-
e.forEach(function(
|
|
277
|
-
i = Math.min(i,
|
|
277
|
+
e.forEach(function(f) {
|
|
278
|
+
i = Math.min(i, f.x), o = Math.min(o, f.y);
|
|
278
279
|
});
|
|
279
280
|
for (var c = n - r.width / 2 - i, d = a - r.height / 2 - o, l = 0; l < e.length; l++) {
|
|
280
|
-
var
|
|
281
|
+
var y = e[l], h = e[l < e.length - 1 ? l + 1 : 0], u = re(
|
|
281
282
|
r,
|
|
282
283
|
t,
|
|
283
|
-
{ x: c +
|
|
284
|
+
{ x: c + y.x, y: d + y.y },
|
|
284
285
|
{ x: c + h.x, y: d + h.y }
|
|
285
286
|
);
|
|
286
287
|
u && s.push(u);
|
|
287
288
|
}
|
|
288
|
-
return s.length ? (s.length > 1 && s.sort(function(
|
|
289
|
-
var
|
|
290
|
-
return
|
|
289
|
+
return s.length ? (s.length > 1 && s.sort(function(f, g) {
|
|
290
|
+
var p = f.x - t.x, v = f.y - t.y, k = Math.sqrt(p * p + v * v), P = g.x - t.x, L = g.y - t.y, O = Math.sqrt(P * P + L * L);
|
|
291
|
+
return k < O ? -1 : k === O ? 0 : 1;
|
|
291
292
|
}), s[0]) : (console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", r), r);
|
|
292
293
|
}
|
|
293
|
-
function
|
|
294
|
+
function Q(r, e) {
|
|
294
295
|
var t = r.x, n = r.y, a = e.x - t, s = e.y - n, i = r.width / 2, o = r.height / 2, c, d;
|
|
295
296
|
return Math.abs(s) * i > Math.abs(a) * o ? (s < 0 && (o = -o), c = s === 0 ? 0 : o * a / s, d = o) : (a < 0 && (i = -i), c = i, d = a === 0 ? 0 : i * s / a), { x: t + c, y: n + d };
|
|
296
297
|
}
|
|
297
|
-
var
|
|
298
|
-
rect:
|
|
299
|
-
ellipse:
|
|
300
|
-
circle:
|
|
301
|
-
diamond:
|
|
298
|
+
var j = {
|
|
299
|
+
rect: ne,
|
|
300
|
+
ellipse: se,
|
|
301
|
+
circle: ie,
|
|
302
|
+
diamond: oe
|
|
302
303
|
};
|
|
303
|
-
function
|
|
304
|
-
|
|
304
|
+
function ae(r) {
|
|
305
|
+
j = r;
|
|
305
306
|
}
|
|
306
|
-
function
|
|
307
|
+
function ne(r, e, t) {
|
|
307
308
|
var n = r.insert("rect", ":first-child").attr("rx", t.rx).attr("ry", t.ry).attr("x", -e.width / 2).attr("y", -e.height / 2).attr("width", e.width).attr("height", e.height);
|
|
308
309
|
return t.intersect = function(a) {
|
|
309
|
-
return
|
|
310
|
+
return Q(t, a);
|
|
310
311
|
}, n;
|
|
311
312
|
}
|
|
312
|
-
function
|
|
313
|
+
function se(r, e, t) {
|
|
313
314
|
var n = e.width / 2, a = e.height / 2, s = r.insert("ellipse", ":first-child").attr("x", -e.width / 2).attr("y", -e.height / 2).attr("rx", n).attr("ry", a);
|
|
314
315
|
return t.intersect = function(i) {
|
|
315
|
-
return
|
|
316
|
+
return lt(t, n, a, i);
|
|
316
317
|
}, s;
|
|
317
318
|
}
|
|
318
|
-
function
|
|
319
|
+
function ie(r, e, t) {
|
|
319
320
|
var n = Math.max(e.width, e.height) / 2, a = r.insert("circle", ":first-child").attr("x", -e.width / 2).attr("y", -e.height / 2).attr("r", n);
|
|
320
321
|
return t.intersect = function(s) {
|
|
321
|
-
return
|
|
322
|
+
return ee(t, n, s);
|
|
322
323
|
}, a;
|
|
323
324
|
}
|
|
324
|
-
function
|
|
325
|
+
function oe(r, e, t) {
|
|
325
326
|
var n = e.width * Math.SQRT2 / 2, a = e.height * Math.SQRT2 / 2, s = [
|
|
326
327
|
{ x: 0, y: -a },
|
|
327
328
|
{ x: -n, y: 0 },
|
|
@@ -334,32 +335,32 @@ function se(r, e, t) {
|
|
|
334
335
|
}).join(" ")
|
|
335
336
|
);
|
|
336
337
|
return t.intersect = function(o) {
|
|
337
|
-
return
|
|
338
|
+
return E(t, s, o);
|
|
338
339
|
}, i;
|
|
339
340
|
}
|
|
340
|
-
function
|
|
341
|
+
function le() {
|
|
341
342
|
var r = function(e, t) {
|
|
342
|
-
|
|
343
|
-
var n =
|
|
344
|
-
|
|
345
|
-
var c =
|
|
346
|
-
Jt(c, t),
|
|
343
|
+
he(t);
|
|
344
|
+
var n = B(e, "output"), a = B(n, "clusters"), s = B(n, "edgePaths"), i = H(B(n, "edgeLabels"), t), o = F(B(n, "nodes"), t, j);
|
|
345
|
+
Et(t), te(o, t), Zt(i, t), X(s, t, z);
|
|
346
|
+
var c = Y(a, t);
|
|
347
|
+
Jt(c, t), ue(t);
|
|
347
348
|
};
|
|
348
349
|
return r.createNodes = function(e) {
|
|
349
|
-
return arguments.length ? (Kt(e), r) :
|
|
350
|
+
return arguments.length ? (Kt(e), r) : F;
|
|
350
351
|
}, r.createClusters = function(e) {
|
|
351
|
-
return arguments.length ? (
|
|
352
|
+
return arguments.length ? (zt(e), r) : Y;
|
|
352
353
|
}, r.createEdgeLabels = function(e) {
|
|
353
|
-
return arguments.length ? (
|
|
354
|
+
return arguments.length ? (Yt(e), r) : H;
|
|
354
355
|
}, r.createEdgePaths = function(e) {
|
|
355
|
-
return arguments.length ? (
|
|
356
|
+
return arguments.length ? (Ht(e), r) : X;
|
|
356
357
|
}, r.shapes = function(e) {
|
|
357
|
-
return arguments.length ? (
|
|
358
|
+
return arguments.length ? (ae(e), r) : j;
|
|
358
359
|
}, r.arrows = function(e) {
|
|
359
|
-
return arguments.length ? (
|
|
360
|
+
return arguments.length ? (Rt(e), r) : z;
|
|
360
361
|
}, r;
|
|
361
362
|
}
|
|
362
|
-
var
|
|
363
|
+
var ce = {
|
|
363
364
|
paddingLeft: 10,
|
|
364
365
|
paddingRight: 10,
|
|
365
366
|
paddingTop: 10,
|
|
@@ -367,54 +368,54 @@ var oe = {
|
|
|
367
368
|
rx: 0,
|
|
368
369
|
ry: 0,
|
|
369
370
|
shape: "rect"
|
|
370
|
-
},
|
|
371
|
+
}, de = {
|
|
371
372
|
arrowhead: "normal",
|
|
372
|
-
curve:
|
|
373
|
+
curve: G
|
|
373
374
|
};
|
|
374
|
-
function
|
|
375
|
-
r.nodes().forEach(
|
|
376
|
-
|
|
377
|
-
!
|
|
375
|
+
function he(r) {
|
|
376
|
+
r.nodes().forEach((e) => {
|
|
377
|
+
const t = r.node(e);
|
|
378
|
+
!Object.prototype.hasOwnProperty.call(t, "label") && !r.children(e).length && (t.label = e), Object.prototype.hasOwnProperty.call(t, "paddingX") && I(t, {
|
|
378
379
|
paddingLeft: t.paddingX,
|
|
379
380
|
paddingRight: t.paddingX
|
|
380
|
-
}),
|
|
381
|
+
}), Object.prototype.hasOwnProperty.call(t, "paddingY") && I(t, {
|
|
381
382
|
paddingTop: t.paddingY,
|
|
382
383
|
paddingBottom: t.paddingY
|
|
383
|
-
}),
|
|
384
|
+
}), Object.prototype.hasOwnProperty.call(t, "padding") && I(t, {
|
|
384
385
|
paddingLeft: t.padding,
|
|
385
386
|
paddingRight: t.padding,
|
|
386
387
|
paddingTop: t.padding,
|
|
387
388
|
paddingBottom: t.padding
|
|
388
|
-
}),
|
|
389
|
+
}), I(t, ce), ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"].forEach((n) => {
|
|
389
390
|
t[n] = Number(t[n]);
|
|
390
|
-
}),
|
|
391
|
+
}), Object.prototype.hasOwnProperty.call(t, "width") && (t._prevWidth = t.width), Object.prototype.hasOwnProperty.call(t, "height") && (t._prevHeight = t.height);
|
|
391
392
|
}), r.edges().forEach(function(e) {
|
|
392
393
|
var t = r.edge(e);
|
|
393
|
-
|
|
394
|
+
Object.prototype.hasOwnProperty.call(t, "label") || (t.label = ""), I(t, de);
|
|
394
395
|
});
|
|
395
396
|
}
|
|
396
|
-
function
|
|
397
|
-
|
|
397
|
+
function ue(r) {
|
|
398
|
+
r.nodes().forEach((e) => {
|
|
398
399
|
var t = r.node(e);
|
|
399
|
-
|
|
400
|
+
Object.prototype.hasOwnProperty.call(t, "_prevWidth") ? t.width = t._prevWidth : delete t.width, Object.prototype.hasOwnProperty.call(t, "_prevHeight") ? t.height = t._prevHeight : delete t.height, delete t._prevWidth, delete t._prevHeight;
|
|
400
401
|
});
|
|
401
402
|
}
|
|
402
|
-
function
|
|
403
|
+
function B(r, e) {
|
|
403
404
|
var t = r.select("g." + e);
|
|
404
405
|
return t.empty() && (t = r.append("g").attr("class", e)), t;
|
|
405
406
|
}
|
|
406
|
-
function
|
|
407
|
+
function ct(r, e, t) {
|
|
407
408
|
const n = e.width, a = e.height, s = (n + a) * 0.9, i = [
|
|
408
409
|
{ x: s / 2, y: 0 },
|
|
409
410
|
{ x: s, y: -s / 2 },
|
|
410
411
|
{ x: s / 2, y: -s },
|
|
411
412
|
{ x: 0, y: -s / 2 }
|
|
412
|
-
], o =
|
|
413
|
+
], o = N(r, s, s, i);
|
|
413
414
|
return t.intersect = function(c) {
|
|
414
|
-
return
|
|
415
|
+
return E(t, i, c);
|
|
415
416
|
}, o;
|
|
416
417
|
}
|
|
417
|
-
function
|
|
418
|
+
function dt(r, e, t) {
|
|
418
419
|
const a = e.height, s = a / 4, i = e.width + 2 * s, o = [
|
|
419
420
|
{ x: s, y: 0 },
|
|
420
421
|
{ x: i - s, y: 0 },
|
|
@@ -422,43 +423,43 @@ function ct(r, e, t) {
|
|
|
422
423
|
{ x: i - s, y: -a },
|
|
423
424
|
{ x: s, y: -a },
|
|
424
425
|
{ x: 0, y: -a / 2 }
|
|
425
|
-
], c =
|
|
426
|
+
], c = N(r, i, a, o);
|
|
426
427
|
return t.intersect = function(d) {
|
|
427
|
-
return
|
|
428
|
+
return E(t, o, d);
|
|
428
429
|
}, c;
|
|
429
430
|
}
|
|
430
|
-
function
|
|
431
|
+
function ht(r, e, t) {
|
|
431
432
|
const n = e.width, a = e.height, s = [
|
|
432
433
|
{ x: -a / 2, y: 0 },
|
|
433
434
|
{ x: n, y: 0 },
|
|
434
435
|
{ x: n, y: -a },
|
|
435
436
|
{ x: -a / 2, y: -a },
|
|
436
437
|
{ x: 0, y: -a / 2 }
|
|
437
|
-
], i =
|
|
438
|
+
], i = N(r, n, a, s);
|
|
438
439
|
return t.intersect = function(o) {
|
|
439
|
-
return
|
|
440
|
+
return E(t, s, o);
|
|
440
441
|
}, i;
|
|
441
442
|
}
|
|
442
|
-
function
|
|
443
|
+
function ut(r, e, t) {
|
|
443
444
|
const n = e.width, a = e.height, s = [
|
|
444
445
|
{ x: -2 * a / 6, y: 0 },
|
|
445
446
|
{ x: n - a / 6, y: 0 },
|
|
446
447
|
{ x: n + 2 * a / 6, y: -a },
|
|
447
448
|
{ x: a / 6, y: -a }
|
|
448
|
-
], i =
|
|
449
|
+
], i = N(r, n, a, s);
|
|
449
450
|
return t.intersect = function(o) {
|
|
450
|
-
return
|
|
451
|
+
return E(t, s, o);
|
|
451
452
|
}, i;
|
|
452
453
|
}
|
|
453
|
-
function
|
|
454
|
+
function pt(r, e, t) {
|
|
454
455
|
const n = e.width, a = e.height, s = [
|
|
455
456
|
{ x: 2 * a / 6, y: 0 },
|
|
456
457
|
{ x: n + a / 6, y: 0 },
|
|
457
458
|
{ x: n - 2 * a / 6, y: -a },
|
|
458
459
|
{ x: -a / 6, y: -a }
|
|
459
|
-
], i =
|
|
460
|
+
], i = N(r, n, a, s);
|
|
460
461
|
return t.intersect = function(o) {
|
|
461
|
-
return
|
|
462
|
+
return E(t, s, o);
|
|
462
463
|
}, i;
|
|
463
464
|
}
|
|
464
465
|
function ft(r, e, t) {
|
|
@@ -467,20 +468,20 @@ function ft(r, e, t) {
|
|
|
467
468
|
{ x: n + 2 * a / 6, y: 0 },
|
|
468
469
|
{ x: n - a / 6, y: -a },
|
|
469
470
|
{ x: a / 6, y: -a }
|
|
470
|
-
], i =
|
|
471
|
+
], i = N(r, n, a, s);
|
|
471
472
|
return t.intersect = function(o) {
|
|
472
|
-
return
|
|
473
|
+
return E(t, s, o);
|
|
473
474
|
}, i;
|
|
474
475
|
}
|
|
475
|
-
function
|
|
476
|
+
function yt(r, e, t) {
|
|
476
477
|
const n = e.width, a = e.height, s = [
|
|
477
478
|
{ x: a / 6, y: 0 },
|
|
478
479
|
{ x: n - a / 6, y: 0 },
|
|
479
480
|
{ x: n + 2 * a / 6, y: -a },
|
|
480
481
|
{ x: -2 * a / 6, y: -a }
|
|
481
|
-
], i =
|
|
482
|
+
], i = N(r, n, a, s);
|
|
482
483
|
return t.intersect = function(o) {
|
|
483
|
-
return
|
|
484
|
+
return E(t, s, o);
|
|
484
485
|
}, i;
|
|
485
486
|
}
|
|
486
487
|
function vt(r, e, t) {
|
|
@@ -490,18 +491,18 @@ function vt(r, e, t) {
|
|
|
490
491
|
{ x: n, y: -a / 2 },
|
|
491
492
|
{ x: n + a / 2, y: -a },
|
|
492
493
|
{ x: 0, y: -a }
|
|
493
|
-
], i =
|
|
494
|
+
], i = N(r, n, a, s);
|
|
494
495
|
return t.intersect = function(o) {
|
|
495
|
-
return
|
|
496
|
+
return E(t, s, o);
|
|
496
497
|
}, i;
|
|
497
498
|
}
|
|
498
499
|
function gt(r, e, t) {
|
|
499
500
|
const n = e.height, a = e.width + n / 4, s = r.insert("rect", ":first-child").attr("rx", n / 2).attr("ry", n / 2).attr("x", -a / 2).attr("y", -n / 2).attr("width", a).attr("height", n);
|
|
500
501
|
return t.intersect = function(i) {
|
|
501
|
-
return
|
|
502
|
+
return Q(t, i);
|
|
502
503
|
}, s;
|
|
503
504
|
}
|
|
504
|
-
function
|
|
505
|
+
function wt(r, e, t) {
|
|
505
506
|
const n = e.width, a = e.height, s = [
|
|
506
507
|
{ x: 0, y: 0 },
|
|
507
508
|
{ x: n, y: 0 },
|
|
@@ -513,29 +514,29 @@ function yt(r, e, t) {
|
|
|
513
514
|
{ x: n + 8, y: -a },
|
|
514
515
|
{ x: -8, y: -a },
|
|
515
516
|
{ x: -8, y: 0 }
|
|
516
|
-
], i =
|
|
517
|
+
], i = N(r, n, a, s);
|
|
517
518
|
return t.intersect = function(o) {
|
|
518
|
-
return
|
|
519
|
+
return E(t, s, o);
|
|
519
520
|
}, i;
|
|
520
521
|
}
|
|
521
|
-
function
|
|
522
|
+
function mt(r, e, t) {
|
|
522
523
|
const n = e.width, a = n / 2, s = a / (2.5 + n / 50), i = e.height + s, o = "M 0," + s + " a " + a + "," + s + " 0,0,0 " + n + " 0 a " + a + "," + s + " 0,0,0 " + -n + " 0 l 0," + i + " a " + a + "," + s + " 0,0,0 " + n + " 0 l 0," + -i, c = r.attr("label-offset-y", s).insert("path", ":first-child").attr("d", o).attr("transform", "translate(" + -n / 2 + "," + -(i / 2 + s) + ")");
|
|
523
524
|
return t.intersect = function(d) {
|
|
524
|
-
const l =
|
|
525
|
-
if (a != 0 && (Math.abs(
|
|
526
|
-
let h = s * s * (1 -
|
|
525
|
+
const l = Q(t, d), y = l.x - t.x;
|
|
526
|
+
if (a != 0 && (Math.abs(y) < t.width / 2 || Math.abs(y) == t.width / 2 && Math.abs(l.y - t.y) > t.height / 2 - s)) {
|
|
527
|
+
let h = s * s * (1 - y * y / (a * a));
|
|
527
528
|
h != 0 && (h = Math.sqrt(h)), h = s - h, d.y - t.y > 0 && (h = -h), l.y += h;
|
|
528
529
|
}
|
|
529
530
|
return l;
|
|
530
531
|
}, c;
|
|
531
532
|
}
|
|
532
|
-
function
|
|
533
|
-
r.shapes().question =
|
|
533
|
+
function pe(r) {
|
|
534
|
+
r.shapes().question = ct, r.shapes().hexagon = dt, r.shapes().stadium = gt, r.shapes().subroutine = wt, r.shapes().cylinder = mt, r.shapes().rect_left_inv_arrow = ht, r.shapes().lean_right = ut, r.shapes().lean_left = pt, r.shapes().trapezoid = ft, r.shapes().inv_trapezoid = yt, r.shapes().rect_right_inv_arrow = vt;
|
|
534
535
|
}
|
|
535
|
-
function
|
|
536
|
-
r({ question:
|
|
536
|
+
function fe(r) {
|
|
537
|
+
r({ question: ct }), r({ hexagon: dt }), r({ stadium: gt }), r({ subroutine: wt }), r({ cylinder: mt }), r({ rect_left_inv_arrow: ht }), r({ lean_right: ut }), r({ lean_left: pt }), r({ trapezoid: ft }), r({ inv_trapezoid: yt }), r({ rect_right_inv_arrow: vt });
|
|
537
538
|
}
|
|
538
|
-
function
|
|
539
|
+
function N(r, e, t, n) {
|
|
539
540
|
return r.insert("polygon", ":first-child").attr(
|
|
540
541
|
"points",
|
|
541
542
|
n.map(function(a) {
|
|
@@ -543,248 +544,248 @@ function A(r, e, t, n) {
|
|
|
543
544
|
}).join(" ")
|
|
544
545
|
).attr("transform", "translate(" + -e / 2 + "," + t / 2 + ")");
|
|
545
546
|
}
|
|
546
|
-
const
|
|
547
|
-
addToRender:
|
|
548
|
-
addToRenderV2:
|
|
549
|
-
}, xt = {},
|
|
547
|
+
const ye = {
|
|
548
|
+
addToRender: pe,
|
|
549
|
+
addToRenderV2: fe
|
|
550
|
+
}, xt = {}, ve = function(r) {
|
|
550
551
|
const e = Object.keys(r);
|
|
551
552
|
for (const t of e)
|
|
552
553
|
xt[t] = r[t];
|
|
553
|
-
},
|
|
554
|
-
const i = n ? n.select(`[id="${t}"]`) :
|
|
554
|
+
}, bt = async function(r, e, t, n, a, s) {
|
|
555
|
+
const i = n ? n.select(`[id="${t}"]`) : x(`[id="${t}"]`), o = a || document, c = Object.keys(r);
|
|
555
556
|
for (const d of c) {
|
|
556
557
|
const l = r[d];
|
|
557
|
-
let
|
|
558
|
-
l.classes.length > 0 && (
|
|
559
|
-
const h =
|
|
560
|
-
let u = l.text !== void 0 ? l.text : l.id,
|
|
561
|
-
if (
|
|
562
|
-
const
|
|
558
|
+
let y = "default";
|
|
559
|
+
l.classes.length > 0 && (y = l.classes.join(" "));
|
|
560
|
+
const h = V(l.styles);
|
|
561
|
+
let u = l.text !== void 0 ? l.text : l.id, f;
|
|
562
|
+
if (Z(D().flowchart.htmlLabels)) {
|
|
563
|
+
const v = {
|
|
563
564
|
label: await tt(
|
|
564
565
|
u.replace(
|
|
565
566
|
/fa[blrs]?:fa-[\w-]+/g,
|
|
566
567
|
// cspell:disable-line
|
|
567
|
-
(
|
|
568
|
+
(k) => `<i class='${k.replace(":", " ")}'></i>`
|
|
568
569
|
),
|
|
569
|
-
|
|
570
|
+
D()
|
|
570
571
|
)
|
|
571
572
|
};
|
|
572
|
-
|
|
573
|
+
f = at(i, v).node(), f.parentNode.removeChild(f);
|
|
573
574
|
} else {
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
const
|
|
577
|
-
for (const
|
|
578
|
-
const
|
|
579
|
-
|
|
575
|
+
const v = o.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
576
|
+
v.setAttribute("style", h.labelStyle.replace("color:", "fill:"));
|
|
577
|
+
const k = u.split(et.lineBreakRegex);
|
|
578
|
+
for (const P of k) {
|
|
579
|
+
const L = o.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
580
|
+
L.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), L.setAttribute("dy", "1em"), L.setAttribute("x", "1"), L.textContent = P, v.appendChild(L);
|
|
580
581
|
}
|
|
581
|
-
|
|
582
|
+
f = v;
|
|
582
583
|
}
|
|
583
|
-
let
|
|
584
|
+
let g = 0, p = "";
|
|
584
585
|
switch (l.type) {
|
|
585
586
|
case "round":
|
|
586
|
-
|
|
587
|
+
g = 5, p = "rect";
|
|
587
588
|
break;
|
|
588
589
|
case "square":
|
|
589
|
-
|
|
590
|
+
p = "rect";
|
|
590
591
|
break;
|
|
591
592
|
case "diamond":
|
|
592
|
-
|
|
593
|
+
p = "question";
|
|
593
594
|
break;
|
|
594
595
|
case "hexagon":
|
|
595
|
-
|
|
596
|
+
p = "hexagon";
|
|
596
597
|
break;
|
|
597
598
|
case "odd":
|
|
598
|
-
|
|
599
|
+
p = "rect_left_inv_arrow";
|
|
599
600
|
break;
|
|
600
601
|
case "lean_right":
|
|
601
|
-
|
|
602
|
+
p = "lean_right";
|
|
602
603
|
break;
|
|
603
604
|
case "lean_left":
|
|
604
|
-
|
|
605
|
+
p = "lean_left";
|
|
605
606
|
break;
|
|
606
607
|
case "trapezoid":
|
|
607
|
-
|
|
608
|
+
p = "trapezoid";
|
|
608
609
|
break;
|
|
609
610
|
case "inv_trapezoid":
|
|
610
|
-
|
|
611
|
+
p = "inv_trapezoid";
|
|
611
612
|
break;
|
|
612
613
|
case "odd_right":
|
|
613
|
-
|
|
614
|
+
p = "rect_left_inv_arrow";
|
|
614
615
|
break;
|
|
615
616
|
case "circle":
|
|
616
|
-
|
|
617
|
+
p = "circle";
|
|
617
618
|
break;
|
|
618
619
|
case "ellipse":
|
|
619
|
-
|
|
620
|
+
p = "ellipse";
|
|
620
621
|
break;
|
|
621
622
|
case "stadium":
|
|
622
|
-
|
|
623
|
+
p = "stadium";
|
|
623
624
|
break;
|
|
624
625
|
case "subroutine":
|
|
625
|
-
|
|
626
|
+
p = "subroutine";
|
|
626
627
|
break;
|
|
627
628
|
case "cylinder":
|
|
628
|
-
|
|
629
|
+
p = "cylinder";
|
|
629
630
|
break;
|
|
630
631
|
case "group":
|
|
631
|
-
|
|
632
|
+
p = "rect";
|
|
632
633
|
break;
|
|
633
634
|
default:
|
|
634
|
-
|
|
635
|
+
p = "rect";
|
|
635
636
|
}
|
|
636
|
-
|
|
637
|
+
M.warn("Adding node", l.id, l.domId), e.setNode(s.db.lookUpDomId(l.id), {
|
|
637
638
|
labelType: "svg",
|
|
638
639
|
labelStyle: h.labelStyle,
|
|
639
|
-
shape:
|
|
640
|
-
label:
|
|
641
|
-
rx:
|
|
642
|
-
ry:
|
|
643
|
-
class:
|
|
640
|
+
shape: p,
|
|
641
|
+
label: f,
|
|
642
|
+
rx: g,
|
|
643
|
+
ry: g,
|
|
644
|
+
class: y,
|
|
644
645
|
style: h.style,
|
|
645
646
|
id: s.db.lookUpDomId(l.id)
|
|
646
647
|
});
|
|
647
648
|
}
|
|
648
|
-
},
|
|
649
|
+
}, kt = async function(r, e, t) {
|
|
649
650
|
let n = 0, a, s;
|
|
650
651
|
if (r.defaultStyle !== void 0) {
|
|
651
|
-
const i =
|
|
652
|
+
const i = V(r.defaultStyle);
|
|
652
653
|
a = i.style, s = i.labelStyle;
|
|
653
654
|
}
|
|
654
655
|
for (const i of r) {
|
|
655
656
|
n++;
|
|
656
657
|
const o = "L-" + i.start + "-" + i.end, c = "LS-" + i.start, d = "LE-" + i.end, l = {};
|
|
657
658
|
i.type === "arrow_open" ? l.arrowhead = "none" : l.arrowhead = "normal";
|
|
658
|
-
let
|
|
659
|
+
let y = "", h = "";
|
|
659
660
|
if (i.style !== void 0) {
|
|
660
|
-
const u =
|
|
661
|
-
|
|
661
|
+
const u = V(i.style);
|
|
662
|
+
y = u.style, h = u.labelStyle;
|
|
662
663
|
} else
|
|
663
664
|
switch (i.stroke) {
|
|
664
665
|
case "normal":
|
|
665
|
-
|
|
666
|
+
y = "fill:none", a !== void 0 && (y = a), s !== void 0 && (h = s);
|
|
666
667
|
break;
|
|
667
668
|
case "dotted":
|
|
668
|
-
|
|
669
|
+
y = "fill:none;stroke-width:2px;stroke-dasharray:3;";
|
|
669
670
|
break;
|
|
670
671
|
case "thick":
|
|
671
|
-
|
|
672
|
+
y = " stroke-width: 3.5px;fill:none";
|
|
672
673
|
break;
|
|
673
674
|
}
|
|
674
|
-
l.style =
|
|
675
|
+
l.style = y, l.labelStyle = h, i.interpolate !== void 0 ? l.curve = W(i.interpolate, G) : r.defaultInterpolate !== void 0 ? l.curve = W(r.defaultInterpolate, G) : l.curve = W(xt.curve, G), i.text === void 0 ? i.style !== void 0 && (l.arrowheadStyle = "fill: #333") : (l.arrowheadStyle = "fill: #333", l.labelpos = "c", Z(D().flowchart.htmlLabels) ? (l.labelType = "html", l.label = `<span id="L-${o}" class="edgeLabel L-${c}' L-${d}" style="${l.labelStyle}">${await tt(
|
|
675
676
|
i.text.replace(
|
|
676
677
|
/fa[blrs]?:fa-[\w-]+/g,
|
|
677
678
|
// cspell:disable-line
|
|
678
679
|
(u) => `<i class='${u.replace(":", " ")}'></i>`
|
|
679
680
|
),
|
|
680
|
-
|
|
681
|
+
D()
|
|
681
682
|
)}</span>`) : (l.labelType = "text", l.label = i.text.replace(et.lineBreakRegex, `
|
|
682
683
|
`), i.style === void 0 && (l.style = l.style || "stroke: #333; stroke-width: 1.5px;fill:none"), l.labelStyle = l.labelStyle.replace("color:", "fill:"))), l.id = o, l.class = c + " " + d, l.minlen = i.length || 1, e.setEdge(t.db.lookUpDomId(i.start), t.db.lookUpDomId(i.end), l, n);
|
|
683
684
|
}
|
|
684
|
-
},
|
|
685
|
-
return
|
|
686
|
-
},
|
|
687
|
-
|
|
688
|
-
const { securityLevel: a, flowchart: s } =
|
|
685
|
+
}, ge = function(r, e) {
|
|
686
|
+
return M.info("Extracting classes"), e.db.getClasses();
|
|
687
|
+
}, we = async function(r, e, t, n) {
|
|
688
|
+
M.info("Drawing flowchart");
|
|
689
|
+
const { securityLevel: a, flowchart: s } = D();
|
|
689
690
|
let i;
|
|
690
|
-
a === "sandbox" && (i =
|
|
691
|
-
const o = a === "sandbox" ?
|
|
691
|
+
a === "sandbox" && (i = x("#i" + e));
|
|
692
|
+
const o = a === "sandbox" ? x(i.nodes()[0].contentDocument.body) : x("body"), c = a === "sandbox" ? i.nodes()[0].contentDocument : document;
|
|
692
693
|
let d = n.db.getDirection();
|
|
693
694
|
d === void 0 && (d = "TD");
|
|
694
|
-
const l = s.nodeSpacing || 50,
|
|
695
|
+
const l = s.nodeSpacing || 50, y = s.rankSpacing || 50, h = new Tt({
|
|
695
696
|
multigraph: !0,
|
|
696
697
|
compound: !0
|
|
697
698
|
}).setGraph({
|
|
698
699
|
rankdir: d,
|
|
699
700
|
nodesep: l,
|
|
700
|
-
ranksep:
|
|
701
|
+
ranksep: y,
|
|
701
702
|
marginx: 8,
|
|
702
703
|
marginy: 8
|
|
703
704
|
}).setDefaultEdgeLabel(function() {
|
|
704
705
|
return {};
|
|
705
706
|
});
|
|
706
707
|
let u;
|
|
707
|
-
const
|
|
708
|
-
for (let
|
|
709
|
-
u =
|
|
710
|
-
const
|
|
711
|
-
|
|
712
|
-
const
|
|
713
|
-
let
|
|
714
|
-
for (
|
|
715
|
-
u =
|
|
716
|
-
for (let
|
|
717
|
-
|
|
708
|
+
const f = n.db.getSubGraphs();
|
|
709
|
+
for (let w = f.length - 1; w >= 0; w--)
|
|
710
|
+
u = f[w], n.db.addVertex(u.id, u.title, "group", void 0, u.classes);
|
|
711
|
+
const g = n.db.getVertices();
|
|
712
|
+
M.warn("Get vertices", g);
|
|
713
|
+
const p = n.db.getEdges();
|
|
714
|
+
let v = 0;
|
|
715
|
+
for (v = f.length - 1; v >= 0; v--) {
|
|
716
|
+
u = f[v], Pt("cluster").append("text");
|
|
717
|
+
for (let w = 0; w < u.nodes.length; w++)
|
|
718
|
+
M.warn(
|
|
718
719
|
"Setting subgraph",
|
|
719
|
-
u.nodes[
|
|
720
|
-
n.db.lookUpDomId(u.nodes[
|
|
720
|
+
u.nodes[w],
|
|
721
|
+
n.db.lookUpDomId(u.nodes[w]),
|
|
721
722
|
n.db.lookUpDomId(u.id)
|
|
722
|
-
), h.setParent(n.db.lookUpDomId(u.nodes[
|
|
723
|
+
), h.setParent(n.db.lookUpDomId(u.nodes[w]), n.db.lookUpDomId(u.id));
|
|
723
724
|
}
|
|
724
|
-
await
|
|
725
|
-
const
|
|
726
|
-
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
},
|
|
730
|
-
|
|
725
|
+
await bt(g, h, e, o, c, n), await kt(p, h, n);
|
|
726
|
+
const k = new le();
|
|
727
|
+
ye.addToRender(k), k.arrows().none = function(b, S, m, C) {
|
|
728
|
+
const A = b.append("marker").attr("id", S).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto").append("path").attr("d", "M 0 0 L 0 0 L 0 0 z");
|
|
729
|
+
T(A, m[C + "Style"]);
|
|
730
|
+
}, k.arrows().normal = function(b, S) {
|
|
731
|
+
b.append("marker").attr("id", S).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowheadPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
731
732
|
};
|
|
732
|
-
const
|
|
733
|
-
for (
|
|
733
|
+
const P = o.select(`[id="${e}"]`), L = o.select("#" + e + " g");
|
|
734
|
+
for (k(L, h), L.selectAll("g.node").attr("title", function() {
|
|
734
735
|
return n.db.getTooltip(this.id);
|
|
735
|
-
}), n.db.indexNodes("subGraph" +
|
|
736
|
-
if (u =
|
|
737
|
-
const
|
|
736
|
+
}), n.db.indexNodes("subGraph" + v), v = 0; v < f.length; v++)
|
|
737
|
+
if (u = f[v], u.title !== "undefined") {
|
|
738
|
+
const w = c.querySelectorAll(
|
|
738
739
|
"#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"] rect'
|
|
739
|
-
),
|
|
740
|
+
), b = c.querySelectorAll(
|
|
740
741
|
"#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"]'
|
|
741
|
-
),
|
|
742
|
-
|
|
743
|
-
for (let
|
|
744
|
-
|
|
742
|
+
), S = w[0].x.baseVal.value, m = w[0].y.baseVal.value, C = w[0].width.baseVal.value, A = x(b[0]).select(".label");
|
|
743
|
+
A.attr("transform", `translate(${S + C / 2}, ${m + 14})`), A.attr("id", e + "Text");
|
|
744
|
+
for (let U = 0; U < u.classes.length; U++)
|
|
745
|
+
b[0].classList.add(u.classes[U]);
|
|
745
746
|
}
|
|
746
747
|
if (!s.htmlLabels) {
|
|
747
|
-
const
|
|
748
|
-
for (const
|
|
749
|
-
const
|
|
750
|
-
m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width",
|
|
748
|
+
const w = c.querySelectorAll('[id="' + e + '"] .edgeLabel .label');
|
|
749
|
+
for (const b of w) {
|
|
750
|
+
const S = b.getBBox(), m = c.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
751
|
+
m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width", S.width), m.setAttribute("height", S.height), b.insertBefore(m, b.firstChild);
|
|
751
752
|
}
|
|
752
753
|
}
|
|
753
|
-
|
|
754
|
-
const
|
|
755
|
-
if (
|
|
756
|
-
const
|
|
757
|
-
if (
|
|
754
|
+
Lt(h, P, s.diagramPadding, s.useMaxWidth), Object.keys(g).forEach(function(w) {
|
|
755
|
+
const b = g[w];
|
|
756
|
+
if (b.link) {
|
|
757
|
+
const S = o.select("#" + e + ' [id="' + n.db.lookUpDomId(w) + '"]');
|
|
758
|
+
if (S) {
|
|
758
759
|
const m = c.createElementNS("http://www.w3.org/2000/svg", "a");
|
|
759
|
-
m.setAttributeNS("http://www.w3.org/2000/svg", "class",
|
|
760
|
-
const
|
|
760
|
+
m.setAttributeNS("http://www.w3.org/2000/svg", "class", b.classes.join(" ")), m.setAttributeNS("http://www.w3.org/2000/svg", "href", b.link), m.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), a === "sandbox" ? m.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : b.linkTarget && m.setAttributeNS("http://www.w3.org/2000/svg", "target", b.linkTarget);
|
|
761
|
+
const C = S.insert(function() {
|
|
761
762
|
return m;
|
|
762
|
-
}, ":first-child"),
|
|
763
|
-
|
|
764
|
-
return
|
|
763
|
+
}, ":first-child"), R = S.select(".label-container");
|
|
764
|
+
R && C.append(function() {
|
|
765
|
+
return R.node();
|
|
765
766
|
});
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
return
|
|
767
|
+
const A = S.select(".label");
|
|
768
|
+
A && C.append(function() {
|
|
769
|
+
return A.node();
|
|
769
770
|
});
|
|
770
771
|
}
|
|
771
772
|
}
|
|
772
773
|
});
|
|
773
|
-
},
|
|
774
|
-
setConf:
|
|
775
|
-
addVertices:
|
|
776
|
-
addEdges:
|
|
777
|
-
getClasses:
|
|
778
|
-
draw:
|
|
779
|
-
},
|
|
780
|
-
parser:
|
|
781
|
-
db:
|
|
782
|
-
renderer:
|
|
783
|
-
styles:
|
|
774
|
+
}, me = {
|
|
775
|
+
setConf: ve,
|
|
776
|
+
addVertices: bt,
|
|
777
|
+
addEdges: kt,
|
|
778
|
+
getClasses: ge,
|
|
779
|
+
draw: we
|
|
780
|
+
}, Ne = {
|
|
781
|
+
parser: St,
|
|
782
|
+
db: $,
|
|
783
|
+
renderer: At,
|
|
784
|
+
styles: Nt,
|
|
784
785
|
init: (r) => {
|
|
785
|
-
r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute,
|
|
786
|
+
r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute, me.setConf(r.flowchart), $.clear(), $.setGen("gen-1");
|
|
786
787
|
}
|
|
787
788
|
};
|
|
788
789
|
export {
|
|
789
|
-
|
|
790
|
+
Ne as diagram
|
|
790
791
|
};
|