@webskill/sdk 0.21.0 → 0.23.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/dist/abnfDiagram-O67JEVCF-DtYFjfqO.js +109 -0
- package/dist/agent.d.ts +3 -3
- package/dist/agent.js +1174 -169
- package/dist/{approval-DwN2o2QG.js → approval-7CuZS3Z4.js} +104 -18
- package/dist/arc-8U_6NQWm.js +130 -0
- package/dist/architecture-7GRP2DOG-RTw1wpAq.js +4 -0
- package/dist/architectureDiagram-NJMV4G6O-XmmXrJAK.js +7473 -0
- package/dist/array-DQfpQNY8.js +8 -0
- package/dist/blockDiagram-BEXU5L5S-D4yjnCD1.js +2582 -0
- package/dist/browser.d.ts +455 -49
- package/dist/browser.js +2134 -138
- package/dist/c4Diagram-YGBWAQC7-BLmA_JSd.js +3668 -0
- package/dist/channel-CZxxLrG7.js +9 -0
- package/dist/chunk-2Q5K7J3B-Ck03gkFR.js +21 -0
- package/dist/chunk-3FUC2YCW-tr6jmbQf.js +530 -0
- package/dist/chunk-5DYCD2WN-Bt97YGTd.js +58 -0
- package/dist/chunk-5VM5RSS4-BBxa48HL.js +21 -0
- package/dist/chunk-6AEJRKK7-JXK89I-O.js +14 -0
- package/dist/chunk-742MDFTN-CPmgCGwC.js +466 -0
- package/dist/chunk-7INBJB4K-C9jq9o66.js +6552 -0
- package/dist/chunk-7M6MHVWA-BrKCWcR1.js +4894 -0
- package/dist/chunk-7PRAP22T-BHED6GVs.js +95 -0
- package/dist/chunk-DUW6YSOI-DoZj78PO.js +19 -0
- package/dist/chunk-FOHPRMQF-Dkbp819z.js +27189 -0
- package/dist/chunk-GNY47TPC-Bpvq1T49.js +87 -0
- package/dist/chunk-GTNCS2PH-CLmh4I2c.js +686 -0
- package/dist/chunk-GWA4HPMP-B6vN3fkL.js +95 -0
- package/dist/chunk-J5ZVWO5B-Bi_Pcobw.js +26 -0
- package/dist/chunk-JWPE2WC7-D1rC79GS.js +12 -0
- package/dist/chunk-LNGE3PJU-D5OIoe3Z.js +2582 -0
- package/dist/chunk-MBY4JIJT-C34L7a4f.js +2276 -0
- package/dist/chunk-NETBCI7D-Cg84k8N8.js +321 -0
- package/dist/chunk-O7XYJQB3-B6K0KOSL.js +8846 -0
- package/dist/chunk-UA2S7LBM-DxHM29_K.js +612 -0
- package/dist/chunk-WEXAMYUT-Ba6jFWhB.js +33 -0
- package/dist/chunk-XXDRQBXY-DPbSy4kg.js +12 -0
- package/dist/chunk-Y2CYZVJY-U3QOMqrW.js +15 -0
- package/dist/chunk-Z7XXMR3K-oLg1h8F3.js +1038 -0
- package/dist/chunk-ZIGJFQKS-DqEFBuHR.js +2215 -0
- package/dist/classDiagram-v2-NBCMYWYE-BqnOWIUt.js +3845 -0
- package/dist/cose-bilkent-JH36ORCC-C0dTAHVK.js +4270 -0
- package/dist/cynefin-OW5HDTMX-B2QvgEQj.js +4 -0
- package/dist/cynefinDiagram-VND7K2PF-yAWc6Z3W.js +479 -0
- package/dist/cytoscape.esm-C64mRh9B.js +28325 -0
- package/dist/dagre-6A5THRUB-D0w2W27v.js +4816 -0
- package/dist/defaultLocale-B_EoOkSF.js +249 -0
- package/dist/diagram-22UHCM2B-DvgzhUzP.js +6115 -0
- package/dist/diagram-3UASUU5V-DWgUB-ef.js +795 -0
- package/dist/diagram-ATOU4E4O-P1olqwIs.js +553 -0
- package/dist/diagram-CDSNMT55-BUlZuLUe.js +402 -0
- package/dist/diagram-MLGK6HIB-6w5qmkGt.js +186 -0
- package/dist/diagram-MPIPVDR6-DEFiSo8o.js +289 -0
- package/dist/dist-UajCDt3n.js +92 -0
- package/dist/ebnfDiagram-ZINNZB2B-CI8liCfR.js +123 -0
- package/dist/elk-276RUBZZ-3SvW6OAK.js +90034 -0
- package/dist/erDiagram-OPXOYQCR-CPTbKhwP.js +2301 -0
- package/dist/eventmodeling-NTZA5JFV-BlyuqGp0.js +4 -0
- package/dist/flowDiagram-KWPJA3E3-CcUJ6HbV.js +18 -0
- package/dist/ganttDiagram-FUAMR5RP-31UjY0KK.js +3939 -0
- package/dist/{toolSource-C9oNuKmr.js → geometry-CRhuySKV.js} +169 -12
- package/dist/gitGraph-4MIJSDKK-ChdVlrk7.js +4 -0
- package/dist/gitGraphDiagram-X574FWY7-DKuxJymB.js +1153 -0
- package/dist/governance.d.ts +22 -4
- package/dist/governance.js +100 -10
- package/dist/graphlib-tk9gQYuN.js +4194 -0
- package/dist/{index-DHopiH_m.d.ts → index-7No55dRb.d.ts} +161 -11
- package/dist/{index-B8Tgmpwh.d.ts → index-ShvCB5I9.d.ts} +2 -2
- package/dist/{index-CYLt5u4L.d.ts → index-V76_OFj2.d.ts} +789 -21
- package/dist/index.d.ts +4 -4
- package/dist/index.js +11 -9
- package/dist/info-A6RAGUB7-CxRAt9S9.js +4 -0
- package/dist/infoDiagram-VRGFBTTK-pRspGfjZ.js +25 -0
- package/dist/init-CMOIWdg-.js +16 -0
- package/dist/ishikawaDiagram-OU5B5YK6-DKerAPAg.js +975 -0
- package/dist/journeyDiagram-ZHPQQLJL-C4MK-YO5.js +1227 -0
- package/dist/kanban-definition-PNTS6WVX-BqsZpMXx.js +1244 -0
- package/dist/katex-BcRRvyh_.js +26465 -0
- package/dist/{kind-DaKqLX2F.js → kind-Dc8x0HWz.js} +54 -7
- package/dist/line-LgV8iVMV.js +48 -0
- package/dist/linear-BWKR0Tqd.js +393 -0
- package/dist/linkedDocument-CZZOl9cO.js +456 -0
- package/dist/mcp.d.ts +2 -2
- package/dist/{memoryArtifactStore-D6dLeY55.js → memoryArtifactStore-Bs7glPqm.js} +14 -0
- package/dist/mermaid-parser.core-pYR5siSx.js +754 -0
- package/dist/mermaid.core-DMtwGCHy.js +1756 -0
- package/dist/mindmap-definition-NLK3R4M7-CXbD-myG.js +1312 -0
- package/dist/node.d.ts +3 -3
- package/dist/node.js +12 -5
- package/dist/{openUiLibrary-b0i7F_oZ.js → openUiLibrary-B7j3rLrm.js} +1 -1
- package/dist/{openUiSpecLang-CLXJEeRU.js → openUiSpecLang-BSYYnjay.js} +1 -1
- package/dist/ordinal-CxA6GHQS.js +84 -0
- package/dist/packet-AYTQ26CC-BOm08cxl.js +4 -0
- package/dist/path-C27Z2Bjv.js +106 -0
- package/dist/{pathSecurity-B1owvJAF.js → pathSecurity-CirkQwWP.js} +12 -1
- package/dist/pegDiagram-GJSIUBJH-BLGJOewQ.js +115 -0
- package/dist/pie-WAS4IAKB-Dvg7glpk.js +4 -0
- package/dist/pieDiagram-5QR66LMP-laoaV_PB.js +298 -0
- package/dist/quadrantDiagram-O4NWA36T-Db_wFBkT.js +2236 -0
- package/dist/radar-RG4KPBEZ-BZDaTu06.js +4 -0
- package/dist/railroad-74A4TZTK-C-UhjkOy.js +4 -0
- package/dist/railroad-abnf-HS5TGJTU-dUKVA4OS.js +4 -0
- package/dist/railroad-ebnf-LZEXJU2U-DzQumk18.js +4 -0
- package/dist/railroad-peg-WCYAUIDC-B3vvTWed.js +4 -0
- package/dist/railroadDiagram-XR7U4H2S-BY0sTM4X.js +89 -0
- package/dist/requirementDiagram-PLB6GJNP-3rkQfEhs.js +2474 -0
- package/dist/rough.cjs-AmDd_NQk.js +1395 -0
- package/dist/sankeyDiagram-IPEJSGJF-CGAJhyG2.js +3578 -0
- package/dist/sequenceDiagram-PO4LG4MO-9FJjFX06.js +5522 -0
- package/dist/sizeCapture-INFHLROL-D8PWxdOn.js +56 -0
- package/dist/{skill-CAJMsLod.js → skill-WSUDp6A1.js} +1 -1
- package/dist/{skillVersionStore-B24Jjjry-BkOk9wI_.d.ts → skillVersionStore-S4_HJ_Fl-Cvy9LqVu.d.ts} +35 -4
- package/dist/src-NkhI3UMl.js +2653 -0
- package/dist/stateDiagram-v2-GCMORJYK-B0O3wc1-.js +2715 -0
- package/dist/swimlanes-2SLR337P-D4EOnrpu.js +6637 -0
- package/dist/swimlanesDiagram-TC7HE7FX-BUx29EJ9.js +30 -0
- package/dist/testing.d.ts +2 -1
- package/dist/testing.js +1 -1
- package/dist/timeline-definition-EJHVYXUP-CrgiiB4C.js +1513 -0
- package/dist/treeView-Q6P3EWNA-C1by-Gzc.js +4 -0
- package/dist/treemap-WGGIJYW6-mC2NZ6ad.js +4 -0
- package/dist/{types-BvTV_05--BW8zDuEk.d.ts → types-CpDRZ0rA-BiZBXGm4.d.ts} +66 -8
- package/dist/ui-react.d.ts +3 -3
- package/dist/ui-react.js +3746 -96
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +2 -2
- package/dist/usecaseDiagram-POWQR4AR-BUt_TQOY.js +14397 -0
- package/dist/vennDiagram-UO4OBE2U-CwXr0wjA.js +2808 -0
- package/dist/wardley-WFR3VGLG-CVSYjq_S.js +4 -0
- package/dist/wardleyDiagram-VNRHLVJA-Cpfd47dQ.js +874 -0
- package/dist/{webSkillApi-Cib6G-94.js → webSkillApi-D5VMUnrv.js} +2 -2
- package/dist/{webskillLitCatalog-W06npwej.js → webskillLitCatalog-D5BCiMCU.js} +1 -1
- package/dist/xychartDiagram-PMCCYNJV-e1TeVoc6.js +2704 -0
- package/package.json +1 -1
- package/dist/linkedDocument-C0gj1sMq.js +0 -245
|
@@ -0,0 +1,1038 @@
|
|
|
1
|
+
import { o as __toESM } from "./rolldown-runtime-BHkdefai.js";
|
|
2
|
+
import { n as __name } from "./chunk-Y2CYZVJY-U3QOMqrW.js";
|
|
3
|
+
import { m as log, p as select_default } from "./src-NkhI3UMl.js";
|
|
4
|
+
import { T as getEffectiveHtmlLabels, b as getConfig, x as getConfig2 } from "./chunk-O7XYJQB3-B6K0KOSL.js";
|
|
5
|
+
import { $ as cardinal_default, J as step_default, K as stepAfter, Q as catmullRom_default, X as monotoneX, Y as natural_default, Z as monotoneY, et as basis_default, g as utils_default, nt as bumpY, q as stepBefore, rt as linear_default, tt as bumpX, u as handleUndefinedAttr } from "./chunk-ZIGJFQKS-DqEFBuHR.js";
|
|
6
|
+
import { t as line_default } from "./line-LgV8iVMV.js";
|
|
7
|
+
import { n as createText, r as fastdom_default2 } from "./chunk-MBY4JIJT-C34L7a4f.js";
|
|
8
|
+
import { i as styles2String, n as isLabelStyle } from "./chunk-7PRAP22T-BHED6GVs.js";
|
|
9
|
+
import { t as require_rough_cjs } from "./rough.cjs-AmDd_NQk.js";
|
|
10
|
+
import { t as createLabel_default } from "./chunk-7INBJB4K-C9jq9o66.js";
|
|
11
|
+
import { n as getSubGraphTitleMargins } from "./chunk-5DYCD2WN-Bt97YGTd.js";
|
|
12
|
+
|
|
13
|
+
//#region ../../node_modules/.pnpm/mermaid@12.0.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-Z7XXMR3K.mjs
|
|
14
|
+
var import_rough_cjs = /* @__PURE__ */ __toESM(require_rough_cjs(), 1);
|
|
15
|
+
var computeLabelTransform = /* @__PURE__ */ __name((bbox, useHtmlLabels) => {
|
|
16
|
+
if (useHtmlLabels) return "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")";
|
|
17
|
+
const x = bbox.x ?? 0;
|
|
18
|
+
const y = bbox.y ?? 0;
|
|
19
|
+
return "translate(" + -(x + bbox.width / 2) + ", " + -(y + bbox.height / 2) + ")";
|
|
20
|
+
}, "computeLabelTransform");
|
|
21
|
+
var markerOffsets = {
|
|
22
|
+
aggregation: 17.25,
|
|
23
|
+
extension: 17.25,
|
|
24
|
+
composition: 17.25,
|
|
25
|
+
dependency: 6,
|
|
26
|
+
lollipop: 13.5,
|
|
27
|
+
arrow_point: 4,
|
|
28
|
+
arrow_barb: 0,
|
|
29
|
+
arrow_barb_neo: 5.5
|
|
30
|
+
};
|
|
31
|
+
var markerOffsets2 = {
|
|
32
|
+
arrow_point: 4,
|
|
33
|
+
arrow_cross: 12.5,
|
|
34
|
+
arrow_circle: 12.5
|
|
35
|
+
};
|
|
36
|
+
function calculateDeltaAndAngle(point1, point2) {
|
|
37
|
+
if (point1 === void 0 || point2 === void 0) return {
|
|
38
|
+
angle: 0,
|
|
39
|
+
deltaX: 0,
|
|
40
|
+
deltaY: 0
|
|
41
|
+
};
|
|
42
|
+
point1 = pointTransformer(point1);
|
|
43
|
+
point2 = pointTransformer(point2);
|
|
44
|
+
const [x1, y1] = [point1.x, point1.y];
|
|
45
|
+
const [x2, y2] = [point2.x, point2.y];
|
|
46
|
+
const deltaX = x2 - x1;
|
|
47
|
+
const deltaY = y2 - y1;
|
|
48
|
+
return {
|
|
49
|
+
angle: Math.atan(deltaY / deltaX),
|
|
50
|
+
deltaX,
|
|
51
|
+
deltaY
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
__name(calculateDeltaAndAngle, "calculateDeltaAndAngle");
|
|
55
|
+
var pointTransformer = /* @__PURE__ */ __name((data) => {
|
|
56
|
+
if (Array.isArray(data)) return {
|
|
57
|
+
x: data[0],
|
|
58
|
+
y: data[1]
|
|
59
|
+
};
|
|
60
|
+
return data;
|
|
61
|
+
}, "pointTransformer");
|
|
62
|
+
var getLineFunctionsWithOffset = /* @__PURE__ */ __name((edge) => {
|
|
63
|
+
return {
|
|
64
|
+
x: /* @__PURE__ */ __name(function(d, i, data) {
|
|
65
|
+
let offset = 0;
|
|
66
|
+
const DIRECTION = pointTransformer(data[0]).x < pointTransformer(data[data.length - 1]).x ? "left" : "right";
|
|
67
|
+
if (i === 0 && Object.hasOwn(markerOffsets, edge.arrowTypeStart)) {
|
|
68
|
+
const { angle, deltaX } = calculateDeltaAndAngle(data[0], data[1]);
|
|
69
|
+
offset = markerOffsets[edge.arrowTypeStart] * Math.cos(angle) * (deltaX >= 0 ? 1 : -1);
|
|
70
|
+
} else if (i === data.length - 1 && Object.hasOwn(markerOffsets, edge.arrowTypeEnd)) {
|
|
71
|
+
const { angle, deltaX } = calculateDeltaAndAngle(data[data.length - 1], data[data.length - 2]);
|
|
72
|
+
offset = markerOffsets[edge.arrowTypeEnd] * Math.cos(angle) * (deltaX >= 0 ? 1 : -1);
|
|
73
|
+
}
|
|
74
|
+
const differenceToEnd = Math.abs(pointTransformer(d).x - pointTransformer(data[data.length - 1]).x);
|
|
75
|
+
const differenceInYEnd = Math.abs(pointTransformer(d).y - pointTransformer(data[data.length - 1]).y);
|
|
76
|
+
const differenceToStart = Math.abs(pointTransformer(d).x - pointTransformer(data[0]).x);
|
|
77
|
+
const differenceInYStart = Math.abs(pointTransformer(d).y - pointTransformer(data[0]).y);
|
|
78
|
+
const startMarkerHeight = markerOffsets[edge.arrowTypeStart];
|
|
79
|
+
const endMarkerHeight = markerOffsets[edge.arrowTypeEnd];
|
|
80
|
+
const extraRoom = 1;
|
|
81
|
+
if (differenceToEnd < endMarkerHeight && differenceToEnd > 0 && differenceInYEnd < endMarkerHeight) {
|
|
82
|
+
let adjustment = endMarkerHeight + extraRoom - differenceToEnd;
|
|
83
|
+
adjustment *= DIRECTION === "right" ? -1 : 1;
|
|
84
|
+
offset -= adjustment;
|
|
85
|
+
}
|
|
86
|
+
if (differenceToStart < startMarkerHeight && differenceToStart > 0 && differenceInYStart < startMarkerHeight) {
|
|
87
|
+
let adjustment = startMarkerHeight + extraRoom - differenceToStart;
|
|
88
|
+
adjustment *= DIRECTION === "right" ? -1 : 1;
|
|
89
|
+
offset += adjustment;
|
|
90
|
+
}
|
|
91
|
+
return pointTransformer(d).x + offset;
|
|
92
|
+
}, "x"),
|
|
93
|
+
y: /* @__PURE__ */ __name(function(d, i, data) {
|
|
94
|
+
let offset = 0;
|
|
95
|
+
const DIRECTION = pointTransformer(data[0]).y < pointTransformer(data[data.length - 1]).y ? "down" : "up";
|
|
96
|
+
if (i === 0 && Object.hasOwn(markerOffsets, edge.arrowTypeStart)) {
|
|
97
|
+
const { angle, deltaY } = calculateDeltaAndAngle(data[0], data[1]);
|
|
98
|
+
offset = markerOffsets[edge.arrowTypeStart] * Math.abs(Math.sin(angle)) * (deltaY >= 0 ? 1 : -1);
|
|
99
|
+
} else if (i === data.length - 1 && Object.hasOwn(markerOffsets, edge.arrowTypeEnd)) {
|
|
100
|
+
const { angle, deltaY } = calculateDeltaAndAngle(data[data.length - 1], data[data.length - 2]);
|
|
101
|
+
offset = markerOffsets[edge.arrowTypeEnd] * Math.abs(Math.sin(angle)) * (deltaY >= 0 ? 1 : -1);
|
|
102
|
+
}
|
|
103
|
+
const differenceToEnd = Math.abs(pointTransformer(d).y - pointTransformer(data[data.length - 1]).y);
|
|
104
|
+
const differenceInXEnd = Math.abs(pointTransformer(d).x - pointTransformer(data[data.length - 1]).x);
|
|
105
|
+
const differenceToStart = Math.abs(pointTransformer(d).y - pointTransformer(data[0]).y);
|
|
106
|
+
const differenceInXStart = Math.abs(pointTransformer(d).x - pointTransformer(data[0]).x);
|
|
107
|
+
const startMarkerHeight = markerOffsets[edge.arrowTypeStart];
|
|
108
|
+
const endMarkerHeight = markerOffsets[edge.arrowTypeEnd];
|
|
109
|
+
const extraRoom = 1;
|
|
110
|
+
if (differenceToEnd < endMarkerHeight && differenceToEnd > 0 && differenceInXEnd < endMarkerHeight) {
|
|
111
|
+
let adjustment = endMarkerHeight + extraRoom - differenceToEnd;
|
|
112
|
+
adjustment *= DIRECTION === "up" ? -1 : 1;
|
|
113
|
+
offset -= adjustment;
|
|
114
|
+
}
|
|
115
|
+
if (differenceToStart < startMarkerHeight && differenceToStart > 0 && differenceInXStart < startMarkerHeight) {
|
|
116
|
+
let adjustment = startMarkerHeight + extraRoom - differenceToStart;
|
|
117
|
+
adjustment *= DIRECTION === "up" ? -1 : 1;
|
|
118
|
+
offset += adjustment;
|
|
119
|
+
}
|
|
120
|
+
return pointTransformer(d).y + offset;
|
|
121
|
+
}, "y")
|
|
122
|
+
};
|
|
123
|
+
}, "getLineFunctionsWithOffset");
|
|
124
|
+
var addEdgeMarkers = /* @__PURE__ */ __name((svgPath, edge, url, id, diagramType, useMargin = false, strokeColor) => {
|
|
125
|
+
if (edge.arrowTypeStart) addEdgeMarker(svgPath, "start", edge.arrowTypeStart, url, id, diagramType, useMargin, strokeColor);
|
|
126
|
+
if (edge.arrowTypeEnd) addEdgeMarker(svgPath, "end", edge.arrowTypeEnd, url, id, diagramType, useMargin, strokeColor);
|
|
127
|
+
}, "addEdgeMarkers");
|
|
128
|
+
var arrowTypesMap = {
|
|
129
|
+
arrow_cross: {
|
|
130
|
+
type: "cross",
|
|
131
|
+
fill: false
|
|
132
|
+
},
|
|
133
|
+
arrow_point: {
|
|
134
|
+
type: "point",
|
|
135
|
+
fill: true
|
|
136
|
+
},
|
|
137
|
+
arrow_barb: {
|
|
138
|
+
type: "barb",
|
|
139
|
+
fill: true
|
|
140
|
+
},
|
|
141
|
+
arrow_barb_neo: {
|
|
142
|
+
type: "barb",
|
|
143
|
+
fill: true
|
|
144
|
+
},
|
|
145
|
+
arrow_circle: {
|
|
146
|
+
type: "circle",
|
|
147
|
+
fill: false
|
|
148
|
+
},
|
|
149
|
+
arrow_hierarchy: {
|
|
150
|
+
type: "hierarchy",
|
|
151
|
+
fill: false
|
|
152
|
+
},
|
|
153
|
+
aggregation: {
|
|
154
|
+
type: "aggregation",
|
|
155
|
+
fill: false
|
|
156
|
+
},
|
|
157
|
+
extension: {
|
|
158
|
+
type: "extension",
|
|
159
|
+
fill: false
|
|
160
|
+
},
|
|
161
|
+
composition: {
|
|
162
|
+
type: "composition",
|
|
163
|
+
fill: true
|
|
164
|
+
},
|
|
165
|
+
dependency: {
|
|
166
|
+
type: "dependency",
|
|
167
|
+
fill: true
|
|
168
|
+
},
|
|
169
|
+
lollipop: {
|
|
170
|
+
type: "lollipop",
|
|
171
|
+
fill: false
|
|
172
|
+
},
|
|
173
|
+
only_one: {
|
|
174
|
+
type: "onlyOne",
|
|
175
|
+
fill: false
|
|
176
|
+
},
|
|
177
|
+
zero_or_one: {
|
|
178
|
+
type: "zeroOrOne",
|
|
179
|
+
fill: false
|
|
180
|
+
},
|
|
181
|
+
one_or_more: {
|
|
182
|
+
type: "oneOrMore",
|
|
183
|
+
fill: false
|
|
184
|
+
},
|
|
185
|
+
zero_or_more: {
|
|
186
|
+
type: "zeroOrMore",
|
|
187
|
+
fill: false
|
|
188
|
+
},
|
|
189
|
+
requirement_arrow: {
|
|
190
|
+
type: "requirement_arrow",
|
|
191
|
+
fill: false
|
|
192
|
+
},
|
|
193
|
+
requirement_contains: {
|
|
194
|
+
type: "requirement_contains",
|
|
195
|
+
fill: false
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
var arrowTypesWithMarginSupport = [
|
|
199
|
+
"cross",
|
|
200
|
+
"point",
|
|
201
|
+
"circle",
|
|
202
|
+
"lollipop",
|
|
203
|
+
"aggregation",
|
|
204
|
+
"extension",
|
|
205
|
+
"composition",
|
|
206
|
+
"dependency",
|
|
207
|
+
"barb"
|
|
208
|
+
];
|
|
209
|
+
var addEdgeMarker = /* @__PURE__ */ __name((svgPath, position, arrowType, url, id, diagramType, useMargin = false, strokeColor) => {
|
|
210
|
+
if (!arrowType || arrowType === "none") return;
|
|
211
|
+
const arrowTypeInfo = arrowTypesMap[arrowType];
|
|
212
|
+
const marginSupport = arrowTypeInfo && arrowTypesWithMarginSupport.includes(arrowTypeInfo.type);
|
|
213
|
+
if (!arrowTypeInfo) {
|
|
214
|
+
log.warn(`Unknown arrow type: ${arrowType}`);
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
const originalMarkerId = `${id}_${diagramType}-${arrowTypeInfo.type}${position === "start" ? "Start" : "End"}${useMargin && marginSupport ? "-margin" : ""}`;
|
|
218
|
+
if (strokeColor && strokeColor.trim() !== "") {
|
|
219
|
+
const coloredMarkerId = `${originalMarkerId}_${strokeColor.replace(/[^\dA-Za-z]/g, "_")}`;
|
|
220
|
+
if (!document.getElementById(coloredMarkerId)) {
|
|
221
|
+
const originalMarker = document.getElementById(originalMarkerId);
|
|
222
|
+
if (originalMarker) {
|
|
223
|
+
const coloredMarker = originalMarker.cloneNode(true);
|
|
224
|
+
coloredMarker.id = coloredMarkerId;
|
|
225
|
+
coloredMarker.querySelectorAll("path, circle, line").forEach((path) => {
|
|
226
|
+
path.setAttribute("stroke", strokeColor);
|
|
227
|
+
if (arrowTypeInfo.fill) path.setAttribute("fill", strokeColor);
|
|
228
|
+
});
|
|
229
|
+
originalMarker.parentNode?.appendChild(coloredMarker);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
svgPath.attr(`marker-${position}`, `url(${url}#${coloredMarkerId})`);
|
|
233
|
+
} else svgPath.attr(`marker-${position}`, `url(${url}#${originalMarkerId})`);
|
|
234
|
+
}, "addEdgeMarker");
|
|
235
|
+
var resolveEdgeCurveType = /* @__PURE__ */ __name((edgeCurve) => {
|
|
236
|
+
return typeof edgeCurve === "string" ? edgeCurve : getConfig2()?.flowchart?.curve;
|
|
237
|
+
}, "resolveEdgeCurveType");
|
|
238
|
+
var edgeLabels = /* @__PURE__ */ new Map();
|
|
239
|
+
var terminalLabels = /* @__PURE__ */ new Map();
|
|
240
|
+
var clear = /* @__PURE__ */ __name(() => {
|
|
241
|
+
edgeLabels.clear();
|
|
242
|
+
terminalLabels.clear();
|
|
243
|
+
}, "clear");
|
|
244
|
+
var hasEdgeLabel = /* @__PURE__ */ __name((edge) => Boolean(edge.label || edge.startLabelLeft || edge.startLabelRight || edge.endLabelLeft || edge.endLabelRight), "hasEdgeLabel");
|
|
245
|
+
var getLabelStyles = /* @__PURE__ */ __name((styleArray) => {
|
|
246
|
+
if (!styleArray) return "";
|
|
247
|
+
if (typeof styleArray === "string") return styleArray;
|
|
248
|
+
return styleArray.reduce((acc, style) => acc + ";" + style, "");
|
|
249
|
+
}, "getLabelStyles");
|
|
250
|
+
var insertEdgeLabel = /* @__PURE__ */ __name(async (elem, edge) => {
|
|
251
|
+
const config = getConfig2();
|
|
252
|
+
let useHtmlLabels = getEffectiveHtmlLabels(config);
|
|
253
|
+
const { labelStyles } = styles2String(edge);
|
|
254
|
+
edge.labelStyle = labelStyles;
|
|
255
|
+
const edgeLabel = elem.insert("g").attr("class", "edgeLabel");
|
|
256
|
+
const label = edgeLabel.insert("g").attr("class", "label").attr("data-id", edge.id);
|
|
257
|
+
const isMarkdown = edge.labelType === "markdown";
|
|
258
|
+
const labelElement = await createText(elem, edge.label, {
|
|
259
|
+
style: getLabelStyles(edge.labelStyle),
|
|
260
|
+
useHtmlLabels,
|
|
261
|
+
addSvgBackground: true,
|
|
262
|
+
isNode: false,
|
|
263
|
+
markdown: isMarkdown,
|
|
264
|
+
width: isMarkdown ? void 0 : void 0
|
|
265
|
+
}, config);
|
|
266
|
+
label.node().appendChild(labelElement);
|
|
267
|
+
log.info("abc82", edge, edge.labelType);
|
|
268
|
+
let bbox;
|
|
269
|
+
let transformBbox;
|
|
270
|
+
if (useHtmlLabels) {
|
|
271
|
+
const div = labelElement.children[0];
|
|
272
|
+
const dv = select_default(labelElement);
|
|
273
|
+
bbox = await fastdom_default2.measure(() => div.getBoundingClientRect());
|
|
274
|
+
transformBbox = bbox;
|
|
275
|
+
dv.attr("width", bbox.width);
|
|
276
|
+
dv.attr("height", bbox.height);
|
|
277
|
+
} else {
|
|
278
|
+
const textEl = select_default(labelElement).select("text").node();
|
|
279
|
+
await fastdom_default2.measure(() => {
|
|
280
|
+
bbox = labelElement.getBBox();
|
|
281
|
+
if (textEl && typeof textEl.getBBox === "function") transformBbox = textEl.getBBox();
|
|
282
|
+
else transformBbox = bbox;
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
label.attr("transform", computeLabelTransform(transformBbox, useHtmlLabels));
|
|
286
|
+
edgeLabels.set(edge.id, edgeLabel);
|
|
287
|
+
edge.width = bbox.width;
|
|
288
|
+
edge.height = bbox.height;
|
|
289
|
+
let fo;
|
|
290
|
+
if (edge.startLabelLeft) {
|
|
291
|
+
const startEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
|
|
292
|
+
const inner = startEdgeLabelLeft.insert("g").attr("class", "inner");
|
|
293
|
+
const startLabelElement = await createLabel_default(inner, edge.startLabelLeft, getLabelStyles(edge.labelStyle) || "", false, false);
|
|
294
|
+
fo = startLabelElement;
|
|
295
|
+
let slBox = startLabelElement.getBBox();
|
|
296
|
+
if (useHtmlLabels) {
|
|
297
|
+
const div = startLabelElement.children[0];
|
|
298
|
+
const dv = select_default(startLabelElement);
|
|
299
|
+
slBox = div.getBoundingClientRect();
|
|
300
|
+
dv.attr("width", slBox.width);
|
|
301
|
+
dv.attr("height", slBox.height);
|
|
302
|
+
}
|
|
303
|
+
inner.attr("transform", computeLabelTransform(slBox, useHtmlLabels));
|
|
304
|
+
if (!terminalLabels.get(edge.id)) terminalLabels.set(edge.id, {});
|
|
305
|
+
terminalLabels.get(edge.id).startLeft = startEdgeLabelLeft;
|
|
306
|
+
setTerminalWidth(fo, edge.startLabelLeft);
|
|
307
|
+
}
|
|
308
|
+
if (edge.startLabelRight) {
|
|
309
|
+
const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
|
|
310
|
+
const inner = startEdgeLabelRight.insert("g").attr("class", "inner");
|
|
311
|
+
const startLabelElement = await createLabel_default(inner, edge.startLabelRight, getLabelStyles(edge.labelStyle) || "", false, false);
|
|
312
|
+
fo = startLabelElement;
|
|
313
|
+
let slBox = startLabelElement.getBBox();
|
|
314
|
+
if (useHtmlLabels) {
|
|
315
|
+
const div = startLabelElement.children[0];
|
|
316
|
+
const dv = select_default(startLabelElement);
|
|
317
|
+
slBox = div.getBoundingClientRect();
|
|
318
|
+
dv.attr("width", slBox.width);
|
|
319
|
+
dv.attr("height", slBox.height);
|
|
320
|
+
}
|
|
321
|
+
inner.attr("transform", computeLabelTransform(slBox, useHtmlLabels));
|
|
322
|
+
if (!terminalLabels.get(edge.id)) terminalLabels.set(edge.id, {});
|
|
323
|
+
terminalLabels.get(edge.id).startRight = startEdgeLabelRight;
|
|
324
|
+
setTerminalWidth(fo, edge.startLabelRight);
|
|
325
|
+
}
|
|
326
|
+
if (edge.endLabelLeft) {
|
|
327
|
+
const endEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
|
|
328
|
+
const inner = endEdgeLabelLeft.insert("g").attr("class", "inner");
|
|
329
|
+
const endLabelElement = await createLabel_default(endEdgeLabelLeft, edge.endLabelLeft, getLabelStyles(edge.labelStyle) || "", false, false);
|
|
330
|
+
fo = endLabelElement;
|
|
331
|
+
let slBox = endLabelElement.getBBox();
|
|
332
|
+
if (useHtmlLabels) {
|
|
333
|
+
const div = endLabelElement.children[0];
|
|
334
|
+
const dv = select_default(endLabelElement);
|
|
335
|
+
slBox = div.getBoundingClientRect();
|
|
336
|
+
dv.attr("width", slBox.width);
|
|
337
|
+
dv.attr("height", slBox.height);
|
|
338
|
+
}
|
|
339
|
+
inner.attr("transform", computeLabelTransform(slBox, useHtmlLabels));
|
|
340
|
+
if (!terminalLabels.get(edge.id)) terminalLabels.set(edge.id, {});
|
|
341
|
+
terminalLabels.get(edge.id).endLeft = endEdgeLabelLeft;
|
|
342
|
+
setTerminalWidth(fo, edge.endLabelLeft);
|
|
343
|
+
}
|
|
344
|
+
if (edge.endLabelRight) {
|
|
345
|
+
const endEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
|
|
346
|
+
const inner = endEdgeLabelRight.insert("g").attr("class", "inner");
|
|
347
|
+
const endLabelElement = await createLabel_default(endEdgeLabelRight, edge.endLabelRight, getLabelStyles(edge.labelStyle) || "", false, false);
|
|
348
|
+
fo = endLabelElement;
|
|
349
|
+
let slBox = endLabelElement.getBBox();
|
|
350
|
+
if (useHtmlLabels) {
|
|
351
|
+
const div = endLabelElement.children[0];
|
|
352
|
+
const dv = select_default(endLabelElement);
|
|
353
|
+
slBox = div.getBoundingClientRect();
|
|
354
|
+
dv.attr("width", slBox.width);
|
|
355
|
+
dv.attr("height", slBox.height);
|
|
356
|
+
}
|
|
357
|
+
inner.attr("transform", computeLabelTransform(slBox, useHtmlLabels));
|
|
358
|
+
if (!terminalLabels.get(edge.id)) terminalLabels.set(edge.id, {});
|
|
359
|
+
terminalLabels.get(edge.id).endRight = endEdgeLabelRight;
|
|
360
|
+
setTerminalWidth(fo, edge.endLabelRight);
|
|
361
|
+
}
|
|
362
|
+
return labelElement;
|
|
363
|
+
}, "insertEdgeLabel");
|
|
364
|
+
function setTerminalWidth(fo, value) {
|
|
365
|
+
if (getEffectiveHtmlLabels(getConfig2()) && fo) {
|
|
366
|
+
fo.style.width = value.length * 9 + "px";
|
|
367
|
+
fo.style.height = "12px";
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
__name(setTerminalWidth, "setTerminalWidth");
|
|
371
|
+
var positionEdgeLabel = /* @__PURE__ */ __name((edge, paths) => {
|
|
372
|
+
log.debug("Moving label abc88 ", edge.id, edge.label, edgeLabels.get(edge.id), paths);
|
|
373
|
+
let path = paths.updatedPath ? paths.updatedPath : paths.originalPath;
|
|
374
|
+
const { subGraphTitleTotalMargin } = getSubGraphTitleMargins(getConfig2());
|
|
375
|
+
if (edge.label) {
|
|
376
|
+
const el = edgeLabels.get(edge.id);
|
|
377
|
+
let x = edge.x;
|
|
378
|
+
let y = edge.y;
|
|
379
|
+
if (path) {
|
|
380
|
+
const pos = utils_default.calcLabelPosition(path);
|
|
381
|
+
log.debug("Moving label " + edge.label + " from (", x, ",", y, ") to (", pos.x, ",", pos.y, ") abc88");
|
|
382
|
+
if (paths.updatedPath) {
|
|
383
|
+
x = pos.x;
|
|
384
|
+
y = pos.y;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
el.attr("transform", `translate(${x}, ${y + subGraphTitleTotalMargin / 2})`);
|
|
388
|
+
}
|
|
389
|
+
if (edge.startLabelLeft) {
|
|
390
|
+
const el = terminalLabels.get(edge.id).startLeft;
|
|
391
|
+
let x = edge.x;
|
|
392
|
+
let y = edge.y;
|
|
393
|
+
if (path) {
|
|
394
|
+
const pos = utils_default.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path);
|
|
395
|
+
x = pos.x;
|
|
396
|
+
y = pos.y;
|
|
397
|
+
}
|
|
398
|
+
el.attr("transform", `translate(${x}, ${y})`);
|
|
399
|
+
}
|
|
400
|
+
if (edge.startLabelRight) {
|
|
401
|
+
const el = terminalLabels.get(edge.id).startRight;
|
|
402
|
+
let x = edge.x;
|
|
403
|
+
let y = edge.y;
|
|
404
|
+
if (path) {
|
|
405
|
+
const pos = utils_default.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_right", path);
|
|
406
|
+
x = pos.x;
|
|
407
|
+
y = pos.y;
|
|
408
|
+
}
|
|
409
|
+
el.attr("transform", `translate(${x}, ${y})`);
|
|
410
|
+
}
|
|
411
|
+
if (edge.endLabelLeft) {
|
|
412
|
+
const el = terminalLabels.get(edge.id).endLeft;
|
|
413
|
+
let x = edge.x;
|
|
414
|
+
let y = edge.y;
|
|
415
|
+
if (path) {
|
|
416
|
+
const pos = utils_default.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path);
|
|
417
|
+
x = pos.x;
|
|
418
|
+
y = pos.y;
|
|
419
|
+
}
|
|
420
|
+
el.attr("transform", `translate(${x}, ${y})`);
|
|
421
|
+
}
|
|
422
|
+
if (edge.endLabelRight) {
|
|
423
|
+
const el = terminalLabels.get(edge.id).endRight;
|
|
424
|
+
let x = edge.x;
|
|
425
|
+
let y = edge.y;
|
|
426
|
+
if (path) {
|
|
427
|
+
const pos = utils_default.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path);
|
|
428
|
+
x = pos.x;
|
|
429
|
+
y = pos.y;
|
|
430
|
+
}
|
|
431
|
+
el.attr("transform", `translate(${x}, ${y})`);
|
|
432
|
+
}
|
|
433
|
+
}, "positionEdgeLabel");
|
|
434
|
+
var orthogonalizeToLabelClippedPoints = /* @__PURE__ */ __name((edge, points) => {
|
|
435
|
+
if (!edge?.isLabelEdge || !edge?.id?.endsWith("-to-label") || !Array.isArray(points)) return points;
|
|
436
|
+
if (points.length !== 2) return points;
|
|
437
|
+
const [start, end] = points;
|
|
438
|
+
const dx = Math.abs(end.x - start.x);
|
|
439
|
+
const dy = Math.abs(end.y - start.y);
|
|
440
|
+
if (dx < .001 || dy < .001) return points;
|
|
441
|
+
if (dy >= dx) return [
|
|
442
|
+
start,
|
|
443
|
+
{
|
|
444
|
+
x: start.x,
|
|
445
|
+
y: end.y
|
|
446
|
+
},
|
|
447
|
+
end
|
|
448
|
+
];
|
|
449
|
+
return [
|
|
450
|
+
start,
|
|
451
|
+
{
|
|
452
|
+
x: end.x,
|
|
453
|
+
y: start.y
|
|
454
|
+
},
|
|
455
|
+
end
|
|
456
|
+
];
|
|
457
|
+
}, "orthogonalizeToLabelClippedPoints");
|
|
458
|
+
var outsideNode = /* @__PURE__ */ __name((node, point2) => {
|
|
459
|
+
const x = node.x;
|
|
460
|
+
const y = node.y;
|
|
461
|
+
const dx = Math.abs(point2.x - x);
|
|
462
|
+
const dy = Math.abs(point2.y - y);
|
|
463
|
+
const w = node.width / 2;
|
|
464
|
+
const h = node.height / 2;
|
|
465
|
+
return dx >= w || dy >= h;
|
|
466
|
+
}, "outsideNode");
|
|
467
|
+
var intersection = /* @__PURE__ */ __name((node, outsidePoint, insidePoint) => {
|
|
468
|
+
log.debug(`intersection calc abc89:
|
|
469
|
+
outsidePoint: ${JSON.stringify(outsidePoint)}
|
|
470
|
+
insidePoint : ${JSON.stringify(insidePoint)}
|
|
471
|
+
node : x:${node.x} y:${node.y} w:${node.width} h:${node.height}`);
|
|
472
|
+
const x = node.x;
|
|
473
|
+
const y = node.y;
|
|
474
|
+
const dx = Math.abs(x - insidePoint.x);
|
|
475
|
+
const w = node.width / 2;
|
|
476
|
+
let r = insidePoint.x < outsidePoint.x ? w - dx : w + dx;
|
|
477
|
+
const h = node.height / 2;
|
|
478
|
+
const Q = Math.abs(outsidePoint.y - insidePoint.y);
|
|
479
|
+
const R = Math.abs(outsidePoint.x - insidePoint.x);
|
|
480
|
+
if (Math.abs(y - outsidePoint.y) * w > Math.abs(x - outsidePoint.x) * h) {
|
|
481
|
+
let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y;
|
|
482
|
+
r = R * q / Q;
|
|
483
|
+
const res = {
|
|
484
|
+
x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r,
|
|
485
|
+
y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q
|
|
486
|
+
};
|
|
487
|
+
if (r === 0) {
|
|
488
|
+
res.x = outsidePoint.x;
|
|
489
|
+
res.y = outsidePoint.y;
|
|
490
|
+
}
|
|
491
|
+
if (R === 0) res.x = outsidePoint.x;
|
|
492
|
+
if (Q === 0) res.y = outsidePoint.y;
|
|
493
|
+
log.debug(`abc89 top/bottom calc, Q ${Q}, q ${q}, R ${R}, r ${r}`, res);
|
|
494
|
+
return res;
|
|
495
|
+
} else {
|
|
496
|
+
if (insidePoint.x < outsidePoint.x) r = outsidePoint.x - w - x;
|
|
497
|
+
else r = x - w - outsidePoint.x;
|
|
498
|
+
let q = Q * r / R;
|
|
499
|
+
let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r;
|
|
500
|
+
let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q : insidePoint.y - q;
|
|
501
|
+
log.debug(`sides calc abc89, Q ${Q}, q ${q}, R ${R}, r ${r}`, {
|
|
502
|
+
_x,
|
|
503
|
+
_y
|
|
504
|
+
});
|
|
505
|
+
if (r === 0) {
|
|
506
|
+
_x = outsidePoint.x;
|
|
507
|
+
_y = outsidePoint.y;
|
|
508
|
+
}
|
|
509
|
+
if (R === 0) _x = outsidePoint.x;
|
|
510
|
+
if (Q === 0) _y = outsidePoint.y;
|
|
511
|
+
return {
|
|
512
|
+
x: _x,
|
|
513
|
+
y: _y
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
}, "intersection");
|
|
517
|
+
var cutPathAtIntersect = /* @__PURE__ */ __name((_points, boundaryNode) => {
|
|
518
|
+
log.warn("abc88 cutPathAtIntersect", _points, boundaryNode);
|
|
519
|
+
let points = [];
|
|
520
|
+
let lastPointOutside = _points[0];
|
|
521
|
+
let isInside = false;
|
|
522
|
+
_points.forEach((point2) => {
|
|
523
|
+
log.info("abc88 checking point", point2, boundaryNode);
|
|
524
|
+
if (!outsideNode(boundaryNode, point2) && !isInside) {
|
|
525
|
+
const inter = intersection(boundaryNode, lastPointOutside, point2);
|
|
526
|
+
log.debug("abc88 inside", point2, lastPointOutside, inter);
|
|
527
|
+
log.debug("abc88 intersection", inter, boundaryNode);
|
|
528
|
+
let pointPresent = false;
|
|
529
|
+
points.forEach((p) => {
|
|
530
|
+
pointPresent = pointPresent || p.x === inter.x && p.y === inter.y;
|
|
531
|
+
});
|
|
532
|
+
if (!points.some((e) => e.x === inter.x && e.y === inter.y)) points.push(inter);
|
|
533
|
+
else log.warn("abc88 no intersect", inter, points);
|
|
534
|
+
isInside = true;
|
|
535
|
+
} else {
|
|
536
|
+
log.warn("abc88 outside", point2, lastPointOutside);
|
|
537
|
+
lastPointOutside = point2;
|
|
538
|
+
if (!isInside) points.push(point2);
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
log.debug("returning points", points);
|
|
542
|
+
return points;
|
|
543
|
+
}, "cutPathAtIntersect");
|
|
544
|
+
function extractCornerPoints(points) {
|
|
545
|
+
const cornerPoints = [];
|
|
546
|
+
const cornerPointPositions = [];
|
|
547
|
+
for (let i = 1; i < points.length - 1; i++) {
|
|
548
|
+
const prev = points[i - 1];
|
|
549
|
+
const curr = points[i];
|
|
550
|
+
const next = points[i + 1];
|
|
551
|
+
if (prev.x === curr.x && curr.y === next.y && Math.abs(curr.x - next.x) > 5 && Math.abs(curr.y - prev.y) > 5) {
|
|
552
|
+
cornerPoints.push(curr);
|
|
553
|
+
cornerPointPositions.push(i);
|
|
554
|
+
} else if (prev.y === curr.y && curr.x === next.x && Math.abs(curr.x - prev.x) > 5 && Math.abs(curr.y - next.y) > 5) {
|
|
555
|
+
cornerPoints.push(curr);
|
|
556
|
+
cornerPointPositions.push(i);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
return {
|
|
560
|
+
cornerPoints,
|
|
561
|
+
cornerPointPositions
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
__name(extractCornerPoints, "extractCornerPoints");
|
|
565
|
+
var findAdjacentPoint = /* @__PURE__ */ __name(function(pointA, pointB, distance) {
|
|
566
|
+
const xDiff = pointB.x - pointA.x;
|
|
567
|
+
const yDiff = pointB.y - pointA.y;
|
|
568
|
+
const ratio = distance / Math.sqrt(xDiff * xDiff + yDiff * yDiff);
|
|
569
|
+
return {
|
|
570
|
+
x: pointB.x - ratio * xDiff,
|
|
571
|
+
y: pointB.y - ratio * yDiff
|
|
572
|
+
};
|
|
573
|
+
}, "findAdjacentPoint");
|
|
574
|
+
var fixCorners = /* @__PURE__ */ __name(function(lineData) {
|
|
575
|
+
const { cornerPointPositions } = extractCornerPoints(lineData);
|
|
576
|
+
const newLineData = [];
|
|
577
|
+
for (let i = 0; i < lineData.length; i++) if (cornerPointPositions.includes(i)) {
|
|
578
|
+
const prevPoint = lineData[i - 1];
|
|
579
|
+
const nextPoint = lineData[i + 1];
|
|
580
|
+
const cornerPoint = lineData[i];
|
|
581
|
+
const newPrevPoint = findAdjacentPoint(prevPoint, cornerPoint, 5);
|
|
582
|
+
const newNextPoint = findAdjacentPoint(nextPoint, cornerPoint, 5);
|
|
583
|
+
const xDiff = newNextPoint.x - newPrevPoint.x;
|
|
584
|
+
const yDiff = newNextPoint.y - newPrevPoint.y;
|
|
585
|
+
newLineData.push(newPrevPoint);
|
|
586
|
+
const a = Math.sqrt(2) * 2;
|
|
587
|
+
let newCornerPoint = {
|
|
588
|
+
x: cornerPoint.x,
|
|
589
|
+
y: cornerPoint.y
|
|
590
|
+
};
|
|
591
|
+
if (Math.abs(nextPoint.x - prevPoint.x) > 10 && Math.abs(nextPoint.y - prevPoint.y) >= 10) {
|
|
592
|
+
log.debug("Corner point fixing", Math.abs(nextPoint.x - prevPoint.x), Math.abs(nextPoint.y - prevPoint.y));
|
|
593
|
+
const r = 5;
|
|
594
|
+
if (cornerPoint.x === newPrevPoint.x) newCornerPoint = {
|
|
595
|
+
x: xDiff < 0 ? newPrevPoint.x - r + a : newPrevPoint.x + r - a,
|
|
596
|
+
y: yDiff < 0 ? newPrevPoint.y - a : newPrevPoint.y + a
|
|
597
|
+
};
|
|
598
|
+
else newCornerPoint = {
|
|
599
|
+
x: xDiff < 0 ? newPrevPoint.x - a : newPrevPoint.x + a,
|
|
600
|
+
y: yDiff < 0 ? newPrevPoint.y - r + a : newPrevPoint.y + r - a
|
|
601
|
+
};
|
|
602
|
+
} else log.debug("Corner point skipping fixing", Math.abs(nextPoint.x - prevPoint.x), Math.abs(nextPoint.y - prevPoint.y));
|
|
603
|
+
newLineData.push(newCornerPoint, newNextPoint);
|
|
604
|
+
} else newLineData.push(lineData[i]);
|
|
605
|
+
return newLineData;
|
|
606
|
+
}, "fixCorners");
|
|
607
|
+
var generateDashArray = /* @__PURE__ */ __name((len, oValueS, oValueE) => {
|
|
608
|
+
const middleLength = len - oValueS - oValueE;
|
|
609
|
+
const dashLength = 2;
|
|
610
|
+
const gapLength = 2;
|
|
611
|
+
const rawPairs = Math.floor(middleLength / 4);
|
|
612
|
+
return `0 ${oValueS} ${Array(Number.isFinite(rawPairs) ? Math.max(0, rawPairs) : 0).fill(`${dashLength} ${gapLength}`).join(" ")} ${oValueE}`;
|
|
613
|
+
}, "generateDashArray");
|
|
614
|
+
var insertEdge = /* @__PURE__ */ __name(function(elem, edge, clusterDb, diagramType, startNode, endNode, diagramId, skipIntersect = false) {
|
|
615
|
+
if (!diagramId) throw new Error(`insertEdge: missing diagramId for edge "${edge.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);
|
|
616
|
+
const { handDrawnSeed, layout } = getConfig2();
|
|
617
|
+
let points = edge.points;
|
|
618
|
+
let pointsHasChanged = false;
|
|
619
|
+
const tail = startNode;
|
|
620
|
+
var head = endNode;
|
|
621
|
+
const edgeClassStyles = [];
|
|
622
|
+
for (const key in edge.cssCompiledStyles) {
|
|
623
|
+
if (isLabelStyle(key)) continue;
|
|
624
|
+
edgeClassStyles.push(edge.cssCompiledStyles[key]);
|
|
625
|
+
}
|
|
626
|
+
if (layout === "swimlane") {
|
|
627
|
+
if (head.intersect && tail.intersect && Array.isArray(points) && points.length >= 2) if (points.length === 2) points = [tail.intersect(points[0]), head.intersect(points[1])];
|
|
628
|
+
else {
|
|
629
|
+
const innerPoints = points.slice(1, -1);
|
|
630
|
+
const firstInner = innerPoints[0];
|
|
631
|
+
const lastInner = innerPoints[innerPoints.length - 1];
|
|
632
|
+
const TOLERANCE = .5;
|
|
633
|
+
const lastIsPinned = Math.abs(points[points.length - 1].x - lastInner.x) < TOLERANCE && Math.abs(points[points.length - 1].y - lastInner.y) < TOLERANCE;
|
|
634
|
+
const newFirst = tail.intersect(firstInner);
|
|
635
|
+
const newLast = lastIsPinned ? lastInner : head.intersect(lastInner);
|
|
636
|
+
const lastIsDuplicate = Math.abs(newLast.x - lastInner.x) < TOLERANCE && Math.abs(newLast.y - lastInner.y) < TOLERANCE;
|
|
637
|
+
const startPoints = Math.abs(newFirst.x - firstInner.x) < TOLERANCE && Math.abs(newFirst.y - firstInner.y) < TOLERANCE ? [] : [newFirst];
|
|
638
|
+
const endPoints = lastIsDuplicate ? [] : [newLast];
|
|
639
|
+
points = [
|
|
640
|
+
...startPoints,
|
|
641
|
+
...innerPoints,
|
|
642
|
+
...endPoints
|
|
643
|
+
];
|
|
644
|
+
}
|
|
645
|
+
points = orthogonalizeToLabelClippedPoints(edge, points);
|
|
646
|
+
} else if (head.intersect && tail.intersect && !skipIntersect) {
|
|
647
|
+
points = points.slice(1, edge.points.length - 1);
|
|
648
|
+
points.unshift(tail.intersect(points[0]));
|
|
649
|
+
points.push(head.intersect(points[points.length - 1]));
|
|
650
|
+
}
|
|
651
|
+
const pointsStr = btoa(JSON.stringify(points));
|
|
652
|
+
if (edge.toCluster) {
|
|
653
|
+
log.info("to cluster abc88", clusterDb.get(edge.toCluster));
|
|
654
|
+
points = cutPathAtIntersect(edge.points, clusterDb.get(edge.toCluster).node);
|
|
655
|
+
pointsHasChanged = true;
|
|
656
|
+
}
|
|
657
|
+
if (edge.fromCluster) {
|
|
658
|
+
log.debug("from cluster abc88", clusterDb.get(edge.fromCluster), JSON.stringify(points, null, 2));
|
|
659
|
+
points = cutPathAtIntersect(points.reverse(), clusterDb.get(edge.fromCluster).node).reverse();
|
|
660
|
+
pointsHasChanged = true;
|
|
661
|
+
}
|
|
662
|
+
let lineData = points.filter((p) => !Number.isNaN(p.y));
|
|
663
|
+
const edgeCurveType = resolveEdgeCurveType(edge.curve);
|
|
664
|
+
if (edgeCurveType !== "rounded") lineData = fixCorners(lineData);
|
|
665
|
+
let curve = linear_default;
|
|
666
|
+
switch (edgeCurveType) {
|
|
667
|
+
case "linear":
|
|
668
|
+
curve = linear_default;
|
|
669
|
+
break;
|
|
670
|
+
case "basis":
|
|
671
|
+
curve = basis_default;
|
|
672
|
+
break;
|
|
673
|
+
case "cardinal":
|
|
674
|
+
curve = cardinal_default;
|
|
675
|
+
break;
|
|
676
|
+
case "bumpX":
|
|
677
|
+
curve = bumpX;
|
|
678
|
+
break;
|
|
679
|
+
case "bumpY":
|
|
680
|
+
curve = bumpY;
|
|
681
|
+
break;
|
|
682
|
+
case "catmullRom":
|
|
683
|
+
curve = catmullRom_default;
|
|
684
|
+
break;
|
|
685
|
+
case "monotoneX":
|
|
686
|
+
curve = monotoneX;
|
|
687
|
+
break;
|
|
688
|
+
case "monotoneY":
|
|
689
|
+
curve = monotoneY;
|
|
690
|
+
break;
|
|
691
|
+
case "natural":
|
|
692
|
+
curve = natural_default;
|
|
693
|
+
break;
|
|
694
|
+
case "step":
|
|
695
|
+
curve = step_default;
|
|
696
|
+
break;
|
|
697
|
+
case "stepAfter":
|
|
698
|
+
curve = stepAfter;
|
|
699
|
+
break;
|
|
700
|
+
case "stepBefore":
|
|
701
|
+
curve = stepBefore;
|
|
702
|
+
break;
|
|
703
|
+
case "rounded":
|
|
704
|
+
curve = linear_default;
|
|
705
|
+
break;
|
|
706
|
+
default: curve = basis_default;
|
|
707
|
+
}
|
|
708
|
+
const { x, y } = getLineFunctionsWithOffset(edge);
|
|
709
|
+
const lineFunction = line_default().x(x).y(y).curve(curve);
|
|
710
|
+
let strokeClasses;
|
|
711
|
+
switch (edge.thickness) {
|
|
712
|
+
case "normal":
|
|
713
|
+
strokeClasses = "edge-thickness-normal";
|
|
714
|
+
break;
|
|
715
|
+
case "thick":
|
|
716
|
+
strokeClasses = "edge-thickness-thick";
|
|
717
|
+
break;
|
|
718
|
+
case "invisible":
|
|
719
|
+
strokeClasses = "edge-thickness-invisible";
|
|
720
|
+
break;
|
|
721
|
+
default: strokeClasses = "edge-thickness-normal";
|
|
722
|
+
}
|
|
723
|
+
switch (edge.pattern) {
|
|
724
|
+
case "solid":
|
|
725
|
+
strokeClasses += " edge-pattern-solid";
|
|
726
|
+
break;
|
|
727
|
+
case "dotted":
|
|
728
|
+
strokeClasses += " edge-pattern-dotted";
|
|
729
|
+
break;
|
|
730
|
+
case "dashed":
|
|
731
|
+
strokeClasses += " edge-pattern-dashed";
|
|
732
|
+
break;
|
|
733
|
+
default: strokeClasses += " edge-pattern-solid";
|
|
734
|
+
}
|
|
735
|
+
let svgPath;
|
|
736
|
+
let linePath = edgeCurveType === "rounded" ? generateRoundedPath(applyMarkerOffsetsToPoints(lineData, edge), 5) : lineFunction(lineData);
|
|
737
|
+
const edgeStyles = Array.isArray(edge.style) ? edge.style : [edge.style];
|
|
738
|
+
let strokeColor = edgeStyles.find((style) => style?.startsWith("stroke:"));
|
|
739
|
+
let animationClass = "";
|
|
740
|
+
if (edge.animate) animationClass = "edge-animation-fast";
|
|
741
|
+
if (edge.animation) animationClass = "edge-animation-" + edge.animation;
|
|
742
|
+
let animatedEdge = false;
|
|
743
|
+
if (edge.look === "handDrawn") {
|
|
744
|
+
const rc = import_rough_cjs.default.svg(elem);
|
|
745
|
+
Object.assign([], lineData);
|
|
746
|
+
const svgPathNode = rc.path(linePath, {
|
|
747
|
+
roughness: .3,
|
|
748
|
+
seed: handDrawnSeed
|
|
749
|
+
});
|
|
750
|
+
strokeClasses += " transition";
|
|
751
|
+
svgPath = select_default(svgPathNode).select("path").attr("id", `${diagramId}-${edge.id}`).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "") + (animationClass ? " " + animationClass : "")).attr("style", edgeStyles ? edgeStyles.reduce((acc, style) => acc + ";" + style, "") : "");
|
|
752
|
+
let d = svgPath.attr("d");
|
|
753
|
+
svgPath.attr("d", d);
|
|
754
|
+
elem.node().appendChild(svgPath.node());
|
|
755
|
+
} else {
|
|
756
|
+
const stylesFromClasses = edgeClassStyles.join(";");
|
|
757
|
+
const styles = edgeStyles ? edgeStyles.reduce((acc, style) => acc + style + ";", "") : "";
|
|
758
|
+
const pathStyle = (stylesFromClasses ? stylesFromClasses + ";" + styles + ";" : styles) + ";" + (edgeStyles ? edgeStyles.reduce((acc, style) => acc + ";" + style, "") : "");
|
|
759
|
+
svgPath = elem.append("path").attr("d", linePath).attr("id", `${diagramId}-${edge.id}`).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "") + (animationClass ? " " + animationClass : "")).attr("style", pathStyle);
|
|
760
|
+
strokeColor = pathStyle.match(/stroke:([^;]+)/)?.[1];
|
|
761
|
+
animatedEdge = edge.animate === true || !!edge.animation || stylesFromClasses.includes("animation");
|
|
762
|
+
const pathNode = svgPath.node();
|
|
763
|
+
const len = typeof pathNode.getTotalLength === "function" ? pathNode.getTotalLength() : 0;
|
|
764
|
+
const oValueS = markerOffsets2[edge.arrowTypeStart] || 0;
|
|
765
|
+
const oValueE = markerOffsets2[edge.arrowTypeEnd] || 0;
|
|
766
|
+
if (edge.look === "neo" && !animatedEdge) {
|
|
767
|
+
const mOffset = `stroke-dasharray: ${edge.pattern === "dotted" || edge.pattern === "dashed" ? generateDashArray(len, oValueS, oValueE) : `0 ${oValueS} ${len - oValueS - oValueE} ${oValueE}`}; stroke-dashoffset: 0;`;
|
|
768
|
+
svgPath.attr("style", mOffset + svgPath.attr("style"));
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
svgPath.attr("data-edge", true);
|
|
772
|
+
svgPath.attr("data-et", "edge");
|
|
773
|
+
svgPath.attr("data-id", edge.id);
|
|
774
|
+
svgPath.attr("data-points", pointsStr);
|
|
775
|
+
svgPath.attr("data-look", handleUndefinedAttr(edge.look));
|
|
776
|
+
if (edge.showPoints) lineData.forEach((point3) => {
|
|
777
|
+
elem.append("circle").style("stroke", "red").style("fill", "red").attr("r", 1).attr("cx", point3.x).attr("cy", point3.y);
|
|
778
|
+
});
|
|
779
|
+
let url = "";
|
|
780
|
+
if (getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) {
|
|
781
|
+
url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
|
|
782
|
+
url = url.replace(/\(/g, "\\(").replace(/\)/g, "\\)");
|
|
783
|
+
}
|
|
784
|
+
log.info("arrowTypeStart", edge.arrowTypeStart);
|
|
785
|
+
log.info("arrowTypeEnd", edge.arrowTypeEnd);
|
|
786
|
+
const useMargin = !animatedEdge && edge?.look === "neo";
|
|
787
|
+
addEdgeMarkers(svgPath, edge, url, diagramId, diagramType, useMargin, strokeColor);
|
|
788
|
+
const midIndex = Math.floor(points.length / 2);
|
|
789
|
+
const point2 = points[midIndex];
|
|
790
|
+
if (!utils_default.isLabelCoordinateInPath(point2, svgPath.attr("d"))) pointsHasChanged = true;
|
|
791
|
+
let paths = {};
|
|
792
|
+
if (pointsHasChanged) paths.updatedPath = points;
|
|
793
|
+
paths.originalPath = edge.points;
|
|
794
|
+
return paths;
|
|
795
|
+
}, "insertEdge");
|
|
796
|
+
function generateRoundedPath(points, radius) {
|
|
797
|
+
if (points.length < 2) return "";
|
|
798
|
+
let path = "";
|
|
799
|
+
const size = points.length;
|
|
800
|
+
const epsilon = 1e-5;
|
|
801
|
+
for (let i = 0; i < size; i++) {
|
|
802
|
+
const currPoint = points[i];
|
|
803
|
+
const prevPoint = points[i - 1];
|
|
804
|
+
const nextPoint = points[i + 1];
|
|
805
|
+
if (i === 0) path += `M${currPoint.x},${currPoint.y}`;
|
|
806
|
+
else if (i === size - 1) path += `L${currPoint.x},${currPoint.y}`;
|
|
807
|
+
else {
|
|
808
|
+
const dx1 = currPoint.x - prevPoint.x;
|
|
809
|
+
const dy1 = currPoint.y - prevPoint.y;
|
|
810
|
+
const dx2 = nextPoint.x - currPoint.x;
|
|
811
|
+
const dy2 = nextPoint.y - currPoint.y;
|
|
812
|
+
const len1 = Math.hypot(dx1, dy1);
|
|
813
|
+
const len2 = Math.hypot(dx2, dy2);
|
|
814
|
+
if (len1 < epsilon || len2 < epsilon) {
|
|
815
|
+
path += `L${currPoint.x},${currPoint.y}`;
|
|
816
|
+
continue;
|
|
817
|
+
}
|
|
818
|
+
const nx1 = dx1 / len1;
|
|
819
|
+
const ny1 = dy1 / len1;
|
|
820
|
+
const nx2 = dx2 / len2;
|
|
821
|
+
const ny2 = dy2 / len2;
|
|
822
|
+
const dot = nx1 * nx2 + ny1 * ny2;
|
|
823
|
+
const angle = Math.acos(Math.max(-1, Math.min(1, dot)));
|
|
824
|
+
if (angle < epsilon || Math.abs(Math.PI - angle) < epsilon) {
|
|
825
|
+
path += `L${currPoint.x},${currPoint.y}`;
|
|
826
|
+
continue;
|
|
827
|
+
}
|
|
828
|
+
const cutLen = Math.min(radius / Math.sin(angle / 2), len1 / 2, len2 / 2);
|
|
829
|
+
const startX = currPoint.x - nx1 * cutLen;
|
|
830
|
+
const startY = currPoint.y - ny1 * cutLen;
|
|
831
|
+
const endX = currPoint.x + nx2 * cutLen;
|
|
832
|
+
const endY = currPoint.y + ny2 * cutLen;
|
|
833
|
+
path += `L${startX},${startY}`;
|
|
834
|
+
path += `Q${currPoint.x},${currPoint.y} ${endX},${endY}`;
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
return path;
|
|
838
|
+
}
|
|
839
|
+
__name(generateRoundedPath, "generateRoundedPath");
|
|
840
|
+
function calculateDeltaAndAngle2(point1, point2) {
|
|
841
|
+
if (!point1 || !point2) return {
|
|
842
|
+
angle: 0,
|
|
843
|
+
deltaX: 0,
|
|
844
|
+
deltaY: 0
|
|
845
|
+
};
|
|
846
|
+
const deltaX = point2.x - point1.x;
|
|
847
|
+
const deltaY = point2.y - point1.y;
|
|
848
|
+
return {
|
|
849
|
+
angle: Math.atan2(deltaY, deltaX),
|
|
850
|
+
deltaX,
|
|
851
|
+
deltaY
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
__name(calculateDeltaAndAngle2, "calculateDeltaAndAngle");
|
|
855
|
+
function applyMarkerOffsetsToPoints(points, edge) {
|
|
856
|
+
const newPoints = points.map((point2) => ({ ...point2 }));
|
|
857
|
+
if (points.length >= 2 && markerOffsets[edge.arrowTypeStart]) {
|
|
858
|
+
const offsetValue = markerOffsets[edge.arrowTypeStart];
|
|
859
|
+
const point1 = points[0];
|
|
860
|
+
const point2 = points[1];
|
|
861
|
+
const { angle } = calculateDeltaAndAngle2(point1, point2);
|
|
862
|
+
const offsetX = offsetValue * Math.cos(angle);
|
|
863
|
+
const offsetY = offsetValue * Math.sin(angle);
|
|
864
|
+
newPoints[0].x = point1.x + offsetX;
|
|
865
|
+
newPoints[0].y = point1.y + offsetY;
|
|
866
|
+
}
|
|
867
|
+
const n = points.length;
|
|
868
|
+
if (n >= 2 && markerOffsets[edge.arrowTypeEnd]) {
|
|
869
|
+
const offsetValue = markerOffsets[edge.arrowTypeEnd];
|
|
870
|
+
const point1 = points[n - 1];
|
|
871
|
+
const point2 = points[n - 2];
|
|
872
|
+
const { angle } = calculateDeltaAndAngle2(point2, point1);
|
|
873
|
+
const offsetX = offsetValue * Math.cos(angle);
|
|
874
|
+
const offsetY = offsetValue * Math.sin(angle);
|
|
875
|
+
newPoints[n - 1].x = point1.x - offsetX;
|
|
876
|
+
newPoints[n - 1].y = point1.y - offsetY;
|
|
877
|
+
}
|
|
878
|
+
return newPoints;
|
|
879
|
+
}
|
|
880
|
+
__name(applyMarkerOffsetsToPoints, "applyMarkerOffsetsToPoints");
|
|
881
|
+
var insertMarkers = /* @__PURE__ */ __name((elem, markerArray, type, id) => {
|
|
882
|
+
markerArray.forEach((markerName) => {
|
|
883
|
+
markers[markerName](elem, type, id);
|
|
884
|
+
});
|
|
885
|
+
}, "insertMarkers");
|
|
886
|
+
var markers = {
|
|
887
|
+
extension: /* @__PURE__ */ __name((elem, type, id) => {
|
|
888
|
+
log.trace("Making markers for ", id);
|
|
889
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionStart").attr("class", "marker extension " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 1,7 L18,13 V 1 Z");
|
|
890
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionEnd").attr("class", "marker extension " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
|
|
891
|
+
elem.append("marker").attr("id", id + "_" + type + "-extensionStart-margin").attr("class", "marker extension " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").attr("viewBox", "0 0 20 14").append("polygon").attr("points", "10,7 18,13 18,1").style("stroke-width", 2).style("stroke-dasharray", "0");
|
|
892
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionEnd-margin").attr("class", "marker extension " + type).attr("refX", 9).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").attr("viewBox", "0 0 20 14").append("polygon").attr("points", "10,1 10,13 18,7").style("stroke-width", 2).style("stroke-dasharray", "0");
|
|
893
|
+
}, "extension"),
|
|
894
|
+
composition: /* @__PURE__ */ __name((elem, type, id) => {
|
|
895
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionStart").attr("class", "marker composition " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
896
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionEnd").attr("class", "marker composition " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
897
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionStart-margin").attr("class", "marker composition " + type).attr("refX", 15).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 0).attr("viewBox", "0 0 15 15").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
898
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionEnd-margin").attr("class", "marker composition " + type).attr("refX", 3.5).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 0).attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
899
|
+
}, "composition"),
|
|
900
|
+
aggregation: /* @__PURE__ */ __name((elem, type, id) => {
|
|
901
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationStart").attr("class", "marker aggregation " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
902
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationEnd").attr("class", "marker aggregation " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
903
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationStart-margin").attr("class", "marker aggregation " + type).attr("refX", 15).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 2).attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
904
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationEnd-margin").attr("class", "marker aggregation " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 2).attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
905
|
+
}, "aggregation"),
|
|
906
|
+
dependency: /* @__PURE__ */ __name((elem, type, id) => {
|
|
907
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyStart").attr("class", "marker dependency " + type).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
|
|
908
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyEnd").attr("class", "marker dependency " + type).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
909
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyStart-margin").attr("class", "marker dependency " + type).attr("refX", 4).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 0).attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
|
|
910
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyEnd-margin").attr("class", "marker dependency " + type).attr("refX", 16).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 0).attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
911
|
+
}, "dependency"),
|
|
912
|
+
lollipop: /* @__PURE__ */ __name((elem, type, id) => {
|
|
913
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopStart").attr("class", "marker lollipop " + type).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("circle").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
|
|
914
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopEnd").attr("class", "marker lollipop " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("circle").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
|
|
915
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopStart-margin").attr("class", "marker lollipop " + type).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("circle").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6).attr("stroke-width", 2);
|
|
916
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopEnd-margin").attr("class", "marker lollipop " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("circle").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6).attr("stroke-width", 2);
|
|
917
|
+
}, "lollipop"),
|
|
918
|
+
point: /* @__PURE__ */ __name((elem, type, id) => {
|
|
919
|
+
elem.append("marker").attr("id", id + "_" + type + "-pointEnd").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
920
|
+
elem.append("marker").attr("id", id + "_" + type + "-pointStart").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
921
|
+
elem.append("marker").attr("id", id + "_" + type + "-pointEnd-margin").attr("class", "marker " + type).attr("viewBox", "0 0 11.5 14").attr("refX", 11.5).attr("refY", 7).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 10.5).attr("markerHeight", 14).attr("orient", "auto").append("path").attr("d", "M 0 0 L 11.5 7 L 0 14 z").attr("class", "arrowMarkerPath").style("stroke-width", 0).style("stroke-dasharray", "1,0");
|
|
922
|
+
elem.append("marker").attr("id", id + "_" + type + "-pointStart-margin").attr("class", "marker " + type).attr("viewBox", "0 0 11.5 14").attr("refX", 1).attr("refY", 7).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11.5).attr("markerHeight", 14).attr("orient", "auto").append("polygon").attr("points", "0,7 11.5,14 11.5,0").attr("class", "arrowMarkerPath").style("stroke-width", 0).style("stroke-dasharray", "1,0");
|
|
923
|
+
}, "point"),
|
|
924
|
+
circle: /* @__PURE__ */ __name((elem, type, id) => {
|
|
925
|
+
elem.append("marker").attr("id", id + "_" + type + "-circleEnd").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
926
|
+
elem.append("marker").attr("id", id + "_" + type + "-circleStart").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
927
|
+
elem.append("marker").attr("id", id + "_" + type + "-circleEnd-margin").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refY", 5).attr("refX", 12.25).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 14).attr("markerHeight", 14).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 0).style("stroke-dasharray", "1,0");
|
|
928
|
+
elem.append("marker").attr("id", id + "_" + type + "-circleStart-margin").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", -2).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 14).attr("markerHeight", 14).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 0).style("stroke-dasharray", "1,0");
|
|
929
|
+
}, "circle"),
|
|
930
|
+
cross: /* @__PURE__ */ __name((elem, type, id) => {
|
|
931
|
+
elem.append("marker").attr("id", id + "_" + type + "-crossEnd").attr("class", "marker cross " + type).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
|
|
932
|
+
elem.append("marker").attr("id", id + "_" + type + "-crossStart").attr("class", "marker cross " + type).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
|
|
933
|
+
elem.append("marker").attr("id", id + "_" + type + "-crossEnd-margin").attr("class", "marker cross " + type).attr("viewBox", "0 0 15 15").attr("refX", 17.7).attr("refY", 7.5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 1,1 L 14,14 M 1,14 L 14,1").attr("class", "arrowMarkerPath").style("stroke-width", 2.5);
|
|
934
|
+
elem.append("marker").attr("id", id + "_" + type + "-crossStart-margin").attr("class", "marker cross " + type).attr("viewBox", "0 0 15 15").attr("refX", -3.5).attr("refY", 7.5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 1,1 L 14,14 M 1,14 L 14,1").attr("class", "arrowMarkerPath").style("stroke-width", 2.5).style("stroke-dasharray", "1,0");
|
|
935
|
+
}, "cross"),
|
|
936
|
+
barb: /* @__PURE__ */ __name((elem, type, id) => {
|
|
937
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
|
|
938
|
+
}, "barb"),
|
|
939
|
+
barbNeo: /* @__PURE__ */ __name((elem, type, id) => {
|
|
940
|
+
const { themeVariables } = getConfig();
|
|
941
|
+
const { transitionColor } = themeVariables;
|
|
942
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L11,14 L13,7 L11,0 Z");
|
|
943
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-barbEnd-margin").attr("refX", 17).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L11,14 L13,7 L11,0 Z").attr("fill", `${transitionColor}`);
|
|
944
|
+
}, "barbNeo"),
|
|
945
|
+
hierarchy: /* @__PURE__ */ __name((elem, type, id) => {
|
|
946
|
+
elem.append("marker").attr("id", id + "_" + type + "-hierarchyEnd").attr("class", "marker hierarchy " + type).attr("viewBox", "0 0 12 10").attr("refX", 10).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 10).attr("orient", "auto").append("path").attr("d", "M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0").style("fill", "none");
|
|
947
|
+
elem.append("marker").attr("id", id + "_" + type + "-hierarchyStart").attr("class", "marker hierarchy " + type).attr("viewBox", "0 0 12 10").attr("refX", 2).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 10).attr("orient", "auto").append("path").attr("d", "M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0").style("fill", "none");
|
|
948
|
+
}, "hierarchy"),
|
|
949
|
+
only_one: /* @__PURE__ */ __name((elem, type, id) => {
|
|
950
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-onlyOneStart").attr("class", "marker onlyOne " + type).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M9,0 L9,18 M15,0 L15,18");
|
|
951
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-onlyOneEnd").attr("class", "marker onlyOne " + type).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M3,0 L3,18 M9,0 L9,18");
|
|
952
|
+
}, "only_one"),
|
|
953
|
+
zero_or_one: /* @__PURE__ */ __name((elem, type, id) => {
|
|
954
|
+
const startMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrOneStart").attr("class", "marker zeroOrOne " + type).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
|
|
955
|
+
startMarker.append("circle").attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6);
|
|
956
|
+
startMarker.append("path").attr("d", "M9,0 L9,18");
|
|
957
|
+
const endMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrOneEnd").attr("class", "marker zeroOrOne " + type).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
|
|
958
|
+
endMarker.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6);
|
|
959
|
+
endMarker.append("path").attr("d", "M21,0 L21,18");
|
|
960
|
+
}, "zero_or_one"),
|
|
961
|
+
one_or_more: /* @__PURE__ */ __name((elem, type, id) => {
|
|
962
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-oneOrMoreStart").attr("class", "marker oneOrMore " + type).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27");
|
|
963
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-oneOrMoreEnd").attr("class", "marker oneOrMore " + type).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18");
|
|
964
|
+
}, "one_or_more"),
|
|
965
|
+
zero_or_more: /* @__PURE__ */ __name((elem, type, id) => {
|
|
966
|
+
const startMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrMoreStart").attr("class", "marker zeroOrMore " + type).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
|
|
967
|
+
startMarker.append("circle").attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6);
|
|
968
|
+
startMarker.append("path").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18");
|
|
969
|
+
const endMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrMoreEnd").attr("class", "marker zeroOrMore " + type).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
|
|
970
|
+
endMarker.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6);
|
|
971
|
+
endMarker.append("path").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
|
|
972
|
+
}, "zero_or_more"),
|
|
973
|
+
only_one_neo: /* @__PURE__ */ __name((elem, type, id) => {
|
|
974
|
+
const { themeVariables } = getConfig();
|
|
975
|
+
const { strokeWidth } = themeVariables;
|
|
976
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-onlyOneStart").attr("class", "marker onlyOne " + type).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M9,0 L9,18 M15,0 L15,18").attr("stroke-width", `${strokeWidth}`);
|
|
977
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-onlyOneEnd").attr("class", "marker onlyOne " + type).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M3,0 L3,18 M9,0 L9,18").attr("stroke-width", `${strokeWidth}`);
|
|
978
|
+
}, "only_one_neo"),
|
|
979
|
+
zero_or_one_neo: /* @__PURE__ */ __name((elem, type, id) => {
|
|
980
|
+
const { themeVariables } = getConfig();
|
|
981
|
+
const { strokeWidth, mainBkg } = themeVariables;
|
|
982
|
+
const startMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrOneStart").attr("class", "marker zeroOrOne " + type).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse");
|
|
983
|
+
startMarker.append("circle").attr("fill", mainBkg ?? "white").attr("cx", 21).attr("cy", 9).attr("stroke-width", `${strokeWidth}`).attr("r", 6);
|
|
984
|
+
startMarker.append("path").attr("d", "M9,0 L9,18").attr("stroke-width", `${strokeWidth}`);
|
|
985
|
+
const endMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrOneEnd").attr("class", "marker zeroOrOne " + type).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto");
|
|
986
|
+
endMarker.append("circle").attr("fill", mainBkg ?? "white").attr("cx", 9).attr("cy", 9).attr("stroke-width", `${strokeWidth}`).attr("r", 6);
|
|
987
|
+
endMarker.append("path").attr("d", "M21,0 L21,18").attr("stroke-width", `${strokeWidth}`);
|
|
988
|
+
}, "zero_or_one_neo"),
|
|
989
|
+
one_or_more_neo: /* @__PURE__ */ __name((elem, type, id) => {
|
|
990
|
+
const { themeVariables } = getConfig();
|
|
991
|
+
const { strokeWidth } = themeVariables;
|
|
992
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-oneOrMoreStart").attr("class", "marker oneOrMore " + type).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width", `${strokeWidth}`);
|
|
993
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-oneOrMoreEnd").attr("class", "marker oneOrMore " + type).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width", `${strokeWidth}`);
|
|
994
|
+
}, "one_or_more_neo"),
|
|
995
|
+
zero_or_more_neo: /* @__PURE__ */ __name((elem, type, id) => {
|
|
996
|
+
const { themeVariables } = getConfig();
|
|
997
|
+
const { strokeWidth, mainBkg } = themeVariables;
|
|
998
|
+
const startMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrMoreStart").attr("class", "marker zeroOrMore " + type).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto");
|
|
999
|
+
startMarker.append("circle").attr("fill", mainBkg ?? "white").attr("cx", 45.5).attr("cy", 18).attr("r", 6).attr("stroke-width", `${strokeWidth}`);
|
|
1000
|
+
startMarker.append("path").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width", `${strokeWidth}`);
|
|
1001
|
+
const endMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrMoreEnd").attr("class", "marker zeroOrMore " + type).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse");
|
|
1002
|
+
endMarker.append("circle").attr("fill", mainBkg ?? "white").attr("cx", 11).attr("cy", 18).attr("r", 6).attr("stroke-width", `${strokeWidth}`);
|
|
1003
|
+
endMarker.append("path").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width", `${strokeWidth}`);
|
|
1004
|
+
}, "zero_or_more_neo"),
|
|
1005
|
+
requirement_arrow: /* @__PURE__ */ __name((elem, type, id) => {
|
|
1006
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-requirement_arrowEnd").attr("refX", 20).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("path").attr("d", `M0,0
|
|
1007
|
+
L20,10
|
|
1008
|
+
M20,10
|
|
1009
|
+
L0,20`);
|
|
1010
|
+
}, "requirement_arrow"),
|
|
1011
|
+
requirement_contains: /* @__PURE__ */ __name((elem, type, id) => {
|
|
1012
|
+
const containsNode = elem.append("defs").append("marker").attr("id", id + "_" + type + "-requirement_containsStart").attr("refX", 0).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("g");
|
|
1013
|
+
containsNode.append("circle").attr("cx", 10).attr("cy", 10).attr("r", 9).attr("fill", "none");
|
|
1014
|
+
containsNode.append("line").attr("x1", 1).attr("x2", 19).attr("y1", 10).attr("y2", 10);
|
|
1015
|
+
containsNode.append("line").attr("y1", 1).attr("y2", 19).attr("x1", 10).attr("x2", 10);
|
|
1016
|
+
}, "requirement_contains"),
|
|
1017
|
+
requirement_arrow_neo: /* @__PURE__ */ __name((elem, type, id) => {
|
|
1018
|
+
const { themeVariables } = getConfig();
|
|
1019
|
+
const { strokeWidth } = themeVariables;
|
|
1020
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-requirement_arrowEnd").attr("refX", 20).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").attr("stroke-width", `${strokeWidth}`).attr("viewBox", "0 0 25 20").append("path").attr("d", `M0,0
|
|
1021
|
+
L20,10
|
|
1022
|
+
M20,10
|
|
1023
|
+
L0,20`).attr("stroke-linejoin", "miter");
|
|
1024
|
+
}, "requirement_arrow_neo"),
|
|
1025
|
+
requirement_contains_neo: /* @__PURE__ */ __name((elem, type, id) => {
|
|
1026
|
+
const { themeVariables } = getConfig();
|
|
1027
|
+
const { strokeWidth } = themeVariables;
|
|
1028
|
+
const containsNode = elem.append("defs").append("marker").attr("id", id + "_" + type + "-requirement_containsStart").attr("refX", 0).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("g");
|
|
1029
|
+
containsNode.append("circle").attr("cx", 10).attr("cy", 10).attr("r", 9).attr("fill", "none");
|
|
1030
|
+
containsNode.append("line").attr("x1", 1).attr("x2", 19).attr("y1", 10).attr("y2", 10);
|
|
1031
|
+
containsNode.append("line").attr("y1", 1).attr("y2", 19).attr("x1", 10).attr("x2", 10);
|
|
1032
|
+
containsNode.selectAll("*").attr("stroke-width", `${strokeWidth}`);
|
|
1033
|
+
}, "requirement_contains_neo")
|
|
1034
|
+
};
|
|
1035
|
+
var markers_default = insertMarkers;
|
|
1036
|
+
|
|
1037
|
+
//#endregion
|
|
1038
|
+
export { insertEdgeLabel as a, markers_default as c, insertEdge as i, positionEdgeLabel as l, edgeLabels as n, markerOffsets as o, hasEdgeLabel as r, markerOffsets2 as s, clear as t, terminalLabels as u };
|