mio-previewer 0.1.1 → 0.1.3
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/{MdRenderer.vue_vue_type_style_index_0_lang-ClzqKjX4.js → MdRenderer.vue_vue_type_style_index_0_lang-B26E5SLd.js} +1 -1
- package/dist/{MdRenderer.vue_vue_type_style_index_0_lang-Dpnz3CdM.cjs → MdRenderer.vue_vue_type_style_index_0_lang-CT8VuqF6.cjs} +1 -1
- package/dist/{_basePickBy-nvL1-X4h.js → _basePickBy-BPvpJ2um.js} +11 -11
- package/dist/_basePickBy-xJ9BT3zN.cjs +1 -0
- package/dist/_baseUniq-BZgquYGf.cjs +1 -0
- package/dist/{_baseUniq-Cwhfu1XM.js → _baseUniq-Tf9Kt8z-.js} +13 -13
- package/dist/arc-C73RRLiG.cjs +1 -0
- package/dist/{arc-C9I4pYLv.js → arc-Dr6aCVTp.js} +1 -1
- package/dist/{architecture-O4VJ6CD3-D00QJU0o.js → architecture-O4VJ6CD3-CeeoNnpL.js} +1 -1
- package/dist/{architecture-O4VJ6CD3-dKuizgWO.cjs → architecture-O4VJ6CD3-DksHFJ_w.cjs} +1 -1
- package/dist/architectureDiagram-VXUJARFQ-3NLUlleK.cjs +36 -0
- package/dist/{architectureDiagram-VXUJARFQ-VWr1UuPv.js → architectureDiagram-VXUJARFQ-CoK0Gwu-.js} +20 -21
- package/dist/{blockDiagram-VD42YOAC-DuC96I2Q.js → blockDiagram-VD42YOAC-B7F_8nB6.js} +5 -5
- package/dist/{blockDiagram-VD42YOAC-EC2x5LwN.cjs → blockDiagram-VD42YOAC-BK-0UQu9.cjs} +1 -1
- package/dist/{c4Diagram-YG6GDRKO-OB8wIuF8.js → c4Diagram-YG6GDRKO-DzMoPOvT.js} +2 -2
- package/dist/{c4Diagram-YG6GDRKO-Dm5d0BWL.cjs → c4Diagram-YG6GDRKO-SAX7mzVM.cjs} +1 -1
- package/dist/{channel-C-uR528Z.js → channel-DZNU43d3.js} +1 -1
- package/dist/channel-K9KCfQVN.cjs +1 -0
- package/dist/{chunk-4BX2VUAB-j8LeaMvy.js → chunk-4BX2VUAB-BM6KMQlI.js} +1 -1
- package/dist/chunk-4BX2VUAB-BNg9BEzs.cjs +1 -0
- package/dist/{chunk-55IACEB6-IYAIzfR4.js → chunk-55IACEB6-CDfNhGdc.js} +1 -1
- package/dist/chunk-55IACEB6-CIkpKv5G.cjs +1 -0
- package/dist/{chunk-B4BG7PRW-DB5df3Iz.js → chunk-B4BG7PRW-DBjDqSED.js} +4 -4
- package/dist/{chunk-B4BG7PRW-CpqTB0S5.cjs → chunk-B4BG7PRW-DXRjU9TI.cjs} +1 -1
- package/dist/{chunk-DI55MBZ5-BoFZpvY3.js → chunk-DI55MBZ5-BCMfI46s.js} +3 -3
- package/dist/{chunk-DI55MBZ5-wqsoqtNw.cjs → chunk-DI55MBZ5-D6sD1SDV.cjs} +1 -1
- package/dist/{chunk-FMBD7UC4-CdmoYYnM.js → chunk-FMBD7UC4-C-N17wry.js} +1 -1
- package/dist/{chunk-FMBD7UC4-BZS_4hun.cjs → chunk-FMBD7UC4-hNxmxOeA.cjs} +1 -1
- package/dist/chunk-QN33PNHL-DD0xRcz_.cjs +1 -0
- package/dist/{chunk-QN33PNHL-BuyP9RXS.js → chunk-QN33PNHL-E13ckPQD.js} +1 -1
- package/dist/{chunk-QZHKN3VN-15dJyQk0.js → chunk-QZHKN3VN-CJGCT_qs.js} +1 -1
- package/dist/chunk-QZHKN3VN-Kkn2ItIi.cjs +1 -0
- package/dist/chunk-TZMSLE5B-B32hxMvx.cjs +1 -0
- package/dist/{chunk-TZMSLE5B-BgFWf03M.js → chunk-TZMSLE5B-DvKudy0L.js} +1 -1
- package/dist/{classDiagram-2ON5EDUG-BQz3UzKi.js → classDiagram-2ON5EDUG-BmtUBt0j.js} +2 -2
- package/dist/classDiagram-2ON5EDUG-x5SSUt5v.cjs +1 -0
- package/dist/{classDiagram-v2-WZHVMYZB-BQz3UzKi.js → classDiagram-v2-WZHVMYZB-BmtUBt0j.js} +2 -2
- package/dist/classDiagram-v2-WZHVMYZB-x5SSUt5v.cjs +1 -0
- package/dist/{clone-D6h_cwF4.js → clone-AbZIjD3b.js} +1 -1
- package/dist/clone-BIUMbfGI.cjs +1 -0
- package/dist/{cose-bilkent-S5V4N54A-D2q7jBXB.js → cose-bilkent-S5V4N54A-Bdj7Vz_1.js} +5 -6
- package/dist/cose-bilkent-S5V4N54A-DJ49z974.cjs +1 -0
- package/dist/custom-Bj6wd8Zo.cjs +263 -0
- package/dist/{plugin-mermaid-y4lbJ7sL.js → custom-DpenvaVL.js} +8845 -5380
- package/dist/dagre-6UL2VRFP-e70bbbAo.cjs +4 -0
- package/dist/{dagre-6UL2VRFP-Cfh4UdSr.js → dagre-6UL2VRFP-wwVKK1c4.js} +108 -108
- package/dist/{diagram-PSM6KHXK-BZDEX43o.js → diagram-PSM6KHXK-BvHkTFl-.js} +16 -16
- package/dist/diagram-PSM6KHXK-ByERYM-3.cjs +24 -0
- package/dist/{diagram-QEK2KX5R-Dda_FEDc.js → diagram-QEK2KX5R-DDeHGuBu.js} +3 -3
- package/dist/diagram-QEK2KX5R-piVunPtl.cjs +43 -0
- package/dist/{diagram-S2PKOQOG-Cnw4b7LB.js → diagram-S2PKOQOG-BKInMDUf.js} +3 -3
- package/dist/diagram-S2PKOQOG-Cr055G-z.cjs +24 -0
- package/dist/entries/md.cjs.js +1 -1
- package/dist/entries/md.es.js +1 -1
- package/dist/{erDiagram-Q2GNP2WA-qAdA8fbE.js → erDiagram-Q2GNP2WA-B4-4JFTr.js} +4 -4
- package/dist/{erDiagram-Q2GNP2WA-DE4JLeNF.cjs → erDiagram-Q2GNP2WA-B8J7KiVg.cjs} +1 -1
- package/dist/{flowDiagram-NV44I4VS-C7YBx4JP.js → flowDiagram-NV44I4VS-5cNi0vQA.js} +5 -5
- package/dist/{flowDiagram-NV44I4VS-j3dB-fjF.cjs → flowDiagram-NV44I4VS-QOrkavK7.cjs} +1 -1
- package/dist/ganttDiagram-LVOFAZNH-CigIkVoy.cjs +267 -0
- package/dist/{ganttDiagram-LVOFAZNH-BL-Yjadx.js → ganttDiagram-LVOFAZNH-DymzdMvs.js} +55 -56
- package/dist/{gitGraph-ZV4HHKMB-Dr9sn7R3.js → gitGraph-ZV4HHKMB-B-D8cNhE.js} +1 -1
- package/dist/{gitGraph-ZV4HHKMB-DyXW77WY.cjs → gitGraph-ZV4HHKMB-CWbWsOyk.cjs} +1 -1
- package/dist/gitGraphDiagram-NY62KEGX-CaafXshn.cjs +65 -0
- package/dist/{gitGraphDiagram-NY62KEGX-DFn7h5BH.js → gitGraphDiagram-NY62KEGX-TPmwKAE3.js} +4 -4
- package/dist/{graph-DiGqaw_6.js → graph-DuYupv9-.js} +7 -7
- package/dist/graph-DxA9vrvy.cjs +1 -0
- package/dist/{info-63CPKGFF-BGxbI0Qv.cjs → info-63CPKGFF-B0dB6Gmo.cjs} +1 -1
- package/dist/info-63CPKGFF-C4jcTOlN.js +5 -0
- package/dist/{infoDiagram-F6ZHWCRC-DOtGa28U.js → infoDiagram-F6ZHWCRC-BRxO2gbr.js} +2 -2
- package/dist/infoDiagram-F6ZHWCRC-BmeO40po.cjs +2 -0
- package/dist/{journeyDiagram-XKPGCS4Q-bJncB3oe.js → journeyDiagram-XKPGCS4Q-B5MOGiml.js} +4 -4
- package/dist/{journeyDiagram-XKPGCS4Q-h-CtcfbS.cjs → journeyDiagram-XKPGCS4Q-DC3T_hOS.cjs} +1 -1
- package/dist/{kanban-definition-3W4ZIXB7-C3y0C_bw.cjs → kanban-definition-3W4ZIXB7-C0DqXzkl.cjs} +3 -3
- package/dist/{kanban-definition-3W4ZIXB7-nMPCi8GW.js → kanban-definition-3W4ZIXB7-DgJ6Uj7K.js} +2 -2
- package/dist/{layout-CHaNS4g6.js → layout-C2ZYHFpX.js} +33 -33
- package/dist/layout-DWd-riGk.cjs +1 -0
- package/dist/{linear-CPFNaVnw.js → linear-BOcw0RYN.js} +5 -5
- package/dist/linear-CHYqhRsW.cjs +1 -0
- package/dist/{mermaid-parser.core-CR8Rcyps.cjs → mermaid-parser.core-2hw0AO3p.cjs} +2 -2
- package/dist/{mermaid-parser.core-CkQKh-yb.js → mermaid-parser.core-9Cm7d5-2.js} +11 -11
- package/dist/{mindmap-definition-VGOIOE7T-C63AEIdU.js → mindmap-definition-VGOIOE7T-DqOPFPo-.js} +3 -3
- package/dist/{mindmap-definition-VGOIOE7T-CHI9UFtA.cjs → mindmap-definition-VGOIOE7T-z7ScFjvc.cjs} +1 -1
- package/dist/mio-previewer.cjs.js +1 -1
- package/dist/mio-previewer.css +1 -1
- package/dist/mio-previewer.es.js +1 -1
- package/dist/{packet-HUATNLJX-dnmrn2-l.js → packet-HUATNLJX-1wKSvaMq.js} +1 -1
- package/dist/{packet-HUATNLJX-BeAGxpDF.cjs → packet-HUATNLJX-CZHu-nbR.cjs} +1 -1
- package/dist/{pie-WTHONI2E-BifrFKgo.cjs → pie-WTHONI2E-DXv4_T2x.cjs} +1 -1
- package/dist/pie-WTHONI2E-Tnd3n2cn.js +5 -0
- package/dist/{pieDiagram-ADFJNKIX-B9OONHi_.cjs → pieDiagram-ADFJNKIX-D2Z---Zh.cjs} +1 -1
- package/dist/{pieDiagram-ADFJNKIX-CEMFAt9B.js → pieDiagram-ADFJNKIX-D6VHJbDG.js} +4 -4
- package/dist/plugins/custom.cjs.js +1 -0
- package/dist/plugins/custom.es.js +6 -0
- package/dist/plugins/markdown-it.cjs.js +1 -0
- package/dist/plugins/markdown-it.es.js +117 -0
- package/dist/{quadrantDiagram-AYHSOK5B-DobvzsAU.js → quadrantDiagram-AYHSOK5B-D5OPLeMW.js} +2 -2
- package/dist/{quadrantDiagram-AYHSOK5B-DqXDgyBD.cjs → quadrantDiagram-AYHSOK5B-DkReeODO.cjs} +3 -3
- package/dist/radar-NJJJXTRR-B7MWPc1b.js +5 -0
- package/dist/{radar-NJJJXTRR-BPN19Spv.cjs → radar-NJJJXTRR-CsSvUZzP.cjs} +1 -1
- package/dist/{requirementDiagram-UZGBJVZJ-M-MPvTnX.js → requirementDiagram-UZGBJVZJ-BtuFN9mE.js} +3 -3
- package/dist/{requirementDiagram-UZGBJVZJ-CVbmNF7M.cjs → requirementDiagram-UZGBJVZJ-C5hVzY2x.cjs} +1 -1
- package/dist/{sankeyDiagram-TZEHDZUN-Czsin99f.js → sankeyDiagram-TZEHDZUN-Cg-JIJqC.js} +1 -1
- package/dist/sankeyDiagram-TZEHDZUN-DpRrZxqg.cjs +10 -0
- package/dist/{sequenceDiagram-WL72ISMW-DApIQwP-.cjs → sequenceDiagram-WL72ISMW-KoQgtSet.cjs} +1 -1
- package/dist/{sequenceDiagram-WL72ISMW-BJByNQsK.js → sequenceDiagram-WL72ISMW-nEmJoaMy.js} +3 -3
- package/dist/{stateDiagram-FKZM4ZOC-jAiBDhVn.js → stateDiagram-FKZM4ZOC-DBDLAMfm.js} +4 -4
- package/dist/stateDiagram-FKZM4ZOC-DT6rGE9e.cjs +1 -0
- package/dist/{stateDiagram-v2-4FDKWEC3-umSVoFht.js → stateDiagram-v2-4FDKWEC3-BlnZMiIk.js} +2 -2
- package/dist/stateDiagram-v2-4FDKWEC3-uHZFzERJ.cjs +1 -0
- package/dist/{timeline-definition-IT6M3QCI-BfAvK0gf.cjs → timeline-definition-IT6M3QCI-5sT2JElf.cjs} +3 -3
- package/dist/{timeline-definition-IT6M3QCI-I--lBLTi.js → timeline-definition-IT6M3QCI-nu6lhLaG.js} +2 -2
- package/dist/{treemap-75Q7IDZK-DNt-zuL8.cjs → treemap-75Q7IDZK-0YVmrH6l.cjs} +1 -1
- package/dist/{treemap-75Q7IDZK-bjql9DgL.js → treemap-75Q7IDZK-CjQGnPQL.js} +1 -1
- package/dist/types/entries/plugins/custom.d.ts +3 -0
- package/dist/types/entries/plugins/markdown-it.d.ts +2 -0
- package/dist/{xychartDiagram-PRI3JC2R-XrOK_egj.js → xychartDiagram-PRI3JC2R-COTy5kPs.js} +2 -2
- package/dist/{xychartDiagram-PRI3JC2R-BN9e47xe.cjs → xychartDiagram-PRI3JC2R-Df-nQpxQ.cjs} +1 -1
- package/package.json +12 -32
- package/dist/_basePickBy-CZxbwAvt.cjs +0 -1
- package/dist/_baseUniq-DunUk-cd.cjs +0 -1
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -1
- package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist/arc-fCflz0gB.cjs +0 -1
- package/dist/architectureDiagram-VXUJARFQ-DQ-YD3RX.cjs +0 -36
- package/dist/channel-YfH5CBV-.cjs +0 -1
- package/dist/chunk-4BX2VUAB-3Liht_XN.cjs +0 -1
- package/dist/chunk-55IACEB6-Dm3mi3ha.cjs +0 -1
- package/dist/chunk-QN33PNHL-CHI_-zix.cjs +0 -1
- package/dist/chunk-QZHKN3VN-DfH9qQ3T.cjs +0 -1
- package/dist/chunk-TZMSLE5B-qIo1h7Gz.cjs +0 -1
- package/dist/classDiagram-2ON5EDUG-CZWeacVd.cjs +0 -1
- package/dist/classDiagram-v2-WZHVMYZB-CZWeacVd.cjs +0 -1
- package/dist/clone-ByeQKKoW.cjs +0 -1
- package/dist/cose-bilkent-S5V4N54A-5dO3qpr4.cjs +0 -1
- package/dist/dagre-6UL2VRFP-DS2Ki9Dv.cjs +0 -4
- package/dist/diagram-PSM6KHXK-CTsP6f2a.cjs +0 -24
- package/dist/diagram-QEK2KX5R-BDKMNi97.cjs +0 -43
- package/dist/diagram-S2PKOQOG-CmfsKOvs.cjs +0 -24
- package/dist/entries/plugin-alert.cjs.js +0 -1
- package/dist/entries/plugin-alert.es.js +0 -27
- package/dist/entries/plugin-codeblock.cjs.js +0 -9
- package/dist/entries/plugin-codeblock.es.js +0 -3441
- package/dist/entries/plugin-emoji.cjs.js +0 -1
- package/dist/entries/plugin-emoji.es.js +0 -28
- package/dist/entries/plugin-katex.cjs.js +0 -1
- package/dist/entries/plugin-katex.es.js +0 -92
- package/dist/entries/plugin-mermaid.cjs.js +0 -1
- package/dist/entries/plugin-mermaid.es.js +0 -4
- package/dist/ganttDiagram-LVOFAZNH-CBhzET57.cjs +0 -267
- package/dist/gitGraphDiagram-NY62KEGX-DDklxVnY.cjs +0 -65
- package/dist/graph-CHoeKkVR.cjs +0 -1
- package/dist/info-63CPKGFF-xflgSxfH.js +0 -5
- package/dist/infoDiagram-F6ZHWCRC-Duylo4r7.cjs +0 -2
- package/dist/layout-BG4AbhIW.cjs +0 -1
- package/dist/linear-Bqd4C_Yb.cjs +0 -1
- package/dist/pie-WTHONI2E-BKoHQt0i.js +0 -5
- package/dist/plugin-mermaid-FTki7cN8.cjs +0 -255
- package/dist/radar-NJJJXTRR-Bj9rI8mr.js +0 -5
- package/dist/sankeyDiagram-TZEHDZUN-C-ESiLJA.cjs +0 -10
- package/dist/stateDiagram-FKZM4ZOC-BuKL2w66.cjs +0 -1
- package/dist/stateDiagram-v2-4FDKWEC3-Ct5PFxdd.cjs +0 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./custom-Bj6wd8Zo.cjs"),P=require("./graph-DxA9vrvy.cjs"),R=require("./layout-DWd-riGk.cjs"),N=require("./_baseUniq-BZgquYGf.cjs"),M=require("./clone-BIUMbfGI.cjs"),O=require("./_basePickBy-xJ9BT3zN.cjs");function m(e){var o={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:q(e),edges:j(e)};return N.isUndefined(e.graph())||(o.value=M.clone(e.graph())),o}function q(e){return O.map(e.nodes(),function(o){var n=e.node(o),l=e.parent(o),s={v:o};return N.isUndefined(n)||(s.value=n),N.isUndefined(l)||(s.parent=l),s})}function j(e){return O.map(e.edges(),function(o){var n=e.edge(o),l={v:o.v,w:o.w};return N.isUndefined(o.name)||(l.name=o.name),N.isUndefined(n)||(l.value=n),l})}var a=new Map,y=new Map,k=new Map,U=t.__name(()=>{y.clear(),k.clear(),a.clear()},"clear"),S=t.__name((e,o)=>{const n=y.get(o)||[];return t.log.trace("In isDescendant",o," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),F=t.__name((e,o)=>{const n=y.get(o)||[];return t.log.info("Descendants of ",o," is ",n),t.log.info("Edge is ",e),e.v===o||e.w===o?!1:n?n.includes(e.v)||S(e.v,o)||S(e.w,o)||n.includes(e.w):(t.log.debug("Tilt, ",o,",not in descendants"),!1)},"edgeInCluster"),B=t.__name((e,o,n,l)=>{t.log.warn("Copying children of ",e,"root",l,"data",o.node(e),l);const s=o.children(e)||[];e!==l&&s.push(e),t.log.warn("Copying (nodes) clusterId",e,"nodes",s),s.forEach(r=>{if(o.children(r).length>0)B(r,o,n,l);else{const d=o.node(r);t.log.info("cp ",r," to ",l," with parent ",e),n.setNode(r,d),l!==o.parent(r)&&(t.log.warn("Setting parent",r,o.parent(r)),n.setParent(r,o.parent(r))),e!==l&&r!==e?(t.log.debug("Setting parent",r,e),n.setParent(r,e)):(t.log.info("In copy ",e,"root",l,"data",o.node(e),l),t.log.debug("Not Setting parent for node=",r,"cluster!==rootId",e!==l,"node!==clusterId",r!==e));const g=o.edges(r);t.log.debug("Copying Edges",g),g.forEach(c=>{t.log.info("Edge",c);const w=o.edge(c.v,c.w,c.name);t.log.info("Edge data",w,l);try{F(c,l)?(t.log.info("Copying as ",c.v,c.w,w,c.name),n.setEdge(c.v,c.w,w,c.name),t.log.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):t.log.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",l," clusterId:",e)}catch(h){t.log.error(h)}})}t.log.debug("Removing node",r),o.removeNode(r)})},"copy"),A=t.__name((e,o)=>{const n=o.children(e);let l=[...n];for(const s of n)k.set(s,e),l=[...l,...A(s,o)];return l},"extractDescendants"),Y=t.__name((e,o,n)=>{const l=e.edges().filter(c=>c.v===o||c.w===o),s=e.edges().filter(c=>c.v===n||c.w===n),r=l.map(c=>({v:c.v===o?n:c.v,w:c.w===o?o:c.w})),d=s.map(c=>({v:c.v,w:c.w}));return r.filter(c=>d.some(w=>c.v===w.v&&c.w===w.w))},"findCommonEdges"),b=t.__name((e,o,n)=>{const l=o.children(e);if(t.log.trace("Searching children of id ",e,l),l.length<1)return e;let s;for(const r of l){const d=b(r,o,n),g=Y(o,n,d);if(d)if(g.length>0)s=d;else return d}return s},"findNonClusterChild"),D=t.__name(e=>!a.has(e)||!a.get(e).externalConnections?e:a.has(e)?a.get(e).id:e,"getAnchorId"),H=t.__name((e,o)=>{if(!e||o>10){t.log.debug("Opting out, no graph ");return}else t.log.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(t.log.warn("Cluster identified",n," Replacement id in edges: ",b(n,e,n)),y.set(n,A(n,e)),a.set(n,{id:b(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const l=e.children(n),s=e.edges();l.length>0?(t.log.debug("Cluster identified",n,y),s.forEach(r=>{const d=S(r.v,n),g=S(r.w,n);d^g&&(t.log.warn("Edge: ",r," leaves cluster ",n),t.log.warn("Descendants of XXX ",n,": ",y.get(n)),a.get(n).externalConnections=!0)})):t.log.debug("Not a cluster ",n,y)});for(let n of a.keys()){const l=a.get(n).id,s=e.parent(l);s!==n&&a.has(s)&&!a.get(s).externalConnections&&(a.get(n).id=s)}e.edges().forEach(function(n){const l=e.edge(n);t.log.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),t.log.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let s=n.v,r=n.w;if(t.log.warn("Fix XXX",a,"ids:",n.v,n.w,"Translating: ",a.get(n.v)," --- ",a.get(n.w)),a.get(n.v)||a.get(n.w)){if(t.log.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),s=D(n.v),r=D(n.w),e.removeEdge(n.v,n.w,n.name),s!==n.v){const d=e.parent(s);a.get(d).externalConnections=!0,l.fromCluster=n.v}if(r!==n.w){const d=e.parent(r);a.get(d).externalConnections=!0,l.toCluster=n.w}t.log.warn("Fix Replacing with XXX",s,r,n.name),e.setEdge(s,r,l,n.name)}}),t.log.warn("Adjusted Graph",m(e)),J(e,0),t.log.trace(a)},"adjustClustersAndEdges"),J=t.__name((e,o)=>{if(t.log.warn("extractor - ",o,m(e),e.children("D")),o>10){t.log.error("Bailing out");return}let n=e.nodes(),l=!1;for(const s of n){const r=e.children(s);l=l||r.length>0}if(!l){t.log.debug("Done, no node has children",e.nodes());return}t.log.debug("Nodes = ",n,o);for(const s of n)if(t.log.debug("Extracting node",s,a,a.has(s)&&!a.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",o),!a.has(s))t.log.debug("Not a cluster",s,o);else if(!a.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){t.log.warn("Cluster without external connections, without a parent and with children",s,o);let d=e.graph().rankdir==="TB"?"LR":"TB";a.get(s)?.clusterData?.dir&&(d=a.get(s).clusterData.dir,t.log.warn("Fixing dir",a.get(s).clusterData.dir,d));const g=new P.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});t.log.warn("Old graph before copy",m(e)),B(s,e,g,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:a.get(s).clusterData,label:a.get(s).label,graph:g}),t.log.warn("New graph after copy node: (",s,")",m(g)),t.log.debug("Old graph after copy",m(e))}else t.log.warn("Cluster ** ",s," **not meeting the criteria !externalConnections:",!a.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),o),t.log.debug(a);n=e.nodes(),t.log.warn("New list of nodes",n);for(const s of n){const r=e.node(s);t.log.warn(" Now next level",s,r),r?.clusterNode&&J(r.graph,o+1)}},"extractor"),T=t.__name((e,o)=>{if(o.length===0)return[];let n=Object.assign([],o);return o.forEach(l=>{const s=e.children(l),r=T(e,s);n=[...n,...r]}),n},"sorter"),V=t.__name(e=>T(e,e.children()),"sortNodesByHierarchy"),G=t.__name(async(e,o,n,l,s,r)=>{t.log.warn("Graph in recursive render:XAX",m(o),s);const d=o.graph().rankdir;t.log.trace("Dir in recursive render - dir:",d);const g=e.insert("g").attr("class","root");o.nodes()?t.log.info("Recursive render XXX",o.nodes()):t.log.info("No nodes found for",o),o.edges().length>0&&t.log.info("Recursive edges",o.edge(o.edges()[0]));const c=g.insert("g").attr("class","clusters"),w=g.insert("g").attr("class","edgePaths"),h=g.insert("g").attr("class","edgeLabels"),v=g.insert("g").attr("class","nodes");await Promise.all(o.nodes().map(async function(f){const i=o.node(f);if(s!==void 0){const u=JSON.parse(JSON.stringify(s.clusterData));t.log.trace(`Setting data for parent cluster XXX
|
|
2
|
+
Node.id = `,f,`
|
|
3
|
+
data=`,u.height,`
|
|
4
|
+
Parent cluster`,s.height),o.setNode(s.id,u),o.parent(f)||(t.log.trace("Setting parent",f,s.id),o.setParent(f,s.id,u))}if(t.log.info("(Insert) Node XXX"+f+": "+JSON.stringify(o.node(f))),i?.clusterNode){t.log.info("Cluster identified XBX",f,i.width,o.node(f));const{ranksep:u,nodesep:p}=o.graph();i.graph.setGraph({...i.graph.graph(),ranksep:u+25,nodesep:p});const E=await G(v,i.graph,n,l,o.node(f),r),_=E.elem;t.updateNodeBounds(i,_),i.diff=E.diff||0,t.log.info("New compound node after recursive render XAX",f,"width",i.width,"height",i.height),t.setNodeElem(_,i)}else o.children(f).length>0?(t.log.trace("Cluster - the non recursive path XBX",f,i.id,i,i.width,"Graph:",o),t.log.trace(b(i.id,o)),a.set(i.id,{id:b(i.id,o),node:i})):(t.log.trace("Node - the non recursive path XAX",f,v,o.node(f),d),await t.insertNode(v,o.node(f),{config:r,dir:d}))})),await t.__name(async()=>{const f=o.edges().map(async function(i){const u=o.edge(i.v,i.w,i.name);t.log.info("Edge "+i.v+" -> "+i.w+": "+JSON.stringify(i)),t.log.info("Edge "+i.v+" -> "+i.w+": ",i," ",JSON.stringify(o.edge(i))),t.log.info("Fix",a,"ids:",i.v,i.w,"Translating: ",a.get(i.v),a.get(i.w)),await t.insertEdgeLabel(h,u)});await Promise.all(f)},"processEdges")(),t.log.info("Graph before layout:",JSON.stringify(m(o))),t.log.info("############################################# XXX"),t.log.info("### Layout ### XXX"),t.log.info("############################################# XXX"),R.layout(o),t.log.info("Graph after layout:",JSON.stringify(m(o)));let x=0,{subGraphTitleTotalMargin:C}=t.getSubGraphTitleMargins(r);return await Promise.all(V(o).map(async function(f){const i=o.node(f);if(t.log.info("Position XBX => "+f+": ("+i.x,","+i.y,") width: ",i.width," height: ",i.height),i?.clusterNode)i.y+=C,t.log.info("A tainted cluster node XBX1",f,i.id,i.width,i.height,i.x,i.y,o.parent(f)),a.get(i.id).node=i,t.positionNode(i);else if(o.children(f).length>0){t.log.info("A pure cluster node XBX1",f,i.id,i.x,i.y,i.width,i.height,o.parent(f)),i.height+=C,o.node(i.parentId);const u=i?.padding/2||0,p=i?.labelBBox?.height||0,E=p-u||0;t.log.debug("OffsetY",E,"labelHeight",p,"halfPadding",u),await t.insertCluster(c,i),a.get(i.id).node=i}else{const u=o.node(i.parentId);i.y+=C/2,t.log.info("A regular node XBX1 - using the padding",i.id,"parent",i.parentId,i.width,i.height,i.x,i.y,"offsetY",i.offsetY,"parent",u,u?.offsetY,i),t.positionNode(i)}})),o.edges().forEach(function(f){const i=o.edge(f);t.log.info("Edge "+f.v+" -> "+f.w+": "+JSON.stringify(i),i),i.points.forEach(_=>_.y+=C/2);const u=o.node(f.v);var p=o.node(f.w);const E=t.insertEdge(w,i,a,n,u,p,l);t.positionEdgeLabel(i,E)}),o.nodes().forEach(function(f){const i=o.node(f);t.log.info(f,i.type,i.diff),i.isGroup&&(x=i.diff)}),t.log.warn("Returning from recursive render XAX",g,x),{elem:g,diff:x}},"recursiveRender"),z=t.__name(async(e,o)=>{const n=new P.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),l=o.select("g");t.markers_default(l,e.markers,e.type,e.diagramId),t.clear2(),t.clear$1(),t.clear$2(),U(),e.nodes.forEach(r=>{n.setNode(r.id,{...r}),r.parentId&&n.setParent(r.id,r.parentId)}),t.log.debug("Edges:",e.edges),e.edges.forEach(r=>{if(r.start===r.end){const d=r.start,g=d+"---"+d+"---1",c=d+"---"+d+"---2",w=n.node(d);n.setNode(g,{domId:g,id:g,parentId:w.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(g,w.parentId),n.setNode(c,{domId:c,id:c,parentId:w.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(c,w.parentId);const h=structuredClone(r),v=structuredClone(r),X=structuredClone(r);h.label="",h.arrowTypeEnd="none",h.id=d+"-cyclic-special-1",v.arrowTypeStart="none",v.arrowTypeEnd="none",v.id=d+"-cyclic-special-mid",X.label="",w.isGroup&&(h.fromCluster=d,X.toCluster=d),X.id=d+"-cyclic-special-2",X.arrowTypeStart="none",n.setEdge(d,g,h,d+"-cyclic-special-0"),n.setEdge(g,c,v,d+"-cyclic-special-1"),n.setEdge(c,d,X,d+"-cyc<lic-special-2")}else n.setEdge(r.start,r.end,{...r},r.id)}),t.log.warn("Graph at first:",JSON.stringify(m(n))),H(n),t.log.warn("Graph after XAX:",JSON.stringify(m(n)));const s=t.getConfig2();await G(l,n,e.type,e.diagramId,void 0,s)},"render");exports.render=z;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { _ as w,
|
|
2
|
-
import { G as B } from "./graph-
|
|
3
|
-
import { l as I } from "./layout-
|
|
4
|
-
import { i as b } from "./_baseUniq-
|
|
5
|
-
import { c as L } from "./clone-
|
|
6
|
-
import { m as A } from "./_basePickBy-
|
|
1
|
+
import { _ as w, ar as F, as as Y, at as _, au as H, l as r, c as V, av as z, aw as U, ag as $, al as q, ah as P, af as K, ax as Q, ay as W, az as Z } from "./custom-DpenvaVL.js";
|
|
2
|
+
import { G as B } from "./graph-DuYupv9-.js";
|
|
3
|
+
import { l as I } from "./layout-C2ZYHFpX.js";
|
|
4
|
+
import { i as b } from "./_baseUniq-Tf9Kt8z-.js";
|
|
5
|
+
import { c as L } from "./clone-AbZIjD3b.js";
|
|
6
|
+
import { m as A } from "./_basePickBy-BPvpJ2um.js";
|
|
7
7
|
function h(e) {
|
|
8
8
|
var t = {
|
|
9
9
|
options: {
|
|
@@ -18,8 +18,8 @@ function h(e) {
|
|
|
18
18
|
}
|
|
19
19
|
function ee(e) {
|
|
20
20
|
return A(e.nodes(), function(t) {
|
|
21
|
-
var n = e.node(t), a = e.parent(t),
|
|
22
|
-
return b(n) || (
|
|
21
|
+
var n = e.node(t), a = e.parent(t), i = { v: t };
|
|
22
|
+
return b(n) || (i.value = n), b(a) || (i.parent = a), i;
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
function ne(e) {
|
|
@@ -32,12 +32,12 @@ var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
32
32
|
y.clear(), J.clear(), d.clear();
|
|
33
33
|
}, "clear"), D = /* @__PURE__ */ w((e, t) => {
|
|
34
34
|
const n = y.get(t) || [];
|
|
35
|
-
return
|
|
35
|
+
return r.trace("In isDescendant", t, " ", e, " = ", n.includes(e)), n.includes(e);
|
|
36
36
|
}, "isDescendant"), se = /* @__PURE__ */ w((e, t) => {
|
|
37
37
|
const n = y.get(t) || [];
|
|
38
|
-
return
|
|
38
|
+
return r.info("Descendants of ", t, " is ", n), r.info("Edge is ", e), e.v === t || e.w === t ? !1 : n ? n.includes(e.v) || D(e.v, t) || D(e.w, t) || n.includes(e.w) : (r.debug("Tilt, ", t, ",not in descendants"), !1);
|
|
39
39
|
}, "edgeInCluster"), G = /* @__PURE__ */ w((e, t, n, a) => {
|
|
40
|
-
|
|
40
|
+
r.warn(
|
|
41
41
|
"Copying children of ",
|
|
42
42
|
e,
|
|
43
43
|
"root",
|
|
@@ -46,13 +46,13 @@ var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
46
46
|
t.node(e),
|
|
47
47
|
a
|
|
48
48
|
);
|
|
49
|
-
const
|
|
50
|
-
e !== a &&
|
|
49
|
+
const i = t.children(e) || [];
|
|
50
|
+
e !== a && i.push(e), r.warn("Copying (nodes) clusterId", e, "nodes", i), i.forEach((o) => {
|
|
51
51
|
if (t.children(o).length > 0)
|
|
52
52
|
G(o, t, n, a);
|
|
53
53
|
else {
|
|
54
54
|
const l = t.node(o);
|
|
55
|
-
|
|
55
|
+
r.info("cp ", o, " to ", a, " with parent ", e), n.setNode(o, l), a !== t.parent(o) && (r.warn("Setting parent", o, t.parent(o)), n.setParent(o, t.parent(o))), e !== a && o !== e ? (r.debug("Setting parent", o, e), n.setParent(o, e)) : (r.info("In copy ", e, "root", a, "data", t.node(e), a), r.debug(
|
|
56
56
|
"Not Setting parent for node=",
|
|
57
57
|
o,
|
|
58
58
|
"cluster!==rootId",
|
|
@@ -61,12 +61,12 @@ var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
61
61
|
o !== e
|
|
62
62
|
));
|
|
63
63
|
const u = t.edges(o);
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
r.debug("Copying Edges", u), u.forEach((c) => {
|
|
65
|
+
r.info("Edge", c);
|
|
66
66
|
const m = t.edge(c.v, c.w, c.name);
|
|
67
|
-
|
|
67
|
+
r.info("Edge data", m, a);
|
|
68
68
|
try {
|
|
69
|
-
se(c, a) ? (
|
|
69
|
+
se(c, a) ? (r.info("Copying as ", c.v, c.w, m, c.name), n.setEdge(c.v, c.w, m, c.name), r.info("newGraph edges ", n.edges(), n.edge(n.edges()[0]))) : r.info(
|
|
70
70
|
"Skipping copy of edge ",
|
|
71
71
|
c.v,
|
|
72
72
|
"-->",
|
|
@@ -77,64 +77,64 @@ var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
77
77
|
e
|
|
78
78
|
);
|
|
79
79
|
} catch (v) {
|
|
80
|
-
|
|
80
|
+
r.error(v);
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
r.debug("Removing node", o), t.removeNode(o);
|
|
85
85
|
});
|
|
86
86
|
}, "copy"), R = /* @__PURE__ */ w((e, t) => {
|
|
87
87
|
const n = t.children(e);
|
|
88
88
|
let a = [...n];
|
|
89
|
-
for (const
|
|
90
|
-
J.set(
|
|
89
|
+
for (const i of n)
|
|
90
|
+
J.set(i, e), a = [...a, ...R(i, t)];
|
|
91
91
|
return a;
|
|
92
|
-
}, "extractDescendants"),
|
|
93
|
-
const a = e.edges().filter((c) => c.v === t || c.w === t),
|
|
92
|
+
}, "extractDescendants"), re = /* @__PURE__ */ w((e, t, n) => {
|
|
93
|
+
const a = e.edges().filter((c) => c.v === t || c.w === t), i = e.edges().filter((c) => c.v === n || c.w === n), o = a.map((c) => ({ v: c.v === t ? n : c.v, w: c.w === t ? t : c.w })), l = i.map((c) => ({ v: c.v, w: c.w }));
|
|
94
94
|
return o.filter((c) => l.some((m) => c.v === m.v && c.w === m.w));
|
|
95
95
|
}, "findCommonEdges"), C = /* @__PURE__ */ w((e, t, n) => {
|
|
96
96
|
const a = t.children(e);
|
|
97
|
-
if (
|
|
97
|
+
if (r.trace("Searching children of id ", e, a), a.length < 1)
|
|
98
98
|
return e;
|
|
99
|
-
let
|
|
99
|
+
let i;
|
|
100
100
|
for (const o of a) {
|
|
101
|
-
const l = C(o, t, n), u =
|
|
101
|
+
const l = C(o, t, n), u = re(t, n, l);
|
|
102
102
|
if (l)
|
|
103
103
|
if (u.length > 0)
|
|
104
|
-
|
|
104
|
+
i = l;
|
|
105
105
|
else
|
|
106
106
|
return l;
|
|
107
107
|
}
|
|
108
|
-
return
|
|
109
|
-
}, "findNonClusterChild"), k = /* @__PURE__ */ w((e) => !d.has(e) || !d.get(e).externalConnections ? e : d.has(e) ? d.get(e).id : e, "getAnchorId"),
|
|
108
|
+
return i;
|
|
109
|
+
}, "findNonClusterChild"), k = /* @__PURE__ */ w((e) => !d.has(e) || !d.get(e).externalConnections ? e : d.has(e) ? d.get(e).id : e, "getAnchorId"), ie = /* @__PURE__ */ w((e, t) => {
|
|
110
110
|
if (!e || t > 10) {
|
|
111
|
-
|
|
111
|
+
r.debug("Opting out, no graph ");
|
|
112
112
|
return;
|
|
113
113
|
} else
|
|
114
|
-
|
|
114
|
+
r.debug("Opting in, graph ");
|
|
115
115
|
e.nodes().forEach(function(n) {
|
|
116
|
-
e.children(n).length > 0 && (
|
|
116
|
+
e.children(n).length > 0 && (r.warn(
|
|
117
117
|
"Cluster identified",
|
|
118
118
|
n,
|
|
119
119
|
" Replacement id in edges: ",
|
|
120
120
|
C(n, e, n)
|
|
121
121
|
), y.set(n, R(n, e)), d.set(n, { id: C(n, e, n), clusterData: e.node(n) }));
|
|
122
122
|
}), e.nodes().forEach(function(n) {
|
|
123
|
-
const a = e.children(n),
|
|
124
|
-
a.length > 0 ? (
|
|
123
|
+
const a = e.children(n), i = e.edges();
|
|
124
|
+
a.length > 0 ? (r.debug("Cluster identified", n, y), i.forEach((o) => {
|
|
125
125
|
const l = D(o.v, n), u = D(o.w, n);
|
|
126
|
-
l ^ u && (
|
|
127
|
-
})) :
|
|
126
|
+
l ^ u && (r.warn("Edge: ", o, " leaves cluster ", n), r.warn("Descendants of XXX ", n, ": ", y.get(n)), d.get(n).externalConnections = !0);
|
|
127
|
+
})) : r.debug("Not a cluster ", n, y);
|
|
128
128
|
});
|
|
129
129
|
for (let n of d.keys()) {
|
|
130
|
-
const a = d.get(n).id,
|
|
131
|
-
|
|
130
|
+
const a = d.get(n).id, i = e.parent(a);
|
|
131
|
+
i !== n && d.has(i) && !d.get(i).externalConnections && (d.get(n).id = i);
|
|
132
132
|
}
|
|
133
133
|
e.edges().forEach(function(n) {
|
|
134
134
|
const a = e.edge(n);
|
|
135
|
-
|
|
136
|
-
let
|
|
137
|
-
if (
|
|
135
|
+
r.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(n)), r.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(e.edge(n)));
|
|
136
|
+
let i = n.v, o = n.w;
|
|
137
|
+
if (r.warn(
|
|
138
138
|
"Fix XXX",
|
|
139
139
|
d,
|
|
140
140
|
"ids:",
|
|
@@ -145,53 +145,53 @@ var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
145
145
|
" --- ",
|
|
146
146
|
d.get(n.w)
|
|
147
147
|
), d.get(n.v) || d.get(n.w)) {
|
|
148
|
-
if (
|
|
149
|
-
const l = e.parent(
|
|
148
|
+
if (r.warn("Fixing and trying - removing XXX", n.v, n.w, n.name), i = k(n.v), o = k(n.w), e.removeEdge(n.v, n.w, n.name), i !== n.v) {
|
|
149
|
+
const l = e.parent(i);
|
|
150
150
|
d.get(l).externalConnections = !0, a.fromCluster = n.v;
|
|
151
151
|
}
|
|
152
152
|
if (o !== n.w) {
|
|
153
153
|
const l = e.parent(o);
|
|
154
154
|
d.get(l).externalConnections = !0, a.toCluster = n.w;
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
r.warn("Fix Replacing with XXX", i, o, n.name), e.setEdge(i, o, a, n.name);
|
|
157
157
|
}
|
|
158
|
-
}),
|
|
158
|
+
}), r.warn("Adjusted Graph", h(e)), T(e, 0), r.trace(d);
|
|
159
159
|
}, "adjustClustersAndEdges"), T = /* @__PURE__ */ w((e, t) => {
|
|
160
|
-
if (
|
|
161
|
-
|
|
160
|
+
if (r.warn("extractor - ", t, h(e), e.children("D")), t > 10) {
|
|
161
|
+
r.error("Bailing out");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
164
|
let n = e.nodes(), a = !1;
|
|
165
|
-
for (const
|
|
166
|
-
const o = e.children(
|
|
165
|
+
for (const i of n) {
|
|
166
|
+
const o = e.children(i);
|
|
167
167
|
a = a || o.length > 0;
|
|
168
168
|
}
|
|
169
169
|
if (!a) {
|
|
170
|
-
|
|
170
|
+
r.debug("Done, no node has children", e.nodes());
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
|
|
174
|
-
for (const
|
|
175
|
-
if (
|
|
173
|
+
r.debug("Nodes = ", n, t);
|
|
174
|
+
for (const i of n)
|
|
175
|
+
if (r.debug(
|
|
176
176
|
"Extracting node",
|
|
177
|
-
|
|
177
|
+
i,
|
|
178
178
|
d,
|
|
179
|
-
d.has(
|
|
180
|
-
!e.parent(
|
|
181
|
-
e.node(
|
|
179
|
+
d.has(i) && !d.get(i).externalConnections,
|
|
180
|
+
!e.parent(i),
|
|
181
|
+
e.node(i),
|
|
182
182
|
e.children("D"),
|
|
183
183
|
" Depth ",
|
|
184
184
|
t
|
|
185
|
-
), !d.has(
|
|
186
|
-
|
|
187
|
-
else if (!d.get(
|
|
188
|
-
|
|
185
|
+
), !d.has(i))
|
|
186
|
+
r.debug("Not a cluster", i, t);
|
|
187
|
+
else if (!d.get(i).externalConnections && e.children(i) && e.children(i).length > 0) {
|
|
188
|
+
r.warn(
|
|
189
189
|
"Cluster without external connections, without a parent and with children",
|
|
190
|
-
|
|
190
|
+
i,
|
|
191
191
|
t
|
|
192
192
|
);
|
|
193
193
|
let l = e.graph().rankdir === "TB" ? "LR" : "TB";
|
|
194
|
-
d.get(
|
|
194
|
+
d.get(i)?.clusterData?.dir && (l = d.get(i).clusterData.dir, r.warn("Fixing dir", d.get(i).clusterData.dir, l));
|
|
195
195
|
const u = new B({
|
|
196
196
|
multigraph: !0,
|
|
197
197
|
compound: !0
|
|
@@ -204,52 +204,52 @@ var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
204
204
|
}).setDefaultEdgeLabel(function() {
|
|
205
205
|
return {};
|
|
206
206
|
});
|
|
207
|
-
|
|
207
|
+
r.warn("Old graph before copy", h(e)), G(i, e, u, i), e.setNode(i, {
|
|
208
208
|
clusterNode: !0,
|
|
209
|
-
id:
|
|
210
|
-
clusterData: d.get(
|
|
211
|
-
label: d.get(
|
|
209
|
+
id: i,
|
|
210
|
+
clusterData: d.get(i).clusterData,
|
|
211
|
+
label: d.get(i).label,
|
|
212
212
|
graph: u
|
|
213
|
-
}),
|
|
213
|
+
}), r.warn("New graph after copy node: (", i, ")", h(u)), r.debug("Old graph after copy", h(e));
|
|
214
214
|
} else
|
|
215
|
-
|
|
215
|
+
r.warn(
|
|
216
216
|
"Cluster ** ",
|
|
217
|
-
|
|
217
|
+
i,
|
|
218
218
|
" **not meeting the criteria !externalConnections:",
|
|
219
|
-
!d.get(
|
|
219
|
+
!d.get(i).externalConnections,
|
|
220
220
|
" no parent: ",
|
|
221
|
-
!e.parent(
|
|
221
|
+
!e.parent(i),
|
|
222
222
|
" children ",
|
|
223
|
-
e.children(
|
|
223
|
+
e.children(i) && e.children(i).length > 0,
|
|
224
224
|
e.children("D"),
|
|
225
225
|
t
|
|
226
|
-
),
|
|
227
|
-
n = e.nodes(),
|
|
228
|
-
for (const
|
|
229
|
-
const o = e.node(
|
|
230
|
-
|
|
226
|
+
), r.debug(d);
|
|
227
|
+
n = e.nodes(), r.warn("New list of nodes", n);
|
|
228
|
+
for (const i of n) {
|
|
229
|
+
const o = e.node(i);
|
|
230
|
+
r.warn(" Now next level", i, o), o?.clusterNode && T(o.graph, t + 1);
|
|
231
231
|
}
|
|
232
232
|
}, "extractor"), M = /* @__PURE__ */ w((e, t) => {
|
|
233
233
|
if (t.length === 0)
|
|
234
234
|
return [];
|
|
235
235
|
let n = Object.assign([], t);
|
|
236
236
|
return t.forEach((a) => {
|
|
237
|
-
const
|
|
237
|
+
const i = e.children(a), o = M(e, i);
|
|
238
238
|
n = [...n, ...o];
|
|
239
239
|
}), n;
|
|
240
|
-
}, "sorter"), oe = /* @__PURE__ */ w((e) => M(e, e.children()), "sortNodesByHierarchy"), j = /* @__PURE__ */ w(async (e, t, n, a,
|
|
241
|
-
|
|
240
|
+
}, "sorter"), oe = /* @__PURE__ */ w((e) => M(e, e.children()), "sortNodesByHierarchy"), j = /* @__PURE__ */ w(async (e, t, n, a, i, o) => {
|
|
241
|
+
r.warn("Graph in recursive render:XAX", h(t), i);
|
|
242
242
|
const l = t.graph().rankdir;
|
|
243
|
-
|
|
243
|
+
r.trace("Dir in recursive render - dir:", l);
|
|
244
244
|
const u = e.insert("g").attr("class", "root");
|
|
245
|
-
t.nodes() ?
|
|
245
|
+
t.nodes() ? r.info("Recursive render XXX", t.nodes()) : r.info("No nodes found for", t), t.edges().length > 0 && r.info("Recursive edges", t.edge(t.edges()[0]));
|
|
246
246
|
const c = u.insert("g").attr("class", "clusters"), m = u.insert("g").attr("class", "edgePaths"), v = u.insert("g").attr("class", "edgeLabels"), X = u.insert("g").attr("class", "nodes");
|
|
247
247
|
await Promise.all(
|
|
248
248
|
t.nodes().map(async function(f) {
|
|
249
249
|
const s = t.node(f);
|
|
250
|
-
if (
|
|
251
|
-
const g = JSON.parse(JSON.stringify(
|
|
252
|
-
|
|
250
|
+
if (i !== void 0) {
|
|
251
|
+
const g = JSON.parse(JSON.stringify(i.clusterData));
|
|
252
|
+
r.trace(
|
|
253
253
|
`Setting data for parent cluster XXX
|
|
254
254
|
Node.id = `,
|
|
255
255
|
f,
|
|
@@ -258,11 +258,11 @@ var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
258
258
|
g.height,
|
|
259
259
|
`
|
|
260
260
|
Parent cluster`,
|
|
261
|
-
|
|
262
|
-
), t.setNode(
|
|
261
|
+
i.height
|
|
262
|
+
), t.setNode(i.id, g), t.parent(f) || (r.trace("Setting parent", f, i.id), t.setParent(f, i.id, g));
|
|
263
263
|
}
|
|
264
|
-
if (
|
|
265
|
-
|
|
264
|
+
if (r.info("(Insert) Node XXX" + f + ": " + JSON.stringify(t.node(f))), s?.clusterNode) {
|
|
265
|
+
r.info("Cluster identified XBX", f, s.width, t.node(f));
|
|
266
266
|
const { ranksep: g, nodesep: E } = t.graph();
|
|
267
267
|
s.graph.setGraph({
|
|
268
268
|
...s.graph.graph(),
|
|
@@ -277,7 +277,7 @@ Parent cluster`,
|
|
|
277
277
|
t.node(f),
|
|
278
278
|
o
|
|
279
279
|
), x = N.elem;
|
|
280
|
-
z(s, x), s.diff = N.diff || 0,
|
|
280
|
+
z(s, x), s.diff = N.diff || 0, r.info(
|
|
281
281
|
"New compound node after recursive render XAX",
|
|
282
282
|
f,
|
|
283
283
|
"width",
|
|
@@ -289,7 +289,7 @@ Parent cluster`,
|
|
|
289
289
|
// node.y
|
|
290
290
|
), U(x, s);
|
|
291
291
|
} else
|
|
292
|
-
t.children(f).length > 0 ? (
|
|
292
|
+
t.children(f).length > 0 ? (r.trace(
|
|
293
293
|
"Cluster - the non recursive path XBX",
|
|
294
294
|
f,
|
|
295
295
|
s.id,
|
|
@@ -297,12 +297,12 @@ Parent cluster`,
|
|
|
297
297
|
s.width,
|
|
298
298
|
"Graph:",
|
|
299
299
|
t
|
|
300
|
-
),
|
|
300
|
+
), r.trace(C(s.id, t)), d.set(s.id, { id: C(s.id, t), node: s })) : (r.trace("Node - the non recursive path XAX", f, X, t.node(f), l), await $(X, t.node(f), { config: o, dir: l }));
|
|
301
301
|
})
|
|
302
302
|
), await (/* @__PURE__ */ w(async () => {
|
|
303
303
|
const f = t.edges().map(async function(s) {
|
|
304
304
|
const g = t.edge(s.v, s.w, s.name);
|
|
305
|
-
|
|
305
|
+
r.info("Edge " + s.v + " -> " + s.w + ": " + JSON.stringify(s)), r.info("Edge " + s.v + " -> " + s.w + ": ", s, " ", JSON.stringify(t.edge(s))), r.info(
|
|
306
306
|
"Fix",
|
|
307
307
|
d,
|
|
308
308
|
"ids:",
|
|
@@ -314,12 +314,12 @@ Parent cluster`,
|
|
|
314
314
|
), await Z(v, g);
|
|
315
315
|
});
|
|
316
316
|
await Promise.all(f);
|
|
317
|
-
}, "processEdges"))(),
|
|
317
|
+
}, "processEdges"))(), r.info("Graph before layout:", JSON.stringify(h(t))), r.info("############################################# XXX"), r.info("### Layout ### XXX"), r.info("############################################# XXX"), I(t), r.info("Graph after layout:", JSON.stringify(h(t)));
|
|
318
318
|
let O = 0, { subGraphTitleTotalMargin: S } = q(o);
|
|
319
319
|
return await Promise.all(
|
|
320
320
|
oe(t).map(async function(f) {
|
|
321
321
|
const s = t.node(f);
|
|
322
|
-
if (
|
|
322
|
+
if (r.info(
|
|
323
323
|
"Position XBX => " + f + ": (" + s.x,
|
|
324
324
|
"," + s.y,
|
|
325
325
|
") width: ",
|
|
@@ -327,7 +327,7 @@ Parent cluster`,
|
|
|
327
327
|
" height: ",
|
|
328
328
|
s.height
|
|
329
329
|
), s?.clusterNode)
|
|
330
|
-
s.y += S,
|
|
330
|
+
s.y += S, r.info(
|
|
331
331
|
"A tainted cluster node XBX1",
|
|
332
332
|
f,
|
|
333
333
|
s.id,
|
|
@@ -338,7 +338,7 @@ Parent cluster`,
|
|
|
338
338
|
t.parent(f)
|
|
339
339
|
), d.get(s.id).node = s, P(s);
|
|
340
340
|
else if (t.children(f).length > 0) {
|
|
341
|
-
|
|
341
|
+
r.info(
|
|
342
342
|
"A pure cluster node XBX1",
|
|
343
343
|
f,
|
|
344
344
|
s.id,
|
|
@@ -349,10 +349,10 @@ Parent cluster`,
|
|
|
349
349
|
t.parent(f)
|
|
350
350
|
), s.height += S, t.node(s.parentId);
|
|
351
351
|
const g = s?.padding / 2 || 0, E = s?.labelBBox?.height || 0, N = E - g || 0;
|
|
352
|
-
|
|
352
|
+
r.debug("OffsetY", N, "labelHeight", E, "halfPadding", g), await K(c, s), d.get(s.id).node = s;
|
|
353
353
|
} else {
|
|
354
354
|
const g = t.node(s.parentId);
|
|
355
|
-
s.y += S / 2,
|
|
355
|
+
s.y += S / 2, r.info(
|
|
356
356
|
"A regular node XBX1 - using the padding",
|
|
357
357
|
s.id,
|
|
358
358
|
"parent",
|
|
@@ -372,15 +372,15 @@ Parent cluster`,
|
|
|
372
372
|
})
|
|
373
373
|
), t.edges().forEach(function(f) {
|
|
374
374
|
const s = t.edge(f);
|
|
375
|
-
|
|
375
|
+
r.info("Edge " + f.v + " -> " + f.w + ": " + JSON.stringify(s), s), s.points.forEach((x) => x.y += S / 2);
|
|
376
376
|
const g = t.node(f.v);
|
|
377
377
|
var E = t.node(f.w);
|
|
378
378
|
const N = Q(m, s, d, n, g, E, a);
|
|
379
379
|
W(s, N);
|
|
380
380
|
}), t.nodes().forEach(function(f) {
|
|
381
381
|
const s = t.node(f);
|
|
382
|
-
|
|
383
|
-
}),
|
|
382
|
+
r.info(f, s.type, s.diff), s.isGroup && (O = s.diff);
|
|
383
|
+
}), r.warn("Returning from recursive render XAX", u, O), { elem: u, diff: O };
|
|
384
384
|
}, "recursiveRender"), ge = /* @__PURE__ */ w(async (e, t) => {
|
|
385
385
|
const n = new B({
|
|
386
386
|
multigraph: !0,
|
|
@@ -396,7 +396,7 @@ Parent cluster`,
|
|
|
396
396
|
}), a = t.select("g");
|
|
397
397
|
F(a, e.markers, e.type, e.diagramId), Y(), _(), H(), te(), e.nodes.forEach((o) => {
|
|
398
398
|
n.setNode(o.id, { ...o }), o.parentId && n.setParent(o.id, o.parentId);
|
|
399
|
-
}),
|
|
399
|
+
}), r.debug("Edges:", e.edges), e.edges.forEach((o) => {
|
|
400
400
|
if (o.start === o.end) {
|
|
401
401
|
const l = o.start, u = l + "---" + l + "---1", c = l + "---" + l + "---2", m = n.node(l);
|
|
402
402
|
n.setNode(u, {
|
|
@@ -428,15 +428,15 @@ Parent cluster`,
|
|
|
428
428
|
v.label = "", v.arrowTypeEnd = "none", v.id = l + "-cyclic-special-1", X.arrowTypeStart = "none", X.arrowTypeEnd = "none", X.id = l + "-cyclic-special-mid", p.label = "", m.isGroup && (v.fromCluster = l, p.toCluster = l), p.id = l + "-cyclic-special-2", p.arrowTypeStart = "none", n.setEdge(l, u, v, l + "-cyclic-special-0"), n.setEdge(u, c, X, l + "-cyclic-special-1"), n.setEdge(c, l, p, l + "-cyc<lic-special-2");
|
|
429
429
|
} else
|
|
430
430
|
n.setEdge(o.start, o.end, { ...o }, o.id);
|
|
431
|
-
}),
|
|
432
|
-
const
|
|
431
|
+
}), r.warn("Graph at first:", JSON.stringify(h(n))), ie(n), r.warn("Graph after XAX:", JSON.stringify(h(n)));
|
|
432
|
+
const i = V();
|
|
433
433
|
await j(
|
|
434
434
|
a,
|
|
435
435
|
n,
|
|
436
436
|
e.type,
|
|
437
437
|
e.diagramId,
|
|
438
438
|
void 0,
|
|
439
|
-
|
|
439
|
+
i
|
|
440
440
|
);
|
|
441
441
|
}, "render");
|
|
442
442
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as w, D as te, E as ae, H as he, e as ue, l as K,
|
|
2
|
-
import { s as we } from "./chunk-QN33PNHL-
|
|
3
|
-
import { p as Ce } from "./chunk-4BX2VUAB-
|
|
4
|
-
import { p as Te } from "./mermaid-parser.core-
|
|
1
|
+
import { _ as w, D as te, E as ae, H as he, e as ue, l as K, a_ as P, d as Y, b as pe, a as fe, p as ge, q as me, g as ye, s as Se, F as ve, a$ as xe, y as be } from "./custom-DpenvaVL.js";
|
|
2
|
+
import { s as we } from "./chunk-QN33PNHL-E13ckPQD.js";
|
|
3
|
+
import { p as Ce } from "./chunk-4BX2VUAB-BM6KMQlI.js";
|
|
4
|
+
import { p as Te } from "./mermaid-parser.core-9Cm7d5-2.js";
|
|
5
5
|
import { b as O } from "./defaultLocale-D7EN2tov.js";
|
|
6
6
|
import { o as J } from "./ordinal-DfAQgscy.js";
|
|
7
7
|
function Le(t) {
|
|
@@ -97,10 +97,10 @@ function* Re() {
|
|
|
97
97
|
}
|
|
98
98
|
function Q(t, a) {
|
|
99
99
|
t instanceof Map ? (t = [void 0, t], a === void 0 && (a = Ie)) : a === void 0 && (a = He);
|
|
100
|
-
for (var l = new
|
|
100
|
+
for (var l = new U(t), n, o = [l], s, d, h, g; n = o.pop(); )
|
|
101
101
|
if ((d = a(n.data)) && (g = (d = Array.from(d)).length))
|
|
102
102
|
for (n.children = d, h = g - 1; h >= 0; --h)
|
|
103
|
-
o.push(s = d[h] = new
|
|
103
|
+
o.push(s = d[h] = new U(d[h])), s.parent = n, s.depth = n.depth + 1;
|
|
104
104
|
return l.eachBefore(qe);
|
|
105
105
|
}
|
|
106
106
|
function We() {
|
|
@@ -121,11 +121,11 @@ function qe(t) {
|
|
|
121
121
|
t.height = a;
|
|
122
122
|
while ((t = t.parent) && t.height < ++a);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function U(t) {
|
|
125
125
|
this.data = t, this.depth = this.height = 0, this.parent = null;
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
constructor:
|
|
127
|
+
U.prototype = Q.prototype = {
|
|
128
|
+
constructor: U,
|
|
129
129
|
count: $e,
|
|
130
130
|
each: Ae,
|
|
131
131
|
eachAfter: ke,
|
|
@@ -164,8 +164,8 @@ function Ye(t, a, l, n, o) {
|
|
|
164
164
|
for (var s = t.children, d, h = -1, g = s.length, c = t.value && (o - l) / t.value; ++h < g; )
|
|
165
165
|
d = s[h], d.x0 = a, d.x1 = n, d.y0 = l, d.y1 = l += d.value * c;
|
|
166
166
|
}
|
|
167
|
-
var
|
|
168
|
-
function
|
|
167
|
+
var Ue = (1 + Math.sqrt(5)) / 2;
|
|
168
|
+
function Ze(t, a, l, n, o, s) {
|
|
169
169
|
for (var d = [], h = a.children, g, c, u = 0, b = 0, r = h.length, x, S, v = a.value, p, m, N, k, V, R, M; u < r; ) {
|
|
170
170
|
x = o - l, S = s - n;
|
|
171
171
|
do
|
|
@@ -184,12 +184,12 @@ function Ue(t, a, l, n, o, s) {
|
|
|
184
184
|
}
|
|
185
185
|
const Je = (function t(a) {
|
|
186
186
|
function l(n, o, s, d, h) {
|
|
187
|
-
|
|
187
|
+
Ze(a, n, o, s, d, h);
|
|
188
188
|
}
|
|
189
189
|
return l.ratio = function(n) {
|
|
190
190
|
return t((n = +n) > 1 ? n : 1);
|
|
191
191
|
}, l;
|
|
192
|
-
})(
|
|
192
|
+
})(Ue);
|
|
193
193
|
function Ke() {
|
|
194
194
|
var t = Je, a = !1, l = 1, n = 1, o = [0], s = q, d = q, h = q, g = q, c = q;
|
|
195
195
|
function u(r) {
|
|
@@ -440,12 +440,12 @@ var Qe = /* @__PURE__ */ w((t, a) => {
|
|
|
440
440
|
let I = Math.max(
|
|
441
441
|
z,
|
|
442
442
|
Math.min(F, Math.round(y * T))
|
|
443
|
-
),
|
|
444
|
-
for (;
|
|
443
|
+
), Z = y + H + I;
|
|
444
|
+
for (; Z > A && y > _ && (y--, I = Math.max(
|
|
445
445
|
z,
|
|
446
446
|
Math.min(F, Math.round(y * T))
|
|
447
447
|
), !(I < z && y === _)); )
|
|
448
|
-
i.style("font-size", `${y}px`),
|
|
448
|
+
i.style("font-size", `${y}px`), Z = y + H + I;
|
|
449
449
|
i.style("font-size", `${y}px`), (L.getComputedTextLength() > D || y < _ || A < y) && i.style("display", "none");
|
|
450
450
|
}), s.showValues !== !1 && j.append("text").attr("class", "treemapValue").attr("x", (i) => (i.x1 - i.x0) / 2).attr("y", function(i) {
|
|
451
451
|
return (i.y1 - i.y0) / 2;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./custom-Bj6wd8Zo.cjs"),se=require("./chunk-QN33PNHL-DD0xRcz_.cjs"),ie=require("./chunk-4BX2VUAB-BNg9BEzs.cjs"),oe=require("./mermaid-parser.core-2hw0AO3p.cjs"),I=require("./defaultLocale-DIVzfLaQ.cjs"),U=require("./ordinal-CagbB1m8.cjs");function ce(a){var t=0,l=a.children,n=l&&l.length;if(!n)t=1;else for(;--n>=0;)t+=l[n].value;a.value=t}function de(){return this.eachAfter(ce)}function ue(a,t){let l=-1;for(const n of this)a.call(t,n,++l,this);return this}function he(a,t){for(var l=this,n=[l],o,s,d=-1;l=n.pop();)if(a.call(t,l,++d,this),o=l.children)for(s=o.length-1;s>=0;--s)n.push(o[s]);return this}function pe(a,t){for(var l=this,n=[l],o=[],s,d,h,m=-1;l=n.pop();)if(o.push(l),s=l.children)for(d=0,h=s.length;d<h;++d)n.push(s[d]);for(;l=o.pop();)a.call(t,l,++m,this);return this}function fe(a,t){let l=-1;for(const n of this)if(a.call(t,n,++l,this))return n}function ge(a){return this.eachAfter(function(t){for(var l=+a(t.data)||0,n=t.children,o=n&&n.length;--o>=0;)l+=n[o].value;t.value=l})}function me(a){return this.eachBefore(function(t){t.children&&t.children.sort(a)})}function ye(a){for(var t=this,l=Se(t,a),n=[t];t!==l;)t=t.parent,n.push(t);for(var o=n.length;a!==l;)n.splice(o,0,a),a=a.parent;return n}function Se(a,t){if(a===t)return a;var l=a.ancestors(),n=t.ancestors(),o=null;for(a=l.pop(),t=n.pop();a===t;)o=a,a=l.pop(),t=n.pop();return o}function ve(){for(var a=this,t=[a];a=a.parent;)t.push(a);return t}function xe(){return Array.from(this)}function be(){var a=[];return this.eachBefore(function(t){t.children||a.push(t)}),a}function we(){var a=this,t=[];return a.each(function(l){l!==a&&t.push({source:l.parent,target:l})}),t}function*Ce(){var a=this,t,l=[a],n,o,s;do for(t=l.reverse(),l=[];a=t.pop();)if(yield a,n=a.children)for(o=0,s=n.length;o<s;++o)l.push(n[o]);while(l.length)}function Q(a,t){a instanceof Map?(a=[void 0,a],t===void 0&&(t=Le)):t===void 0&&(t=Te);for(var l=new j(a),n,o=[l],s,d,h,m;n=o.pop();)if((d=t(n.data))&&(m=(d=Array.from(d)).length))for(n.children=d,h=m-1;h>=0;--h)o.push(s=d[h]=new j(d[h])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ae)}function _e(){return Q(this).eachBefore($e)}function Te(a){return a.children}function Le(a){return Array.isArray(a)?a[1]:null}function $e(a){a.data.value!==void 0&&(a.value=a.data.value),a.data=a.data.data}function Ae(a){var t=0;do a.height=t;while((a=a.parent)&&a.height<++t)}function j(a){this.data=a,this.depth=this.height=0,this.parent=null}j.prototype=Q.prototype={constructor:j,count:de,each:ue,eachAfter:pe,eachBefore:he,find:fe,sum:ge,sort:me,path:ye,ancestors:ve,descendants:xe,leaves:be,links:we,copy:_e,[Symbol.iterator]:Ce};function ke(a){if(typeof a!="function")throw new Error;return a}function q(){return 0}function O(a){return function(){return a}}function Ne(a){a.x0=Math.round(a.x0),a.y0=Math.round(a.y0),a.x1=Math.round(a.x1),a.y1=Math.round(a.y1)}function Me(a,t,l,n,o){for(var s=a.children,d,h=-1,m=s.length,c=a.value&&(n-t)/a.value;++h<m;)d=s[h],d.y0=l,d.y1=o,d.x0=t,d.x1=t+=d.value*c}function Fe(a,t,l,n,o){for(var s=a.children,d,h=-1,m=s.length,c=a.value&&(o-l)/a.value;++h<m;)d=s[h],d.x0=t,d.x1=n,d.y0=l,d.y1=l+=d.value*c}var ze=(1+Math.sqrt(5))/2;function Ve(a,t,l,n,o,s){for(var d=[],h=t.children,m,c,p=0,w=0,r=h.length,b,v,x=t.value,f,y,N,k,V,R,M;p<r;){b=o-l,v=s-n;do f=h[w++].value;while(!f&&w<r);for(y=N=f,R=Math.max(v/b,b/v)/(x*a),M=f*f*R,V=Math.max(N/M,M/y);w<r;++w){if(f+=c=h[w].value,c<y&&(y=c),c>N&&(N=c),M=f*f*R,k=Math.max(N/M,M/y),k>V){f-=c;break}V=k}d.push(m={value:f,dice:b<v,children:h.slice(p,w)}),m.dice?Me(m,l,n,o,x?n+=v*f/x:s):Fe(m,l,n,x?l+=b*f/x:o,s),x-=f,p=w}return d}const Pe=(function a(t){function l(n,o,s,d,h){Ve(t,n,o,s,d,h)}return l.ratio=function(n){return a((n=+n)>1?n:1)},l})(ze);function Be(){var a=Pe,t=!1,l=1,n=1,o=[0],s=q,d=q,h=q,m=q,c=q;function p(r){return r.x0=r.y0=0,r.x1=l,r.y1=n,r.eachBefore(w),o=[0],t&&r.eachBefore(Ne),r}function w(r){var b=o[r.depth],v=r.x0+b,x=r.y0+b,f=r.x1-b,y=r.y1-b;f<v&&(v=f=(v+f)/2),y<x&&(x=y=(x+y)/2),r.x0=v,r.y0=x,r.x1=f,r.y1=y,r.children&&(b=o[r.depth+1]=s(r)/2,v+=c(r)-b,x+=d(r)-b,f-=h(r)-b,y-=m(r)-b,f<v&&(v=f=(v+f)/2),y<x&&(x=y=(x+y)/2),a(r,v,x,f,y))}return p.round=function(r){return arguments.length?(t=!!r,p):t},p.size=function(r){return arguments.length?(l=+r[0],n=+r[1],p):[l,n]},p.tile=function(r){return arguments.length?(a=ke(r),p):a},p.padding=function(r){return arguments.length?p.paddingInner(r).paddingOuter(r):p.paddingInner()},p.paddingInner=function(r){return arguments.length?(s=typeof r=="function"?r:O(+r),p):s},p.paddingOuter=function(r){return arguments.length?p.paddingTop(r).paddingRight(r).paddingBottom(r).paddingLeft(r):p.paddingTop()},p.paddingTop=function(r){return arguments.length?(d=typeof r=="function"?r:O(+r),p):d},p.paddingRight=function(r){return arguments.length?(h=typeof r=="function"?r:O(+r),p):h},p.paddingBottom=function(r){return arguments.length?(m=typeof r=="function"?r:O(+r),p):m},p.paddingLeft=function(r){return arguments.length?(c=typeof r=="function"?r:O(+r),p):c},p}var D,J=(D=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=u.setAccTitle,this.getAccTitle=u.getAccTitle,this.setDiagramTitle=u.setDiagramTitle,this.getDiagramTitle=u.getDiagramTitle,this.getAccDescription=u.getAccDescription,this.setAccDescription=u.setAccDescription}getNodes(){return this.nodes}getConfig(){const t=u.defaultConfig_default,l=u.getConfig();return u.cleanAndMerge({...t.treemap,...l.treemap??{}})}addNode(t,l){this.nodes.push(t),this.levels.set(t,l),l===0&&(this.outerNodes.push(t),this.root??=t)}getRoot(){return{name:"",children:this.outerNodes}}addClass(t,l){const n=this.classes.get(t)??{id:t,styles:[],textStyles:[]},o=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");o&&o.forEach(s=>{u.isLabelStyle(s)&&(n?.textStyles?n.textStyles.push(s):n.textStyles=[s]),n?.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(t,n)}getClasses(){return this.classes}getStylesForClass(t){return this.classes.get(t)?.styles??[]}clear(){u.clear(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},u.__name(D,"TreeMapDB"),D);function K(a){if(!a.length)return[];const t=[],l=[];return a.forEach(n=>{const o={name:n.name,children:n.type==="Leaf"?void 0:[]};for(o.classSelector=n?.classSelector,n?.cssCompiledStyles&&(o.cssCompiledStyles=[n.cssCompiledStyles]),n.type==="Leaf"&&n.value!==void 0&&(o.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)t.push(o);else{const s=l[l.length-1].node;s.children?s.children.push(o):s.children=[o]}n.type!=="Leaf"&&l.push({node:o,level:n.level})}),t}u.__name(K,"buildHierarchy");var De=u.__name((a,t)=>{ie.populateCommonDb(a,t);const l=[];for(const s of a.TreemapRows??[])s.$type==="ClassDefStatement"&&t.addClass(s.className??"",s.styleText??"");for(const s of a.TreemapRows??[]){const d=s.item;if(!d)continue;const h=s.indent?parseInt(s.indent):0,m=Re(d),c=d.classSelector?t.getStylesForClass(d.classSelector):[],p=c.length>0?c.join(";"):void 0,w={level:h,name:m,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:p};l.push(w)}const n=K(l),o=u.__name((s,d)=>{for(const h of s)t.addNode(h,d),h.children&&h.children.length>0&&o(h.children,d+1)},"addNodesRecursively");o(n,0)},"populate"),Re=u.__name(a=>a.name?String(a.name):"","getItemName"),ee={parser:{yy:void 0},parse:u.__name(async a=>{try{const t=oe.parse,l=await t("treemap",a);u.log.debug("Treemap AST:",l);const n=ee.parser?.yy;if(!(n instanceof J))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");De(l,n)}catch(t){throw u.log.error("Error parsing treemap:",t),t}},"parse")},Ee=10,B=10,G=25,We=u.__name((a,t,l,n)=>{const o=n.db,s=o.getConfig(),d=s.padding??Ee,h=o.getDiagramTitle(),m=o.getRoot(),{themeVariables:c}=u.getConfig();if(!m)return;const p=h?30:0,w=u.selectSvgElement(t),r=s.nodeWidth?s.nodeWidth*B:960,b=s.nodeHeight?s.nodeHeight*B:500,v=r,x=b+p;w.attr("viewBox",`0 0 ${v} ${x}`),u.configureSvgSize(w,x,v,s.useMaxWidth);let f;try{const e=s.valueFormat||",";if(e==="$0,0")f=u.__name(i=>"$"+I.format(",")(i),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const i=/\.\d+/.exec(e),g=i?i[0]:"";f=u.__name(C=>"$"+I.format(","+g)(C),"valueFormat")}else if(e.startsWith("$")){const i=e.substring(1);f=u.__name(g=>"$"+I.format(i||"")(g),"valueFormat")}else f=I.format(e)}catch(e){u.log.error("Error creating format function:",e),f=I.format(",")}const y=U.ordinal().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=U.ordinal().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),k=U.ordinal().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);h&&w.append("text").attr("x",v/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const V=w.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=Q(m).sum(e=>e.value??0).sort((e,i)=>(i.value??0)-(e.value??0)),Z=Be().size([r,b]).paddingTop(e=>e.children&&e.children.length>0?G+B:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?B:0).paddingRight(e=>e.children&&e.children.length>0?B:0).paddingBottom(e=>e.children&&e.children.length>0?B:0).round(!0)(R),te=Z.descendants().filter(e=>e.children&&e.children.length>0),E=V.selectAll(".treemapSection").data(te).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);E.append("rect").attr("width",e=>e.x1-e.x0).attr("height",G).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),E.append("clipPath").attr("id",(e,i)=>`clip-section-${t}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",G),E.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,i)=>`treemapSection section${i}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const i=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),E.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",G/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const i=u.select(this),g=e.data.name;i.text(g);const C=e.x1-e.x0,T=6;let L;s.showValues!==!1&&e.value?L=C-10-30-10-T:L=C-T-6;const $=Math.max(15,L),S=i.node();if(S.getComputedTextLength()>$){let _=g;for(;_.length>0;){if(_=g.substring(0,_.length-1),_.length===0){i.text("..."),S.getComputedTextLength()>$&&i.text("");break}if(i.text(_+"..."),S.getComputedTextLength()<=$)break}}}),s.showValues!==!1&&E.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",G/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?f(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")});const ae=Z.leaves(),X=V.selectAll(".treemapLeafGroup").data(ae).enter().append("g").attr("class",(e,i)=>`treemapNode treemapLeafGroup leaf${i}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);X.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),X.append("clipPath").attr("id",(e,i)=>`clip-${t}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),X.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const i="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+k(e.data.name)+";",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,i)=>`url(#clip-${t}-${i})`).text(e=>e.data.name).each(function(e){const i=u.select(this),g=e.x1-e.x0,C=e.y1-e.y0,T=i.node(),L=4,P=g-2*L,$=C-2*L;if(P<10||$<10){i.style("display","none");return}let S=parseInt(i.style("font-size"),10);const F=8,A=28,_=.6,z=6,W=2;for(;T.getComputedTextLength()>P&&S>F;)S--,i.style("font-size",`${S}px`);let H=Math.max(z,Math.min(A,Math.round(S*_))),Y=S+W+H;for(;Y>$&&S>F&&(S--,H=Math.max(z,Math.min(A,Math.round(S*_))),!(H<z&&S===F));)i.style("font-size",`${S}px`),Y=S+W+H;i.style("font-size",`${S}px`),(T.getComputedTextLength()>P||S<F||$<S)&&i.style("display","none")}),s.showValues!==!1&&X.append("text").attr("class","treemapValue").attr("x",i=>(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const g="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+k(i.data.name)+";",C=u.styles2String({cssCompiledStyles:i.data.cssCompiledStyles});return g+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,g)=>`url(#clip-${t}-${g})`).text(i=>i.value?f(i.value):"").each(function(i){const g=u.select(this),C=this.parentNode;if(!C){g.style("display","none");return}const T=u.select(C).select(".treemapLabel");if(T.empty()||T.style("display")==="none"){g.style("display","none");return}const L=parseFloat(T.style("font-size")),P=28,$=.6,S=6,F=2,A=Math.max(S,Math.min(P,Math.round(L*$)));g.style("font-size",`${A}px`);const z=(i.y1-i.y0)/2+L/2+F;g.attr("y",z);const W=i.x1-i.x0,le=i.y1-i.y0-4,re=W-8;g.node().getComputedTextLength()>re||z+A>le||A<S?g.style("display","none"):g.style("display",null)});const ne=s.diagramPadding??8;se.setupViewPortForSVG(w,ne,"flowchart",s?.useMaxWidth||!1)},"draw"),He=u.__name(function(a,t){return t.db.getClasses()},"getClasses"),Ie={draw:We,getClasses:He},qe={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},Oe=u.__name(({treemap:a}={})=>{const t=u.cleanAndMerge(qe,a);return`
|
|
2
|
+
.treemapNode.section {
|
|
3
|
+
stroke: ${t.sectionStrokeColor};
|
|
4
|
+
stroke-width: ${t.sectionStrokeWidth};
|
|
5
|
+
fill: ${t.sectionFillColor};
|
|
6
|
+
}
|
|
7
|
+
.treemapNode.leaf {
|
|
8
|
+
stroke: ${t.leafStrokeColor};
|
|
9
|
+
stroke-width: ${t.leafStrokeWidth};
|
|
10
|
+
fill: ${t.leafFillColor};
|
|
11
|
+
}
|
|
12
|
+
.treemapLabel {
|
|
13
|
+
fill: ${t.labelColor};
|
|
14
|
+
font-size: ${t.labelFontSize};
|
|
15
|
+
}
|
|
16
|
+
.treemapValue {
|
|
17
|
+
fill: ${t.valueColor};
|
|
18
|
+
font-size: ${t.valueFontSize};
|
|
19
|
+
}
|
|
20
|
+
.treemapTitle {
|
|
21
|
+
fill: ${t.titleColor};
|
|
22
|
+
font-size: ${t.titleFontSize};
|
|
23
|
+
}
|
|
24
|
+
`},"getStyles"),Ge=Oe,Xe={parser:ee,get db(){return new J},renderer:Ie,styles:Ge};exports.diagram=Xe;
|