@zjlab-frontier/markdown 1.2.5 → 1.2.7
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/_basePickBy-CWu8v0ko.mjs +151 -0
- package/dist/_baseUniq-BYBDg8So.mjs +614 -0
- package/dist/arc-2_S8ohSf.mjs +83 -0
- package/dist/architecture-U656AL7Q-DGKLYZ_K.mjs +5 -0
- package/dist/architectureDiagram-VXUJARFQ-CiE3U1mu.mjs +4661 -0
- package/dist/blockDiagram-VD42YOAC-CsZjZOPb.mjs +2261 -0
- package/dist/{c4Diagram-c83219d4-C9K6bQ9I.mjs → c4Diagram-YG6GDRKO-1xvcuQft.mjs} +795 -794
- package/dist/{channel-D78LrwNC.mjs → channel-DcbfLn-q.mjs} +1 -1
- package/dist/chunk-4BX2VUAB-BDp4Xs60.mjs +8 -0
- package/dist/chunk-55IACEB6-CTW8J150.mjs +8 -0
- package/dist/chunk-B4BG7PRW-B_heTEEq.mjs +1375 -0
- package/dist/chunk-DI55MBZ5-DhjTVH-t.mjs +1370 -0
- package/dist/chunk-FMBD7UC4-ClbSERVz.mjs +19 -0
- package/dist/chunk-QN33PNHL-BKK9fOrS.mjs +19 -0
- package/dist/chunk-QZHKN3VN-BJGNV1ga.mjs +15 -0
- package/dist/chunk-TZMSLE5B-CGED95dA.mjs +64 -0
- package/dist/classDiagram-2ON5EDUG-B940_szE.mjs +16 -0
- package/dist/classDiagram-v2-WZHVMYZB-B940_szE.mjs +16 -0
- package/dist/{clone-DTaSrs1K.mjs → clone-DCtolUVn.mjs} +1 -1
- package/dist/cose-bilkent-S5V4N54A-BYen7Ep1.mjs +2608 -0
- package/dist/cytoscape.esm-MSgpKP8s.mjs +18721 -0
- package/dist/dagre-6UL2VRFP-iIFq-NoW.mjs +444 -0
- package/dist/defaultLocale-D7EN2tov.mjs +171 -0
- package/dist/diagram-PSM6KHXK-Dy7h44b4.mjs +531 -0
- package/dist/diagram-QEK2KX5R-C94F1gFy.mjs +217 -0
- package/dist/diagram-S2PKOQOG-yhlmdZS2.mjs +142 -0
- package/dist/erDiagram-Q2GNP2WA-BpLUZP7_.mjs +841 -0
- package/dist/flowDiagram-NV44I4VS-SLzktk7G.mjs +1620 -0
- package/dist/ganttDiagram-JELNMOA3-DeGgQKGo.mjs +2670 -0
- package/dist/gitGraph-F6HP7TQM-BMUVRqib.mjs +5 -0
- package/dist/gitGraphDiagram-NY62KEGX-CAg0nU-l.mjs +699 -0
- package/dist/graph-D3huRaLs.mjs +247 -0
- package/dist/{index-BqMI8xYQ.mjs → index-BrxkOr3k.mjs} +35919 -28721
- package/dist/index.es.js +4 -4
- package/dist/index.umd.js +1884 -1442
- package/dist/info-NVLQJR56-B7-uUvSf.mjs +5 -0
- package/dist/infoDiagram-WHAUD3N6-CvBpxqLi.mjs +24 -0
- package/dist/journeyDiagram-XKPGCS4Q-DuCbTsAr.mjs +834 -0
- package/dist/kanban-definition-3W4ZIXB7-DvIE5yxA.mjs +719 -0
- package/dist/layout-DxYqTZ5R.mjs +1335 -0
- package/dist/linear-Ft07C63i.mjs +259 -0
- package/dist/markdown.d.ts +3 -6
- package/dist/mermaid-parser.core-D4YfUPNI.mjs +12966 -0
- package/dist/mindmap-definition-VGOIOE7T-urZ0HI-X.mjs +784 -0
- package/dist/packet-BFZMPI3H-ByWPr9-O.mjs +5 -0
- package/dist/pie-7BOR55EZ-B4RcaSOO.mjs +5 -0
- package/dist/pieDiagram-ADFJNKIX-ieTD_ZLt.mjs +161 -0
- package/dist/quadrantDiagram-AYHSOK5B-CA5Lp1fr.mjs +1022 -0
- package/dist/radar-NHE76QYJ-xjkuc7ne.mjs +5 -0
- package/dist/requirementDiagram-UZGBJVZJ-dsQFkWyE.mjs +850 -0
- package/dist/sankeyDiagram-TZEHDZUN-BbxCMN2Y.mjs +810 -0
- package/dist/sequenceDiagram-WL72ISMW-DXuguRyg.mjs +2511 -0
- package/dist/stateDiagram-FKZM4ZOC-Df7YOK3T.mjs +263 -0
- package/dist/stateDiagram-v2-4FDKWEC3-D8vtVcSe.mjs +16 -0
- package/dist/timeline-definition-IT6M3QCI-BECtudMW.mjs +795 -0
- package/dist/treemap-KMMF4GRG-Whla94QX.mjs +5 -0
- package/dist/{xychartDiagram-f5964ef8-CW6jA0Nt.mjs → xychartDiagram-PRI3JC2R-Vnmd1h04.mjs} +503 -445
- package/package.json +3 -3
- package/dist/Tableau10-D7jGxypv.mjs +0 -8
- package/dist/arc-CP3svFB8.mjs +0 -84
- package/dist/array-CqVTtuYm.mjs +0 -6
- package/dist/blockDiagram-c4efeb88-4NVD4LaE.mjs +0 -1221
- package/dist/classDiagram-beda092f-Dsj9YDh9.mjs +0 -218
- package/dist/classDiagram-v2-2358418a-B6I0OSmI.mjs +0 -200
- package/dist/createText-1719965b-CoaKkLy-.mjs +0 -2955
- package/dist/edges-96097737-Dd8HYq0D.mjs +0 -1088
- package/dist/erDiagram-0228fc6a-pAkxmK4a.mjs +0 -929
- package/dist/flowDb-c6c81e3f-BjKRlxie.mjs +0 -1126
- package/dist/flowDiagram-50d868cf-CKxGU02W.mjs +0 -788
- package/dist/flowDiagram-v2-4f6560a1-CnoMWeXO.mjs +0 -17
- package/dist/flowchart-elk-definition-6af322e1-BZD0dDGP.mjs +0 -48146
- package/dist/ganttDiagram-a2739b55-CRorchsD.mjs +0 -2477
- package/dist/gitGraphDiagram-82fe8481-Cymt6QVM.mjs +0 -1264
- package/dist/graph-PkwPfVNG.mjs +0 -847
- package/dist/index-5325376f-DZkWeHco.mjs +0 -373
- package/dist/infoDiagram-8eee0895-CvC19e9K.mjs +0 -319
- package/dist/journeyDiagram-c64418c1-CkqlDqM2.mjs +0 -801
- package/dist/layout-DJG11mrF.mjs +0 -1472
- package/dist/line-CO-DhGRr.mjs +0 -33
- package/dist/linear-JFQBUd8q.mjs +0 -423
- package/dist/mindmap-definition-8da855dc-B-QmBciE.mjs +0 -21922
- package/dist/path-DLwuMfdd.mjs +0 -84
- package/dist/pieDiagram-a8764435-BBzodiLy.mjs +0 -500
- package/dist/quadrantDiagram-1e28029f-8h3jdyxV.mjs +0 -903
- package/dist/requirementDiagram-08caed73-Dqh4s_7c.mjs +0 -767
- package/dist/sankeyDiagram-a04cb91d--jfrAKSY.mjs +0 -802
- package/dist/sequenceDiagram-c5b8d532-DHJT6ITm.mjs +0 -2234
- package/dist/stateDiagram-1ecb1508-BWLFQq_E.mjs +0 -266
- package/dist/stateDiagram-v2-c2b004d7-CnHxd5ys.mjs +0 -184
- package/dist/styles-b4e223ce-BMvSm8Xc.mjs +0 -1089
- package/dist/styles-ca3715f6-CZd-uM_s.mjs +0 -960
- package/dist/styles-d45a18b0-Djl4Hn18.mjs +0 -436
- package/dist/svgDrawCommon-b86b1483-CGt4V7sp.mjs +0 -64
- package/dist/timeline-definition-faaaa080-CzynWXY8.mjs +0 -792
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { s as G, d as S, p as A } from "./styles-b4e223ce-BMvSm8Xc.mjs";
|
|
2
|
-
import { g as v, l as y, d as B, e as W, F as $, B as M, G as I } from "./index-BqMI8xYQ.mjs";
|
|
3
|
-
import { G as O } from "./graph-PkwPfVNG.mjs";
|
|
4
|
-
import { l as P } from "./layout-DJG11mrF.mjs";
|
|
5
|
-
import { l as X } from "./line-CO-DhGRr.mjs";
|
|
6
|
-
let H = 0;
|
|
7
|
-
const Y = function(i, a, t, o, p) {
|
|
8
|
-
const g = function(e) {
|
|
9
|
-
switch (e) {
|
|
10
|
-
case p.db.relationType.AGGREGATION:
|
|
11
|
-
return "aggregation";
|
|
12
|
-
case p.db.relationType.EXTENSION:
|
|
13
|
-
return "extension";
|
|
14
|
-
case p.db.relationType.COMPOSITION:
|
|
15
|
-
return "composition";
|
|
16
|
-
case p.db.relationType.DEPENDENCY:
|
|
17
|
-
return "dependency";
|
|
18
|
-
case p.db.relationType.LOLLIPOP:
|
|
19
|
-
return "lollipop";
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
a.points = a.points.filter((e) => !Number.isNaN(e.y));
|
|
23
|
-
const s = a.points, c = X().x(function(e) {
|
|
24
|
-
return e.x;
|
|
25
|
-
}).y(function(e) {
|
|
26
|
-
return e.y;
|
|
27
|
-
}).curve($), n = i.append("path").attr("d", c(s)).attr("id", "edge" + H).attr("class", "relation");
|
|
28
|
-
let r = "";
|
|
29
|
-
o.arrowMarkerAbsolute && (r = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, r = r.replace(/\(/g, "\\("), r = r.replace(/\)/g, "\\)")), t.relation.lineType == 1 && n.attr("class", "relation dashed-line"), t.relation.lineType == 10 && n.attr("class", "relation dotted-line"), t.relation.type1 !== "none" && n.attr(
|
|
30
|
-
"marker-start",
|
|
31
|
-
"url(" + r + "#" + g(t.relation.type1) + "Start)"
|
|
32
|
-
), t.relation.type2 !== "none" && n.attr(
|
|
33
|
-
"marker-end",
|
|
34
|
-
"url(" + r + "#" + g(t.relation.type2) + "End)"
|
|
35
|
-
);
|
|
36
|
-
let f, h;
|
|
37
|
-
const x = a.points.length;
|
|
38
|
-
let b = M.calcLabelPosition(a.points);
|
|
39
|
-
f = b.x, h = b.y;
|
|
40
|
-
let u, m, w, k;
|
|
41
|
-
if (x % 2 !== 0 && x > 1) {
|
|
42
|
-
let e = M.calcCardinalityPosition(
|
|
43
|
-
t.relation.type1 !== "none",
|
|
44
|
-
a.points,
|
|
45
|
-
a.points[0]
|
|
46
|
-
), d = M.calcCardinalityPosition(
|
|
47
|
-
t.relation.type2 !== "none",
|
|
48
|
-
a.points,
|
|
49
|
-
a.points[x - 1]
|
|
50
|
-
);
|
|
51
|
-
y.debug("cardinality_1_point " + JSON.stringify(e)), y.debug("cardinality_2_point " + JSON.stringify(d)), u = e.x, m = e.y, w = d.x, k = d.y;
|
|
52
|
-
}
|
|
53
|
-
if (t.title !== void 0) {
|
|
54
|
-
const e = i.append("g").attr("class", "classLabel"), d = e.append("text").attr("class", "label").attr("x", f).attr("y", h).attr("fill", "red").attr("text-anchor", "middle").text(t.title);
|
|
55
|
-
window.label = d;
|
|
56
|
-
const l = d.node().getBBox();
|
|
57
|
-
e.insert("rect", ":first-child").attr("class", "box").attr("x", l.x - o.padding / 2).attr("y", l.y - o.padding / 2).attr("width", l.width + o.padding).attr("height", l.height + o.padding);
|
|
58
|
-
}
|
|
59
|
-
y.info("Rendering relation " + JSON.stringify(t)), t.relationTitle1 !== void 0 && t.relationTitle1 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type1").attr("x", u).attr("y", m).attr("fill", "black").attr("font-size", "6").text(t.relationTitle1), t.relationTitle2 !== void 0 && t.relationTitle2 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type2").attr("x", w).attr("y", k).attr("fill", "black").attr("font-size", "6").text(t.relationTitle2), H++;
|
|
60
|
-
}, J = function(i, a, t, o) {
|
|
61
|
-
y.debug("Rendering class ", a, t);
|
|
62
|
-
const p = a.id, g = {
|
|
63
|
-
id: p,
|
|
64
|
-
label: a.id,
|
|
65
|
-
width: 0,
|
|
66
|
-
height: 0
|
|
67
|
-
}, s = i.append("g").attr("id", o.db.lookUpDomId(p)).attr("class", "classGroup");
|
|
68
|
-
let c;
|
|
69
|
-
a.link ? c = s.append("svg:a").attr("xlink:href", a.link).attr("target", a.linkTarget).append("text").attr("y", t.textHeight + t.padding).attr("x", 0) : c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
|
|
70
|
-
let n = !0;
|
|
71
|
-
a.annotations.forEach(function(d) {
|
|
72
|
-
const l = c.append("tspan").text("«" + d + "»");
|
|
73
|
-
n || l.attr("dy", t.textHeight), n = !1;
|
|
74
|
-
});
|
|
75
|
-
let r = C(a);
|
|
76
|
-
const f = c.append("tspan").text(r).attr("class", "title");
|
|
77
|
-
n || f.attr("dy", t.textHeight);
|
|
78
|
-
const h = c.node().getBBox().height;
|
|
79
|
-
let x, b, u;
|
|
80
|
-
if (a.members.length > 0) {
|
|
81
|
-
x = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin / 2).attr("y2", t.padding + h + t.dividerMargin / 2);
|
|
82
|
-
const d = s.append("text").attr("x", t.padding).attr("y", h + t.dividerMargin + t.textHeight).attr("fill", "white").attr("class", "classText");
|
|
83
|
-
n = !0, a.members.forEach(function(l) {
|
|
84
|
-
_(d, l, n, t), n = !1;
|
|
85
|
-
}), b = d.node().getBBox();
|
|
86
|
-
}
|
|
87
|
-
if (a.methods.length > 0) {
|
|
88
|
-
u = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin + b.height).attr("y2", t.padding + h + t.dividerMargin + b.height);
|
|
89
|
-
const d = s.append("text").attr("x", t.padding).attr("y", h + 2 * t.dividerMargin + b.height + t.textHeight).attr("fill", "white").attr("class", "classText");
|
|
90
|
-
n = !0, a.methods.forEach(function(l) {
|
|
91
|
-
_(d, l, n, t), n = !1;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
const m = s.node().getBBox();
|
|
95
|
-
var w = " ";
|
|
96
|
-
a.cssClasses.length > 0 && (w = w + a.cssClasses.join(" "));
|
|
97
|
-
const e = s.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", m.width + 2 * t.padding).attr("height", m.height + t.padding + 0.5 * t.dividerMargin).attr("class", w).node().getBBox().width;
|
|
98
|
-
return c.node().childNodes.forEach(function(d) {
|
|
99
|
-
d.setAttribute("x", (e - d.getBBox().width) / 2);
|
|
100
|
-
}), a.tooltip && c.insert("title").text(a.tooltip), x && x.attr("x2", e), u && u.attr("x2", e), g.width = e, g.height = m.height + t.padding + 0.5 * t.dividerMargin, g;
|
|
101
|
-
}, C = function(i) {
|
|
102
|
-
let a = i.id;
|
|
103
|
-
return i.type && (a += "<" + I(i.type) + ">"), a;
|
|
104
|
-
}, Z = function(i, a, t, o) {
|
|
105
|
-
y.debug("Rendering note ", a, t);
|
|
106
|
-
const p = a.id, g = {
|
|
107
|
-
id: p,
|
|
108
|
-
text: a.text,
|
|
109
|
-
width: 0,
|
|
110
|
-
height: 0
|
|
111
|
-
}, s = i.append("g").attr("id", p).attr("class", "classGroup");
|
|
112
|
-
let c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
|
|
113
|
-
const n = JSON.parse(`"${a.text}"`).split(`
|
|
114
|
-
`);
|
|
115
|
-
n.forEach(function(x) {
|
|
116
|
-
y.debug(`Adding line: ${x}`), c.append("tspan").text(x).attr("class", "title").attr("dy", t.textHeight);
|
|
117
|
-
});
|
|
118
|
-
const r = s.node().getBBox(), h = s.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", r.width + 2 * t.padding).attr(
|
|
119
|
-
"height",
|
|
120
|
-
r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin
|
|
121
|
-
).node().getBBox().width;
|
|
122
|
-
return c.node().childNodes.forEach(function(x) {
|
|
123
|
-
x.setAttribute("x", (h - x.getBBox().width) / 2);
|
|
124
|
-
}), g.width = h, g.height = r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin, g;
|
|
125
|
-
}, _ = function(i, a, t, o) {
|
|
126
|
-
const { displayText: p, cssStyle: g } = a.getDisplayDetails(), s = i.append("tspan").attr("x", o.padding).text(p);
|
|
127
|
-
g !== "" && s.attr("style", a.cssStyle), t || s.attr("dy", o.textHeight);
|
|
128
|
-
}, N = {
|
|
129
|
-
getClassTitleString: C,
|
|
130
|
-
drawClass: J,
|
|
131
|
-
drawEdge: Y,
|
|
132
|
-
drawNote: Z
|
|
133
|
-
};
|
|
134
|
-
let T = {};
|
|
135
|
-
const E = 20, L = function(i) {
|
|
136
|
-
const a = Object.entries(T).find((t) => t[1].label === i);
|
|
137
|
-
if (a)
|
|
138
|
-
return a[0];
|
|
139
|
-
}, R = function(i) {
|
|
140
|
-
i.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), i.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"), i.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
141
|
-
}, F = function(i, a, t, o) {
|
|
142
|
-
const p = v().class;
|
|
143
|
-
T = {}, y.info("Rendering diagram " + i);
|
|
144
|
-
const g = v().securityLevel;
|
|
145
|
-
let s;
|
|
146
|
-
g === "sandbox" && (s = B("#i" + a));
|
|
147
|
-
const c = g === "sandbox" ? B(s.nodes()[0].contentDocument.body) : B("body"), n = c.select(`[id='${a}']`);
|
|
148
|
-
R(n);
|
|
149
|
-
const r = new O({
|
|
150
|
-
multigraph: !0
|
|
151
|
-
});
|
|
152
|
-
r.setGraph({
|
|
153
|
-
isMultiGraph: !0
|
|
154
|
-
}), r.setDefaultEdgeLabel(function() {
|
|
155
|
-
return {};
|
|
156
|
-
});
|
|
157
|
-
const f = o.db.getClasses(), h = Object.keys(f);
|
|
158
|
-
for (const e of h) {
|
|
159
|
-
const d = f[e], l = N.drawClass(n, d, p, o);
|
|
160
|
-
T[l.id] = l, r.setNode(l.id, l), y.info("Org height: " + l.height);
|
|
161
|
-
}
|
|
162
|
-
o.db.getRelations().forEach(function(e) {
|
|
163
|
-
y.info(
|
|
164
|
-
// cspell:ignore tjoho
|
|
165
|
-
"tjoho" + L(e.id1) + L(e.id2) + JSON.stringify(e)
|
|
166
|
-
), r.setEdge(
|
|
167
|
-
L(e.id1),
|
|
168
|
-
L(e.id2),
|
|
169
|
-
{
|
|
170
|
-
relation: e
|
|
171
|
-
},
|
|
172
|
-
e.title || "DEFAULT"
|
|
173
|
-
);
|
|
174
|
-
}), o.db.getNotes().forEach(function(e) {
|
|
175
|
-
y.debug(`Adding note: ${JSON.stringify(e)}`);
|
|
176
|
-
const d = N.drawNote(n, e, p, o);
|
|
177
|
-
T[d.id] = d, r.setNode(d.id, d), e.class && e.class in f && r.setEdge(
|
|
178
|
-
e.id,
|
|
179
|
-
L(e.class),
|
|
180
|
-
{
|
|
181
|
-
relation: {
|
|
182
|
-
id1: e.id,
|
|
183
|
-
id2: e.class,
|
|
184
|
-
relation: {
|
|
185
|
-
type1: "none",
|
|
186
|
-
type2: "none",
|
|
187
|
-
lineType: 10
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
"DEFAULT"
|
|
192
|
-
);
|
|
193
|
-
}), P(r), r.nodes().forEach(function(e) {
|
|
194
|
-
e !== void 0 && r.node(e) !== void 0 && (y.debug("Node " + e + ": " + JSON.stringify(r.node(e))), c.select("#" + (o.db.lookUpDomId(e) || e)).attr(
|
|
195
|
-
"transform",
|
|
196
|
-
"translate(" + (r.node(e).x - r.node(e).width / 2) + "," + (r.node(e).y - r.node(e).height / 2) + " )"
|
|
197
|
-
));
|
|
198
|
-
}), r.edges().forEach(function(e) {
|
|
199
|
-
e !== void 0 && r.edge(e) !== void 0 && (y.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(r.edge(e))), N.drawEdge(n, r.edge(e), r.edge(e).relation, p, o));
|
|
200
|
-
});
|
|
201
|
-
const u = n.node().getBBox(), m = u.width + E * 2, w = u.height + E * 2;
|
|
202
|
-
W(n, w, m, p.useMaxWidth);
|
|
203
|
-
const k = `${u.x - E} ${u.y - E} ${m} ${w}`;
|
|
204
|
-
y.debug(`viewBox ${k}`), n.attr("viewBox", k);
|
|
205
|
-
}, U = {
|
|
206
|
-
draw: F
|
|
207
|
-
}, D = {
|
|
208
|
-
parser: A,
|
|
209
|
-
db: S,
|
|
210
|
-
renderer: U,
|
|
211
|
-
styles: G,
|
|
212
|
-
init: (i) => {
|
|
213
|
-
i.class || (i.class = {}), i.class.arrowMarkerAbsolute = i.arrowMarkerAbsolute, S.clear();
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
export {
|
|
217
|
-
D as diagram
|
|
218
|
-
};
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import { s as M, d as _, p as B } from "./styles-b4e223ce-BMvSm8Xc.mjs";
|
|
2
|
-
import { l as d, g as c, d as w, B as R, o as G, k as D, p as E, q as C, n as A } from "./index-BqMI8xYQ.mjs";
|
|
3
|
-
import { G as q } from "./graph-PkwPfVNG.mjs";
|
|
4
|
-
import { r as z } from "./index-5325376f-DZkWeHco.mjs";
|
|
5
|
-
import "./layout-DJG11mrF.mjs";
|
|
6
|
-
const S = (s) => D.sanitizeText(s, c());
|
|
7
|
-
let k = {
|
|
8
|
-
dividerMargin: 10,
|
|
9
|
-
padding: 5,
|
|
10
|
-
textHeight: 10,
|
|
11
|
-
curve: void 0
|
|
12
|
-
};
|
|
13
|
-
const P = function(s, t, y, a) {
|
|
14
|
-
const e = Object.keys(s);
|
|
15
|
-
d.info("keys:", e), d.info(s), e.forEach(function(i) {
|
|
16
|
-
var o, r;
|
|
17
|
-
const l = s[i], p = {
|
|
18
|
-
shape: "rect",
|
|
19
|
-
id: l.id,
|
|
20
|
-
domId: l.domId,
|
|
21
|
-
labelText: S(l.id),
|
|
22
|
-
labelStyle: "",
|
|
23
|
-
style: "fill: none; stroke: black",
|
|
24
|
-
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
25
|
-
padding: ((o = c().flowchart) == null ? void 0 : o.padding) ?? ((r = c().class) == null ? void 0 : r.padding)
|
|
26
|
-
};
|
|
27
|
-
t.setNode(l.id, p), $(l.classes, t, y, a, l.id), d.info("setNode", p);
|
|
28
|
-
});
|
|
29
|
-
}, $ = function(s, t, y, a, e) {
|
|
30
|
-
const i = Object.keys(s);
|
|
31
|
-
d.info("keys:", i), d.info(s), i.filter((o) => s[o].parent == e).forEach(function(o) {
|
|
32
|
-
var r, l;
|
|
33
|
-
const n = s[o], p = n.cssClasses.join(" "), f = E(n.styles), h = n.label ?? n.id, u = 0, b = {
|
|
34
|
-
labelStyle: f.labelStyle,
|
|
35
|
-
shape: "class_box",
|
|
36
|
-
labelText: S(h),
|
|
37
|
-
classData: n,
|
|
38
|
-
rx: u,
|
|
39
|
-
ry: u,
|
|
40
|
-
class: p,
|
|
41
|
-
style: f.style,
|
|
42
|
-
id: n.id,
|
|
43
|
-
domId: n.domId,
|
|
44
|
-
tooltip: a.db.getTooltip(n.id, e) || "",
|
|
45
|
-
haveCallback: n.haveCallback,
|
|
46
|
-
link: n.link,
|
|
47
|
-
width: n.type === "group" ? 500 : void 0,
|
|
48
|
-
type: n.type,
|
|
49
|
-
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
50
|
-
padding: ((r = c().flowchart) == null ? void 0 : r.padding) ?? ((l = c().class) == null ? void 0 : l.padding)
|
|
51
|
-
};
|
|
52
|
-
t.setNode(n.id, b), e && t.setParent(n.id, e), d.info("setNode", b);
|
|
53
|
-
});
|
|
54
|
-
}, F = function(s, t, y, a) {
|
|
55
|
-
d.info(s), s.forEach(function(e, i) {
|
|
56
|
-
var o, r;
|
|
57
|
-
const l = e, n = "", p = { labelStyle: "", style: "" }, f = l.text, h = 0, v = {
|
|
58
|
-
labelStyle: p.labelStyle,
|
|
59
|
-
shape: "note",
|
|
60
|
-
labelText: S(f),
|
|
61
|
-
noteData: l,
|
|
62
|
-
rx: h,
|
|
63
|
-
ry: h,
|
|
64
|
-
class: n,
|
|
65
|
-
style: p.style,
|
|
66
|
-
id: l.id,
|
|
67
|
-
domId: l.id,
|
|
68
|
-
tooltip: "",
|
|
69
|
-
type: "note",
|
|
70
|
-
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
71
|
-
padding: ((o = c().flowchart) == null ? void 0 : o.padding) ?? ((r = c().class) == null ? void 0 : r.padding)
|
|
72
|
-
};
|
|
73
|
-
if (t.setNode(l.id, v), d.info("setNode", v), !l.class || !(l.class in a))
|
|
74
|
-
return;
|
|
75
|
-
const b = y + i, x = {
|
|
76
|
-
id: `edgeNote${b}`,
|
|
77
|
-
//Set relationship style and line type
|
|
78
|
-
classes: "relation",
|
|
79
|
-
pattern: "dotted",
|
|
80
|
-
// Set link type for rendering
|
|
81
|
-
arrowhead: "none",
|
|
82
|
-
//Set edge extra labels
|
|
83
|
-
startLabelRight: "",
|
|
84
|
-
endLabelLeft: "",
|
|
85
|
-
//Set relation arrow types
|
|
86
|
-
arrowTypeStart: "none",
|
|
87
|
-
arrowTypeEnd: "none",
|
|
88
|
-
style: "fill:none",
|
|
89
|
-
labelStyle: "",
|
|
90
|
-
curve: C(k.curve, A)
|
|
91
|
-
};
|
|
92
|
-
t.setEdge(l.id, l.class, x, b);
|
|
93
|
-
});
|
|
94
|
-
}, H = function(s, t) {
|
|
95
|
-
const y = c().flowchart;
|
|
96
|
-
let a = 0;
|
|
97
|
-
s.forEach(function(e) {
|
|
98
|
-
var i;
|
|
99
|
-
a++;
|
|
100
|
-
const o = {
|
|
101
|
-
//Set relationship style and line type
|
|
102
|
-
classes: "relation",
|
|
103
|
-
pattern: e.relation.lineType == 1 ? "dashed" : "solid",
|
|
104
|
-
id: `id_${e.id1}_${e.id2}_${a}`,
|
|
105
|
-
// Set link type for rendering
|
|
106
|
-
arrowhead: e.type === "arrow_open" ? "none" : "normal",
|
|
107
|
-
//Set edge extra labels
|
|
108
|
-
startLabelRight: e.relationTitle1 === "none" ? "" : e.relationTitle1,
|
|
109
|
-
endLabelLeft: e.relationTitle2 === "none" ? "" : e.relationTitle2,
|
|
110
|
-
//Set relation arrow types
|
|
111
|
-
arrowTypeStart: N(e.relation.type1),
|
|
112
|
-
arrowTypeEnd: N(e.relation.type2),
|
|
113
|
-
style: "fill:none",
|
|
114
|
-
labelStyle: "",
|
|
115
|
-
curve: C(y?.curve, A)
|
|
116
|
-
};
|
|
117
|
-
if (d.info(o, e), e.style !== void 0) {
|
|
118
|
-
const r = E(e.style);
|
|
119
|
-
o.style = r.style, o.labelStyle = r.labelStyle;
|
|
120
|
-
}
|
|
121
|
-
e.text = e.title, e.text === void 0 ? e.style !== void 0 && (o.arrowheadStyle = "fill: #333") : (o.arrowheadStyle = "fill: #333", o.labelpos = "c", ((i = c().flowchart) == null ? void 0 : i.htmlLabels) ?? c().htmlLabels ? (o.labelType = "html", o.label = '<span class="edgeLabel">' + e.text + "</span>") : (o.labelType = "text", o.label = e.text.replace(D.lineBreakRegex, `
|
|
122
|
-
`), e.style === void 0 && (o.style = o.style || "stroke: #333; stroke-width: 1.5px;fill:none"), o.labelStyle = o.labelStyle.replace("color:", "fill:"))), t.setEdge(e.id1, e.id2, o, a);
|
|
123
|
-
});
|
|
124
|
-
}, V = function(s) {
|
|
125
|
-
k = {
|
|
126
|
-
...k,
|
|
127
|
-
...s
|
|
128
|
-
};
|
|
129
|
-
}, W = async function(s, t, y, a) {
|
|
130
|
-
d.info("Drawing class - ", t);
|
|
131
|
-
const e = c().flowchart ?? c().class, i = c().securityLevel;
|
|
132
|
-
d.info("config:", e);
|
|
133
|
-
const o = e?.nodeSpacing ?? 50, r = e?.rankSpacing ?? 50, l = new q({
|
|
134
|
-
multigraph: !0,
|
|
135
|
-
compound: !0
|
|
136
|
-
}).setGraph({
|
|
137
|
-
rankdir: a.db.getDirection(),
|
|
138
|
-
nodesep: o,
|
|
139
|
-
ranksep: r,
|
|
140
|
-
marginx: 8,
|
|
141
|
-
marginy: 8
|
|
142
|
-
}).setDefaultEdgeLabel(function() {
|
|
143
|
-
return {};
|
|
144
|
-
}), n = a.db.getNamespaces(), p = a.db.getClasses(), f = a.db.getRelations(), h = a.db.getNotes();
|
|
145
|
-
d.info(f), P(n, l, t, a), $(p, l, t, a), H(f, l), F(h, l, f.length + 1, p);
|
|
146
|
-
let u;
|
|
147
|
-
i === "sandbox" && (u = w("#i" + t));
|
|
148
|
-
const v = i === "sandbox" ? w(u.nodes()[0].contentDocument.body) : w("body"), b = v.select(`[id="${t}"]`), x = v.select("#" + t + " g");
|
|
149
|
-
if (await z(
|
|
150
|
-
x,
|
|
151
|
-
l,
|
|
152
|
-
["aggregation", "extension", "composition", "dependency", "lollipop"],
|
|
153
|
-
"classDiagram",
|
|
154
|
-
t
|
|
155
|
-
), R.insertTitle(b, "classTitleText", e?.titleTopMargin ?? 5, a.db.getDiagramTitle()), G(l, b, e?.diagramPadding, e?.useMaxWidth), !e?.htmlLabels) {
|
|
156
|
-
const T = i === "sandbox" ? u.nodes()[0].contentDocument : document, I = T.querySelectorAll('[id="' + t + '"] .edgeLabel .label');
|
|
157
|
-
for (const g of I) {
|
|
158
|
-
const L = g.getBBox(), m = T.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
159
|
-
m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width", L.width), m.setAttribute("height", L.height), g.insertBefore(m, g.firstChild);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
function N(s) {
|
|
164
|
-
let t;
|
|
165
|
-
switch (s) {
|
|
166
|
-
case 0:
|
|
167
|
-
t = "aggregation";
|
|
168
|
-
break;
|
|
169
|
-
case 1:
|
|
170
|
-
t = "extension";
|
|
171
|
-
break;
|
|
172
|
-
case 2:
|
|
173
|
-
t = "composition";
|
|
174
|
-
break;
|
|
175
|
-
case 3:
|
|
176
|
-
t = "dependency";
|
|
177
|
-
break;
|
|
178
|
-
case 4:
|
|
179
|
-
t = "lollipop";
|
|
180
|
-
break;
|
|
181
|
-
default:
|
|
182
|
-
t = "none";
|
|
183
|
-
}
|
|
184
|
-
return t;
|
|
185
|
-
}
|
|
186
|
-
const J = {
|
|
187
|
-
setConf: V,
|
|
188
|
-
draw: W
|
|
189
|
-
}, Z = {
|
|
190
|
-
parser: B,
|
|
191
|
-
db: _,
|
|
192
|
-
renderer: J,
|
|
193
|
-
styles: M,
|
|
194
|
-
init: (s) => {
|
|
195
|
-
s.class || (s.class = {}), s.class.arrowMarkerAbsolute = s.arrowMarkerAbsolute, _.clear();
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
export {
|
|
199
|
-
Z as diagram
|
|
200
|
-
};
|