@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.
Files changed (93) hide show
  1. package/dist/_basePickBy-BKSBQzQ_.mjs +151 -0
  2. package/dist/_baseUniq-C5o5iO5w.mjs +614 -0
  3. package/dist/arc-CBfSUzPA.mjs +83 -0
  4. package/dist/architecture-U656AL7Q-BnMV_JKl.mjs +5 -0
  5. package/dist/architectureDiagram-VXUJARFQ-D2XPETMC.mjs +4661 -0
  6. package/dist/blockDiagram-VD42YOAC-DUECz_lY.mjs +2261 -0
  7. package/dist/{c4Diagram-c83219d4-DPiPzMng.mjs → c4Diagram-YG6GDRKO-CFmlTOHZ.mjs} +795 -794
  8. package/dist/{channel-DLtPd-ti.mjs → channel-Cn_QU-_B.mjs} +1 -1
  9. package/dist/chunk-4BX2VUAB-Ddlc-PTG.mjs +8 -0
  10. package/dist/chunk-55IACEB6-3bItwaWC.mjs +8 -0
  11. package/dist/chunk-B4BG7PRW-fzrbCD9m.mjs +1375 -0
  12. package/dist/chunk-DI55MBZ5-BsM6MitH.mjs +1370 -0
  13. package/dist/chunk-FMBD7UC4-D0L58RDY.mjs +19 -0
  14. package/dist/chunk-QN33PNHL-BRwIp2MO.mjs +19 -0
  15. package/dist/chunk-QZHKN3VN-3WK04u4j.mjs +15 -0
  16. package/dist/chunk-TZMSLE5B-QppC8KMb.mjs +64 -0
  17. package/dist/classDiagram-2ON5EDUG-DV1NEn5N.mjs +16 -0
  18. package/dist/classDiagram-v2-WZHVMYZB-DV1NEn5N.mjs +16 -0
  19. package/dist/{clone-Bekeo3TW.mjs → clone-BqweF2qi.mjs} +1 -1
  20. package/dist/cose-bilkent-S5V4N54A-v0swiza8.mjs +2608 -0
  21. package/dist/cytoscape.esm-MSgpKP8s.mjs +18721 -0
  22. package/dist/dagre-6UL2VRFP-BAviPdlZ.mjs +444 -0
  23. package/dist/defaultLocale-D7EN2tov.mjs +171 -0
  24. package/dist/diagram-PSM6KHXK-CfFtF0lE.mjs +531 -0
  25. package/dist/diagram-QEK2KX5R-CTU-B7VS.mjs +217 -0
  26. package/dist/diagram-S2PKOQOG-jCY9Tumq.mjs +142 -0
  27. package/dist/erDiagram-Q2GNP2WA-BcKQMz3F.mjs +841 -0
  28. package/dist/flowDiagram-NV44I4VS-udQXA0_8.mjs +1620 -0
  29. package/dist/ganttDiagram-JELNMOA3-Dk5PKr9Z.mjs +2670 -0
  30. package/dist/gitGraph-F6HP7TQM-DkwcvDhk.mjs +5 -0
  31. package/dist/gitGraphDiagram-NY62KEGX-DjJof2Hb.mjs +699 -0
  32. package/dist/graph-D-Tmz5vo.mjs +247 -0
  33. package/dist/{index-C3zgkbpi.mjs → index-CWsdn0Oh.mjs} +35928 -28717
  34. package/dist/index.es.js +4 -4
  35. package/dist/index.umd.js +1884 -1442
  36. package/dist/info-NVLQJR56-TpH_gM4H.mjs +5 -0
  37. package/dist/infoDiagram-WHAUD3N6-DrsD1lMt.mjs +24 -0
  38. package/dist/journeyDiagram-XKPGCS4Q-Cq5Y94aQ.mjs +834 -0
  39. package/dist/kanban-definition-3W4ZIXB7-BEiPA-13.mjs +719 -0
  40. package/dist/layout-QOTssOZa.mjs +1335 -0
  41. package/dist/linear-CCFzTlKw.mjs +259 -0
  42. package/dist/mermaid-parser.core-CSzOHvro.mjs +12966 -0
  43. package/dist/mindmap-definition-VGOIOE7T-ChH1RCzL.mjs +784 -0
  44. package/dist/packet-BFZMPI3H-RY9z3tXt.mjs +5 -0
  45. package/dist/pie-7BOR55EZ-DWSbWhsM.mjs +5 -0
  46. package/dist/pieDiagram-ADFJNKIX-CjvCGMnv.mjs +161 -0
  47. package/dist/quadrantDiagram-AYHSOK5B-yLMChKK1.mjs +1022 -0
  48. package/dist/radar-NHE76QYJ-DxZgeX1m.mjs +5 -0
  49. package/dist/requirementDiagram-UZGBJVZJ-D_Kv5PcV.mjs +850 -0
  50. package/dist/sankeyDiagram-TZEHDZUN-BT4gTtRH.mjs +810 -0
  51. package/dist/sequenceDiagram-WL72ISMW-CcZ0NGLk.mjs +2511 -0
  52. package/dist/stateDiagram-FKZM4ZOC-BpQhvfG2.mjs +263 -0
  53. package/dist/stateDiagram-v2-4FDKWEC3-X4ju2xD3.mjs +16 -0
  54. package/dist/timeline-definition-IT6M3QCI-mIpcHDXS.mjs +795 -0
  55. package/dist/treemap-KMMF4GRG-CTNebVlI.mjs +5 -0
  56. package/dist/{xychartDiagram-f5964ef8-fDv4mp1P.mjs → xychartDiagram-PRI3JC2R-DooouUUZ.mjs} +503 -445
  57. package/package.json +3 -3
  58. package/dist/Tableau10-D7jGxypv.mjs +0 -8
  59. package/dist/arc-DqrMsJeG.mjs +0 -84
  60. package/dist/array-CqVTtuYm.mjs +0 -6
  61. package/dist/blockDiagram-c4efeb88-B7Mcu3H_.mjs +0 -1221
  62. package/dist/classDiagram-beda092f-CRNvkLYf.mjs +0 -218
  63. package/dist/classDiagram-v2-2358418a-CUFy5DGQ.mjs +0 -200
  64. package/dist/createText-1719965b-BEXd6yNU.mjs +0 -2955
  65. package/dist/edges-96097737-CTds2HS2.mjs +0 -1088
  66. package/dist/erDiagram-0228fc6a-DdOqXYmJ.mjs +0 -929
  67. package/dist/flowDb-c6c81e3f-LkwBoeG_.mjs +0 -1126
  68. package/dist/flowDiagram-50d868cf-BlsvSXSO.mjs +0 -788
  69. package/dist/flowDiagram-v2-4f6560a1-KScjGHBx.mjs +0 -17
  70. package/dist/flowchart-elk-definition-6af322e1-mTna7kqR.mjs +0 -48146
  71. package/dist/ganttDiagram-a2739b55-B2o_UW9_.mjs +0 -2477
  72. package/dist/gitGraphDiagram-82fe8481-B6-VRPS0.mjs +0 -1264
  73. package/dist/graph-CSVeLFCJ.mjs +0 -847
  74. package/dist/index-5325376f-DsGv8AO4.mjs +0 -373
  75. package/dist/infoDiagram-8eee0895-Cx7V52QV.mjs +0 -319
  76. package/dist/journeyDiagram-c64418c1-C03IeVHa.mjs +0 -801
  77. package/dist/layout-DfnPfvJm.mjs +0 -1472
  78. package/dist/line-BwAWhs05.mjs +0 -33
  79. package/dist/linear-Ck_Qt8nI.mjs +0 -423
  80. package/dist/mindmap-definition-8da855dc-DdMLbjBy.mjs +0 -21922
  81. package/dist/path-DLwuMfdd.mjs +0 -84
  82. package/dist/pieDiagram-a8764435-BymSofHf.mjs +0 -500
  83. package/dist/quadrantDiagram-1e28029f-BXtW3eHp.mjs +0 -903
  84. package/dist/requirementDiagram-08caed73-DGBKyhE-.mjs +0 -767
  85. package/dist/sankeyDiagram-a04cb91d-BfUYRgG3.mjs +0 -802
  86. package/dist/sequenceDiagram-c5b8d532-Jj_1ttvV.mjs +0 -2234
  87. package/dist/stateDiagram-1ecb1508-CbSM9l6I.mjs +0 -266
  88. package/dist/stateDiagram-v2-c2b004d7-dS2KbqNc.mjs +0 -184
  89. package/dist/styles-b4e223ce-D01XEgS6.mjs +0 -1089
  90. package/dist/styles-ca3715f6-amZyw1GB.mjs +0 -960
  91. package/dist/styles-d45a18b0-GN33fYGn.mjs +0 -436
  92. package/dist/svgDrawCommon-b86b1483-BQvqkIEE.mjs +0 -64
  93. package/dist/timeline-definition-faaaa080-BjbyYT4p.mjs +0 -792
@@ -1,84 +0,0 @@
1
- const c = Math.PI, x = 2 * c, u = 1e-6, m = x - u;
2
- function E(e) {
3
- this._ += e[0];
4
- for (let t = 1, h = e.length; t < h; ++t)
5
- this._ += arguments[t] + e[t];
6
- }
7
- function A(e) {
8
- let t = Math.floor(e);
9
- if (!(t >= 0)) throw new Error(`invalid digits: ${e}`);
10
- if (t > 15) return E;
11
- const h = 10 ** t;
12
- return function(i) {
13
- this._ += i[0];
14
- for (let s = 1, n = i.length; s < n; ++s)
15
- this._ += Math.round(arguments[s] * h) / h + i[s];
16
- };
17
- }
18
- class L {
19
- constructor(t) {
20
- this._x0 = this._y0 = // start of current subpath
21
- this._x1 = this._y1 = null, this._ = "", this._append = t == null ? E : A(t);
22
- }
23
- moveTo(t, h) {
24
- this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +h}`;
25
- }
26
- closePath() {
27
- this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`);
28
- }
29
- lineTo(t, h) {
30
- this._append`L${this._x1 = +t},${this._y1 = +h}`;
31
- }
32
- quadraticCurveTo(t, h, i, s) {
33
- this._append`Q${+t},${+h},${this._x1 = +i},${this._y1 = +s}`;
34
- }
35
- bezierCurveTo(t, h, i, s, n, $) {
36
- this._append`C${+t},${+h},${+i},${+s},${this._x1 = +n},${this._y1 = +$}`;
37
- }
38
- arcTo(t, h, i, s, n) {
39
- if (t = +t, h = +h, i = +i, s = +s, n = +n, n < 0) throw new Error(`negative radius: ${n}`);
40
- let $ = this._x1, r = this._y1, p = i - t, l = s - h, _ = $ - t, o = r - h, a = _ * _ + o * o;
41
- if (this._x1 === null)
42
- this._append`M${this._x1 = t},${this._y1 = h}`;
43
- else if (a > u) if (!(Math.abs(o * p - l * _) > u) || !n)
44
- this._append`L${this._x1 = t},${this._y1 = h}`;
45
- else {
46
- let d = i - $, f = s - r, y = p * p + l * l, T = d * d + f * f, g = Math.sqrt(y), v = Math.sqrt(a), w = n * Math.tan((c - Math.acos((y + a - T) / (2 * g * v))) / 2), M = w / v, b = w / g;
47
- Math.abs(M - 1) > u && this._append`L${t + M * _},${h + M * o}`, this._append`A${n},${n},0,0,${+(o * d > _ * f)},${this._x1 = t + b * p},${this._y1 = h + b * l}`;
48
- }
49
- }
50
- arc(t, h, i, s, n, $) {
51
- if (t = +t, h = +h, i = +i, $ = !!$, i < 0) throw new Error(`negative radius: ${i}`);
52
- let r = i * Math.cos(s), p = i * Math.sin(s), l = t + r, _ = h + p, o = 1 ^ $, a = $ ? s - n : n - s;
53
- this._x1 === null ? this._append`M${l},${_}` : (Math.abs(this._x1 - l) > u || Math.abs(this._y1 - _) > u) && this._append`L${l},${_}`, i && (a < 0 && (a = a % x + x), a > m ? this._append`A${i},${i},0,1,${o},${t - r},${h - p}A${i},${i},0,1,${o},${this._x1 = l},${this._y1 = _}` : a > u && this._append`A${i},${i},0,${+(a >= c)},${o},${this._x1 = t + i * Math.cos(n)},${this._y1 = h + i * Math.sin(n)}`);
54
- }
55
- rect(t, h, i, s) {
56
- this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +h}h${i = +i}v${+s}h${-i}Z`;
57
- }
58
- toString() {
59
- return this._;
60
- }
61
- }
62
- function P(e) {
63
- return function() {
64
- return e;
65
- };
66
- }
67
- function q(e) {
68
- let t = 3;
69
- return e.digits = function(h) {
70
- if (!arguments.length) return t;
71
- if (h == null)
72
- t = null;
73
- else {
74
- const i = Math.floor(h);
75
- if (!(i >= 0)) throw new RangeError(`invalid digits: ${h}`);
76
- t = i;
77
- }
78
- return e;
79
- }, () => new L(t);
80
- }
81
- export {
82
- P as c,
83
- q as w
84
- };
@@ -1,500 +0,0 @@
1
- import { U as H, a as rt, s as at, b as lt, c as ot, C as ct, D as ht, l as et, g as it, V as ut, T as yt, W as ft, e as pt, i as gt, E as dt, X as mt } from "./index-C3zgkbpi.mjs";
2
- import { a as tt } from "./arc-DqrMsJeG.mjs";
3
- import { o as _t } from "./ordinal-C0oynhte.mjs";
4
- import { a as xt } from "./array-CqVTtuYm.mjs";
5
- import { c as F } from "./path-DLwuMfdd.mjs";
6
- function kt(e, u) {
7
- return u < e ? -1 : u > e ? 1 : u >= e ? 0 : NaN;
8
- }
9
- function vt(e) {
10
- return e;
11
- }
12
- function bt() {
13
- var e = vt, u = kt, $ = null, p = F(0), g = F(H), E = F(0);
14
- function y(a) {
15
- var l, d = (a = xt(a)).length, k, I, T = 0, m = new Array(d), v = new Array(d), c = +p.apply(this, arguments), A = Math.min(H, Math.max(-H, g.apply(this, arguments) - c)), O, w = Math.min(Math.abs(A) / d, E.apply(this, arguments)), b = w * (A < 0 ? -1 : 1), t;
16
- for (l = 0; l < d; ++l)
17
- (t = v[m[l] = l] = +e(a[l], l, a)) > 0 && (T += t);
18
- for (u != null ? m.sort(function(i, n) {
19
- return u(v[i], v[n]);
20
- }) : $ != null && m.sort(function(i, n) {
21
- return $(a[i], a[n]);
22
- }), l = 0, I = T ? (A - d * b) / T : 0; l < d; ++l, c = O)
23
- k = m[l], t = v[k], O = c + (t > 0 ? t * I : 0) + b, v[k] = {
24
- data: a[k],
25
- index: l,
26
- value: t,
27
- startAngle: c,
28
- endAngle: O,
29
- padAngle: w
30
- };
31
- return v;
32
- }
33
- return y.value = function(a) {
34
- return arguments.length ? (e = typeof a == "function" ? a : F(+a), y) : e;
35
- }, y.sortValues = function(a) {
36
- return arguments.length ? (u = a, $ = null, y) : u;
37
- }, y.sort = function(a) {
38
- return arguments.length ? ($ = a, u = null, y) : $;
39
- }, y.startAngle = function(a) {
40
- return arguments.length ? (p = typeof a == "function" ? a : F(+a), y) : p;
41
- }, y.endAngle = function(a) {
42
- return arguments.length ? (g = typeof a == "function" ? a : F(+a), y) : g;
43
- }, y.padAngle = function(a) {
44
- return arguments.length ? (E = typeof a == "function" ? a : F(+a), y) : E;
45
- }, y;
46
- }
47
- var J = (function() {
48
- var e = function(b, t, i, n) {
49
- for (i = i || {}, n = b.length; n--; i[b[n]] = t)
50
- ;
51
- return i;
52
- }, u = [1, 3], $ = [1, 4], p = [1, 5], g = [1, 6], E = [1, 10, 12, 14, 16, 18, 19, 20, 21, 22], y = [2, 4], a = [1, 5, 10, 12, 14, 16, 18, 19, 20, 21, 22], l = [20, 21, 22], d = [2, 7], k = [1, 12], I = [1, 13], T = [1, 14], m = [1, 15], v = [1, 16], c = [1, 17], A = {
53
- trace: function() {
54
- },
55
- yy: {},
56
- symbols_: { error: 2, start: 3, eol: 4, PIE: 5, document: 6, showData: 7, line: 8, statement: 9, txt: 10, value: 11, title: 12, title_value: 13, acc_title: 14, acc_title_value: 15, acc_descr: 16, acc_descr_value: 17, acc_descr_multiline_value: 18, section: 19, NEWLINE: 20, ";": 21, EOF: 22, $accept: 0, $end: 1 },
57
- terminals_: { 2: "error", 5: "PIE", 7: "showData", 10: "txt", 11: "value", 12: "title", 13: "title_value", 14: "acc_title", 15: "acc_title_value", 16: "acc_descr", 17: "acc_descr_value", 18: "acc_descr_multiline_value", 19: "section", 20: "NEWLINE", 21: ";", 22: "EOF" },
58
- productions_: [0, [3, 2], [3, 2], [3, 3], [6, 0], [6, 2], [8, 2], [9, 0], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [4, 1], [4, 1], [4, 1]],
59
- performAction: function(t, i, n, r, o, s, V) {
60
- var _ = s.length - 1;
61
- switch (o) {
62
- case 3:
63
- r.setShowData(!0);
64
- break;
65
- case 6:
66
- this.$ = s[_ - 1];
67
- break;
68
- case 8:
69
- r.addSection(s[_ - 1], r.cleanupValue(s[_]));
70
- break;
71
- case 9:
72
- this.$ = s[_].trim(), r.setDiagramTitle(this.$);
73
- break;
74
- case 10:
75
- this.$ = s[_].trim(), r.setAccTitle(this.$);
76
- break;
77
- case 11:
78
- case 12:
79
- this.$ = s[_].trim(), r.setAccDescription(this.$);
80
- break;
81
- case 13:
82
- r.addSection(s[_].substr(8)), this.$ = s[_].substr(8);
83
- break;
84
- }
85
- },
86
- table: [{ 3: 1, 4: 2, 5: u, 20: $, 21: p, 22: g }, { 1: [3] }, { 3: 7, 4: 2, 5: u, 20: $, 21: p, 22: g }, e(E, y, { 6: 8, 7: [1, 9] }), e(a, [2, 14]), e(a, [2, 15]), e(a, [2, 16]), { 1: [2, 1] }, e(l, d, { 8: 10, 9: 11, 1: [2, 2], 10: k, 12: I, 14: T, 16: m, 18: v, 19: c }), e(E, y, { 6: 18 }), e(E, [2, 5]), { 4: 19, 20: $, 21: p, 22: g }, { 11: [1, 20] }, { 13: [1, 21] }, { 15: [1, 22] }, { 17: [1, 23] }, e(l, [2, 12]), e(l, [2, 13]), e(l, d, { 8: 10, 9: 11, 1: [2, 3], 10: k, 12: I, 14: T, 16: m, 18: v, 19: c }), e(E, [2, 6]), e(l, [2, 8]), e(l, [2, 9]), e(l, [2, 10]), e(l, [2, 11])],
87
- defaultActions: { 7: [2, 1] },
88
- parseError: function(t, i) {
89
- if (i.recoverable)
90
- this.trace(t);
91
- else {
92
- var n = new Error(t);
93
- throw n.hash = i, n;
94
- }
95
- },
96
- parse: function(t) {
97
- var i = this, n = [0], r = [], o = [null], s = [], V = this.table, _ = "", f = 0, P = 0, R = 2, M = 1, B = s.slice.call(arguments, 1), h = Object.create(this.lexer), N = { yy: {} };
98
- for (var Y in this.yy)
99
- Object.prototype.hasOwnProperty.call(this.yy, Y) && (N.yy[Y] = this.yy[Y]);
100
- h.setInput(t, N.yy), N.yy.lexer = h, N.yy.parser = this, typeof h.yylloc > "u" && (h.yylloc = {});
101
- var X = h.yylloc;
102
- s.push(X);
103
- var nt = h.options && h.options.ranges;
104
- typeof N.yy.parseError == "function" ? this.parseError = N.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
105
- function st() {
106
- var C;
107
- return C = r.pop() || h.lex() || M, typeof C != "number" && (C instanceof Array && (r = C, C = r.pop()), C = i.symbols_[C] || C), C;
108
- }
109
- for (var x, L, S, Z, z = {}, W, D, Q, j; ; ) {
110
- if (L = n[n.length - 1], this.defaultActions[L] ? S = this.defaultActions[L] : ((x === null || typeof x > "u") && (x = st()), S = V[L] && V[L][x]), typeof S > "u" || !S.length || !S[0]) {
111
- var q = "";
112
- j = [];
113
- for (W in V[L])
114
- this.terminals_[W] && W > R && j.push("'" + this.terminals_[W] + "'");
115
- h.showPosition ? q = "Parse error on line " + (f + 1) + `:
116
- ` + h.showPosition() + `
117
- Expecting ` + j.join(", ") + ", got '" + (this.terminals_[x] || x) + "'" : q = "Parse error on line " + (f + 1) + ": Unexpected " + (x == M ? "end of input" : "'" + (this.terminals_[x] || x) + "'"), this.parseError(q, {
118
- text: h.match,
119
- token: this.terminals_[x] || x,
120
- line: h.yylineno,
121
- loc: X,
122
- expected: j
123
- });
124
- }
125
- if (S[0] instanceof Array && S.length > 1)
126
- throw new Error("Parse Error: multiple actions possible at state: " + L + ", token: " + x);
127
- switch (S[0]) {
128
- case 1:
129
- n.push(x), o.push(h.yytext), s.push(h.yylloc), n.push(S[1]), x = null, P = h.yyleng, _ = h.yytext, f = h.yylineno, X = h.yylloc;
130
- break;
131
- case 2:
132
- if (D = this.productions_[S[1]][1], z.$ = o[o.length - D], z._$ = {
133
- first_line: s[s.length - (D || 1)].first_line,
134
- last_line: s[s.length - 1].last_line,
135
- first_column: s[s.length - (D || 1)].first_column,
136
- last_column: s[s.length - 1].last_column
137
- }, nt && (z._$.range = [
138
- s[s.length - (D || 1)].range[0],
139
- s[s.length - 1].range[1]
140
- ]), Z = this.performAction.apply(z, [
141
- _,
142
- P,
143
- f,
144
- N.yy,
145
- S[1],
146
- o,
147
- s
148
- ].concat(B)), typeof Z < "u")
149
- return Z;
150
- D && (n = n.slice(0, -1 * D * 2), o = o.slice(0, -1 * D), s = s.slice(0, -1 * D)), n.push(this.productions_[S[1]][0]), o.push(z.$), s.push(z._$), Q = V[n[n.length - 2]][n[n.length - 1]], n.push(Q);
151
- break;
152
- case 3:
153
- return !0;
154
- }
155
- }
156
- return !0;
157
- }
158
- }, O = /* @__PURE__ */ (function() {
159
- var b = {
160
- EOF: 1,
161
- parseError: function(i, n) {
162
- if (this.yy.parser)
163
- this.yy.parser.parseError(i, n);
164
- else
165
- throw new Error(i);
166
- },
167
- // resets the lexer, sets new input
168
- setInput: function(t, i) {
169
- return this.yy = i || this.yy || {}, this._input = t, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
170
- first_line: 1,
171
- first_column: 0,
172
- last_line: 1,
173
- last_column: 0
174
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
175
- },
176
- // consumes and returns one char from the input
177
- input: function() {
178
- var t = this._input[0];
179
- this.yytext += t, this.yyleng++, this.offset++, this.match += t, this.matched += t;
180
- var i = t.match(/(?:\r\n?|\n).*/g);
181
- return i ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), t;
182
- },
183
- // unshifts one char (or a string) into the input
184
- unput: function(t) {
185
- var i = t.length, n = t.split(/(?:\r\n?|\n)/g);
186
- this._input = t + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - i), this.offset -= i;
187
- var r = this.match.split(/(?:\r\n?|\n)/g);
188
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
189
- var o = this.yylloc.range;
190
- return this.yylloc = {
191
- first_line: this.yylloc.first_line,
192
- last_line: this.yylineno + 1,
193
- first_column: this.yylloc.first_column,
194
- last_column: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - i
195
- }, this.options.ranges && (this.yylloc.range = [o[0], o[0] + this.yyleng - i]), this.yyleng = this.yytext.length, this;
196
- },
197
- // When called from action, caches matched text and appends it on next action
198
- more: function() {
199
- return this._more = !0, this;
200
- },
201
- // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
202
- reject: function() {
203
- if (this.options.backtrack_lexer)
204
- this._backtrack = !0;
205
- else
206
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
207
- ` + this.showPosition(), {
208
- text: "",
209
- token: null,
210
- line: this.yylineno
211
- });
212
- return this;
213
- },
214
- // retain first n characters of the match
215
- less: function(t) {
216
- this.unput(this.match.slice(t));
217
- },
218
- // displays already matched input, i.e. for error messages
219
- pastInput: function() {
220
- var t = this.matched.substr(0, this.matched.length - this.match.length);
221
- return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, "");
222
- },
223
- // displays upcoming input, i.e. for error messages
224
- upcomingInput: function() {
225
- var t = this.match;
226
- return t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "");
227
- },
228
- // displays the character position where the lexing error occurred, i.e. for error messages
229
- showPosition: function() {
230
- var t = this.pastInput(), i = new Array(t.length + 1).join("-");
231
- return t + this.upcomingInput() + `
232
- ` + i + "^";
233
- },
234
- // test the lexed token: return FALSE when not a match, otherwise return token
235
- test_match: function(t, i) {
236
- var n, r, o;
237
- if (this.options.backtrack_lexer && (o = {
238
- yylineno: this.yylineno,
239
- yylloc: {
240
- first_line: this.yylloc.first_line,
241
- last_line: this.last_line,
242
- first_column: this.yylloc.first_column,
243
- last_column: this.yylloc.last_column
244
- },
245
- yytext: this.yytext,
246
- match: this.match,
247
- matches: this.matches,
248
- matched: this.matched,
249
- yyleng: this.yyleng,
250
- offset: this.offset,
251
- _more: this._more,
252
- _input: this._input,
253
- yy: this.yy,
254
- conditionStack: this.conditionStack.slice(0),
255
- done: this.done
256
- }, this.options.ranges && (o.yylloc.range = this.yylloc.range.slice(0))), r = t[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
257
- first_line: this.yylloc.last_line,
258
- last_line: this.yylineno + 1,
259
- first_column: this.yylloc.last_column,
260
- last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length
261
- }, this.yytext += t[0], this.match += t[0], this.matches = t, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(t[0].length), this.matched += t[0], n = this.performAction.call(this, this.yy, this, i, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n)
262
- return n;
263
- if (this._backtrack) {
264
- for (var s in o)
265
- this[s] = o[s];
266
- return !1;
267
- }
268
- return !1;
269
- },
270
- // return next match in input
271
- next: function() {
272
- if (this.done)
273
- return this.EOF;
274
- this._input || (this.done = !0);
275
- var t, i, n, r;
276
- this._more || (this.yytext = "", this.match = "");
277
- for (var o = this._currentRules(), s = 0; s < o.length; s++)
278
- if (n = this._input.match(this.rules[o[s]]), n && (!i || n[0].length > i[0].length)) {
279
- if (i = n, r = s, this.options.backtrack_lexer) {
280
- if (t = this.test_match(n, o[s]), t !== !1)
281
- return t;
282
- if (this._backtrack) {
283
- i = !1;
284
- continue;
285
- } else
286
- return !1;
287
- } else if (!this.options.flex)
288
- break;
289
- }
290
- return i ? (t = this.test_match(i, o[r]), t !== !1 ? t : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
291
- ` + this.showPosition(), {
292
- text: "",
293
- token: null,
294
- line: this.yylineno
295
- });
296
- },
297
- // return next match that has a token
298
- lex: function() {
299
- var i = this.next();
300
- return i || this.lex();
301
- },
302
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
303
- begin: function(i) {
304
- this.conditionStack.push(i);
305
- },
306
- // pop the previously active lexer condition state off the condition stack
307
- popState: function() {
308
- var i = this.conditionStack.length - 1;
309
- return i > 0 ? this.conditionStack.pop() : this.conditionStack[0];
310
- },
311
- // produce the lexer rule set which is active for the currently active lexer condition state
312
- _currentRules: function() {
313
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
314
- },
315
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
316
- topState: function(i) {
317
- return i = this.conditionStack.length - 1 - Math.abs(i || 0), i >= 0 ? this.conditionStack[i] : "INITIAL";
318
- },
319
- // alias for begin(condition)
320
- pushState: function(i) {
321
- this.begin(i);
322
- },
323
- // return the number of states currently on the stack
324
- stateStackSize: function() {
325
- return this.conditionStack.length;
326
- },
327
- options: { "case-insensitive": !0 },
328
- performAction: function(i, n, r, o) {
329
- switch (r) {
330
- case 0:
331
- break;
332
- case 1:
333
- break;
334
- case 2:
335
- return 20;
336
- case 3:
337
- break;
338
- case 4:
339
- break;
340
- case 5:
341
- return this.begin("title"), 12;
342
- case 6:
343
- return this.popState(), "title_value";
344
- case 7:
345
- return this.begin("acc_title"), 14;
346
- case 8:
347
- return this.popState(), "acc_title_value";
348
- case 9:
349
- return this.begin("acc_descr"), 16;
350
- case 10:
351
- return this.popState(), "acc_descr_value";
352
- case 11:
353
- this.begin("acc_descr_multiline");
354
- break;
355
- case 12:
356
- this.popState();
357
- break;
358
- case 13:
359
- return "acc_descr_multiline_value";
360
- case 14:
361
- this.begin("string");
362
- break;
363
- case 15:
364
- this.popState();
365
- break;
366
- case 16:
367
- return "txt";
368
- case 17:
369
- return 5;
370
- case 18:
371
- return 7;
372
- case 19:
373
- return "value";
374
- case 20:
375
- return 22;
376
- }
377
- },
378
- rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:[\s]+)/i, /^(?:title\b)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:pie\b)/i, /^(?:showData\b)/i, /^(?::[\s]*[\d]+(?:\.[\d]+)?)/i, /^(?:$)/i],
379
- conditions: { acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, title: { rules: [6], inclusive: !1 }, string: { rules: [15, 16], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 7, 9, 11, 14, 17, 18, 19, 20], inclusive: !0 } }
380
- };
381
- return b;
382
- })();
383
- A.lexer = O;
384
- function w() {
385
- this.yy = {};
386
- }
387
- return w.prototype = A, A.Parser = w, new w();
388
- })();
389
- J.parser = J;
390
- const St = J, $t = mt.pie, G = {
391
- sections: {},
392
- showData: !1
393
- };
394
- let U = G.sections, K = G.showData;
395
- const Et = structuredClone($t), At = () => structuredClone(Et), wt = () => {
396
- U = structuredClone(G.sections), K = G.showData, dt();
397
- }, Tt = (e, u) => {
398
- e = gt(e, it()), U[e] === void 0 && (U[e] = u, et.debug(`added new section: ${e}, with value: ${u}`));
399
- }, It = () => U, Dt = (e) => (e.substring(0, 1) === ":" && (e = e.substring(1).trim()), Number(e.trim())), Ct = (e) => {
400
- K = e;
401
- }, Ot = () => K, Vt = {
402
- getConfig: At,
403
- clear: wt,
404
- setDiagramTitle: ht,
405
- getDiagramTitle: ct,
406
- setAccTitle: ot,
407
- getAccTitle: lt,
408
- setAccDescription: at,
409
- getAccDescription: rt,
410
- addSection: Tt,
411
- getSections: It,
412
- cleanupValue: Dt,
413
- setShowData: Ct,
414
- getShowData: Ot
415
- }, Pt = (e) => `
416
- .pieCircle{
417
- stroke: ${e.pieStrokeColor};
418
- stroke-width : ${e.pieStrokeWidth};
419
- opacity : ${e.pieOpacity};
420
- }
421
- .pieOuterCircle{
422
- stroke: ${e.pieOuterStrokeColor};
423
- stroke-width: ${e.pieOuterStrokeWidth};
424
- fill: none;
425
- }
426
- .pieTitleText {
427
- text-anchor: middle;
428
- font-size: ${e.pieTitleTextSize};
429
- fill: ${e.pieTitleTextColor};
430
- font-family: ${e.fontFamily};
431
- }
432
- .slice {
433
- font-family: ${e.fontFamily};
434
- fill: ${e.pieSectionTextColor};
435
- font-size:${e.pieSectionTextSize};
436
- // fill: white;
437
- }
438
- .legend text {
439
- fill: ${e.pieLegendTextColor};
440
- font-family: ${e.fontFamily};
441
- font-size: ${e.pieLegendTextSize};
442
- }
443
- `, Nt = Pt, Lt = (e) => {
444
- const u = Object.entries(e).map((p) => ({
445
- label: p[0],
446
- value: p[1]
447
- })).sort((p, g) => g.value - p.value);
448
- return bt().value(
449
- (p) => p.value
450
- )(u);
451
- }, Ft = (e, u, $, p) => {
452
- et.debug(`rendering pie chart
453
- ` + e);
454
- const g = p.db, E = it(), y = ut(g.getConfig(), E.pie), a = 40, l = 18, d = 4, k = 450, I = k, T = yt(u), m = T.append("g"), v = g.getSections();
455
- m.attr("transform", "translate(" + I / 2 + "," + k / 2 + ")");
456
- const { themeVariables: c } = E;
457
- let [A] = ft(c.pieOuterStrokeWidth);
458
- A ?? (A = 2);
459
- const O = y.textPosition, w = Math.min(I, k) / 2 - a, b = tt().innerRadius(0).outerRadius(w), t = tt().innerRadius(w * O).outerRadius(w * O);
460
- m.append("circle").attr("cx", 0).attr("cy", 0).attr("r", w + A / 2).attr("class", "pieOuterCircle");
461
- const i = Lt(v), n = [
462
- c.pie1,
463
- c.pie2,
464
- c.pie3,
465
- c.pie4,
466
- c.pie5,
467
- c.pie6,
468
- c.pie7,
469
- c.pie8,
470
- c.pie9,
471
- c.pie10,
472
- c.pie11,
473
- c.pie12
474
- ], r = _t(n);
475
- m.selectAll("mySlices").data(i).enter().append("path").attr("d", b).attr("fill", (f) => r(f.data.label)).attr("class", "pieCircle");
476
- let o = 0;
477
- Object.keys(v).forEach((f) => {
478
- o += v[f];
479
- }), m.selectAll("mySlices").data(i).enter().append("text").text((f) => (f.data.value / o * 100).toFixed(0) + "%").attr("transform", (f) => "translate(" + t.centroid(f) + ")").style("text-anchor", "middle").attr("class", "slice"), m.append("text").text(g.getDiagramTitle()).attr("x", 0).attr("y", -400 / 2).attr("class", "pieTitleText");
480
- const s = m.selectAll(".legend").data(r.domain()).enter().append("g").attr("class", "legend").attr("transform", (f, P) => {
481
- const R = l + d, M = R * r.domain().length / 2, B = 12 * l, h = P * R - M;
482
- return "translate(" + B + "," + h + ")";
483
- });
484
- s.append("rect").attr("width", l).attr("height", l).style("fill", r).style("stroke", r), s.data(i).append("text").attr("x", l + d).attr("y", l - d).text((f) => {
485
- const { label: P, value: R } = f.data;
486
- return g.getShowData() ? `${P} [${R}]` : P;
487
- });
488
- const V = Math.max(
489
- ...s.selectAll("text").nodes().map((f) => f?.getBoundingClientRect().width ?? 0)
490
- ), _ = I + a + l + d + V;
491
- T.attr("viewBox", `0 0 ${_} ${k}`), pt(T, k, _, y.useMaxWidth);
492
- }, Rt = { draw: Ft }, Ut = {
493
- parser: St,
494
- db: Vt,
495
- renderer: Rt,
496
- styles: Nt
497
- };
498
- export {
499
- Ut as diagram
500
- };