@layers-app/editor 0.7.25 → 0.7.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/{layers.Brp6skAm.js → layers.-wjKgffX.js} +5 -5
- package/dist/{layers.DTruHn92.js → layers.1bJ3Mbz9.js} +4 -4
- package/dist/{layers.CRzNguJz.js → layers.2T1xhom9.js} +1 -1
- package/dist/{layers.LgT80au8.js → layers.6sikPcq3.js} +1 -1
- package/dist/{layers.BV05ps6w.js → layers.6w8B4hFk.js} +1 -1
- package/dist/{layers.TrDbXRb8.js → layers.8RkOJVIE.js} +1 -1
- package/dist/{layers.C47T8dJb.js → layers.8VJeG9rG.js} +1 -1
- package/dist/{layers.D34dFD31.js → layers.AAIYJoWX.js} +1 -1
- package/dist/{layers.BVrJzYwq.js → layers.B2YKwjXz.js} +2 -2
- package/dist/{layers.DbK_nYcQ.js → layers.B2qAOIlo.js} +1 -1
- package/dist/{layers.ChuiM2Ge.js → layers.B2yHR68Q.js} +1 -1
- package/dist/{layers.-SJh4Kq2.js → layers.B33gaZah.js} +1 -1
- package/dist/{layers.D9B9kI_I.js → layers.B3I1RQ68.js} +8 -8
- package/dist/{layers.CHFi7PC4.js → layers.B3z0mDcg.js} +1 -1
- package/dist/{layers.UlDQNWlA.js → layers.B4bWwT6u.js} +3 -3
- package/dist/{layers.CtqLApR-.js → layers.B4ck5N3X.js} +1 -1
- package/dist/{layers.D_2dwpMo.js → layers.B6c3HMGt.js} +1 -1
- package/dist/{layers.Bd6cgHp0.js → layers.B6rDUX-b.js} +1 -1
- package/dist/{layers.RxenRXMY.js → layers.B7edFg4K.js} +1 -1
- package/dist/{layers.jtRJowIU.js → layers.B7mfWigl.js} +1 -1
- package/dist/{layers.CG_YrCGZ.js → layers.BB8EnLVz.js} +1 -1
- package/dist/{layers.NXDHF5r0.js → layers.BFEVByrk.js} +1 -1
- package/dist/{layers.C5AaiHMH.js → layers.BFc73oZr.js} +1 -1
- package/dist/{layers.BBWtc1Na.js → layers.BG--DwYt.js} +1 -1
- package/dist/{layers.CfAsuE0t.js → layers.BGC5ykCP.js} +4 -4
- package/dist/{layers.C1avgZsp.js → layers.BIEejIsW.js} +1 -1
- package/dist/{layers.baDgNsYq.js → layers.BIHazuDa.js} +3 -3
- package/dist/{layers.BHReeHPG.js → layers.BKpRcWnp.js} +1 -1
- package/dist/{layers.BGJOBg2o.js → layers.BMNubRvf.js} +1 -1
- package/dist/{layers.C80QAnj8.js → layers.BN9FdsoO.js} +1 -1
- package/dist/{layers.CBfqnUFp.js → layers.BNk35KKQ.js} +1 -1
- package/dist/{layers.CRhRxpH2.js → layers.BO9n3EnR.js} +1 -1
- package/dist/{layers.BSls3Y1p.js → layers.BPcVGKN8.js} +1 -1
- package/dist/{layers.DSJEusk2.js → layers.BRzgC6KB.js} +1 -1
- package/dist/{layers.BiHH6Fh-.js → layers.BTCB0JpX.js} +1 -1
- package/dist/{layers.Dr8lokU-.js → layers.BTeJHhdu.js} +1 -1
- package/dist/{layers.Bj75ZwcK.js → layers.BTuPozoV.js} +1 -1
- package/dist/{layers.CRov8ByE.js → layers.BTzUbI88.js} +1 -1
- package/dist/{layers.3on5zDVs.js → layers.BV21urwt.js} +1 -1
- package/dist/{layers.__unmC_q.js → layers.BXpw5pIX.js} +1 -1
- package/dist/{layers.C06M-eeu.js → layers.BYSykmoC.js} +1 -1
- package/dist/{layers.BDZl0ah2.js → layers.BY_J4jYD.js} +1 -1
- package/dist/{layers.8UaSgU3C.js → layers.B_VEfl-c.js} +1 -1
- package/dist/{layers.CGi5h4Tm.js → layers.B_o3asJK.js} +1 -1
- package/dist/{layers.DQTRq76g.js → layers.BaT04AWS.js} +1 -1
- package/dist/{layers.KnN1a1l_.js → layers.BaVjgFII.js} +1 -1
- package/dist/{layers.TH2ncHZv.js → layers.BbH61zxx.js} +1 -1
- package/dist/{layers.CP3V97Mm.js → layers.BbPfMVtY.js} +1 -1
- package/dist/{layers.BIlCcpn1.js → layers.Bc3f0bzg.js} +1 -1
- package/dist/{layers.BWO0uznn.js → layers.BcdMFEfM.js} +1 -1
- package/dist/{layers.Q6R5qldt.js → layers.Bd3FesAt.js} +1 -1
- package/dist/{layers.CElY53KJ.js → layers.Bd6kH7xt.js} +1 -1
- package/dist/{layers.LPHz4BH7.js → layers.Be7W7XL8.js} +1 -1
- package/dist/{layers.D3fmo_a0.js → layers.Bex4q159.js} +1 -1
- package/dist/{layers.BKd9fapo.js → layers.Bh3bOLvQ.js} +3 -3
- package/dist/{layers.CAa0nmHW.js → layers.BiSuaFI7.js} +1 -1
- package/dist/{layers.BgYC2RJy.js → layers.Bi_FdRT_.js} +1 -1
- package/dist/{layers.Bk0JsLzb.js → layers.BiyAv8aG.js} +1 -1
- package/dist/{layers.CaxVzvWl.js → layers.BjMl2wQQ.js} +1 -1
- package/dist/{layers.CtxJX2Ez.js → layers.BjOHqBbv.js} +1 -1
- package/dist/{layers.yhyvjVY-.js → layers.BlEI10xV.js} +1 -1
- package/dist/{layers.DK92KcNH.js → layers.Bq8p214x.js} +1 -1
- package/dist/{layers.2MRpSdXa.js → layers.BqdhwtFO.js} +1 -1
- package/dist/{layers.C1SX3CJH.js → layers.BsEw_gIa.js} +1 -1
- package/dist/{layers.D9IH2mS5.js → layers.Bsoxckn8.js} +2 -2
- package/dist/{layers.DtPJRxRH.js → layers.BtVBENDV.js} +2 -2
- package/dist/{layers.CphQN_oX.js → layers.BtjJdW-J.js} +5 -5
- package/dist/{layers.Dz3W71gG.js → layers.BuslMnX9.js} +1 -1
- package/dist/{layers.D6q3P_TI.js → layers.Bw8iToJZ.js} +1 -1
- package/dist/{layers.BAncAh6d.js → layers.BwDyCg1e.js} +1 -1
- package/dist/{layers.d7lMg0QR.js → layers.Bwkdf-_V.js} +1 -1
- package/dist/{layers.CTCQa5B7.js → layers.Bxp23eQH.js} +1 -1
- package/dist/{layers.CQMBJcRL.js → layers.ByrUhAUL.js} +1 -1
- package/dist/{layers.366DcUWU.js → layers.Bze40RCj.js} +1 -1
- package/dist/{layers.DPYvrBWd.js → layers.BztYpZSr.js} +1 -1
- package/dist/{layers.BJkSsggW.js → layers.C0Ws-fCa.js} +1 -1
- package/dist/{layers.-rsDxFRH.js → layers.C1tEKsbt.js} +1 -1
- package/dist/{layers.B8esHPGj.js → layers.C2FJqDkI.js} +1 -1
- package/dist/{layers.DWoq7Geh.js → layers.C2k_QfG3.js} +2 -2
- package/dist/{layers.DWdnOpAN.js → layers.C34ZNIfL.js} +1 -1
- package/dist/{layers.CvXSTQJz.js → layers.C3DvXqUP.js} +1 -1
- package/dist/{layers.y6SdGC3M.js → layers.C4MSW5Y5.js} +1 -1
- package/dist/{layers.BiHFWV_4.js → layers.C7AUSLfi.js} +1 -1
- package/dist/layers.C7mlmYdC.js +129 -0
- package/dist/{layers._JK3_ksl.js → layers.C8N13X_Z.js} +1 -1
- package/dist/{layers.BBUPOkcX.js → layers.C8ZWzhQl.js} +1 -1
- package/dist/{layers.Bv-JUrFh.js → layers.C8d3D9Lb.js} +1 -1
- package/dist/{layers.DU_zIQ6M.js → layers.C92GKFB8.js} +1 -1
- package/dist/{layers.SrRljbf9.js → layers.CHGPKVlh.js} +1 -1
- package/dist/{layers.2y946lwL.js → layers.CJF69bGz.js} +1 -1
- package/dist/{layers.BH1NBu4v.js → layers.CMFoKFfW.js} +5872 -5847
- package/dist/{layers.CO41l4gK.js → layers.COGWYVIo.js} +3 -3
- package/dist/layers.CQJnLKvH.js +8 -0
- package/dist/{layers.CkEVC49l.js → layers.CVUrxvM-.js} +3 -3
- package/dist/{layers.D6MuphvH.js → layers.CY5BDIai.js} +1 -1
- package/dist/{layers.DOfjoqoq.js → layers.CYkqJ9mA.js} +1 -1
- package/dist/{layers.Cna8Ix8m.js → layers.C_X4Kdn2.js} +1 -1
- package/dist/{layers.B8g_dztZ.js → layers.CaPlf6cQ.js} +1 -1
- package/dist/{layers.DhGC-0BV.js → layers.Caliy2g7.js} +1 -1
- package/dist/{layers.YIK80l-U.js → layers.CanJemCn.js} +1 -1
- package/dist/{layers.C_tM78la.js → layers.CcZVMGJ2.js} +1 -1
- package/dist/{layers.BNcnWyZC.js → layers.CfOpBTNW.js} +1 -1
- package/dist/{layers.ClSWW8ox.js → layers.CgywpxNj.js} +1 -1
- package/dist/{layers.cca4U64x.js → layers.ChP80TqX.js} +1 -1
- package/dist/{layers.BmNaCbw0.js → layers.CickKalz.js} +1 -1
- package/dist/{layers.CwVVNOFl.js → layers.CkYHBZT_.js} +1 -1
- package/dist/{layers.HLK-BXOS.js → layers.ClGUwzhg.js} +1 -1
- package/dist/{layers.CI9_bgQu.js → layers.ClfyzbH1.js} +1 -1
- package/dist/{layers.CQKhlAxU.js → layers.CmxS83Nk.js} +4 -4
- package/dist/{layers.B-BmUfj1.js → layers.Cn5BBMoQ.js} +1 -1
- package/dist/{layers.9ePqiVXU.js → layers.Cnp_kKHs.js} +1 -1
- package/dist/{layers.BuN7h8kT.js → layers.CqUEj4Gr.js} +1 -1
- package/dist/{layers.H8FpXLLW.js → layers.CqVF0OGH.js} +1 -1
- package/dist/{layers.BgWGKBdw.js → layers.CsPg2KjG.js} +1 -1
- package/dist/{layers.d-AtY83o.js → layers.CtQWlaO1.js} +1 -1
- package/dist/{layers.itjHVGTW.js → layers.Cv6S_9I-.js} +1 -1
- package/dist/{layers.C3XlKjwL.js → layers.CxWefKHI.js} +4 -4
- package/dist/{layers.Cn08aFBp.js → layers.Cx_nY6Y7.js} +1 -1
- package/dist/{layers.Dzrd2B4v.js → layers.D01DTzLv.js} +1 -1
- package/dist/{layers.DY10hfS3.js → layers.D0KthgS6.js} +1 -1
- package/dist/{layers.BJkSCIpo.js → layers.D1wXYOhT.js} +2 -2
- package/dist/{layers.D7UuTR-C.js → layers.D3nu7CUH.js} +1 -1
- package/dist/{layers.BfwtWCjL.js → layers.D4aYlLPZ.js} +1 -1
- package/dist/{layers.QE-5n_hV.js → layers.D5OBgP7h.js} +3 -3
- package/dist/{layers.Bs2nvrmm.js → layers.D5VfbQu6.js} +1 -1
- package/dist/{layers.BV5Pu35h.js → layers.D5g62wy8.js} +1 -1
- package/dist/{layers.DtVegRxz.js → layers.D6CpOfiQ.js} +1 -1
- package/dist/{layers.DXtHZ1nj.js → layers.D8wPyzG6.js} +1 -1
- package/dist/{layers.CVcYc1wm.js → layers.D9Tic5tu.js} +1 -1
- package/dist/{layers.BgWSbI6d.js → layers.D9_JSxkr.js} +1 -1
- package/dist/{layers.k2tN79I5.js → layers.DAxsOQEh.js} +1 -1
- package/dist/{layers.CdKTin55.js → layers.DBfOwxPO.js} +1 -1
- package/dist/layers.DEjsgTOR.js +6 -0
- package/dist/{layers.Bz2VJd4T.js → layers.DElPAzG2.js} +1 -1
- package/dist/{layers.CvkyQals.js → layers.DEpxDMdS.js} +1 -1
- package/dist/{layers.DK__DrcP.js → layers.DFF50PT4.js} +1 -1
- package/dist/{layers.CRg1Vflm.js → layers.DIPoQibL.js} +1 -1
- package/dist/{layers.4X_U1XfV.js → layers.DIlNlcqo.js} +1 -1
- package/dist/{layers.BPLm35_w.js → layers.DKm1mN2X.js} +1 -1
- package/dist/{layers.-Ls-OI7U.js → layers.DLV3QO1y.js} +2 -2
- package/dist/{layers.BdYcBuDT.js → layers.DMqa4UuA.js} +3 -3
- package/dist/{layers.D1i520jt.js → layers.DOQpvHnX.js} +1 -1
- package/dist/{layers.B9jCYEPd.js → layers.DOZaSqiR.js} +1 -1
- package/dist/{layers.BoFg5lNF.js → layers.DQ5ZJRxN.js} +1 -1
- package/dist/{layers.B4ClD1c5.js → layers.DQ7Ue1Fv.js} +4 -4
- package/dist/{layers.KkRLbnbd.js → layers.DQ87eVFA.js} +1 -1
- package/dist/{layers.CYRxy5k9.js → layers.DS_qYTUu.js} +1 -1
- package/dist/{layers.Bbk9SfBC.js → layers.DT1Fui5R.js} +1 -1
- package/dist/{layers.CArHK820.js → layers.DTagsNpb.js} +1 -1
- package/dist/layers.DWkC7jVJ.js +1 -0
- package/dist/{layers.PGgmS3VA.js → layers.D_ZvKS4q.js} +1 -1
- package/dist/{layers.BuJyAbNv.js → layers.DagwUHWb.js} +1 -1
- package/dist/{layers.DzgnM6hP.js → layers.Ddc-JH2d.js} +1 -1
- package/dist/{layers.JNFHOtMm.js → layers.DeTIo1zr.js} +1 -1
- package/dist/{layers.Du_afT3B.js → layers.Df5vGs9k.js} +4 -4
- package/dist/{layers.z0ksrFC0.js → layers.DfDXn4TD.js} +1 -1
- package/dist/{layers.gtTSzMc7.js → layers.DfsVAKCW.js} +1 -1
- package/dist/{layers.Ba3lckQw.js → layers.DiSdECjm.js} +3 -3
- package/dist/{layers.axz7t9Nk.js → layers.DkHHkcwB.js} +1 -1
- package/dist/{layers.CGKhD7iW.js → layers.DlaPU6IV.js} +1 -1
- package/dist/{layers.C3DmzNpM.js → layers.DmSHn1Q-.js} +1 -1
- package/dist/{layers.wK0oP6nr.js → layers.DosSADRb.js} +3 -3
- package/dist/{layers.BT2O41er.js → layers.DptMIwKT.js} +1 -1
- package/dist/{layers.DqrXXHei.js → layers.DpvmCmKj.js} +1 -1
- package/dist/{layers.JnIQDm74.js → layers.DrAry1Kf.js} +1 -1
- package/dist/{layers.5x8VmuQb.js → layers.Ds_tgW-V.js} +1 -1
- package/dist/{layers.kfnq0Wd4.js → layers.DtdLS6Dk.js} +1 -1
- package/dist/{layers.DrawsUTF.js → layers.DujvWPQs.js} +4 -4
- package/dist/{layers.CghzKO0C.js → layers.Dx95JHIq.js} +1 -1
- package/dist/{layers.Czao8tOu.js → layers.DxYMwPJD.js} +1 -1
- package/dist/{layers.BX9_f-uK.js → layers.DxqWMo04.js} +1 -1
- package/dist/{layers.XesU1l2Y.js → layers.DzhNjcrw.js} +1 -1
- package/dist/{layers.BQh9MYpb.js → layers.EtcHUsqn.js} +1 -1
- package/dist/{layers.BbTcTSCn.js → layers.GQBWZE5I.js} +3 -3
- package/dist/{layers.BBZaAVkH.js → layers.IAIKoo0h.js} +4 -4
- package/dist/{layers.-NLu5icC.js → layers.LvEP7msO.js} +6 -6
- package/dist/{layers.CiXZ-yap.js → layers.My9kZFhO.js} +4 -4
- package/dist/{layers.BKYZGhXa.js → layers.NDz-9Ggu.js} +1 -1
- package/dist/{layers.BdcGJ_QJ.js → layers.NZf4E-Wg.js} +1 -1
- package/dist/{layers.vRc0zJGo.js → layers.O1t5sl2z.js} +1 -1
- package/dist/{layers.Cabxe0kn.js → layers.RIwhwY8U.js} +2 -2
- package/dist/{layers.e-P09YvR.js → layers.W7ATjiDf.js} +1 -1
- package/dist/layers.X8-JMNQm.js +1 -0
- package/dist/{layers.Iv3TGUjH.js → layers.XMCRkU_N.js} +1 -1
- package/dist/{layers.Clk1Fe4w.js → layers.bf7CMgrh.js} +1 -1
- package/dist/{layers.CuBkUG-7.js → layers.d30Rgcib.js} +1 -1
- package/dist/{layers.B9a8_NYJ.js → layers.dyig4B3u.js} +7 -7
- package/dist/{layers.DhHWB_mo.js → layers.em6rytD5.js} +1 -1
- package/dist/{layers.CAa18d0o.js → layers.gGLUL8Z7.js} +1 -1
- package/dist/{layers.C6CgZWbu.js → layers.hoCWKOtV.js} +1 -1
- package/dist/{layers.CrhNLlxi.js → layers.iFeAlI6H.js} +1 -1
- package/dist/{layers.ByRG1wSE.js → layers.jfJgHirm.js} +1 -1
- package/dist/{layers.eaF4IPbr.js → layers.kZlGqXlo.js} +1 -1
- package/dist/{layers.Cts5KajW.js → layers.lel7gNeu.js} +1 -1
- package/dist/{layers.D959YWGL.js → layers.mBB8ss0I.js} +1 -1
- package/dist/{layers.1T1xbs_L.js → layers.mGvgS9vW.js} +1 -1
- package/dist/{layers.D1lfRls5.js → layers.nFOcuDzr.js} +1 -1
- package/dist/{layers.BwPh3QUh.js → layers.obwBR-PL.js} +1 -1
- package/dist/{layers.DBuKAjE6.js → layers.pWVdZ1OI.js} +3 -3
- package/dist/{layers.M8WSI-kl.js → layers.qT-9akPN.js} +1 -1
- package/dist/{layers.BdaWU2a_.js → layers.s4n1roZI.js} +1 -1
- package/dist/{layers.BbeMJlU4.js → layers.vJOgspvU.js} +24 -24
- package/dist/{layers.Bn-X5mPt.js → layers.ylvIcl1z.js} +3 -3
- package/dist/{layers.BmXDrArd.js → layers.zi2jGsFZ.js} +1 -1
- package/package.json +1 -1
- package/dist/layers.BE2A8-RV.js +0 -129
- package/dist/layers.BxVrC-Rx.js +0 -6
- package/dist/layers.CXNL_oox.js +0 -1
- package/dist/layers.DUnhjbuG.js +0 -1
- package/dist/layers.DdnbCtG7.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const P=require("lodash-es"),J=require("./layers.Cyzu9PKQ.js"),k=require("./layers.BLd2spTm.js"),u=require("./layers.DqrXXHei.js"),i=require("./layers.Bn-X5mPt.js"),j=require("./layers.BBUPOkcX.js");function G(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const m=G(P);function x(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:M(e),edges:F(e)};return m.isUndefined(e.graph())||(t.value=m.clone(e.graph())),t}function M(e){return m.map(e.nodes(),function(t){var n=e.node(t),r=e.parent(t),s={v:t};return m.isUndefined(n)||(s.value=n),m.isUndefined(r)||(s.parent=r),s})}function F(e){return m.map(e.edges(),function(t){var n=e.edge(t),r={v:t.v,w:t.w};return m.isUndefined(t.name)||(r.name=t.name),m.isUndefined(n)||(r.value=n),r})}let a={},w={},p={};const q=()=>{w={},p={},a={}},X=(e,t)=>(i.log$1.trace("In isDescendant",t," ",e," = ",w[t].includes(e)),!!w[t].includes(e)),_=(e,t)=>(i.log$1.info("Descendants of ",t," is ",w[t]),i.log$1.info("Edge is ",e),e.v===t||e.w===t?!1:w[t]?w[t].includes(e.v)||X(e.v,t)||X(e.w,t)||w[t].includes(e.w):(i.log$1.debug("Tilt, ",t,",not in descendants"),!1)),B=(e,t,n,r)=>{i.log$1.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const s=t.children(e)||[];e!==r&&s.push(e),i.log$1.warn("Copying (nodes) clusterId",e,"nodes",s),s.forEach(o=>{if(t.children(o).length>0)B(o,t,n,r);else{const f=t.node(o);i.log$1.info("cp ",o," to ",r," with parent ",e),n.setNode(o,f),r!==t.parent(o)&&(i.log$1.warn("Setting parent",o,t.parent(o)),n.setParent(o,t.parent(o))),e!==r&&o!==e?(i.log$1.debug("Setting parent",o,e),n.setParent(o,e)):(i.log$1.info("In copy ",e,"root",r,"data",t.node(e),r),i.log$1.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==r,"node!==clusterId",o!==e));const g=t.edges(o);i.log$1.debug("Copying Edges",g),g.forEach(d=>{i.log$1.info("Edge",d);const h=t.edge(d.v,d.w,d.name);i.log$1.info("Edge data",h,r);try{_(d,r)?(i.log$1.info("Copying as ",d.v,d.w,h,d.name),n.setEdge(d.v,d.w,h,d.name),i.log$1.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):i.log$1.info("Skipping copy of edge ",d.v,"-->",d.w," rootId: ",r," clusterId:",e)}catch($){i.log$1.error($)}})}i.log$1.debug("Removing node",o),t.removeNode(o)})},D=(e,t)=>{const n=t.children(e);let r=[...n];for(const s of n)p[s]=e,r=[...r,...D(s,t)];return r},C=(e,t)=>{i.log$1.trace("Searching",e);const n=t.children(e);if(i.log$1.trace("Searching children of id ",e,n),n.length<1)return i.log$1.trace("This is a valid node",e),e;for(const r of n){const s=C(r,t);if(s)return i.log$1.trace("Found replacement for",e," => ",s),s}},S=e=>!a[e]||!a[e].externalConnections?e:a[e]?a[e].id:e,U=(e,t)=>{if(!e||t>10){i.log$1.debug("Opting out, no graph ");return}else i.log$1.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.log$1.warn("Cluster identified",n," Replacement id in edges: ",C(n,e)),w[n]=D(n,e),a[n]={id:C(n,e),clusterData:e.node(n)})}),e.nodes().forEach(function(n){const r=e.children(n),s=e.edges();r.length>0?(i.log$1.debug("Cluster identified",n,w),s.forEach(o=>{if(o.v!==n&&o.w!==n){const f=X(o.v,n),g=X(o.w,n);f^g&&(i.log$1.warn("Edge: ",o," leaves cluster ",n),i.log$1.warn("Descendants of XXX ",n,": ",w[n]),a[n].externalConnections=!0)}})):i.log$1.debug("Not a cluster ",n,w)});for(let n of Object.keys(a)){const r=a[n].id,s=e.parent(r);s!==n&&a[s]&&!a[s].externalConnections&&(a[n].id=s)}e.edges().forEach(function(n){const r=e.edge(n);i.log$1.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.log$1.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let s=n.v,o=n.w;if(i.log$1.warn("Fix XXX",a,"ids:",n.v,n.w,"Translating: ",a[n.v]," --- ",a[n.w]),a[n.v]&&a[n.w]&&a[n.v]===a[n.w]){i.log$1.warn("Fixing and trixing link to self - removing XXX",n.v,n.w,n.name),i.log$1.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),s=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name);const f=n.w+"---"+n.v;e.setNode(f,{domId:f,id:f,labelStyle:"",labelText:r.label,padding:0,shape:"labelRect",style:""});const g=structuredClone(r),d=structuredClone(r);g.label="",g.arrowTypeEnd="none",d.label="",g.fromCluster=n.v,d.toCluster=n.v,e.setEdge(s,f,g,n.name+"-cyclic-special"),e.setEdge(f,o,d,n.name+"-cyclic-special")}else if(a[n.v]||a[n.w]){if(i.log$1.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),s=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name),s!==n.v){const f=e.parent(s);a[f].externalConnections=!0,r.fromCluster=n.v}if(o!==n.w){const f=e.parent(o);a[f].externalConnections=!0,r.toCluster=n.w}i.log$1.warn("Fix Replacing with XXX",s,o,n.name),e.setEdge(s,o,r,n.name)}}),i.log$1.warn("Adjusted Graph",x(e)),T(e,0),i.log$1.trace(a)},T=(e,t)=>{if(i.log$1.warn("extractor - ",t,x(e),e.children("D")),t>10){i.log$1.error("Bailing out");return}let n=e.nodes(),r=!1;for(const s of n){const o=e.children(s);r=r||o.length>0}if(!r){i.log$1.debug("Done, no node has children",e.nodes());return}i.log$1.debug("Nodes = ",n,t);for(const s of n)if(i.log$1.debug("Extracting node",s,a,a[s]&&!a[s].externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",t),!a[s])i.log$1.debug("Not a cluster",s,t);else if(!a[s].externalConnections&&e.children(s)&&e.children(s).length>0){i.log$1.warn("Cluster without external connections, without a parent and with children",s,t);let f=e.graph().rankdir==="TB"?"LR":"TB";a[s]&&a[s].clusterData&&a[s].clusterData.dir&&(f=a[s].clusterData.dir,i.log$1.warn("Fixing dir",a[s].clusterData.dir,f));const g=new k.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:f,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});i.log$1.warn("Old graph before copy",x(e)),B(s,e,g,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:a[s].clusterData,labelText:a[s].labelText,graph:g}),i.log$1.warn("New graph after copy node: (",s,")",x(g)),i.log$1.debug("Old graph after copy",x(e))}else i.log$1.warn("Cluster ** ",s," **not meeting the criteria !externalConnections:",!a[s].externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),t),i.log$1.debug(a);n=e.nodes(),i.log$1.warn("New list of nodes",n);for(const s of n){const o=e.node(s);i.log$1.warn(" Now next level",s,o),o.clusterNode&&T(o.graph,t+1)}},O=(e,t)=>{if(t.length===0)return[];let n=Object.assign(t);return t.forEach(r=>{const s=e.children(r),o=O(e,s);n=[...n,...o]}),n},A=e=>O(e,e.children()),H=(e,t)=>{i.log$1.info("Creating subgraph rect for ",t.id,t);const n=i.getConfig(),r=e.insert("g").attr("class","cluster"+(t.class?" "+t.class:"")).attr("id",t.id),s=r.insert("rect",":first-child"),o=i.evaluate(n.flowchart.htmlLabels),f=r.insert("g").attr("class","cluster-label"),g=t.labelType==="markdown"?j.createText(f,t.labelText,{style:t.labelStyle,useHtmlLabels:o}):f.node().appendChild(u.createLabel$1(t.labelText,t.labelStyle,void 0,!0));let d=g.getBBox();if(i.evaluate(n.flowchart.htmlLabels)){const l=g.children[0],c=i.select(g);d=l.getBoundingClientRect(),c.attr("width",d.width),c.attr("height",d.height)}const h=0*t.padding,$=h/2,y=t.width<=d.width+h?d.width+h:t.width;t.width<=d.width+h?t.diff=(d.width-t.width)/2-t.padding/2:t.diff=-t.padding/2,i.log$1.trace("Data ",t,JSON.stringify(t)),s.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-y/2).attr("y",t.y-t.height/2-$).attr("width",y).attr("height",t.height+h);const{subGraphTitleTopMargin:N}=u.getSubGraphTitleMargins(n);o?f.attr("transform",`translate(${t.x-d.width/2}, ${t.y-t.height/2+N})`):f.attr("transform",`translate(${t.x}, ${t.y-t.height/2+N})`);const b=s.node().getBBox();return t.width=b.width,t.height=b.height,t.intersect=function(l){return u.intersectRect$1(t,l)},r},V=(e,t)=>{const n=e.insert("g").attr("class","note-cluster").attr("id",t.id),r=n.insert("rect",":first-child"),s=0*t.padding,o=s/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-o).attr("y",t.y-t.height/2-o).attr("width",t.width+s).attr("height",t.height+s).attr("fill","none");const f=r.node().getBBox();return t.width=f.width,t.height=f.height,t.intersect=function(g){return u.intersectRect$1(t,g)},n},z=(e,t)=>{const n=i.getConfig(),r=e.insert("g").attr("class",t.classes).attr("id",t.id),s=r.insert("rect",":first-child"),o=r.insert("g").attr("class","cluster-label"),f=r.append("rect"),g=o.node().appendChild(u.createLabel$1(t.labelText,t.labelStyle,void 0,!0));let d=g.getBBox();if(i.evaluate(n.flowchart.htmlLabels)){const l=g.children[0],c=i.select(g);d=l.getBoundingClientRect(),c.attr("width",d.width),c.attr("height",d.height)}d=g.getBBox();const h=0*t.padding,$=h/2,y=t.width<=d.width+t.padding?d.width+t.padding:t.width;t.width<=d.width+t.padding?t.diff=(d.width+t.padding*0-t.width)/2:t.diff=-t.padding/2,s.attr("class","outer").attr("x",t.x-y/2-$).attr("y",t.y-t.height/2-$).attr("width",y+h).attr("height",t.height+h),f.attr("class","inner").attr("x",t.x-y/2-$).attr("y",t.y-t.height/2-$+d.height-1).attr("width",y+h).attr("height",t.height+h-d.height-3);const{subGraphTitleTopMargin:N}=u.getSubGraphTitleMargins(n);o.attr("transform",`translate(${t.x-d.width/2}, ${t.y-t.height/2-t.padding/3+(i.evaluate(n.flowchart.htmlLabels)?5:3)+N})`);const b=s.node().getBBox();return t.height=b.height,t.intersect=function(l){return u.intersectRect$1(t,l)},r},W=(e,t)=>{const n=e.insert("g").attr("class",t.classes).attr("id",t.id),r=n.insert("rect",":first-child"),s=0*t.padding,o=s/2;r.attr("class","divider").attr("x",t.x-t.width/2-o).attr("y",t.y-t.height/2).attr("width",t.width+s).attr("height",t.height+s);const f=r.node().getBBox();return t.width=f.width,t.height=f.height,t.diff=-t.padding/2,t.intersect=function(g){return u.intersectRect$1(t,g)},n},K={rect:H,roundedWithTitle:z,noteGroup:V,divider:W};let R={};const Q=(e,t)=>{i.log$1.trace("Inserting cluster");const n=t.shape||"rect";R[t.id]=K[n](e,t)},Y=()=>{R={}},L=async(e,t,n,r,s,o)=>{i.log$1.info("Graph in recursive render: XXX",x(t),s);const f=t.graph().rankdir;i.log$1.trace("Dir in recursive render - dir:",f);const g=e.insert("g").attr("class","root");t.nodes()?i.log$1.info("Recursive render XXX",t.nodes()):i.log$1.info("No nodes found for",t),t.edges().length>0&&i.log$1.trace("Recursive edges",t.edge(t.edges()[0]));const d=g.insert("g").attr("class","clusters"),h=g.insert("g").attr("class","edgePaths"),$=g.insert("g").attr("class","edgeLabels"),y=g.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(l){const c=t.node(l);if(s!==void 0){const v=JSON.parse(JSON.stringify(s.clusterData));i.log$1.info("Setting data for cluster XXX (",l,") ",v,s),t.setNode(s.id,v),t.parent(l)||(i.log$1.trace("Setting parent",l,s.id),t.setParent(l,s.id,v))}if(i.log$1.info("(Insert) Node XXX"+l+": "+JSON.stringify(t.node(l))),c&&c.clusterNode){i.log$1.info("Cluster identified",l,c.width,t.node(l));const v=await L(y,c.graph,n,r,t.node(l),o),E=v.elem;u.updateNodeBounds(c,E),c.diff=v.diff||0,i.log$1.info("Node bounds (abc123)",l,c,c.width,c.x,c.y),u.setNodeElem(E,c),i.log$1.warn("Recursive render complete ",E,c)}else t.children(l).length>0?(i.log$1.info("Cluster - the non recursive path XXX",l,c.id,c,t),i.log$1.info(C(c.id,t)),a[c.id]={id:C(c.id,t),node:c}):(i.log$1.info("Node - the non recursive path",l,c.id,c),await u.insertNode(y,t.node(l),f))})),t.edges().forEach(function(l){const c=t.edge(l.v,l.w,l.name);i.log$1.info("Edge "+l.v+" -> "+l.w+": "+JSON.stringify(l)),i.log$1.info("Edge "+l.v+" -> "+l.w+": ",l," ",JSON.stringify(t.edge(l))),i.log$1.info("Fix",a,"ids:",l.v,l.w,"Translating: ",a[l.v],a[l.w]),u.insertEdgeLabel($,c)}),t.edges().forEach(function(l){i.log$1.info("Edge "+l.v+" -> "+l.w+": "+JSON.stringify(l))}),i.log$1.info("#############################################"),i.log$1.info("### Layout ###"),i.log$1.info("#############################################"),i.log$1.info(t),J.layout(t),i.log$1.info("Graph after layout:",x(t));let N=0;const{subGraphTitleTotalMargin:b}=u.getSubGraphTitleMargins(o);return A(t).forEach(function(l){const c=t.node(l);i.log$1.info("Position "+l+": "+JSON.stringify(t.node(l))),i.log$1.info("Position "+l+": ("+c.x,","+c.y,") width: ",c.width," height: ",c.height),c&&c.clusterNode?(c.y+=b,u.positionNode(c)):t.children(l).length>0?(c.height+=b,Q(d,c),a[c.id].node=c):(c.y+=b/2,u.positionNode(c))}),t.edges().forEach(function(l){const c=t.edge(l);i.log$1.info("Edge "+l.v+" -> "+l.w+": "+JSON.stringify(c),c),c.points.forEach(E=>E.y+=b/2);const v=u.insertEdge(h,l,c,a,n,t,r);u.positionEdgeLabel(c,v)}),t.nodes().forEach(function(l){const c=t.node(l);i.log$1.info(l,c.type,c.diff),c.type==="group"&&(N=c.diff)}),{elem:g,diff:N}},Z=async(e,t,n,r,s)=>{u.insertMarkers$1(e,n,r,s),u.clear$1(),u.clear(),Y(),q(),i.log$1.warn("Graph at first:",JSON.stringify(x(t))),U(t),i.log$1.warn("Graph after:",JSON.stringify(x(t)));const o=i.getConfig();await L(e,t,r,s,void 0,o)};exports.render=Z;
|
|
1
|
+
"use strict";const P=require("lodash-es"),J=require("./layers.Cyzu9PKQ.js"),k=require("./layers.BLd2spTm.js"),u=require("./layers.DpvmCmKj.js"),i=require("./layers.ylvIcl1z.js"),j=require("./layers.C8ZWzhQl.js");function G(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const m=G(P);function x(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:M(e),edges:F(e)};return m.isUndefined(e.graph())||(t.value=m.clone(e.graph())),t}function M(e){return m.map(e.nodes(),function(t){var n=e.node(t),r=e.parent(t),s={v:t};return m.isUndefined(n)||(s.value=n),m.isUndefined(r)||(s.parent=r),s})}function F(e){return m.map(e.edges(),function(t){var n=e.edge(t),r={v:t.v,w:t.w};return m.isUndefined(t.name)||(r.name=t.name),m.isUndefined(n)||(r.value=n),r})}let a={},w={},p={};const q=()=>{w={},p={},a={}},X=(e,t)=>(i.log$1.trace("In isDescendant",t," ",e," = ",w[t].includes(e)),!!w[t].includes(e)),_=(e,t)=>(i.log$1.info("Descendants of ",t," is ",w[t]),i.log$1.info("Edge is ",e),e.v===t||e.w===t?!1:w[t]?w[t].includes(e.v)||X(e.v,t)||X(e.w,t)||w[t].includes(e.w):(i.log$1.debug("Tilt, ",t,",not in descendants"),!1)),B=(e,t,n,r)=>{i.log$1.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const s=t.children(e)||[];e!==r&&s.push(e),i.log$1.warn("Copying (nodes) clusterId",e,"nodes",s),s.forEach(o=>{if(t.children(o).length>0)B(o,t,n,r);else{const f=t.node(o);i.log$1.info("cp ",o," to ",r," with parent ",e),n.setNode(o,f),r!==t.parent(o)&&(i.log$1.warn("Setting parent",o,t.parent(o)),n.setParent(o,t.parent(o))),e!==r&&o!==e?(i.log$1.debug("Setting parent",o,e),n.setParent(o,e)):(i.log$1.info("In copy ",e,"root",r,"data",t.node(e),r),i.log$1.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==r,"node!==clusterId",o!==e));const g=t.edges(o);i.log$1.debug("Copying Edges",g),g.forEach(d=>{i.log$1.info("Edge",d);const h=t.edge(d.v,d.w,d.name);i.log$1.info("Edge data",h,r);try{_(d,r)?(i.log$1.info("Copying as ",d.v,d.w,h,d.name),n.setEdge(d.v,d.w,h,d.name),i.log$1.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):i.log$1.info("Skipping copy of edge ",d.v,"-->",d.w," rootId: ",r," clusterId:",e)}catch($){i.log$1.error($)}})}i.log$1.debug("Removing node",o),t.removeNode(o)})},D=(e,t)=>{const n=t.children(e);let r=[...n];for(const s of n)p[s]=e,r=[...r,...D(s,t)];return r},C=(e,t)=>{i.log$1.trace("Searching",e);const n=t.children(e);if(i.log$1.trace("Searching children of id ",e,n),n.length<1)return i.log$1.trace("This is a valid node",e),e;for(const r of n){const s=C(r,t);if(s)return i.log$1.trace("Found replacement for",e," => ",s),s}},S=e=>!a[e]||!a[e].externalConnections?e:a[e]?a[e].id:e,U=(e,t)=>{if(!e||t>10){i.log$1.debug("Opting out, no graph ");return}else i.log$1.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.log$1.warn("Cluster identified",n," Replacement id in edges: ",C(n,e)),w[n]=D(n,e),a[n]={id:C(n,e),clusterData:e.node(n)})}),e.nodes().forEach(function(n){const r=e.children(n),s=e.edges();r.length>0?(i.log$1.debug("Cluster identified",n,w),s.forEach(o=>{if(o.v!==n&&o.w!==n){const f=X(o.v,n),g=X(o.w,n);f^g&&(i.log$1.warn("Edge: ",o," leaves cluster ",n),i.log$1.warn("Descendants of XXX ",n,": ",w[n]),a[n].externalConnections=!0)}})):i.log$1.debug("Not a cluster ",n,w)});for(let n of Object.keys(a)){const r=a[n].id,s=e.parent(r);s!==n&&a[s]&&!a[s].externalConnections&&(a[n].id=s)}e.edges().forEach(function(n){const r=e.edge(n);i.log$1.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.log$1.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let s=n.v,o=n.w;if(i.log$1.warn("Fix XXX",a,"ids:",n.v,n.w,"Translating: ",a[n.v]," --- ",a[n.w]),a[n.v]&&a[n.w]&&a[n.v]===a[n.w]){i.log$1.warn("Fixing and trixing link to self - removing XXX",n.v,n.w,n.name),i.log$1.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),s=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name);const f=n.w+"---"+n.v;e.setNode(f,{domId:f,id:f,labelStyle:"",labelText:r.label,padding:0,shape:"labelRect",style:""});const g=structuredClone(r),d=structuredClone(r);g.label="",g.arrowTypeEnd="none",d.label="",g.fromCluster=n.v,d.toCluster=n.v,e.setEdge(s,f,g,n.name+"-cyclic-special"),e.setEdge(f,o,d,n.name+"-cyclic-special")}else if(a[n.v]||a[n.w]){if(i.log$1.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),s=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name),s!==n.v){const f=e.parent(s);a[f].externalConnections=!0,r.fromCluster=n.v}if(o!==n.w){const f=e.parent(o);a[f].externalConnections=!0,r.toCluster=n.w}i.log$1.warn("Fix Replacing with XXX",s,o,n.name),e.setEdge(s,o,r,n.name)}}),i.log$1.warn("Adjusted Graph",x(e)),T(e,0),i.log$1.trace(a)},T=(e,t)=>{if(i.log$1.warn("extractor - ",t,x(e),e.children("D")),t>10){i.log$1.error("Bailing out");return}let n=e.nodes(),r=!1;for(const s of n){const o=e.children(s);r=r||o.length>0}if(!r){i.log$1.debug("Done, no node has children",e.nodes());return}i.log$1.debug("Nodes = ",n,t);for(const s of n)if(i.log$1.debug("Extracting node",s,a,a[s]&&!a[s].externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",t),!a[s])i.log$1.debug("Not a cluster",s,t);else if(!a[s].externalConnections&&e.children(s)&&e.children(s).length>0){i.log$1.warn("Cluster without external connections, without a parent and with children",s,t);let f=e.graph().rankdir==="TB"?"LR":"TB";a[s]&&a[s].clusterData&&a[s].clusterData.dir&&(f=a[s].clusterData.dir,i.log$1.warn("Fixing dir",a[s].clusterData.dir,f));const g=new k.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:f,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});i.log$1.warn("Old graph before copy",x(e)),B(s,e,g,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:a[s].clusterData,labelText:a[s].labelText,graph:g}),i.log$1.warn("New graph after copy node: (",s,")",x(g)),i.log$1.debug("Old graph after copy",x(e))}else i.log$1.warn("Cluster ** ",s," **not meeting the criteria !externalConnections:",!a[s].externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),t),i.log$1.debug(a);n=e.nodes(),i.log$1.warn("New list of nodes",n);for(const s of n){const o=e.node(s);i.log$1.warn(" Now next level",s,o),o.clusterNode&&T(o.graph,t+1)}},O=(e,t)=>{if(t.length===0)return[];let n=Object.assign(t);return t.forEach(r=>{const s=e.children(r),o=O(e,s);n=[...n,...o]}),n},A=e=>O(e,e.children()),H=(e,t)=>{i.log$1.info("Creating subgraph rect for ",t.id,t);const n=i.getConfig(),r=e.insert("g").attr("class","cluster"+(t.class?" "+t.class:"")).attr("id",t.id),s=r.insert("rect",":first-child"),o=i.evaluate(n.flowchart.htmlLabels),f=r.insert("g").attr("class","cluster-label"),g=t.labelType==="markdown"?j.createText(f,t.labelText,{style:t.labelStyle,useHtmlLabels:o}):f.node().appendChild(u.createLabel$1(t.labelText,t.labelStyle,void 0,!0));let d=g.getBBox();if(i.evaluate(n.flowchart.htmlLabels)){const l=g.children[0],c=i.select(g);d=l.getBoundingClientRect(),c.attr("width",d.width),c.attr("height",d.height)}const h=0*t.padding,$=h/2,y=t.width<=d.width+h?d.width+h:t.width;t.width<=d.width+h?t.diff=(d.width-t.width)/2-t.padding/2:t.diff=-t.padding/2,i.log$1.trace("Data ",t,JSON.stringify(t)),s.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-y/2).attr("y",t.y-t.height/2-$).attr("width",y).attr("height",t.height+h);const{subGraphTitleTopMargin:N}=u.getSubGraphTitleMargins(n);o?f.attr("transform",`translate(${t.x-d.width/2}, ${t.y-t.height/2+N})`):f.attr("transform",`translate(${t.x}, ${t.y-t.height/2+N})`);const b=s.node().getBBox();return t.width=b.width,t.height=b.height,t.intersect=function(l){return u.intersectRect$1(t,l)},r},V=(e,t)=>{const n=e.insert("g").attr("class","note-cluster").attr("id",t.id),r=n.insert("rect",":first-child"),s=0*t.padding,o=s/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-o).attr("y",t.y-t.height/2-o).attr("width",t.width+s).attr("height",t.height+s).attr("fill","none");const f=r.node().getBBox();return t.width=f.width,t.height=f.height,t.intersect=function(g){return u.intersectRect$1(t,g)},n},z=(e,t)=>{const n=i.getConfig(),r=e.insert("g").attr("class",t.classes).attr("id",t.id),s=r.insert("rect",":first-child"),o=r.insert("g").attr("class","cluster-label"),f=r.append("rect"),g=o.node().appendChild(u.createLabel$1(t.labelText,t.labelStyle,void 0,!0));let d=g.getBBox();if(i.evaluate(n.flowchart.htmlLabels)){const l=g.children[0],c=i.select(g);d=l.getBoundingClientRect(),c.attr("width",d.width),c.attr("height",d.height)}d=g.getBBox();const h=0*t.padding,$=h/2,y=t.width<=d.width+t.padding?d.width+t.padding:t.width;t.width<=d.width+t.padding?t.diff=(d.width+t.padding*0-t.width)/2:t.diff=-t.padding/2,s.attr("class","outer").attr("x",t.x-y/2-$).attr("y",t.y-t.height/2-$).attr("width",y+h).attr("height",t.height+h),f.attr("class","inner").attr("x",t.x-y/2-$).attr("y",t.y-t.height/2-$+d.height-1).attr("width",y+h).attr("height",t.height+h-d.height-3);const{subGraphTitleTopMargin:N}=u.getSubGraphTitleMargins(n);o.attr("transform",`translate(${t.x-d.width/2}, ${t.y-t.height/2-t.padding/3+(i.evaluate(n.flowchart.htmlLabels)?5:3)+N})`);const b=s.node().getBBox();return t.height=b.height,t.intersect=function(l){return u.intersectRect$1(t,l)},r},W=(e,t)=>{const n=e.insert("g").attr("class",t.classes).attr("id",t.id),r=n.insert("rect",":first-child"),s=0*t.padding,o=s/2;r.attr("class","divider").attr("x",t.x-t.width/2-o).attr("y",t.y-t.height/2).attr("width",t.width+s).attr("height",t.height+s);const f=r.node().getBBox();return t.width=f.width,t.height=f.height,t.diff=-t.padding/2,t.intersect=function(g){return u.intersectRect$1(t,g)},n},K={rect:H,roundedWithTitle:z,noteGroup:V,divider:W};let R={};const Q=(e,t)=>{i.log$1.trace("Inserting cluster");const n=t.shape||"rect";R[t.id]=K[n](e,t)},Y=()=>{R={}},L=async(e,t,n,r,s,o)=>{i.log$1.info("Graph in recursive render: XXX",x(t),s);const f=t.graph().rankdir;i.log$1.trace("Dir in recursive render - dir:",f);const g=e.insert("g").attr("class","root");t.nodes()?i.log$1.info("Recursive render XXX",t.nodes()):i.log$1.info("No nodes found for",t),t.edges().length>0&&i.log$1.trace("Recursive edges",t.edge(t.edges()[0]));const d=g.insert("g").attr("class","clusters"),h=g.insert("g").attr("class","edgePaths"),$=g.insert("g").attr("class","edgeLabels"),y=g.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(l){const c=t.node(l);if(s!==void 0){const v=JSON.parse(JSON.stringify(s.clusterData));i.log$1.info("Setting data for cluster XXX (",l,") ",v,s),t.setNode(s.id,v),t.parent(l)||(i.log$1.trace("Setting parent",l,s.id),t.setParent(l,s.id,v))}if(i.log$1.info("(Insert) Node XXX"+l+": "+JSON.stringify(t.node(l))),c&&c.clusterNode){i.log$1.info("Cluster identified",l,c.width,t.node(l));const v=await L(y,c.graph,n,r,t.node(l),o),E=v.elem;u.updateNodeBounds(c,E),c.diff=v.diff||0,i.log$1.info("Node bounds (abc123)",l,c,c.width,c.x,c.y),u.setNodeElem(E,c),i.log$1.warn("Recursive render complete ",E,c)}else t.children(l).length>0?(i.log$1.info("Cluster - the non recursive path XXX",l,c.id,c,t),i.log$1.info(C(c.id,t)),a[c.id]={id:C(c.id,t),node:c}):(i.log$1.info("Node - the non recursive path",l,c.id,c),await u.insertNode(y,t.node(l),f))})),t.edges().forEach(function(l){const c=t.edge(l.v,l.w,l.name);i.log$1.info("Edge "+l.v+" -> "+l.w+": "+JSON.stringify(l)),i.log$1.info("Edge "+l.v+" -> "+l.w+": ",l," ",JSON.stringify(t.edge(l))),i.log$1.info("Fix",a,"ids:",l.v,l.w,"Translating: ",a[l.v],a[l.w]),u.insertEdgeLabel($,c)}),t.edges().forEach(function(l){i.log$1.info("Edge "+l.v+" -> "+l.w+": "+JSON.stringify(l))}),i.log$1.info("#############################################"),i.log$1.info("### Layout ###"),i.log$1.info("#############################################"),i.log$1.info(t),J.layout(t),i.log$1.info("Graph after layout:",x(t));let N=0;const{subGraphTitleTotalMargin:b}=u.getSubGraphTitleMargins(o);return A(t).forEach(function(l){const c=t.node(l);i.log$1.info("Position "+l+": "+JSON.stringify(t.node(l))),i.log$1.info("Position "+l+": ("+c.x,","+c.y,") width: ",c.width," height: ",c.height),c&&c.clusterNode?(c.y+=b,u.positionNode(c)):t.children(l).length>0?(c.height+=b,Q(d,c),a[c.id].node=c):(c.y+=b/2,u.positionNode(c))}),t.edges().forEach(function(l){const c=t.edge(l);i.log$1.info("Edge "+l.v+" -> "+l.w+": "+JSON.stringify(c),c),c.points.forEach(E=>E.y+=b/2);const v=u.insertEdge(h,l,c,a,n,t,r);u.positionEdgeLabel(c,v)}),t.nodes().forEach(function(l){const c=t.node(l);i.log$1.info(l,c.type,c.diff),c.type==="group"&&(N=c.diff)}),{elem:g,diff:N}},Z=async(e,t,n,r,s)=>{u.insertMarkers$1(e,n,r,s),u.clear$1(),u.clear(),Y(),q(),i.log$1.warn("Graph at first:",JSON.stringify(x(t))),U(t),i.log$1.warn("Graph after:",JSON.stringify(x(t)));const o=i.getConfig();await L(e,t,r,s,void 0,o)};exports.render=Z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./layers.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./layers.dyig4B3u.js");exports.alerts=e.l;exports.buttons=e.n;exports.canvasError=e.u;exports.clearCanvasDialog=e.v;exports.colorPicker=e.A;exports.colors=e.F;exports.commandPalette=e.R;exports.confirmDialog=e.C;exports.default=e.B;exports.element=e.c;exports.elementLink=e.r;exports.encrypted=e.E;exports.errorDialog=e.y;exports.errorSplash=e.h;exports.errors=e.s;exports.exportDialog=e.w;exports.fontList=e.N;exports.headings=e.p;exports.helpDialog=e.k;exports.hints=e.m;exports.imageExportDialog=e.x;exports.labels=e.t;exports.library=e.a;exports.mermaid=e.D;exports.overwriteConfirm=e._;exports.publishDialog=e.f;exports.publishSuccessDialog=e.S;exports.quickSearch=e.I;exports.roomDialog=e.g;exports.search=e.i;exports.shareDialog=e.b;exports.stats=e.T;exports.toast=e.L;exports.toolBar=e.d;exports.userList=e.z;exports.welcomeScreen=e.P;
|