@data_wise/hyper-markdown 1.0.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/LICENSE +201 -0
- package/README.md +201 -0
- package/dist/_basePickBy-CU9zxouA.js +151 -0
- package/dist/_baseUniq-Dfv1esQT.js +614 -0
- package/dist/arc-c3dke9_g.js +83 -0
- package/dist/architecture-U656AL7Q-zgUqrnAb.js +5 -0
- package/dist/architectureDiagram-VXUJARFQ-Dv4YjP5o.js +4665 -0
- package/dist/blockDiagram-VD42YOAC-D98UGbTn.js +2265 -0
- package/dist/c4Diagram-YG6GDRKO-XUzUdD_2.js +1581 -0
- package/dist/channel-C5xtftmJ.js +5 -0
- package/dist/chunk-4BX2VUAB-DEeESiZ5.js +9 -0
- package/dist/chunk-55IACEB6-DHxOGacI.js +8 -0
- package/dist/chunk-B4BG7PRW-8o0v-7qo.js +1376 -0
- package/dist/chunk-DI55MBZ5-DW3vqV--.js +1382 -0
- package/dist/chunk-FMBD7UC4-DDdtUAG0.js +19 -0
- package/dist/chunk-QN33PNHL-CSSbo0QX.js +20 -0
- package/dist/chunk-QZHKN3VN-w9zLiEAG.js +15 -0
- package/dist/chunk-TZMSLE5B-t-rP83k8.js +64 -0
- package/dist/classDiagram-2ON5EDUG-e9sZhnve.js +16 -0
- package/dist/classDiagram-v2-WZHVMYZB-e9sZhnve.js +16 -0
- package/dist/clone-DiTglB0h.js +8 -0
- package/dist/cose-bilkent-S5V4N54A-CWVtemhp.js +2605 -0
- package/dist/cytoscape.esm-ZmItrg9y.js +18731 -0
- package/dist/dagre-6UL2VRFP-MV2ZfZta.js +447 -0
- package/dist/defaultLocale-D7EN2tov.js +171 -0
- package/dist/diagram-PSM6KHXK-5lJpUCK9.js +534 -0
- package/dist/diagram-QEK2KX5R-CNU6jJsS.js +221 -0
- package/dist/diagram-S2PKOQOG-BKjk2v_A.js +143 -0
- package/dist/erDiagram-Q2GNP2WA-BtAVbAYU.js +842 -0
- package/dist/flowDiagram-NV44I4VS-DISVIV3t.js +1627 -0
- package/dist/ganttDiagram-LVOFAZNH-Ddt7ksjd.js +2499 -0
- package/dist/gitGraph-F6HP7TQM-BAIad0GA.js +5 -0
- package/dist/gitGraphDiagram-NY62KEGX-C-l5siHi.js +712 -0
- package/dist/graph-DoqhIGWS.js +247 -0
- package/dist/hyper-markdown.es.js +11 -0
- package/dist/hyper-markdown.umd.js +3180 -0
- package/dist/index-D8q1QLkY.js +139643 -0
- package/dist/info-NVLQJR56-temdJZnQ.js +5 -0
- package/dist/infoDiagram-ER5ION4S-CWrTqrrP.js +24 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/journeyDiagram-XKPGCS4Q-033aYkz7.js +836 -0
- package/dist/kanban-definition-3W4ZIXB7-Dz47qxF_.js +720 -0
- package/dist/katex-dDbcVckU.js +11687 -0
- package/dist/layout-DRpSHON1.js +1335 -0
- package/dist/linear-BO6pDEmK.js +259 -0
- package/dist/mermaid-parser.core-D_tMj5cA.js +12921 -0
- package/dist/mindmap-definition-VGOIOE7T-BsHgjAmS.js +786 -0
- package/dist/ordinal-DfAQgscy.js +61 -0
- package/dist/packet-BFZMPI3H-Bzlf_wLW.js +5 -0
- package/dist/pie-7BOR55EZ-Czidi0ky.js +5 -0
- package/dist/pieDiagram-ADFJNKIX-CSpQeOry.js +161 -0
- package/dist/quadrantDiagram-AYHSOK5B-flM7H9xo.js +1024 -0
- package/dist/radar-NHE76QYJ-D1f__eiC.js +5 -0
- package/dist/requirementDiagram-UZGBJVZJ-1iG0LrwF.js +852 -0
- package/dist/sankeyDiagram-TZEHDZUN-0SClKoX9.js +810 -0
- package/dist/sequenceDiagram-WL72ISMW-Bwbc6j-1.js +2518 -0
- package/dist/stateDiagram-FKZM4ZOC-BuNY3ZqE.js +263 -0
- package/dist/stateDiagram-v2-4FDKWEC3-CB1nMpEc.js +16 -0
- package/dist/style.css +10 -0
- package/dist/timeline-definition-IT6M3QCI-CjFYKVsS.js +801 -0
- package/dist/treemap-KMMF4GRG-Cs8Vv-VD.js +5 -0
- package/dist/xychartDiagram-PRI3JC2R-B6hpuUj2.js +1340 -0
- package/package.json +70 -0
- package/types/index.d.ts +34 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { i as a } from "./init-DjUOC4st.js";
|
|
2
|
+
class o extends Map {
|
|
3
|
+
constructor(n, t = g) {
|
|
4
|
+
if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: t } }), n != null) for (const [r, s] of n) this.set(r, s);
|
|
5
|
+
}
|
|
6
|
+
get(n) {
|
|
7
|
+
return super.get(c(this, n));
|
|
8
|
+
}
|
|
9
|
+
has(n) {
|
|
10
|
+
return super.has(c(this, n));
|
|
11
|
+
}
|
|
12
|
+
set(n, t) {
|
|
13
|
+
return super.set(l(this, n), t);
|
|
14
|
+
}
|
|
15
|
+
delete(n) {
|
|
16
|
+
return super.delete(p(this, n));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function c({ _intern: e, _key: n }, t) {
|
|
20
|
+
const r = n(t);
|
|
21
|
+
return e.has(r) ? e.get(r) : t;
|
|
22
|
+
}
|
|
23
|
+
function l({ _intern: e, _key: n }, t) {
|
|
24
|
+
const r = n(t);
|
|
25
|
+
return e.has(r) ? e.get(r) : (e.set(r, t), t);
|
|
26
|
+
}
|
|
27
|
+
function p({ _intern: e, _key: n }, t) {
|
|
28
|
+
const r = n(t);
|
|
29
|
+
return e.has(r) && (t = e.get(r), e.delete(r)), t;
|
|
30
|
+
}
|
|
31
|
+
function g(e) {
|
|
32
|
+
return e !== null && typeof e == "object" ? e.valueOf() : e;
|
|
33
|
+
}
|
|
34
|
+
const f = Symbol("implicit");
|
|
35
|
+
function h() {
|
|
36
|
+
var e = new o(), n = [], t = [], r = f;
|
|
37
|
+
function s(u) {
|
|
38
|
+
let i = e.get(u);
|
|
39
|
+
if (i === void 0) {
|
|
40
|
+
if (r !== f) return r;
|
|
41
|
+
e.set(u, i = n.push(u) - 1);
|
|
42
|
+
}
|
|
43
|
+
return t[i % t.length];
|
|
44
|
+
}
|
|
45
|
+
return s.domain = function(u) {
|
|
46
|
+
if (!arguments.length) return n.slice();
|
|
47
|
+
n = [], e = new o();
|
|
48
|
+
for (const i of u)
|
|
49
|
+
e.has(i) || e.set(i, n.push(i) - 1);
|
|
50
|
+
return s;
|
|
51
|
+
}, s.range = function(u) {
|
|
52
|
+
return arguments.length ? (t = Array.from(u), s) : t.slice();
|
|
53
|
+
}, s.unknown = function(u) {
|
|
54
|
+
return arguments.length ? (r = u, s) : r;
|
|
55
|
+
}, s.copy = function() {
|
|
56
|
+
return h(n, t).unknown(r);
|
|
57
|
+
}, a.apply(s, arguments), s;
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
h as o
|
|
61
|
+
};
|
|
@@ -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-D8q1QLkY.js";
|
|
2
|
+
import { p as ie } from "./chunk-4BX2VUAB-DEeESiZ5.js";
|
|
3
|
+
import { p as se } from "./mermaid-parser.core-D_tMj5cA.js";
|
|
4
|
+
import { d as I } from "./arc-c3dke9_g.js";
|
|
5
|
+
import { o as le } from "./ordinal-DfAQgscy.js";
|
|
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, g, 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), d;
|
|
16
|
+
for (n = 0; n < c; ++n)
|
|
17
|
+
(d = i[u[n] = n] = +e(t[n], n, t)) > 0 && (m += d);
|
|
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
|
+
g = u[n], d = i[g], h = v + (d > 0 ? d * x : 0) + $, i[g] = {
|
|
24
|
+
data: t[g],
|
|
25
|
+
index: n,
|
|
26
|
+
value: d,
|
|
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, ge = structuredClone(pe), de = /* @__PURE__ */ p(() => structuredClone(ge), "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: de,
|
|
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, g = 450, x = g, m = ee(a), u = m.append("g");
|
|
115
|
+
u.attr("transform", "translate(" + x / 2 + "," + g / 2 + ")");
|
|
116
|
+
const { themeVariables: i } = o;
|
|
117
|
+
let [v] = te(i.pieOuterStrokeWidth);
|
|
118
|
+
v ?? (v = 2);
|
|
119
|
+
const w = l.textPosition, h = Math.min(x, g) / 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 d = s.getSections(), A = De(d), 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
|
+
d.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 = [...d.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 == null ? void 0 : r.getBoundingClientRect().width) ?? 0)
|
|
151
|
+
), P = x + t + n + c + _;
|
|
152
|
+
m.attr("viewBox", `0 0 ${P} ${g}`), ae(m, g, 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
|
+
};
|