@aiquants/markdown 5.0.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +176 -14
- package/dist/{abnfDiagram-VRR7QNED-DeHJ63Vu.js → abnfDiagram-VRR7QNED-0ow9i3L-.js} +3 -3
- package/dist/{abnfDiagram-VRR7QNED-CfVjEUzG.cjs → abnfDiagram-VRR7QNED-DRNsVB-u.cjs} +1 -1
- package/dist/{arc-XFFLkHkK.cjs → arc-BWR9_qMf.cjs} +1 -1
- package/dist/arc-Bh12k776.js +83 -0
- package/dist/{architectureDiagram-ZJ3FMSHR-CQ1m3MUB.js → architectureDiagram-ZJ3FMSHR-CsFXQcxx.js} +123 -123
- package/dist/{architectureDiagram-ZJ3FMSHR-7xJ6YYGu.cjs → architectureDiagram-ZJ3FMSHR-DtrqDlxV.cjs} +1 -1
- package/dist/{blockDiagram-677ZJIJ3-CJOFqwiW.cjs → blockDiagram-677ZJIJ3-CoZEeE0C.cjs} +1 -1
- package/dist/{blockDiagram-677ZJIJ3-BPC3se0e.js → blockDiagram-677ZJIJ3-CqQ43viF.js} +166 -166
- package/dist/{c4Diagram-LMCZKHZV-D8ytYGhR.cjs → c4Diagram-LMCZKHZV-DGA2gxp-.cjs} +1 -1
- package/dist/{c4Diagram-LMCZKHZV-BEIrp4t6.js → c4Diagram-LMCZKHZV-QPgNg4El.js} +2 -2
- package/dist/{channel-CJQcZr8o.cjs → channel-Jkgg7NV4.cjs} +1 -1
- package/dist/channel-PnA15jK3.js +5 -0
- package/dist/{chunk-2Q5K7J3B-BbMQR3Sm.cjs → chunk-2Q5K7J3B-1iQ5h7FK.cjs} +1 -1
- package/dist/{chunk-2Q5K7J3B-l8ly7Yjr.js → chunk-2Q5K7J3B-DOWfHP5s.js} +1 -1
- package/dist/{chunk-32BRIVSS-BhQJBlVw.js → chunk-32BRIVSS-94iTIA-u.js} +1 -1
- package/dist/{chunk-32BRIVSS-BwDfmprN.cjs → chunk-32BRIVSS-XUAL4SUU.cjs} +1 -1
- package/dist/{chunk-5VM5RSS4-CqDQlS7v.cjs → chunk-5VM5RSS4-CKgpuXOS.cjs} +1 -1
- package/dist/{chunk-5VM5RSS4-Bfis-x7E.js → chunk-5VM5RSS4-OANQKmQE.js} +1 -1
- package/dist/{chunk-EX3LRPZG-DUTbzwDM.js → chunk-EX3LRPZG-BQDQ1MdS.js} +50 -50
- package/dist/{chunk-EX3LRPZG-9aDULZwJ.cjs → chunk-EX3LRPZG-BrRRbskW.cjs} +1 -1
- package/dist/{chunk-JWPE2WC7-5cM5nFf6.cjs → chunk-JWPE2WC7-Bz9dXsLZ.cjs} +1 -1
- package/dist/{chunk-JWPE2WC7-DpcSSOP5.js → chunk-JWPE2WC7-Djg6Qi23.js} +1 -1
- package/dist/{chunk-MOJQB5TN-D_h6bolU.js → chunk-MOJQB5TN-1pZNp2Wl.js} +9 -9
- package/dist/{chunk-MOJQB5TN-Cw864mUL.cjs → chunk-MOJQB5TN-DUk2Jy4_.cjs} +1 -1
- package/dist/{chunk-PUDLZKDR-yLvT3c9x.cjs → chunk-PUDLZKDR-CVedetzB.cjs} +1 -1
- package/dist/{chunk-PUDLZKDR-B0wZjmzv.js → chunk-PUDLZKDR-G5JYyEiR.js} +22 -22
- package/dist/{chunk-RYQCIY6F-DTKYsCgk.js → chunk-RYQCIY6F-Crmt36sO.js} +6 -6
- package/dist/{chunk-RYQCIY6F-hj9dRWMT.cjs → chunk-RYQCIY6F-D0y50t5B.cjs} +1 -1
- package/dist/{chunk-V7JOEXUC-COa9uddv.js → chunk-V7JOEXUC-BNo-X7NC.js} +5 -5
- package/dist/{chunk-V7JOEXUC-DIQ8n1AN.cjs → chunk-V7JOEXUC-DXSQM1ea.cjs} +1 -1
- package/dist/{chunk-VR4S4FIN-B72PxPVm.js → chunk-VR4S4FIN-BGGITgpQ.js} +3 -3
- package/dist/{chunk-VR4S4FIN-Cy-2mZJB.cjs → chunk-VR4S4FIN-Bc567umS.cjs} +1 -1
- package/dist/{chunk-XXDRQBXY-DmoUE7-y.cjs → chunk-XXDRQBXY-DOuLpiJ4.cjs} +1 -1
- package/dist/{chunk-XXDRQBXY-D2Sgptl-.js → chunk-XXDRQBXY-Drnpl-KK.js} +1 -1
- package/dist/{classDiagram-v2-EOCWNBFH-Dah4_VL7.js → classDiagram-OUVF2IWQ-Cneye7qT.js} +2 -2
- package/dist/{classDiagram-OUVF2IWQ-GjsCEuKI.cjs → classDiagram-OUVF2IWQ-mmjBEYmN.cjs} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-Dah4_VL7.js → classDiagram-v2-EOCWNBFH-Cneye7qT.js} +2 -2
- package/dist/{classDiagram-v2-EOCWNBFH-GjsCEuKI.cjs → classDiagram-v2-EOCWNBFH-mmjBEYmN.cjs} +1 -1
- package/dist/components/MarkdownRenderer.d.ts +5 -2
- package/dist/components/MarkdownViewer.d.ts +3 -2
- package/dist/components/NodesRenderer.d.ts +1 -5
- package/dist/components/embeds/ClientFrame.d.ts +13 -0
- package/dist/components/embeds/LinkCard.d.ts +20 -0
- package/dist/components/embeds/ProviderEmbed.d.ts +11 -0
- package/dist/components/embeds/embedLabels.d.ts +12 -0
- package/dist/components/embeds/frameMessages.d.ts +7 -0
- package/dist/components/embeds/markdownEmbeds.d.ts +2 -0
- package/dist/components/embeds/requestQueue.d.ts +16 -0
- package/dist/components/embeds.d.ts +0 -8
- package/dist/components/htmlSanitizer.d.ts +4 -0
- package/dist/components/mdastNodes/HTMLBlockContainerNode.d.ts +1 -2
- package/dist/components/rawHtml.d.ts +6 -3
- package/dist/components/viewerLabels.d.ts +3 -1
- package/dist/{cose-bilkent-JH36ORCC-Pi0l3C5o.js → cose-bilkent-JH36ORCC-BQWfGE1G.js} +1 -1
- package/dist/{cose-bilkent-JH36ORCC-Vi9pHFwc.cjs → cose-bilkent-JH36ORCC-BaEdcRlX.cjs} +1 -1
- package/dist/css/zenn-content.css +0 -40
- package/dist/{cynefinDiagram-TSTJHNR4-CIh03JTU.js → cynefinDiagram-TSTJHNR4-CTDDSUz7.js} +47 -47
- package/dist/{cynefinDiagram-TSTJHNR4-BQ2k9Z6b.cjs → cynefinDiagram-TSTJHNR4-DPQl09kC.cjs} +1 -1
- package/dist/{dagre-VKFMJZFB-cINcPwV3.js → dagre-VKFMJZFB-BMRdJgZy.js} +27 -27
- package/dist/{dagre-VKFMJZFB-DI2wSrAy.cjs → dagre-VKFMJZFB-DZ4E-Szs.cjs} +1 -1
- package/dist/{diagram-FQU43EPY-BonrBTG_.js → diagram-FQU43EPY-CmEpNw5i.js} +42 -42
- package/dist/{diagram-FQU43EPY-B6iUH2l5.cjs → diagram-FQU43EPY-mK9YHIy1.cjs} +1 -1
- package/dist/{diagram-G47NLZAW-CY6mWS2R.cjs → diagram-G47NLZAW-BX8Lj_uD.cjs} +1 -1
- package/dist/{diagram-G47NLZAW-5N876QQA.js → diagram-G47NLZAW-eJRQFjAg.js} +83 -83
- package/dist/{diagram-NH7WQ7WH-x3SaRfd6.cjs → diagram-NH7WQ7WH-3r1_3TrC.cjs} +1 -1
- package/dist/{diagram-NH7WQ7WH-LFuTbHxY.js → diagram-NH7WQ7WH-BOOj_4-N.js} +18 -18
- package/dist/{diagram-OA4YK3LP-B9mVw8cB.cjs → diagram-OA4YK3LP-CkDJzLOy.cjs} +1 -1
- package/dist/{diagram-OA4YK3LP-Cinpbl0B.js → diagram-OA4YK3LP-DnDIHtcW.js} +61 -61
- package/dist/{diagram-WEI45ONY-HPCHpafe.js → diagram-WEI45ONY-BHpuPTt-.js} +21 -21
- package/dist/{diagram-WEI45ONY-BRYVUhRr.cjs → diagram-WEI45ONY-BpCCo_Ty.cjs} +1 -1
- package/dist/{ebnfDiagram-CCIWWBDH-oLOdtH39.js → ebnfDiagram-CCIWWBDH-BDLB-AVF.js} +5 -5
- package/dist/{ebnfDiagram-CCIWWBDH-DhFlIi0a.cjs → ebnfDiagram-CCIWWBDH-CfdalXdM.cjs} +1 -1
- package/dist/embeds/frames.d.ts +4 -0
- package/dist/embeds/linkCards.d.ts +48 -0
- package/dist/embeds/placeholder.d.ts +15 -0
- package/dist/embeds/providers.d.ts +73 -0
- package/dist/embeds/testing.cjs +1 -0
- package/dist/embeds/testing.d.ts +7 -0
- package/dist/embeds/testing.js +67 -0
- package/dist/embeds.cjs +1 -0
- package/dist/embeds.d.ts +4 -0
- package/dist/embeds.js +73 -0
- package/dist/{erDiagram-Q63AITRT-DCCFR1Ai.cjs → erDiagram-Q63AITRT-CviOyQsx.cjs} +1 -1
- package/dist/{erDiagram-Q63AITRT-CCtzpK78.js → erDiagram-Q63AITRT-DZlcgZfp.js} +9 -9
- package/dist/{extractHeadings-CGJexznE.js → extractHeadings-CtiYkq2z.js} +5482 -5431
- package/dist/extractHeadings-D1A8WzVy.cjs +311 -0
- package/dist/flowDiagram-23GEKE2U-C_FW0q38.js +7 -0
- package/dist/flowDiagram-23GEKE2U-Cb0U58EU.cjs +1 -0
- package/dist/{ganttDiagram-NO4QXBWP-C9RPyo4r.cjs → ganttDiagram-NO4QXBWP-CJa-hKPU.cjs} +1 -1
- package/dist/{ganttDiagram-NO4QXBWP-Dfi3nINO.js → ganttDiagram-NO4QXBWP-DO0HAbYg.js} +69 -69
- package/dist/{gitGraphDiagram-IHSO6WYX-CjAqPhww.js → gitGraphDiagram-IHSO6WYX-CXStgPQs.js} +38 -38
- package/dist/{gitGraphDiagram-IHSO6WYX-mT3NNT7T.cjs → gitGraphDiagram-IHSO6WYX-CXcPHbkt.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.client.cjs +1 -1
- package/dist/index.client.d.ts +1 -10
- package/dist/index.client.js +41 -49
- package/dist/index.js +41 -49
- package/dist/index.server.cjs +1 -1
- package/dist/index.server.d.ts +1 -2
- package/dist/index.server.js +593 -191
- package/dist/{infoDiagram-FWYZ7A6U-0Co9BitR.cjs → infoDiagram-FWYZ7A6U-BByoHihL.cjs} +1 -1
- package/dist/{infoDiagram-FWYZ7A6U-BXWQ9Vy4.js → infoDiagram-FWYZ7A6U-K0__ySEG.js} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-CZp5P1WE.js → ishikawaDiagram-FXEZZL3T-C8QlwQP1.js} +35 -35
- package/dist/{ishikawaDiagram-FXEZZL3T-BKqUBw1i.cjs → ishikawaDiagram-FXEZZL3T-DZOMdeTI.cjs} +1 -1
- package/dist/{journeyDiagram-5HDEW3XC-DYVTgOOE.js → journeyDiagram-5HDEW3XC-CZ9PFNNN.js} +39 -39
- package/dist/{journeyDiagram-5HDEW3XC-CeumPQ1I.cjs → journeyDiagram-5HDEW3XC-RvC77rKo.cjs} +1 -1
- package/dist/{kanban-definition-HUTT4EX6-Cg5KnsE9.cjs → kanban-definition-HUTT4EX6-BL1jihGl.cjs} +1 -1
- package/dist/{kanban-definition-HUTT4EX6-CnleRy80.js → kanban-definition-HUTT4EX6-Q12F4vHx.js} +123 -123
- package/dist/{linear-Cf8i6Rsk.js → linear-LWjATjog.js} +32 -32
- package/dist/{linear-qqwu6T0F.cjs → linear-lDvPoqlB.cjs} +1 -1
- package/dist/linkCardServer/addressGuard.server.d.ts +25 -0
- package/dist/linkCardServer/htmlEncoding.server.d.ts +6 -0
- package/dist/linkCardServer/linkCardHandler.server.d.ts +7 -0
- package/dist/linkCardServer/metadataCache.server.d.ts +5 -0
- package/dist/linkCardServer/pageFetch.server.d.ts +37 -0
- package/dist/linkCardServer/pageMetadata.server.d.ts +11 -0
- package/dist/linkCards-1JxY8wdm.js +48 -0
- package/dist/linkCards-Bjd_vW39.cjs +1 -0
- package/dist/markdown.css +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-lBin9VOm.js → mindmap-definition-LN4V7U3C-CM1XvwJX.js} +33 -33
- package/dist/{mindmap-definition-LN4V7U3C-DfFWeFph.cjs → mindmap-definition-LN4V7U3C-TVYKONRm.cjs} +1 -1
- package/dist/{pegDiagram-2B236MQR-BiD21lOj.js → pegDiagram-2B236MQR-Dlrnikqd.js} +5 -5
- package/dist/{pegDiagram-2B236MQR-Cf1f-3yi.cjs → pegDiagram-2B236MQR-a9Up0ERY.cjs} +1 -1
- package/dist/{pieDiagram-ENE6RG2P-jwhVsZgX.cjs → pieDiagram-ENE6RG2P-ClakmSma.cjs} +1 -1
- package/dist/{pieDiagram-ENE6RG2P-BqZb6gaV.js → pieDiagram-ENE6RG2P-WYrEJp8U.js} +58 -58
- package/dist/providers-Bxr2Wb-j.cjs +1 -0
- package/dist/providers-Drq7MT_K.js +209 -0
- package/dist/{quadrantDiagram-ABIIQ3AL-CNe9fRLO.js → quadrantDiagram-ABIIQ3AL-BkgMVDaX.js} +48 -48
- package/dist/{quadrantDiagram-ABIIQ3AL-sO_sIA7b.cjs → quadrantDiagram-ABIIQ3AL-Cb01YcqR.cjs} +1 -1
- package/dist/{railroadDiagram-RFXS5EU6-Dkc8k3e9.cjs → railroadDiagram-RFXS5EU6-Bob4WSMz.cjs} +1 -1
- package/dist/{railroadDiagram-RFXS5EU6-53YTkJrs.js → railroadDiagram-RFXS5EU6-RfCtZGUR.js} +3 -3
- package/dist/{requirementDiagram-TGXJPOKE-C0GMlJO4.cjs → requirementDiagram-TGXJPOKE-BP5h9mCj.cjs} +1 -1
- package/dist/{requirementDiagram-TGXJPOKE-D8Gz7jzA.js → requirementDiagram-TGXJPOKE-C1yJPMp1.js} +3 -3
- package/dist/{sankeyDiagram-HTMAVEWB-CEC0GaCg.js → sankeyDiagram-HTMAVEWB-D5G9Dcmr.js} +67 -67
- package/dist/{sankeyDiagram-HTMAVEWB-Bw9J2Ay2.cjs → sankeyDiagram-HTMAVEWB-shq9WK4t.cjs} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-CKb4m3I0.js → sequenceDiagram-DBY2YBRQ-8EJMQxiB.js} +47 -47
- package/dist/{sequenceDiagram-DBY2YBRQ-BuqPCreB.cjs → sequenceDiagram-DBY2YBRQ-BRxcK5-5.cjs} +1 -1
- package/dist/{simple-logger-DZxBpX7v.cjs → simple-logger-9yf7ypyB.cjs} +1 -1
- package/dist/{simple-logger-i94ikRyH.js → simple-logger-DwH1YQvq.js} +3 -1
- package/dist/{sizeCapture-X5ZJPWSS-Dm3rsxXw.cjs → sizeCapture-X5ZJPWSS-BtBRJO2R.cjs} +1 -1
- package/dist/{sizeCapture-X5ZJPWSS-CotnTNAA.js → sizeCapture-X5ZJPWSS-DJG85IuR.js} +1 -1
- package/dist/{stateDiagram-2N3HPSRC-GWEIP-C9.js → stateDiagram-2N3HPSRC-CAd-NU-f.js} +22 -22
- package/dist/{stateDiagram-2N3HPSRC-5Y-OlePe.cjs → stateDiagram-2N3HPSRC-Czgkv_ey.cjs} +1 -1
- package/dist/{stateDiagram-v2-6OUMAXLB-v77D3Qyf.cjs → stateDiagram-v2-6OUMAXLB-BNP5Lx0Y.cjs} +1 -1
- package/dist/{stateDiagram-v2-6OUMAXLB-BZFV8swJ.js → stateDiagram-v2-6OUMAXLB-x_Zps-d5.js} +2 -2
- package/dist/styles/markdown.css +1 -1
- package/dist/{swimlanes-5IMT3BWC-B1hLl8Ph.cjs → swimlanes-5IMT3BWC-CfdkDd3q.cjs} +1 -1
- package/dist/{swimlanes-5IMT3BWC-DujAOwAt.js → swimlanes-5IMT3BWC-D8brzzxb.js} +313 -313
- package/dist/{swimlanesDiagram-G3AALYLV-B-5z3jDg.js → swimlanesDiagram-G3AALYLV-Bc9-lR2e.js} +2 -2
- package/dist/{swimlanesDiagram-G3AALYLV-Cklgsxbg.cjs → swimlanesDiagram-G3AALYLV-dvJpSdGV.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-B2m-aQLI.cjs → timeline-definition-FHXFAJF6-BSqACati.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-Fmzt_lvR.js → timeline-definition-FHXFAJF6-CKW3NJOF.js} +34 -34
- package/dist/utils/simple-logger.d.ts +1 -0
- package/dist/{vennDiagram-L72KCM5P-rL7UDYbl.cjs → vennDiagram-L72KCM5P-ChKxsFyJ.cjs} +1 -1
- package/dist/{vennDiagram-L72KCM5P-zIXK42Cx.js → vennDiagram-L72KCM5P-vPmq984y.js} +92 -92
- package/dist/{wardleyDiagram-EHGQE667-pTeeZ0uM.js → wardleyDiagram-EHGQE667-CwN9zwBX.js} +11 -11
- package/dist/{wardleyDiagram-EHGQE667-CNLieFen.cjs → wardleyDiagram-EHGQE667-CxzlR7km.cjs} +1 -1
- package/dist/{xychartDiagram-FW5EYKEG-B6UdSSVZ.js → xychartDiagram-FW5EYKEG-DBSKTLuc.js} +37 -37
- package/dist/{xychartDiagram-FW5EYKEG-CD5ik4HK.cjs → xychartDiagram-FW5EYKEG-wJqYRInm.cjs} +1 -1
- package/package.json +25 -9
- package/dist/arc-DH6k2JIR.js +0 -83
- package/dist/channel-DoH_tsOQ.js +0 -5
- package/dist/components/mdastNodes/BlockLinkNode.d.ts +0 -5
- package/dist/components/mdastNodes/RichLinkCard.d.ts +0 -8
- package/dist/components/mdastNodes/TwitterEmbedNode.d.ts +0 -25
- package/dist/components/mdastNodes/YouTubeEmbedNode.d.ts +0 -6
- package/dist/extractHeadings-lDHB2sBb.cjs +0 -310
- package/dist/flowDiagram-23GEKE2U-ORytlvmX.js +0 -7
- package/dist/flowDiagram-23GEKE2U-h2WZTCCn.cjs +0 -1
- package/dist/plugins/createIntentTweetLink.d.ts +0 -10
- package/dist/plugins/extractYouTubeVideoId.d.ts +0 -5
- package/dist/plugins/fetchSiteMetadata.d.ts +0 -9
- package/dist/plugins/remark-auto-heading-id.d.ts +0 -2
- package/dist/plugins/remark-block-link-metadata.d.ts +0 -23
- package/dist/plugins/remark-block-link.d.ts +0 -12
- package/dist/plugins/remark-twitter-embed.d.ts +0 -20
- package/dist/plugins/remark-youtube-embed.d.ts +0 -14
- package/dist/utils/getFaviconUrl.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const kt = (t, n) =>
|
|
1
|
+
import { bI as Kt, y as Wt, z as Ht, a6 as Yt, a5 as Xt, A as Zt, G as Qt, _ as w, af as wt, ak as Jt, K as ot, aZ as $t, ax as te, ay as ee, az as ne, Q as se, ab as ie, ah as oe, ai as re } from "./extractHeadings-CtiYkq2z.js";
|
|
2
|
+
const kt = (t, n) => Kt(t, "a", -n), _t = 1e-10;
|
|
3
3
|
function st(t, n) {
|
|
4
4
|
const s = le(t), e = s.filter((l) => ae(l, t));
|
|
5
5
|
let i = 0, o = 0;
|
|
@@ -565,9 +565,9 @@ function Dt(t, n, s) {
|
|
|
565
565
|
let f = 1;
|
|
566
566
|
for (; f < i.length; )
|
|
567
567
|
l(i[f], !0, !1), l(i[f + 1], !1, !0), l(i[f + 2], !0, !0), f += 3, o = dt(e);
|
|
568
|
-
return
|
|
568
|
+
return Ot(e);
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function Nt(t, n, s, e, i) {
|
|
571
571
|
const o = Ft(t);
|
|
572
572
|
n -= 2 * e, s -= 2 * e;
|
|
573
573
|
const { xRange: r, yRange: l } = dt(o);
|
|
@@ -580,7 +580,7 @@ function Ot(t, n, s, e, i) {
|
|
|
580
580
|
} else
|
|
581
581
|
f = n / (r.max - r.min), u = s / (l.max - l.min);
|
|
582
582
|
const a = Math.min(u, f), y = (n - (r.max - r.min) * a) / 2, h = (s - (l.max - l.min) * a) / 2;
|
|
583
|
-
return
|
|
583
|
+
return Ot(
|
|
584
584
|
o.map((b) => ({
|
|
585
585
|
radius: a * b.radius,
|
|
586
586
|
x: e + y + (b.x - r.min) * a,
|
|
@@ -589,7 +589,7 @@ function Ot(t, n, s, e, i) {
|
|
|
589
589
|
}))
|
|
590
590
|
);
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function Ot(t) {
|
|
593
593
|
const n = {};
|
|
594
594
|
for (const s of t)
|
|
595
595
|
n[s.setid] = s;
|
|
@@ -625,56 +625,56 @@ function ve(t = {}) {
|
|
|
625
625
|
let I = {}, D = {};
|
|
626
626
|
if (d.length > 0) {
|
|
627
627
|
let k = m(d, { lossFunction: v, distinct: b });
|
|
628
|
-
l && (k = Dt(k, r, h)), I =
|
|
628
|
+
l && (k = Dt(k, r, h)), I = Nt(k, s, e, i, f), D = Lt(I, d, M);
|
|
629
629
|
}
|
|
630
630
|
const U = {};
|
|
631
631
|
d.forEach((k) => {
|
|
632
632
|
k.label && (U[k.sets] = k.label);
|
|
633
633
|
});
|
|
634
|
-
function
|
|
634
|
+
function V(k) {
|
|
635
635
|
if (k.sets in U)
|
|
636
636
|
return U[k.sets];
|
|
637
637
|
if (k.sets.length == 1)
|
|
638
638
|
return "" + k.sets[0];
|
|
639
639
|
}
|
|
640
640
|
x.selectAll("svg").data([I]).enter().append("svg");
|
|
641
|
-
const
|
|
642
|
-
n ?
|
|
641
|
+
const O = x.select("svg");
|
|
642
|
+
n ? O.attr("viewBox", `0 0 ${s} ${e}`) : O.attr("width", s).attr("height", e);
|
|
643
643
|
const R = {};
|
|
644
644
|
let T = !1;
|
|
645
|
-
|
|
645
|
+
O.selectAll(".venn-area path").each(function(k) {
|
|
646
646
|
const F = this.getAttribute("d");
|
|
647
647
|
k.sets.length == 1 && F && !b && (T = !0, R[k.sets[0]] = Me(F));
|
|
648
648
|
});
|
|
649
649
|
function A(k) {
|
|
650
650
|
return (F) => {
|
|
651
651
|
const H = k.sets.map((et) => {
|
|
652
|
-
let
|
|
653
|
-
return
|
|
654
|
-
x:
|
|
655
|
-
y:
|
|
656
|
-
radius:
|
|
652
|
+
let Y = R[et], Z = I[et];
|
|
653
|
+
return Y || (Y = { x: s / 2, y: e / 2, radius: 1 }), Z || (Z = { x: s / 2, y: e / 2, radius: 1 }), {
|
|
654
|
+
x: Y.x * (1 - F) + Z.x * F,
|
|
655
|
+
y: Y.y * (1 - F) + Z.y * F,
|
|
656
|
+
radius: Y.radius * (1 - F) + Z.radius * F
|
|
657
657
|
};
|
|
658
658
|
});
|
|
659
659
|
return St(H, p);
|
|
660
660
|
};
|
|
661
661
|
}
|
|
662
|
-
const G =
|
|
662
|
+
const G = O.selectAll(".venn-area").data(d, (k) => k.sets), P = G.enter().append("g").attr(
|
|
663
663
|
"class",
|
|
664
664
|
(k) => `venn-area venn-${k.sets.length == 1 ? "circle" : "intersection"}${k.colour || k.color ? " venn-coloured" : ""}`
|
|
665
|
-
).attr("data-venn-sets", (k) => k.sets.join("_")),
|
|
666
|
-
a && (
|
|
667
|
-
function
|
|
665
|
+
).attr("data-venn-sets", (k) => k.sets.join("_")), B = P.append("path"), L = P.append("text").attr("class", "label").text((k) => V(k)).attr("text-anchor", "middle").attr("dy", ".35em").attr("x", s / 2).attr("y", e / 2);
|
|
666
|
+
a && (B.style("fill-opacity", "0").filter((k) => k.sets.length == 1).style("fill", (k) => k.colour ? k.colour : k.color ? k.color : g(k.sets)).style("fill-opacity", ".25"), L.style("fill", (k) => k.colour || k.color ? "#FFF" : t.textFill ? t.textFill : k.sets.length == 1 ? g(k.sets) : "#444"));
|
|
667
|
+
function W(k) {
|
|
668
668
|
return typeof k.transition == "function" ? k.transition("venn").duration(o) : k;
|
|
669
669
|
}
|
|
670
670
|
let z = x;
|
|
671
|
-
T && typeof z.transition == "function" ? (z =
|
|
672
|
-
const
|
|
673
|
-
u && (T ? "on" in
|
|
674
|
-
const j =
|
|
671
|
+
T && typeof z.transition == "function" ? (z = W(x), z.selectAll("path").attrTween("d", A)) : z.selectAll("path").attr("d", (k) => St(k.sets.map((F) => I[F])), p);
|
|
672
|
+
const N = z.selectAll("text").filter((k) => k.sets in D).text((k) => V(k)).attr("x", (k) => Math.floor(D[k.sets].x)).attr("y", (k) => Math.floor(D[k.sets].y));
|
|
673
|
+
u && (T ? "on" in N ? N.on("end", rt(I, V)) : N.each("end", rt(I, V)) : N.each(rt(I, V)));
|
|
674
|
+
const j = W(G.exit()).remove();
|
|
675
675
|
typeof G.transition == "function" && j.selectAll("path").attrTween("d", A);
|
|
676
|
-
const
|
|
677
|
-
return y !== null && (L.style("font-size", "0px"),
|
|
676
|
+
const X = j.selectAll("text").attr("x", s / 2).attr("y", e / 2);
|
|
677
|
+
return y !== null && (L.style("font-size", "0px"), N.style("font-size", y), X.style("font-size", "0px")), { circles: I, textCentres: D, nodes: G, enter: P, update: z, exit: j };
|
|
678
678
|
}
|
|
679
679
|
return c.wrap = function(x) {
|
|
680
680
|
return arguments.length ? (u = x, c) : u;
|
|
@@ -830,7 +830,7 @@ function Pt(t) {
|
|
|
830
830
|
const n = {};
|
|
831
831
|
return st(t, n), n.arcs;
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function Bt(t, n) {
|
|
834
834
|
if (t.length === 0)
|
|
835
835
|
return "M 0 0";
|
|
836
836
|
const s = Math.pow(10, n || 0), e = n != null ? (o) => Math.round(o * s) / s : (o) => o;
|
|
@@ -848,7 +848,7 @@ A`, r, r, 0, o.large ? 1 : 0, o.sweep ? 1 : 0, e(o.p1.x), e(o.p1.y));
|
|
|
848
848
|
return i.join(" ");
|
|
849
849
|
}
|
|
850
850
|
function St(t, n) {
|
|
851
|
-
return
|
|
851
|
+
return Bt(Pt(t), n);
|
|
852
852
|
}
|
|
853
853
|
function Se(t, n = {}) {
|
|
854
854
|
const {
|
|
@@ -870,7 +870,7 @@ function Se(t, n = {}) {
|
|
|
870
870
|
distinct: h
|
|
871
871
|
});
|
|
872
872
|
i && (p = Dt(p, o, r));
|
|
873
|
-
const M =
|
|
873
|
+
const M = Nt(p, l, f, u, a), E = Lt(M, t, y), _ = new Map(
|
|
874
874
|
Object.keys(M).map((m) => [
|
|
875
875
|
m,
|
|
876
876
|
{
|
|
@@ -881,7 +881,7 @@ function Se(t, n = {}) {
|
|
|
881
881
|
}
|
|
882
882
|
])
|
|
883
883
|
), S = t.map((m) => {
|
|
884
|
-
const v = m.sets.map((d) => _.get(d)), c = Pt(v), x =
|
|
884
|
+
const v = m.sets.map((d) => _.get(d)), c = Pt(v), x = Bt(c, b);
|
|
885
885
|
return { circles: v, arcs: c, path: x, area: m, has: new Set(m.sets) };
|
|
886
886
|
});
|
|
887
887
|
function g(m) {
|
|
@@ -1033,41 +1033,41 @@ var gt = (function() {
|
|
|
1033
1033
|
}
|
|
1034
1034
|
}, "parseError"),
|
|
1035
1035
|
parse: /* @__PURE__ */ w(function(g) {
|
|
1036
|
-
var m = this, v = [0], c = [], x = [null], d = [], C = this.table, I = "", D = 0, U = 0,
|
|
1036
|
+
var m = this, v = [0], c = [], x = [null], d = [], C = this.table, I = "", D = 0, U = 0, V = 2, O = 1, R = d.slice.call(arguments, 1), T = Object.create(this.lexer), A = { yy: {} };
|
|
1037
1037
|
for (var G in this.yy)
|
|
1038
1038
|
Object.prototype.hasOwnProperty.call(this.yy, G) && (A.yy[G] = this.yy[G]);
|
|
1039
1039
|
T.setInput(g, A.yy), A.yy.lexer = T, A.yy.parser = this, typeof T.yylloc > "u" && (T.yylloc = {});
|
|
1040
1040
|
var P = T.yylloc;
|
|
1041
1041
|
d.push(P);
|
|
1042
|
-
var
|
|
1042
|
+
var B = T.options && T.options.ranges;
|
|
1043
1043
|
typeof A.yy.parseError == "function" ? this.parseError = A.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
1044
|
-
function L(
|
|
1045
|
-
v.length = v.length - 2 *
|
|
1044
|
+
function L(K) {
|
|
1045
|
+
v.length = v.length - 2 * K, x.length = x.length - K, d.length = d.length - K;
|
|
1046
1046
|
}
|
|
1047
1047
|
w(L, "popStack");
|
|
1048
|
-
function
|
|
1049
|
-
var
|
|
1050
|
-
return
|
|
1048
|
+
function W() {
|
|
1049
|
+
var K;
|
|
1050
|
+
return K = c.pop() || T.lex() || O, typeof K != "number" && (K instanceof Array && (c = K, K = c.pop()), K = m.symbols_[K] || K), K;
|
|
1051
1051
|
}
|
|
1052
|
-
w(
|
|
1053
|
-
for (var z,
|
|
1054
|
-
if (
|
|
1052
|
+
w(W, "lex");
|
|
1053
|
+
for (var z, N, j, X, k = {}, F, H, et, Y; ; ) {
|
|
1054
|
+
if (N = v[v.length - 1], this.defaultActions[N] ? j = this.defaultActions[N] : ((z === null || typeof z > "u") && (z = W()), j = C[N] && C[N][z]), typeof j > "u" || !j.length || !j[0]) {
|
|
1055
1055
|
var Z = "";
|
|
1056
|
-
|
|
1057
|
-
for (F in C[
|
|
1058
|
-
this.terminals_[F] && F >
|
|
1056
|
+
Y = [];
|
|
1057
|
+
for (F in C[N])
|
|
1058
|
+
this.terminals_[F] && F > V && Y.push("'" + this.terminals_[F] + "'");
|
|
1059
1059
|
T.showPosition ? Z = "Parse error on line " + (D + 1) + `:
|
|
1060
1060
|
` + T.showPosition() + `
|
|
1061
|
-
Expecting ` +
|
|
1061
|
+
Expecting ` + Y.join(", ") + ", got '" + (this.terminals_[z] || z) + "'" : Z = "Parse error on line " + (D + 1) + ": Unexpected " + (z == O ? "end of input" : "'" + (this.terminals_[z] || z) + "'"), this.parseError(Z, {
|
|
1062
1062
|
text: T.match,
|
|
1063
1063
|
token: this.terminals_[z] || z,
|
|
1064
1064
|
line: T.yylineno,
|
|
1065
1065
|
loc: P,
|
|
1066
|
-
expected:
|
|
1066
|
+
expected: Y
|
|
1067
1067
|
});
|
|
1068
1068
|
}
|
|
1069
1069
|
if (j[0] instanceof Array && j.length > 1)
|
|
1070
|
-
throw new Error("Parse Error: multiple actions possible at state: " +
|
|
1070
|
+
throw new Error("Parse Error: multiple actions possible at state: " + N + ", token: " + z);
|
|
1071
1071
|
switch (j[0]) {
|
|
1072
1072
|
case 1:
|
|
1073
1073
|
v.push(z), x.push(T.yytext), d.push(T.yylloc), v.push(j[1]), z = null, U = T.yyleng, I = T.yytext, D = T.yylineno, P = T.yylloc;
|
|
@@ -1078,10 +1078,10 @@ Expecting ` + X.join(", ") + ", got '" + (this.terminals_[z] || z) + "'" : Z = "
|
|
|
1078
1078
|
last_line: d[d.length - 1].last_line,
|
|
1079
1079
|
first_column: d[d.length - (H || 1)].first_column,
|
|
1080
1080
|
last_column: d[d.length - 1].last_column
|
|
1081
|
-
},
|
|
1081
|
+
}, B && (k._$.range = [
|
|
1082
1082
|
d[d.length - (H || 1)].range[0],
|
|
1083
1083
|
d[d.length - 1].range[1]
|
|
1084
|
-
]),
|
|
1084
|
+
]), X = this.performAction.apply(k, [
|
|
1085
1085
|
I,
|
|
1086
1086
|
U,
|
|
1087
1087
|
D,
|
|
@@ -1089,8 +1089,8 @@ Expecting ` + X.join(", ") + ", got '" + (this.terminals_[z] || z) + "'" : Z = "
|
|
|
1089
1089
|
j[1],
|
|
1090
1090
|
x,
|
|
1091
1091
|
d
|
|
1092
|
-
].concat(R)), typeof
|
|
1093
|
-
return
|
|
1092
|
+
].concat(R)), typeof X < "u")
|
|
1093
|
+
return X;
|
|
1094
1094
|
H && (v = v.slice(0, -1 * H * 2), x = x.slice(0, -1 * H), d = d.slice(0, -1 * H)), v.push(this.productions_[j[1]][0]), x.push(k.$), d.push(k._$), et = C[v[v.length - 2]][v[v.length - 1]], v.push(et);
|
|
1095
1095
|
break;
|
|
1096
1096
|
case 3:
|
|
@@ -1370,24 +1370,24 @@ var we = gt, yt = [], pt = [], mt = [], bt = /* @__PURE__ */ new Set(), vt, It =
|
|
|
1370
1370
|
const s = it(t).filter((e) => !bt.has(e));
|
|
1371
1371
|
if (s.length > 0)
|
|
1372
1372
|
throw new Error(`unknown set identifier: ${s.join(", ")}`);
|
|
1373
|
-
}, "validateUnionIdentifiers"), De = /* @__PURE__ */ w(() => pt, "getTextData"),
|
|
1373
|
+
}, "validateUnionIdentifiers"), De = /* @__PURE__ */ w(() => pt, "getTextData"), Ne = /* @__PURE__ */ w(() => vt, "getCurrentSets"), Oe = /* @__PURE__ */ w(() => It, "getIndentMode"), Fe = /* @__PURE__ */ w((t) => {
|
|
1374
1374
|
It = t;
|
|
1375
1375
|
}, "setIndentMode"), je = re.venn;
|
|
1376
|
-
function
|
|
1376
|
+
function Vt() {
|
|
1377
1377
|
return oe(je, wt().venn);
|
|
1378
1378
|
}
|
|
1379
|
-
w(
|
|
1379
|
+
w(Vt, "getConfig");
|
|
1380
1380
|
var Le = /* @__PURE__ */ w(() => {
|
|
1381
1381
|
ie(), yt.length = 0, pt.length = 0, mt.length = 0, bt.clear(), vt = void 0, It = !1;
|
|
1382
1382
|
}, "customClear"), Pe = {
|
|
1383
|
-
getConfig:
|
|
1383
|
+
getConfig: Vt,
|
|
1384
1384
|
clear: Le,
|
|
1385
1385
|
setAccTitle: Qt,
|
|
1386
1386
|
getAccTitle: Zt,
|
|
1387
|
-
setDiagramTitle:
|
|
1388
|
-
getDiagramTitle:
|
|
1387
|
+
setDiagramTitle: Xt,
|
|
1388
|
+
getDiagramTitle: Yt,
|
|
1389
1389
|
getAccDescription: Ht,
|
|
1390
|
-
setAccDescription:
|
|
1390
|
+
setAccDescription: Wt,
|
|
1391
1391
|
addSubsetData: _e,
|
|
1392
1392
|
getSubsetData: Te,
|
|
1393
1393
|
addTextData: ze,
|
|
@@ -1395,10 +1395,10 @@ var Le = /* @__PURE__ */ w(() => {
|
|
|
1395
1395
|
validateUnionIdentifiers: Ce,
|
|
1396
1396
|
getTextData: De,
|
|
1397
1397
|
getStyleData: Re,
|
|
1398
|
-
getCurrentSets:
|
|
1399
|
-
getIndentMode:
|
|
1398
|
+
getCurrentSets: Ne,
|
|
1399
|
+
getIndentMode: Oe,
|
|
1400
1400
|
setIndentMode: Fe
|
|
1401
|
-
},
|
|
1401
|
+
}, Be = /* @__PURE__ */ w((t) => `
|
|
1402
1402
|
.venn-title {
|
|
1403
1403
|
font-size: 32px;
|
|
1404
1404
|
fill: ${t.vennTitleTextColor};
|
|
@@ -1420,7 +1420,7 @@ var Le = /* @__PURE__ */ w(() => {
|
|
|
1420
1420
|
font-family: ${t.fontFamily};
|
|
1421
1421
|
color: ${t.vennSetTextColor};
|
|
1422
1422
|
}
|
|
1423
|
-
`, "getStyles"),
|
|
1423
|
+
`, "getStyles"), Ve = Be;
|
|
1424
1424
|
function qt(t) {
|
|
1425
1425
|
const n = /* @__PURE__ */ new Map();
|
|
1426
1426
|
for (const s of t) {
|
|
@@ -1456,13 +1456,13 @@ var qe = /* @__PURE__ */ w((t, n, s, e) => {
|
|
|
1456
1456
|
b.length > 0 && Ut(o, D, x, b, g, p);
|
|
1457
1457
|
const U = te(r.background || "#f4f4f4");
|
|
1458
1458
|
x.selectAll(".venn-circle").each(function(R, T) {
|
|
1459
|
-
const A = ot(this), P = J([...R.sets].sort()),
|
|
1459
|
+
const A = ot(this), P = J([...R.sets].sort()), B = p.get(P), L = B?.fill || a[T % a.length] || r.primaryColor;
|
|
1460
1460
|
A.classed(`venn-set-${T % 8}`, !0);
|
|
1461
|
-
const
|
|
1461
|
+
const W = B?.["fill-opacity"] ?? 0.1, z = B?.stroke || L, N = B?.["stroke-width"] || `${5 * g}`;
|
|
1462
1462
|
if (u && C) {
|
|
1463
|
-
const
|
|
1464
|
-
if (
|
|
1465
|
-
const k =
|
|
1463
|
+
const X = D.get(P);
|
|
1464
|
+
if (X && X.circles.length > 0) {
|
|
1465
|
+
const k = X.circles[0], F = C.circle(k.x, k.y, k.radius * 2, {
|
|
1466
1466
|
roughness: 0.7,
|
|
1467
1467
|
seed: f,
|
|
1468
1468
|
fill: kt(L, 0.7),
|
|
@@ -1471,30 +1471,30 @@ var qe = /* @__PURE__ */ w((t, n, s, e) => {
|
|
|
1471
1471
|
hachureGap: 8,
|
|
1472
1472
|
hachureAngle: -41 + T * 60,
|
|
1473
1473
|
stroke: z,
|
|
1474
|
-
strokeWidth: parseFloat(String(
|
|
1474
|
+
strokeWidth: parseFloat(String(N))
|
|
1475
1475
|
});
|
|
1476
1476
|
A.select("path").remove(), A.node()?.insertBefore(F, A.select("text").node());
|
|
1477
1477
|
}
|
|
1478
1478
|
} else
|
|
1479
|
-
A.select("path").style("fill", L).style("fill-opacity",
|
|
1480
|
-
const j =
|
|
1479
|
+
A.select("path").style("fill", L).style("fill-opacity", W).style("stroke", z).style("stroke-width", N).style("stroke-opacity", 0.95);
|
|
1480
|
+
const j = B?.color || (U ? ee(L, 30) : ne(L, 30));
|
|
1481
1481
|
A.select("text").style("font-size", `${48 * g}px`).style("fill", j);
|
|
1482
1482
|
}), u && C ? x.selectAll(".venn-intersection").each(function(R) {
|
|
1483
|
-
const T = ot(this), G = J([...R.sets].sort()), P = p.get(G),
|
|
1484
|
-
if (
|
|
1485
|
-
const L = T.select("path"),
|
|
1486
|
-
if (
|
|
1487
|
-
const z = C.path(
|
|
1483
|
+
const T = ot(this), G = J([...R.sets].sort()), P = p.get(G), B = P?.fill;
|
|
1484
|
+
if (B) {
|
|
1485
|
+
const L = T.select("path"), W = L.attr("d");
|
|
1486
|
+
if (W) {
|
|
1487
|
+
const z = C.path(W, {
|
|
1488
1488
|
roughness: 0.7,
|
|
1489
1489
|
seed: f,
|
|
1490
|
-
fill: kt(
|
|
1490
|
+
fill: kt(B, 0.3),
|
|
1491
1491
|
fillStyle: "cross-hatch",
|
|
1492
1492
|
fillWeight: 2,
|
|
1493
1493
|
hachureGap: 6,
|
|
1494
1494
|
hachureAngle: 60,
|
|
1495
1495
|
stroke: "none"
|
|
1496
|
-
}),
|
|
1497
|
-
|
|
1496
|
+
}), N = L.node();
|
|
1497
|
+
N?.parentNode?.insertBefore(z, N), L.remove();
|
|
1498
1498
|
}
|
|
1499
1499
|
} else
|
|
1500
1500
|
T.select("path").style("fill-opacity", 0);
|
|
@@ -1509,10 +1509,10 @@ var qe = /* @__PURE__ */ w((t, n, s, e) => {
|
|
|
1509
1509
|
const A = J([...R.sets].sort());
|
|
1510
1510
|
return p.get(A)?.fill ?? "transparent";
|
|
1511
1511
|
}));
|
|
1512
|
-
const
|
|
1513
|
-
if (
|
|
1514
|
-
for (const R of [...
|
|
1515
|
-
|
|
1512
|
+
const V = c.append("g").attr("transform", `translate(0, ${m})`), O = x.select("svg").node();
|
|
1513
|
+
if (O && "childNodes" in O)
|
|
1514
|
+
for (const R of [...O.childNodes])
|
|
1515
|
+
V.node()?.appendChild(R);
|
|
1516
1516
|
se(c, _, E, o?.useMaxWidth ?? !0);
|
|
1517
1517
|
}, "draw");
|
|
1518
1518
|
function J(t) {
|
|
@@ -1529,19 +1529,19 @@ function Ut(t, n, s, e, i, o) {
|
|
|
1529
1529
|
const h = n.get(a);
|
|
1530
1530
|
if (!h?.text)
|
|
1531
1531
|
continue;
|
|
1532
|
-
const b = h.text.x, p = h.text.y, M = Math.min(...h.circles.map((
|
|
1533
|
-
...h.circles.map((
|
|
1532
|
+
const b = h.text.x, p = h.text.y, M = Math.min(...h.circles.map((O) => O.radius)), E = Math.min(
|
|
1533
|
+
...h.circles.map((O) => O.radius - Math.hypot(b - O.x, p - O.y))
|
|
1534
1534
|
);
|
|
1535
1535
|
let _ = Number.isFinite(E) ? Math.max(0, E) : 0;
|
|
1536
1536
|
_ === 0 && Number.isFinite(M) && (_ = M * 0.6);
|
|
1537
1537
|
const S = f.append("g").attr("class", "venn-text-area").attr("font-size", `${40 * i}px`);
|
|
1538
1538
|
r && S.append("circle").attr("class", "venn-text-debug-circle").attr("cx", b).attr("cy", p).attr("r", _).attr("fill", "none").attr("stroke", "purple").attr("stroke-width", 1.5 * i).attr("stroke-dasharray", `${6 * i} ${4 * i}`);
|
|
1539
|
-
const g = Math.max(80 * i, _ * 2 * 0.95), m = Math.max(60 * i, _ * 2 * 0.95), x = (h.data.label && h.data.label.length > 0 ? Math.min(32 * i, _ * 0.25) : 0) + (y.length <= 2 ? 30 * i : 0), d = b - g / 2, C = p - m / 2 + x, I = Math.max(1, Math.ceil(Math.sqrt(y.length))), D = Math.max(1, Math.ceil(y.length / I)), U = g / I,
|
|
1540
|
-
for (const [
|
|
1541
|
-
const T =
|
|
1542
|
-
r && S.append("rect").attr("class", "venn-text-debug-cell").attr("x", d + U * T).attr("y", C +
|
|
1543
|
-
const
|
|
1544
|
-
z &&
|
|
1539
|
+
const g = Math.max(80 * i, _ * 2 * 0.95), m = Math.max(60 * i, _ * 2 * 0.95), x = (h.data.label && h.data.label.length > 0 ? Math.min(32 * i, _ * 0.25) : 0) + (y.length <= 2 ? 30 * i : 0), d = b - g / 2, C = p - m / 2 + x, I = Math.max(1, Math.ceil(Math.sqrt(y.length))), D = Math.max(1, Math.ceil(y.length / I)), U = g / I, V = m / D;
|
|
1540
|
+
for (const [O, R] of y.entries()) {
|
|
1541
|
+
const T = O % I, A = Math.floor(O / I), G = d + U * (T + 0.5), P = C + V * (A + 0.5);
|
|
1542
|
+
r && S.append("rect").attr("class", "venn-text-debug-cell").attr("x", d + U * T).attr("y", C + V * A).attr("width", U).attr("height", V).attr("fill", "none").attr("stroke", "teal").attr("stroke-width", 1 * i).attr("stroke-dasharray", `${4 * i} ${3 * i}`);
|
|
1543
|
+
const B = U * 0.9, L = V * 0.9, W = S.append("foreignObject").attr("class", "venn-text-node-fo").attr("width", B).attr("height", L).attr("x", G - B / 2).attr("y", P - L / 2).attr("overflow", "visible"), z = o.get(R.id)?.color, N = W.append("xhtml:span").attr("class", "venn-text-node").style("display", "flex").style("width", "100%").style("height", "100%").style("white-space", "normal").style("align-items", "center").style("justify-content", "center").style("text-align", "center").style("overflow-wrap", "normal").style("word-break", "normal").text(R.label ?? R.id);
|
|
1544
|
+
z && N.style("color", z);
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
1547
1547
|
}
|
|
@@ -1567,12 +1567,12 @@ function Gt(t) {
|
|
|
1567
1567
|
return e.length > 0 ? [...t, ...e] : t;
|
|
1568
1568
|
}
|
|
1569
1569
|
w(Gt, "ensurePairwiseSubsets");
|
|
1570
|
-
var Ue = { draw: qe },
|
|
1570
|
+
var Ue = { draw: qe }, Ke = {
|
|
1571
1571
|
parser: we,
|
|
1572
1572
|
db: Pe,
|
|
1573
1573
|
renderer: Ue,
|
|
1574
|
-
styles:
|
|
1574
|
+
styles: Ve
|
|
1575
1575
|
};
|
|
1576
1576
|
export {
|
|
1577
|
-
|
|
1577
|
+
Ke as diagram
|
|
1578
1578
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as Mt } from "./chunk-JWPE2WC7-
|
|
2
|
-
import {
|
|
1
|
+
import { p as Mt } from "./chunk-JWPE2WC7-Djg6Qi23.js";
|
|
2
|
+
import { y as Nt, z as zt, a6 as Lt, a5 as Tt, A as At, G as Xt, _ as u, al as Et, af as Yt, ah as Q, O as K, ak as It, Q as Bt, ab as Ft, J as V } from "./extractHeadings-CtiYkq2z.js";
|
|
3
3
|
import { p as Ot } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
|
|
4
4
|
var G = /* @__PURE__ */ u((o, r) => {
|
|
5
5
|
const e = o <= 1 ? o * 100 : o;
|
|
@@ -11,7 +11,7 @@ var G = /* @__PURE__ */ u((o, r) => {
|
|
|
11
11
|
}, "toPercent"), A = /* @__PURE__ */ u((o, r, e) => ({
|
|
12
12
|
x: G(r, `${e} evolution`),
|
|
13
13
|
y: G(o, `${e} visibility`)
|
|
14
|
-
}), "toCoordinates"),
|
|
14
|
+
}), "toCoordinates"), U = /* @__PURE__ */ u((o) => {
|
|
15
15
|
if (o) {
|
|
16
16
|
if (o === "+<>")
|
|
17
17
|
return "bidirectional";
|
|
@@ -74,7 +74,7 @@ var G = /* @__PURE__ */ u((o, r) => {
|
|
|
74
74
|
});
|
|
75
75
|
}), o.links.forEach((e) => {
|
|
76
76
|
const h = !!e.arrow && (e.arrow.includes("-.->") || e.arrow.includes(".-."));
|
|
77
|
-
let a =
|
|
77
|
+
let a = U(e.fromPort) ?? U(e.toPort);
|
|
78
78
|
const { flow: d, label: w } = Rt(e.arrow);
|
|
79
79
|
!a && d && (a = d);
|
|
80
80
|
const C = e.linkLabel, g = w ?? C;
|
|
@@ -443,12 +443,12 @@ var Gt = {
|
|
|
443
443
|
}
|
|
444
444
|
});
|
|
445
445
|
}
|
|
446
|
-
const _ = v.append("g").attr("class", "wardley-links"),
|
|
446
|
+
const _ = v.append("g").attr("class", "wardley-links"), Z = /* @__PURE__ */ new Map();
|
|
447
447
|
g.pipelines.forEach((t) => {
|
|
448
|
-
|
|
448
|
+
Z.set(t.nodeId, new Set(t.componentIds));
|
|
449
449
|
});
|
|
450
|
-
const
|
|
451
|
-
_.selectAll("line").data(
|
|
450
|
+
const J = g.links.filter((t) => !(!c.has(t.source) || !c.has(t.target) || Z.get(t.target)?.has(t.source)));
|
|
451
|
+
_.selectAll("line").data(J).enter().append("line").attr("class", (t) => `wardley-link${t.dashed ? " wardley-link--dashed" : ""}`).attr("x1", (t) => {
|
|
452
452
|
const s = c.get(t.source), n = c.get(t.target), p = g.nodes.find((y) => y.id === t.source).isPipelineParent ? w / Math.sqrt(2) : a.nodeRadius, l = n.x - s.x, f = n.y - s.y, x = Math.sqrt(l * l + f * f);
|
|
453
453
|
return s.x + l / x * p;
|
|
454
454
|
}).attr("y1", (t) => {
|
|
@@ -460,7 +460,7 @@ var Gt = {
|
|
|
460
460
|
}).attr("y2", (t) => {
|
|
461
461
|
const s = c.get(t.source), n = c.get(t.target), p = g.nodes.find((y) => y.id === t.target).isPipelineParent ? w / Math.sqrt(2) : a.nodeRadius, l = s.x - n.x, f = s.y - n.y, x = Math.sqrt(l * l + f * f);
|
|
462
462
|
return n.y + f / x * p;
|
|
463
|
-
}).attr("stroke", d.linkStroke).attr("stroke-width", 1).attr("stroke-dasharray", (t) => t.dashed ? "6 6" : null).attr("marker-end", (t) => t.flow === "forward" || t.flow === "bidirectional" ? `url(#link-arrow-end-${r})` : null).attr("marker-start", (t) => t.flow === "backward" || t.flow === "bidirectional" ? `url(#link-arrow-start-${r})` : null), _.selectAll("text").data(
|
|
463
|
+
}).attr("stroke", d.linkStroke).attr("stroke-width", 1).attr("stroke-dasharray", (t) => t.dashed ? "6 6" : null).attr("marker-end", (t) => t.flow === "forward" || t.flow === "bidirectional" ? `url(#link-arrow-end-${r})` : null).attr("marker-start", (t) => t.flow === "backward" || t.flow === "bidirectional" ? `url(#link-arrow-start-${r})` : null), _.selectAll("text").data(J.filter((t) => t.label)).enter().append("text").attr("class", "wardley-link-label").attr("x", (t) => {
|
|
464
464
|
const s = c.get(t.source), n = c.get(t.target), i = (s.x + n.x) / 2, p = n.y - s.y, l = n.x - s.x, f = Math.sqrt(l * l + p * p), x = 8, y = p / f;
|
|
465
465
|
return i + y * x;
|
|
466
466
|
}).attr("y", (t) => {
|
|
@@ -601,7 +601,7 @@ var Gt = {
|
|
|
601
601
|
}
|
|
602
602
|
}, "draw"), _t = {
|
|
603
603
|
draw: Vt
|
|
604
|
-
},
|
|
604
|
+
}, Zt = /* @__PURE__ */ u(({
|
|
605
605
|
wardley: o
|
|
606
606
|
} = {}) => {
|
|
607
607
|
const r = Et(), e = Yt(), h = Q(r, e.themeVariables), a = Q(h.wardley, o);
|
|
@@ -668,7 +668,7 @@ var Gt = {
|
|
|
668
668
|
parser: tt,
|
|
669
669
|
db: Gt,
|
|
670
670
|
renderer: _t,
|
|
671
|
-
styles:
|
|
671
|
+
styles: Zt
|
|
672
672
|
};
|
|
673
673
|
export {
|
|
674
674
|
te as diagram
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Pt=require("./chunk-JWPE2WC7-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Pt=require("./chunk-JWPE2WC7-Bz9dXsLZ.cjs"),f=require("./extractHeadings-D1A8WzVy.cjs"),Ct=require("./cynefin-VYW2F7L2-MpAliYy9.cjs");var D=f.__name((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),L=f.__name((o,r,e)=>({x:D(r,`${e} evolution`),y:D(o,`${e} visibility`)}),"toCoordinates"),J=f.__name(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),St=f.__name(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Mt=f.__name((o,r)=>{if(Pt.populateCommonDb(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),g=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:g})}if(o.anchors.forEach(e=>{const g=L(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,g.x,g.y,"anchor")}),o.components.forEach(e=>{const g=L(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=e.decorator?.strategy;r.addNode(e.name,e.name,g.x,g.y,"component",a,d,e.inertia,m)}),o.notes.forEach(e=>{const g=L(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,g.x,g.y)}),o.pipelines.forEach(e=>{const g=r.getNode(e.parent);if(!g||typeof g.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=g.y;r.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,y=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,B=D(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(m,d.name,B,a,"pipeline-component",C,y),r.addPipelineComponent(e.parent,m)})}),o.links.forEach(e=>{const g=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=J(e.fromPort)??J(e.toPort);const{flow:d,label:m}=St(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,y=m??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),g,y,a)}),o.evolves.forEach(e=>{const g=r.getNode(e.component);if(g?.y!==void 0){const a=D(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,g.y)}}),o.annotations.length>0){const e=o.annotations[0],g=L(e.x,e.y,"Annotations box");r.setAnnotationsBox(g.x,g.y)}o.annotation.forEach(e=>{const g=L(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:g.x,y:g.y}],e.text)}),o.accelerators.forEach(e=>{const g=L(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,g.x,g.y)}),o.deaccelerators.forEach(e=>{const g=L(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,g.x,g.y)})},"populateDb"),U={parser:{yy:void 0},parse:f.__name(async o=>{const r=await Ct.parse("wardley",o);f.log.debug(r);const e=U.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Mt(r,e)},"parse")},X,_t=(X=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},g={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,g)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const g=this.pipelines.get(r);g&&g.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,g]of this.nodes)if(g.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},f.__name(X,"WardleyBuilder"),X),k=new _t;function K(){return f.getConfig2()["wardley-beta"]}f.__name(K,"getConfig");function Q(o,r,e,g,a,d,m,C,y){k.addNode({id:o,label:r,x:e,y:g,className:a,labelOffsetX:d,labelOffsetY:m,inertia:C,sourceStrategy:y})}f.__name(Q,"addNode");function tt(o,r,e=!1,g,a){k.addLink({source:o,target:r,dashed:e,label:g,flow:a})}f.__name(tt,"addLink");function et(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}f.__name(et,"addTrend");function at(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}f.__name(at,"addAnnotation");function rt(o,r,e){k.addNote({text:o,x:r,y:e})}f.__name(rt,"addNote");function ot(o,r,e){k.addAccelerator({name:o,x:r,y:e})}f.__name(ot,"addAccelerator");function nt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}f.__name(nt,"addDeaccelerator");function st(o,r){k.setAnnotationsBox(o,r)}f.__name(st,"setAnnotationsBox");function it(o,r){k.setSize(o,r)}f.__name(it,"setSize");function dt(o){k.startPipeline(o)}f.__name(dt,"startPipeline");function lt(o,r){k.addPipelineComponent(o,r)}f.__name(lt,"addPipelineComponent");function ct(o){k.setAxes(o)}f.__name(ct,"updateAxes");function pt(o){return k.getNode(o)}f.__name(pt,"getNode");function ft(o){return k.resolveNodeId(o)}f.__name(ft,"resolveNodeId");function ht(){return k.build()}f.__name(ht,"getWardleyData");function gt(){k.clear(),f.clear()}f.__name(gt,"clear");var Nt={getConfig:K,addNode:Q,addLink:tt,addTrend:et,addAnnotation:at,addNote:rt,addAccelerator:ot,addDeaccelerator:nt,setAnnotationsBox:st,setSize:it,startPipeline:dt,addPipelineComponent:lt,updateAxes:ct,getNode:pt,resolveNodeId:ft,getWardleyData:ht,clear:gt,setAccTitle:f.setAccTitle,getAccTitle:f.getAccTitle,setDiagramTitle:f.setDiagramTitle,getDiagramTitle:f.getDiagramTitle,getAccDescription:f.getAccDescription,setAccDescription:f.setAccDescription},Tt=["Genesis","Custom Built","Product","Commodity"],At=f.__name(()=>{const{themeVariables:o}=f.getConfig2();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),Lt=f.__name(()=>{const o=f.getConfig2()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),zt=f.__name((o,r,e,g)=>{f.log.debug(`Rendering Wardley map
|
|
2
2
|
`+o);const a=Lt(),d=At(),m=a.nodeRadius*1.6,C=g.db,y=C.getWardleyData(),B=C.getDiagramTitle(),S=y.size?.width??a.width,b=y.size?.height??a.height,E=f.selectSvgElement(r);E.selectAll("*").remove(),f.configureSvgSize(E,b,S,a.useMaxWidth),E.attr("viewBox",`0 0 ${S} ${b}`);const v=E.append("g").attr("class","wardley-map"),G=E.append("defs");G.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),G.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),G.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const Y=S-a.padding*2,I=b-a.padding*2;B&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(B);const N=f.__name(t=>a.padding+t/100*Y,"projectX"),T=f.__name(t=>b-a.padding-t/100*I,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const xt=y.axes.xLabel??"Evolution",yt=y.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+Y/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(xt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+I/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+I/2})`).text(yt);const F=y.axes.stages&&y.axes.stages.length>0?y.axes.stages:Tt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=y.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],h=a.padding+l.start*Y,x=a.padding+l.end*Y,u=(h+x)/2;p>0&&t.append("line").attr("x1",h).attr("x2",h).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",u).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+Y*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-I*n).attr("y2",b-a.padding-I*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(y.nodes.forEach(t=>{c.set(t.id,{x:N(t.x),y:T(t.y),node:t})}),y.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");y.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:y.nodes.find(u=>u.id===x)})).filter(x=>x.pos&&x.node).sort((x,u)=>x.node.x-u.node.x);for(let x=0;x<i.length-1;x++){const u=i[x],w=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",u.pos.x).attr("y1",u.pos.y).attr("x2",w.pos.x).attr("y2",w.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,h=0;if(n.componentIds.forEach(x=>{const u=c.get(x);u&&(p=Math.min(p,u.x),l=Math.max(l,u.x),h=u.y)}),p!==1/0&&l!==-1/0){const u=a.nodeRadius*4,w=h-u/2,P=c.get(n.nodeId);if(P){const _=(p+l)/2;P.x=_,P.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",w).attr("width",l-p+30).attr("height",u).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const j=v.append("g").attr("class","wardley-links"),V=new Map;y.pipelines.forEach(t=>{V.set(t.nodeId,new Set(t.componentIds))});const Z=y.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||V.get(t.target)?.has(t.source)));j.selectAll("line").data(Z).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=y.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,h=n.y-s.y,x=Math.sqrt(l*l+h*h);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=y.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,h=n.y-s.y,x=Math.sqrt(l*l+h*h);return s.y+h/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=y.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,h=s.y-n.y,x=Math.sqrt(l*l+h*h);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=y.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,h=s.y-n.y,x=Math.sqrt(l*l+h*h);return n.y+h/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),j.selectAll("text").data(Z.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,h=Math.sqrt(l*l+p*p),x=8,u=p/h;return i+u*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,h=Math.sqrt(p*p+l*l),x=8,u=-p/h;return i+u*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,h=n.y-s.y,x=Math.sqrt(l*l+h*h),u=8,w=h/x,P=-l/x,_=i+w*u,R=p+P*u;let z=Math.atan2(h,l)*180/Math.PI;return(z>90||z<-90)&&(z+=180),`rotate(${z} ${_} ${R})`}).text(t=>t.label);const ut=v.append("g").attr("class","wardley-trends"),mt=y.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=N(t.targetX),i=T(t.targetY),p=n-s.x,l=i-s.y,h=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,u=h>x?n-p/h*x:n,w=h>x?i-l/h*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:u,adjustedY2:w}}).filter(t=>t!==null);ut.selectAll("line").data(mt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(y.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const A=M.filter(t=>t.sourceStrategy==="market");A.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const q=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(A.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),A.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),A.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),A.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),A.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),A.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?m/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?m:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?m/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?m:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),y.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(y.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:N(i.x),y:T(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),y.annotationsBox){let s=N(y.annotationsBox.x),n=T(y.annotationsBox.y);const i=10,p=16,l=11,h=t.append("g").attr("class","wardley-annotations-box"),x=[...y.annotations].filter(w=>w.text).sort((w,P)=>w.number-P.number),u=[];if(x.forEach((w,P)=>{const _=h.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);u.push(_)}),u.length>0){let w=0,P=0;u.forEach(H=>{const W=H.node(),$t=W.getComputedTextLength();w=Math.max(w,$t);const vt=W.getBBox();P=Math.max(P,vt.height)});const _=w+i*2+105,R=x.length*p+i*2+P/2,z=a.padding,wt=S-a.padding-_,kt=a.padding,bt=b-a.padding-R;s=Math.max(z,Math.min(s,wt)),n=Math.max(kt,Math.min(n,bt)),u.forEach((H,W)=>{H.attr("x",s+i).attr("y",n+i+(W+1)*p)}),h.insert("rect","text").attr("x",s).attr("y",n).attr("width",_).attr("height",R).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(y.notes.length>0){const t=v.append("g").attr("class","wardley-notes");y.notes.forEach(s=>{const n=N(s.x),i=T(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(y.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");y.accelerators.forEach(s=>{const n=N(s.x),i=T(s.y),p=60,l=30,h=20,x=`
|
|
3
3
|
M ${n} ${i-l/2}
|
|
4
4
|
L ${n+p-h} ${i-l/2}
|