@zjlab-frontier/markdown 1.2.6 → 1.2.8
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-BKSBQzQ_.mjs +151 -0
- package/dist/_baseUniq-C5o5iO5w.mjs +614 -0
- package/dist/arc-CBfSUzPA.mjs +83 -0
- package/dist/architecture-U656AL7Q-BnMV_JKl.mjs +5 -0
- package/dist/architectureDiagram-VXUJARFQ-D2XPETMC.mjs +4661 -0
- package/dist/blockDiagram-VD42YOAC-DUECz_lY.mjs +2261 -0
- package/dist/{c4Diagram-c83219d4-DPiPzMng.mjs → c4Diagram-YG6GDRKO-CFmlTOHZ.mjs} +795 -794
- package/dist/{channel-DLtPd-ti.mjs → channel-Cn_QU-_B.mjs} +1 -1
- package/dist/chunk-4BX2VUAB-Ddlc-PTG.mjs +8 -0
- package/dist/chunk-55IACEB6-3bItwaWC.mjs +8 -0
- package/dist/chunk-B4BG7PRW-fzrbCD9m.mjs +1375 -0
- package/dist/chunk-DI55MBZ5-BsM6MitH.mjs +1370 -0
- package/dist/chunk-FMBD7UC4-D0L58RDY.mjs +19 -0
- package/dist/chunk-QN33PNHL-BRwIp2MO.mjs +19 -0
- package/dist/chunk-QZHKN3VN-3WK04u4j.mjs +15 -0
- package/dist/chunk-TZMSLE5B-QppC8KMb.mjs +64 -0
- package/dist/classDiagram-2ON5EDUG-DV1NEn5N.mjs +16 -0
- package/dist/classDiagram-v2-WZHVMYZB-DV1NEn5N.mjs +16 -0
- package/dist/{clone-Bekeo3TW.mjs → clone-BqweF2qi.mjs} +1 -1
- package/dist/cose-bilkent-S5V4N54A-v0swiza8.mjs +2608 -0
- package/dist/cytoscape.esm-MSgpKP8s.mjs +18721 -0
- package/dist/dagre-6UL2VRFP-BAviPdlZ.mjs +444 -0
- package/dist/defaultLocale-D7EN2tov.mjs +171 -0
- package/dist/diagram-PSM6KHXK-CfFtF0lE.mjs +531 -0
- package/dist/diagram-QEK2KX5R-CTU-B7VS.mjs +217 -0
- package/dist/diagram-S2PKOQOG-jCY9Tumq.mjs +142 -0
- package/dist/erDiagram-Q2GNP2WA-BcKQMz3F.mjs +841 -0
- package/dist/flowDiagram-NV44I4VS-udQXA0_8.mjs +1620 -0
- package/dist/ganttDiagram-JELNMOA3-Dk5PKr9Z.mjs +2670 -0
- package/dist/gitGraph-F6HP7TQM-DkwcvDhk.mjs +5 -0
- package/dist/gitGraphDiagram-NY62KEGX-DjJof2Hb.mjs +699 -0
- package/dist/graph-D-Tmz5vo.mjs +247 -0
- package/dist/{index-C3zgkbpi.mjs → index-CWsdn0Oh.mjs} +35928 -28717
- package/dist/index.es.js +4 -4
- package/dist/index.umd.js +1884 -1442
- package/dist/info-NVLQJR56-TpH_gM4H.mjs +5 -0
- package/dist/infoDiagram-WHAUD3N6-DrsD1lMt.mjs +24 -0
- package/dist/journeyDiagram-XKPGCS4Q-Cq5Y94aQ.mjs +834 -0
- package/dist/kanban-definition-3W4ZIXB7-BEiPA-13.mjs +719 -0
- package/dist/layout-QOTssOZa.mjs +1335 -0
- package/dist/linear-CCFzTlKw.mjs +259 -0
- package/dist/mermaid-parser.core-CSzOHvro.mjs +12966 -0
- package/dist/mindmap-definition-VGOIOE7T-ChH1RCzL.mjs +784 -0
- package/dist/packet-BFZMPI3H-RY9z3tXt.mjs +5 -0
- package/dist/pie-7BOR55EZ-DWSbWhsM.mjs +5 -0
- package/dist/pieDiagram-ADFJNKIX-CjvCGMnv.mjs +161 -0
- package/dist/quadrantDiagram-AYHSOK5B-yLMChKK1.mjs +1022 -0
- package/dist/radar-NHE76QYJ-DxZgeX1m.mjs +5 -0
- package/dist/requirementDiagram-UZGBJVZJ-D_Kv5PcV.mjs +850 -0
- package/dist/sankeyDiagram-TZEHDZUN-BT4gTtRH.mjs +810 -0
- package/dist/sequenceDiagram-WL72ISMW-CcZ0NGLk.mjs +2511 -0
- package/dist/stateDiagram-FKZM4ZOC-BpQhvfG2.mjs +263 -0
- package/dist/stateDiagram-v2-4FDKWEC3-X4ju2xD3.mjs +16 -0
- package/dist/timeline-definition-IT6M3QCI-mIpcHDXS.mjs +795 -0
- package/dist/treemap-KMMF4GRG-CTNebVlI.mjs +5 -0
- package/dist/{xychartDiagram-f5964ef8-fDv4mp1P.mjs → xychartDiagram-PRI3JC2R-DooouUUZ.mjs} +503 -445
- package/package.json +3 -3
- package/dist/Tableau10-D7jGxypv.mjs +0 -8
- package/dist/arc-DqrMsJeG.mjs +0 -84
- package/dist/array-CqVTtuYm.mjs +0 -6
- package/dist/blockDiagram-c4efeb88-B7Mcu3H_.mjs +0 -1221
- package/dist/classDiagram-beda092f-CRNvkLYf.mjs +0 -218
- package/dist/classDiagram-v2-2358418a-CUFy5DGQ.mjs +0 -200
- package/dist/createText-1719965b-BEXd6yNU.mjs +0 -2955
- package/dist/edges-96097737-CTds2HS2.mjs +0 -1088
- package/dist/erDiagram-0228fc6a-DdOqXYmJ.mjs +0 -929
- package/dist/flowDb-c6c81e3f-LkwBoeG_.mjs +0 -1126
- package/dist/flowDiagram-50d868cf-BlsvSXSO.mjs +0 -788
- package/dist/flowDiagram-v2-4f6560a1-KScjGHBx.mjs +0 -17
- package/dist/flowchart-elk-definition-6af322e1-mTna7kqR.mjs +0 -48146
- package/dist/ganttDiagram-a2739b55-B2o_UW9_.mjs +0 -2477
- package/dist/gitGraphDiagram-82fe8481-B6-VRPS0.mjs +0 -1264
- package/dist/graph-CSVeLFCJ.mjs +0 -847
- package/dist/index-5325376f-DsGv8AO4.mjs +0 -373
- package/dist/infoDiagram-8eee0895-Cx7V52QV.mjs +0 -319
- package/dist/journeyDiagram-c64418c1-C03IeVHa.mjs +0 -801
- package/dist/layout-DfnPfvJm.mjs +0 -1472
- package/dist/line-BwAWhs05.mjs +0 -33
- package/dist/linear-Ck_Qt8nI.mjs +0 -423
- package/dist/mindmap-definition-8da855dc-DdMLbjBy.mjs +0 -21922
- package/dist/path-DLwuMfdd.mjs +0 -84
- package/dist/pieDiagram-a8764435-BymSofHf.mjs +0 -500
- package/dist/quadrantDiagram-1e28029f-BXtW3eHp.mjs +0 -903
- package/dist/requirementDiagram-08caed73-DGBKyhE-.mjs +0 -767
- package/dist/sankeyDiagram-a04cb91d-BfUYRgG3.mjs +0 -802
- package/dist/sequenceDiagram-c5b8d532-Jj_1ttvV.mjs +0 -2234
- package/dist/stateDiagram-1ecb1508-CbSM9l6I.mjs +0 -266
- package/dist/stateDiagram-v2-c2b004d7-dS2KbqNc.mjs +0 -184
- package/dist/styles-b4e223ce-D01XEgS6.mjs +0 -1089
- package/dist/styles-ca3715f6-amZyw1GB.mjs +0 -960
- package/dist/styles-d45a18b0-GN33fYGn.mjs +0 -436
- package/dist/svgDrawCommon-b86b1483-BQvqkIEE.mjs +0 -64
- package/dist/timeline-definition-faaaa080-BjbyYT4p.mjs +0 -792
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { a8 as S, a3 as F, aG as j, _ as p, g as q, s as H, a as Z, b as J, q as K, p as Q, l as z, c as X, D as Y, H as ee, N as te, e as ae, y as re, F as ne } from "./index-CWsdn0Oh.mjs";
|
|
2
|
+
import { p as ie } from "./chunk-4BX2VUAB-Ddlc-PTG.mjs";
|
|
3
|
+
import { p as se } from "./mermaid-parser.core-CSzOHvro.mjs";
|
|
4
|
+
import { d as I } from "./arc-CBfSUzPA.mjs";
|
|
5
|
+
import { o as le } from "./ordinal-C0oynhte.mjs";
|
|
6
|
+
function oe(e, a) {
|
|
7
|
+
return a < e ? -1 : a > e ? 1 : a >= e ? 0 : NaN;
|
|
8
|
+
}
|
|
9
|
+
function ce(e) {
|
|
10
|
+
return e;
|
|
11
|
+
}
|
|
12
|
+
function ue() {
|
|
13
|
+
var e = ce, a = oe, f = null, y = S(0), s = S(F), o = S(0);
|
|
14
|
+
function l(t) {
|
|
15
|
+
var n, c = (t = j(t)).length, d, x, m = 0, u = new Array(c), i = new Array(c), v = +y.apply(this, arguments), w = Math.min(F, Math.max(-F, s.apply(this, arguments) - v)), h, C = Math.min(Math.abs(w) / c, o.apply(this, arguments)), $ = C * (w < 0 ? -1 : 1), g;
|
|
16
|
+
for (n = 0; n < c; ++n)
|
|
17
|
+
(g = i[u[n] = n] = +e(t[n], n, t)) > 0 && (m += g);
|
|
18
|
+
for (a != null ? u.sort(function(A, D) {
|
|
19
|
+
return a(i[A], i[D]);
|
|
20
|
+
}) : f != null && u.sort(function(A, D) {
|
|
21
|
+
return f(t[A], t[D]);
|
|
22
|
+
}), n = 0, x = m ? (w - c * $) / m : 0; n < c; ++n, v = h)
|
|
23
|
+
d = u[n], g = i[d], h = v + (g > 0 ? g * x : 0) + $, i[d] = {
|
|
24
|
+
data: t[d],
|
|
25
|
+
index: n,
|
|
26
|
+
value: g,
|
|
27
|
+
startAngle: v,
|
|
28
|
+
endAngle: h,
|
|
29
|
+
padAngle: C
|
|
30
|
+
};
|
|
31
|
+
return i;
|
|
32
|
+
}
|
|
33
|
+
return l.value = function(t) {
|
|
34
|
+
return arguments.length ? (e = typeof t == "function" ? t : S(+t), l) : e;
|
|
35
|
+
}, l.sortValues = function(t) {
|
|
36
|
+
return arguments.length ? (a = t, f = null, l) : a;
|
|
37
|
+
}, l.sort = function(t) {
|
|
38
|
+
return arguments.length ? (f = t, a = null, l) : f;
|
|
39
|
+
}, l.startAngle = function(t) {
|
|
40
|
+
return arguments.length ? (y = typeof t == "function" ? t : S(+t), l) : y;
|
|
41
|
+
}, l.endAngle = function(t) {
|
|
42
|
+
return arguments.length ? (s = typeof t == "function" ? t : S(+t), l) : s;
|
|
43
|
+
}, l.padAngle = function(t) {
|
|
44
|
+
return arguments.length ? (o = typeof t == "function" ? t : S(+t), l) : o;
|
|
45
|
+
}, l;
|
|
46
|
+
}
|
|
47
|
+
var pe = ne.pie, G = {
|
|
48
|
+
sections: /* @__PURE__ */ new Map(),
|
|
49
|
+
showData: !1
|
|
50
|
+
}, T = G.sections, N = G.showData, de = structuredClone(pe), ge = /* @__PURE__ */ p(() => structuredClone(de), "getConfig"), fe = /* @__PURE__ */ p(() => {
|
|
51
|
+
T = /* @__PURE__ */ new Map(), N = G.showData, re();
|
|
52
|
+
}, "clear"), he = /* @__PURE__ */ p(({ label: e, value: a }) => {
|
|
53
|
+
if (a < 0)
|
|
54
|
+
throw new Error(
|
|
55
|
+
`"${e}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`
|
|
56
|
+
);
|
|
57
|
+
T.has(e) || (T.set(e, a), z.debug(`added new section: ${e}, with value: ${a}`));
|
|
58
|
+
}, "addSection"), me = /* @__PURE__ */ p(() => T, "getSections"), ve = /* @__PURE__ */ p((e) => {
|
|
59
|
+
N = e;
|
|
60
|
+
}, "setShowData"), Se = /* @__PURE__ */ p(() => N, "getShowData"), L = {
|
|
61
|
+
getConfig: ge,
|
|
62
|
+
clear: fe,
|
|
63
|
+
setDiagramTitle: Q,
|
|
64
|
+
getDiagramTitle: K,
|
|
65
|
+
setAccTitle: J,
|
|
66
|
+
getAccTitle: Z,
|
|
67
|
+
setAccDescription: H,
|
|
68
|
+
getAccDescription: q,
|
|
69
|
+
addSection: he,
|
|
70
|
+
getSections: me,
|
|
71
|
+
setShowData: ve,
|
|
72
|
+
getShowData: Se
|
|
73
|
+
}, ye = /* @__PURE__ */ p((e, a) => {
|
|
74
|
+
ie(e, a), a.setShowData(e.showData), e.sections.map(a.addSection);
|
|
75
|
+
}, "populateDb"), xe = {
|
|
76
|
+
parse: /* @__PURE__ */ p(async (e) => {
|
|
77
|
+
const a = await se("pie", e);
|
|
78
|
+
z.debug(a), ye(a, L);
|
|
79
|
+
}, "parse")
|
|
80
|
+
}, we = /* @__PURE__ */ p((e) => `
|
|
81
|
+
.pieCircle{
|
|
82
|
+
stroke: ${e.pieStrokeColor};
|
|
83
|
+
stroke-width : ${e.pieStrokeWidth};
|
|
84
|
+
opacity : ${e.pieOpacity};
|
|
85
|
+
}
|
|
86
|
+
.pieOuterCircle{
|
|
87
|
+
stroke: ${e.pieOuterStrokeColor};
|
|
88
|
+
stroke-width: ${e.pieOuterStrokeWidth};
|
|
89
|
+
fill: none;
|
|
90
|
+
}
|
|
91
|
+
.pieTitleText {
|
|
92
|
+
text-anchor: middle;
|
|
93
|
+
font-size: ${e.pieTitleTextSize};
|
|
94
|
+
fill: ${e.pieTitleTextColor};
|
|
95
|
+
font-family: ${e.fontFamily};
|
|
96
|
+
}
|
|
97
|
+
.slice {
|
|
98
|
+
font-family: ${e.fontFamily};
|
|
99
|
+
fill: ${e.pieSectionTextColor};
|
|
100
|
+
font-size:${e.pieSectionTextSize};
|
|
101
|
+
// fill: white;
|
|
102
|
+
}
|
|
103
|
+
.legend text {
|
|
104
|
+
fill: ${e.pieLegendTextColor};
|
|
105
|
+
font-family: ${e.fontFamily};
|
|
106
|
+
font-size: ${e.pieLegendTextSize};
|
|
107
|
+
}
|
|
108
|
+
`, "getStyles"), Ae = we, De = /* @__PURE__ */ p((e) => {
|
|
109
|
+
const a = [...e.values()].reduce((s, o) => s + o, 0), f = [...e.entries()].map(([s, o]) => ({ label: s, value: o })).filter((s) => s.value / a * 100 >= 1).sort((s, o) => o.value - s.value);
|
|
110
|
+
return ue().value((s) => s.value)(f);
|
|
111
|
+
}, "createPieArcs"), Ce = /* @__PURE__ */ p((e, a, f, y) => {
|
|
112
|
+
z.debug(`rendering pie chart
|
|
113
|
+
` + e);
|
|
114
|
+
const s = y.db, o = X(), l = Y(s.getConfig(), o.pie), t = 40, n = 18, c = 4, d = 450, x = d, m = ee(a), u = m.append("g");
|
|
115
|
+
u.attr("transform", "translate(" + x / 2 + "," + d / 2 + ")");
|
|
116
|
+
const { themeVariables: i } = o;
|
|
117
|
+
let [v] = te(i.pieOuterStrokeWidth);
|
|
118
|
+
v ??= 2;
|
|
119
|
+
const w = l.textPosition, h = Math.min(x, d) / 2 - t, C = I().innerRadius(0).outerRadius(h), $ = I().innerRadius(h * w).outerRadius(h * w);
|
|
120
|
+
u.append("circle").attr("cx", 0).attr("cy", 0).attr("r", h + v / 2).attr("class", "pieOuterCircle");
|
|
121
|
+
const g = s.getSections(), A = De(g), D = [
|
|
122
|
+
i.pie1,
|
|
123
|
+
i.pie2,
|
|
124
|
+
i.pie3,
|
|
125
|
+
i.pie4,
|
|
126
|
+
i.pie5,
|
|
127
|
+
i.pie6,
|
|
128
|
+
i.pie7,
|
|
129
|
+
i.pie8,
|
|
130
|
+
i.pie9,
|
|
131
|
+
i.pie10,
|
|
132
|
+
i.pie11,
|
|
133
|
+
i.pie12
|
|
134
|
+
];
|
|
135
|
+
let b = 0;
|
|
136
|
+
g.forEach((r) => {
|
|
137
|
+
b += r;
|
|
138
|
+
});
|
|
139
|
+
const W = A.filter((r) => (r.data.value / b * 100).toFixed(0) !== "0"), E = le(D);
|
|
140
|
+
u.selectAll("mySlices").data(W).enter().append("path").attr("d", C).attr("fill", (r) => E(r.data.label)).attr("class", "pieCircle"), u.selectAll("mySlices").data(W).enter().append("text").text((r) => (r.data.value / b * 100).toFixed(0) + "%").attr("transform", (r) => "translate(" + $.centroid(r) + ")").style("text-anchor", "middle").attr("class", "slice"), u.append("text").text(s.getDiagramTitle()).attr("x", 0).attr("y", -400 / 2).attr("class", "pieTitleText");
|
|
141
|
+
const O = [...g.entries()].map(([r, M]) => ({
|
|
142
|
+
label: r,
|
|
143
|
+
value: M
|
|
144
|
+
})), k = u.selectAll(".legend").data(O).enter().append("g").attr("class", "legend").attr("transform", (r, M) => {
|
|
145
|
+
const R = n + c, B = R * O.length / 2, V = 12 * n, U = M * R - B;
|
|
146
|
+
return "translate(" + V + "," + U + ")";
|
|
147
|
+
});
|
|
148
|
+
k.append("rect").attr("width", n).attr("height", n).style("fill", (r) => E(r.label)).style("stroke", (r) => E(r.label)), k.append("text").attr("x", n + c).attr("y", n - c).text((r) => s.getShowData() ? `${r.label} [${r.value}]` : r.label);
|
|
149
|
+
const _ = Math.max(
|
|
150
|
+
...k.selectAll("text").nodes().map((r) => r?.getBoundingClientRect().width ?? 0)
|
|
151
|
+
), P = x + t + n + c + _;
|
|
152
|
+
m.attr("viewBox", `0 0 ${P} ${d}`), ae(m, d, P, l.useMaxWidth);
|
|
153
|
+
}, "draw"), $e = { draw: Ce }, Fe = {
|
|
154
|
+
parser: xe,
|
|
155
|
+
db: L,
|
|
156
|
+
renderer: $e,
|
|
157
|
+
styles: Ae
|
|
158
|
+
};
|
|
159
|
+
export {
|
|
160
|
+
Fe as diagram
|
|
161
|
+
};
|