@sourcegraph/amp 0.0.1749585689-g82b91d → 0.0.1749600114-g5c00b8
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/amp.js +3 -3
- package/dist/architectureDiagram-RWNHDUBN-1v8WgxdD.js +4635 -0
- package/dist/blockDiagram-XZSR5OGQ-XFBYN-jB.js +2243 -0
- package/dist/c4Diagram-6R2MQUNL-B0L0pltn.js +1587 -0
- package/dist/chunk-COUQ6RZ3-qd4eG6tc.js +17852 -0
- package/dist/chunk-CRQPXCKQ-yjI467Bq.js +65 -0
- package/dist/chunk-EFPBJHX4-DdHmqd0M.js +1378 -0
- package/dist/chunk-EOAU2GW5-CpRNAcjo.js +253 -0
- package/dist/chunk-IHYUGLNO-DJcRQIf7.js +1365 -0
- package/dist/chunk-K2ZEYYM2-CbqHhUqy.js +9 -0
- package/dist/chunk-Q7VUVKE6-gBSSbdjU.js +24 -0
- package/dist/chunk-T2M37SMK-Br8mK30k.js +1411 -0
- package/dist/chunk-TGZYFRKZ-BYBLXoJz.js +1331 -0
- package/dist/chunk-YJGJQOYZ-BGiSkWF0.js +19 -0
- package/dist/classDiagram-LB37KKQG-DhFsEyDS.js +17 -0
- package/dist/classDiagram-v2-KFQJBC22-DhFsEyDS.js +17 -0
- package/dist/{client-C1WG2nEf.js → client-D-YAg8x6.js} +6 -6
- package/dist/{console-DK0gDzNQ.js → console-CoE5Qzyz.js} +41106 -22971
- package/dist/create_file.node-Co0Uh1F3.js +21 -0
- package/dist/dagre-CMTPJJKG-UDPzd9Iy.js +446 -0
- package/dist/diagram-BIPOGRU5-B7TV59-n.js +128 -0
- package/dist/diagram-YF4VECWA-LsAZsciQ.js +219 -0
- package/dist/{edit_file.node-BH524GkF.js → edit_file.node-CmTZeBc2.js} +11 -11
- package/dist/erDiagram-AK44R45H-BWpeEu7D.js +843 -0
- package/dist/{executable-5cBRGrsC.js → executable-BE7tfoX5.js} +1 -1
- package/dist/{files-CybxYgbE.js → files-DqpRf5q4.js} +10 -10
- package/dist/flowDiagram-XARHJDSH-DzpV02UB.js +1618 -0
- package/dist/ganttDiagram-H5QQZTZ5-C0BhJTzn.js +1605 -0
- package/dist/gitGraphDiagram-XHLTLO3W-0EiOmv44.js +701 -0
- package/dist/{glob.node-C6HbLuPt.js → glob.node-DNei8bFS.js} +11 -11
- package/dist/{index-C2wo7rRZ.js → index-BcjxaWOc.js} +31 -31
- package/dist/infoDiagram-TP2HPDHO-CQX5a0Fc.js +24 -0
- package/dist/journeyDiagram-VHRN44N3-C82dEe4G.js +809 -0
- package/dist/kanban-definition-K5J3OUUV-xilJcrom.js +718 -0
- package/dist/katex-5N2NCDMP-CAsrnb6_.js +11703 -0
- package/dist/{list_directory.node-ZQscizpi.js → list_directory.node-CMiNNbXP.js} +1 -1
- package/dist/{load-profile-BbmyxO_7.js → load-profile-Cg8XaTx6.js} +1 -1
- package/dist/{main-CiUaVPC2.js → main-Dy2VZM_S.js} +15 -15
- package/dist/mindmap-definition-TI5ONXTW-BNaRba4R.js +3221 -0
- package/dist/{node-DvmQAW7h.js → node-BtG1o_DD.js} +2 -2
- package/dist/{node-VrazB_nQ.js → node-BulbxvrV.js} +58 -58
- package/dist/{node-Cpbjmhrj.js → node-Cp3D7_hw.js} +71 -71
- package/dist/{node-GgocwWwI.js → node-CtoBdTQT.js} +3 -3
- package/dist/{node-CiFAW-F3.js → node-Ctw1i0nl.js} +12 -12
- package/dist/{node-CgVq0JJ9.js → node-D1zxOCuN.js} +1 -1
- package/dist/pieDiagram-FPR3CNQC-_30_tQz0.js +120 -0
- package/dist/quadrantDiagram-RLP5YTJ2-CTD43GTk.js +1028 -0
- package/dist/radar-MK3ICKWK-55CS4JTO-afihMdR4.js +14398 -0
- package/dist/{read_file.node-CIdAFiJ6.js → read_file.node-QZ0VCmB2.js} +1 -1
- package/dist/requirementDiagram-P5NVWGNK-Sd2_6g8e.js +853 -0
- package/dist/sankeyDiagram-C6NZRJHT-D1EcCYaw.js +864 -0
- package/dist/sequenceDiagram-6SLVIXKN-CghQTpGf.js +2283 -0
- package/dist/stateDiagram-WI5ZVJ5I-Bv21MlSK.js +272 -0
- package/dist/stateDiagram-v2-KVDSFUFK-BgP0D8xL.js +17 -0
- package/dist/{stdio-D9HyubOc.js → stdio-CCCGI3C7.js} +8 -8
- package/dist/storybook.js +7 -7
- package/dist/timeline-definition-65575674-BUqRZdJ-.js +800 -0
- package/dist/{undo_edit.node-VYuTxRwd.js → undo_edit.node-BkletvTZ.js} +5 -5
- package/dist/xychartDiagram-674MFTBU-DjBabATx.js +1291 -0
- package/package.json +1 -1
- package/dist/create_file.node-DtVTaHj5.js +0 -21
@@ -0,0 +1,1291 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
import { _ as n, u as ii, v as ei, U as Pt, T as si, w as ni, x as ai, A as Lt, av as oi, C as hi, Z as ri, a5 as lt, a4 as Et, a6 as li, aB as ci, I as ui, aC as kt, aD as gi, ab as Tt, aE as Rt } from "./console-CoE5Qzyz.js";
|
3
|
+
var at = function() {
|
4
|
+
var t = /* @__PURE__ */ n(function(M, h, l, c) {
|
5
|
+
for (l = l || {}, c = M.length; c--; l[M[c]] = h) ;
|
6
|
+
return l;
|
7
|
+
}, "o"), i = [1, 10, 12, 14, 16, 18, 19, 21, 23], e = [2, 6], s = [1, 3], o = [1, 5], d = [1, 6], g = [1, 7], y = [1, 5, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], T = [1, 25], E = [1, 26], S = [1, 28], R = [1, 29], I = [1, 30], V = [1, 31], _ = [1, 32], L = [1, 33], f = [1, 34], C = [1, 35], r = [1, 36], D = [1, 37], X = [1, 43], mt = [1, 42], bt = [1, 47], $ = [1, 50], b = [1, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], J = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36], v = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], At = [1, 64], tt = {
|
8
|
+
trace: /* @__PURE__ */ n(function() {
|
9
|
+
}, "trace"),
|
10
|
+
yy: {},
|
11
|
+
symbols_: { error: 2, start: 3, eol: 4, XYCHART: 5, chartConfig: 6, document: 7, CHART_ORIENTATION: 8, statement: 9, title: 10, text: 11, X_AXIS: 12, parseXAxis: 13, Y_AXIS: 14, parseYAxis: 15, LINE: 16, plotData: 17, BAR: 18, acc_title: 19, acc_title_value: 20, acc_descr: 21, acc_descr_value: 22, acc_descr_multiline_value: 23, SQUARE_BRACES_START: 24, commaSeparatedNumbers: 25, SQUARE_BRACES_END: 26, NUMBER_WITH_DECIMAL: 27, COMMA: 28, xAxisData: 29, bandData: 30, ARROW_DELIMITER: 31, commaSeparatedTexts: 32, yAxisData: 33, NEWLINE: 34, SEMI: 35, EOF: 36, alphaNum: 37, STR: 38, MD_STR: 39, alphaNumToken: 40, AMP: 41, NUM: 42, ALPHA: 43, PLUS: 44, EQUALS: 45, MULT: 46, DOT: 47, BRKT: 48, MINUS: 49, UNDERSCORE: 50, $accept: 0, $end: 1 },
|
12
|
+
terminals_: { 2: "error", 5: "XYCHART", 8: "CHART_ORIENTATION", 10: "title", 12: "X_AXIS", 14: "Y_AXIS", 16: "LINE", 18: "BAR", 19: "acc_title", 20: "acc_title_value", 21: "acc_descr", 22: "acc_descr_value", 23: "acc_descr_multiline_value", 24: "SQUARE_BRACES_START", 26: "SQUARE_BRACES_END", 27: "NUMBER_WITH_DECIMAL", 28: "COMMA", 31: "ARROW_DELIMITER", 34: "NEWLINE", 35: "SEMI", 36: "EOF", 38: "STR", 39: "MD_STR", 41: "AMP", 42: "NUM", 43: "ALPHA", 44: "PLUS", 45: "EQUALS", 46: "MULT", 47: "DOT", 48: "BRKT", 49: "MINUS", 50: "UNDERSCORE" },
|
13
|
+
productions_: [0, [3, 2], [3, 3], [3, 2], [3, 1], [6, 1], [7, 0], [7, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 3], [9, 2], [9, 3], [9, 2], [9, 2], [9, 1], [17, 3], [25, 3], [25, 1], [13, 1], [13, 2], [13, 1], [29, 1], [29, 3], [30, 3], [32, 3], [32, 1], [15, 1], [15, 2], [15, 1], [33, 3], [4, 1], [4, 1], [4, 1], [11, 1], [11, 1], [11, 1], [37, 1], [37, 2], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1]],
|
14
|
+
performAction: /* @__PURE__ */ n(function(h, l, c, u, m, a, N) {
|
15
|
+
var x = a.length - 1;
|
16
|
+
switch (m) {
|
17
|
+
case 5:
|
18
|
+
u.setOrientation(a[x]);
|
19
|
+
break;
|
20
|
+
case 9:
|
21
|
+
u.setDiagramTitle(a[x].text.trim());
|
22
|
+
break;
|
23
|
+
case 12:
|
24
|
+
u.setLineData({ text: "", type: "text" }, a[x]);
|
25
|
+
break;
|
26
|
+
case 13:
|
27
|
+
u.setLineData(a[x - 1], a[x]);
|
28
|
+
break;
|
29
|
+
case 14:
|
30
|
+
u.setBarData({ text: "", type: "text" }, a[x]);
|
31
|
+
break;
|
32
|
+
case 15:
|
33
|
+
u.setBarData(a[x - 1], a[x]);
|
34
|
+
break;
|
35
|
+
case 16:
|
36
|
+
this.$ = a[x].trim(), u.setAccTitle(this.$);
|
37
|
+
break;
|
38
|
+
case 17:
|
39
|
+
case 18:
|
40
|
+
this.$ = a[x].trim(), u.setAccDescription(this.$);
|
41
|
+
break;
|
42
|
+
case 19:
|
43
|
+
this.$ = a[x - 1];
|
44
|
+
break;
|
45
|
+
case 20:
|
46
|
+
this.$ = [Number(a[x - 2]), ...a[x]];
|
47
|
+
break;
|
48
|
+
case 21:
|
49
|
+
this.$ = [Number(a[x])];
|
50
|
+
break;
|
51
|
+
case 22:
|
52
|
+
u.setXAxisTitle(a[x]);
|
53
|
+
break;
|
54
|
+
case 23:
|
55
|
+
u.setXAxisTitle(a[x - 1]);
|
56
|
+
break;
|
57
|
+
case 24:
|
58
|
+
u.setXAxisTitle({ type: "text", text: "" });
|
59
|
+
break;
|
60
|
+
case 25:
|
61
|
+
u.setXAxisBand(a[x]);
|
62
|
+
break;
|
63
|
+
case 26:
|
64
|
+
u.setXAxisRangeData(Number(a[x - 2]), Number(a[x]));
|
65
|
+
break;
|
66
|
+
case 27:
|
67
|
+
this.$ = a[x - 1];
|
68
|
+
break;
|
69
|
+
case 28:
|
70
|
+
this.$ = [a[x - 2], ...a[x]];
|
71
|
+
break;
|
72
|
+
case 29:
|
73
|
+
this.$ = [a[x]];
|
74
|
+
break;
|
75
|
+
case 30:
|
76
|
+
u.setYAxisTitle(a[x]);
|
77
|
+
break;
|
78
|
+
case 31:
|
79
|
+
u.setYAxisTitle(a[x - 1]);
|
80
|
+
break;
|
81
|
+
case 32:
|
82
|
+
u.setYAxisTitle({ type: "text", text: "" });
|
83
|
+
break;
|
84
|
+
case 33:
|
85
|
+
u.setYAxisRangeData(Number(a[x - 2]), Number(a[x]));
|
86
|
+
break;
|
87
|
+
case 37:
|
88
|
+
this.$ = { text: a[x], type: "text" };
|
89
|
+
break;
|
90
|
+
case 38:
|
91
|
+
this.$ = { text: a[x], type: "text" };
|
92
|
+
break;
|
93
|
+
case 39:
|
94
|
+
this.$ = { text: a[x], type: "markdown" };
|
95
|
+
break;
|
96
|
+
case 40:
|
97
|
+
this.$ = a[x];
|
98
|
+
break;
|
99
|
+
case 41:
|
100
|
+
this.$ = a[x - 1] + "" + a[x];
|
101
|
+
break;
|
102
|
+
}
|
103
|
+
}, "anonymous"),
|
104
|
+
table: [t(i, e, { 3: 1, 4: 2, 7: 4, 5: s, 34: o, 35: d, 36: g }), { 1: [3] }, t(i, e, { 4: 2, 7: 4, 3: 8, 5: s, 34: o, 35: d, 36: g }), t(i, e, { 4: 2, 7: 4, 6: 9, 3: 10, 5: s, 8: [1, 11], 34: o, 35: d, 36: g }), { 1: [2, 4], 9: 12, 10: [1, 13], 12: [1, 14], 14: [1, 15], 16: [1, 16], 18: [1, 17], 19: [1, 18], 21: [1, 19], 23: [1, 20] }, t(y, [2, 34]), t(y, [2, 35]), t(y, [2, 36]), { 1: [2, 1] }, t(i, e, { 4: 2, 7: 4, 3: 21, 5: s, 34: o, 35: d, 36: g }), { 1: [2, 3] }, t(y, [2, 5]), t(i, [2, 7], { 4: 22, 34: o, 35: d, 36: g }), { 11: 23, 37: 24, 38: T, 39: E, 40: 27, 41: S, 42: R, 43: I, 44: V, 45: _, 46: L, 47: f, 48: C, 49: r, 50: D }, { 11: 39, 13: 38, 24: X, 27: mt, 29: 40, 30: 41, 37: 24, 38: T, 39: E, 40: 27, 41: S, 42: R, 43: I, 44: V, 45: _, 46: L, 47: f, 48: C, 49: r, 50: D }, { 11: 45, 15: 44, 27: bt, 33: 46, 37: 24, 38: T, 39: E, 40: 27, 41: S, 42: R, 43: I, 44: V, 45: _, 46: L, 47: f, 48: C, 49: r, 50: D }, { 11: 49, 17: 48, 24: $, 37: 24, 38: T, 39: E, 40: 27, 41: S, 42: R, 43: I, 44: V, 45: _, 46: L, 47: f, 48: C, 49: r, 50: D }, { 11: 52, 17: 51, 24: $, 37: 24, 38: T, 39: E, 40: 27, 41: S, 42: R, 43: I, 44: V, 45: _, 46: L, 47: f, 48: C, 49: r, 50: D }, { 20: [1, 53] }, { 22: [1, 54] }, t(b, [2, 18]), { 1: [2, 2] }, t(b, [2, 8]), t(b, [2, 9]), t(J, [2, 37], { 40: 55, 41: S, 42: R, 43: I, 44: V, 45: _, 46: L, 47: f, 48: C, 49: r, 50: D }), t(J, [2, 38]), t(J, [2, 39]), t(v, [2, 40]), t(v, [2, 42]), t(v, [2, 43]), t(v, [2, 44]), t(v, [2, 45]), t(v, [2, 46]), t(v, [2, 47]), t(v, [2, 48]), t(v, [2, 49]), t(v, [2, 50]), t(v, [2, 51]), t(b, [2, 10]), t(b, [2, 22], { 30: 41, 29: 56, 24: X, 27: mt }), t(b, [2, 24]), t(b, [2, 25]), { 31: [1, 57] }, { 11: 59, 32: 58, 37: 24, 38: T, 39: E, 40: 27, 41: S, 42: R, 43: I, 44: V, 45: _, 46: L, 47: f, 48: C, 49: r, 50: D }, t(b, [2, 11]), t(b, [2, 30], { 33: 60, 27: bt }), t(b, [2, 32]), { 31: [1, 61] }, t(b, [2, 12]), { 17: 62, 24: $ }, { 25: 63, 27: At }, t(b, [2, 14]), { 17: 65, 24: $ }, t(b, [2, 16]), t(b, [2, 17]), t(v, [2, 41]), t(b, [2, 23]), { 27: [1, 66] }, { 26: [1, 67] }, { 26: [2, 29], 28: [1, 68] }, t(b, [2, 31]), { 27: [1, 69] }, t(b, [2, 13]), { 26: [1, 70] }, { 26: [2, 21], 28: [1, 71] }, t(b, [2, 15]), t(b, [2, 26]), t(b, [2, 27]), { 11: 59, 32: 72, 37: 24, 38: T, 39: E, 40: 27, 41: S, 42: R, 43: I, 44: V, 45: _, 46: L, 47: f, 48: C, 49: r, 50: D }, t(b, [2, 33]), t(b, [2, 19]), { 25: 73, 27: At }, { 26: [2, 28] }, { 26: [2, 20] }],
|
105
|
+
defaultActions: { 8: [2, 1], 10: [2, 3], 21: [2, 2], 72: [2, 28], 73: [2, 20] },
|
106
|
+
parseError: /* @__PURE__ */ n(function(h, l) {
|
107
|
+
if (l.recoverable)
|
108
|
+
this.trace(h);
|
109
|
+
else {
|
110
|
+
var c = new Error(h);
|
111
|
+
throw c.hash = l, c;
|
112
|
+
}
|
113
|
+
}, "parseError"),
|
114
|
+
parse: /* @__PURE__ */ n(function(h) {
|
115
|
+
var l = this, c = [0], u = [], m = [null], a = [], N = this.table, x = "", G = 0, Ct = 0, Kt = 2, wt = 1, Zt = a.slice.call(arguments, 1), A = Object.create(this.lexer), W = { yy: {} };
|
116
|
+
for (var it in this.yy)
|
117
|
+
Object.prototype.hasOwnProperty.call(this.yy, it) && (W.yy[it] = this.yy[it]);
|
118
|
+
A.setInput(h, W.yy), W.yy.lexer = A, W.yy.parser = this, typeof A.yylloc > "u" && (A.yylloc = {});
|
119
|
+
var et = A.yylloc;
|
120
|
+
a.push(et);
|
121
|
+
var Jt = A.options && A.options.ranges;
|
122
|
+
typeof W.yy.parseError == "function" ? this.parseError = W.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
123
|
+
function ti(k) {
|
124
|
+
c.length = c.length - 2 * k, m.length = m.length - k, a.length = a.length - k;
|
125
|
+
}
|
126
|
+
n(ti, "popStack");
|
127
|
+
function St() {
|
128
|
+
var k;
|
129
|
+
return k = u.pop() || A.lex() || wt, typeof k != "number" && (k instanceof Array && (u = k, k = u.pop()), k = l.symbols_[k] || k), k;
|
130
|
+
}
|
131
|
+
n(St, "lex");
|
132
|
+
for (var w, O, P, st, z = {}, j, B, _t, Q; ; ) {
|
133
|
+
if (O = c[c.length - 1], this.defaultActions[O] ? P = this.defaultActions[O] : ((w === null || typeof w > "u") && (w = St()), P = N[O] && N[O][w]), typeof P > "u" || !P.length || !P[0]) {
|
134
|
+
var nt = "";
|
135
|
+
Q = [];
|
136
|
+
for (j in N[O])
|
137
|
+
this.terminals_[j] && j > Kt && Q.push("'" + this.terminals_[j] + "'");
|
138
|
+
A.showPosition ? nt = "Parse error on line " + (G + 1) + `:
|
139
|
+
` + A.showPosition() + `
|
140
|
+
Expecting ` + Q.join(", ") + ", got '" + (this.terminals_[w] || w) + "'" : nt = "Parse error on line " + (G + 1) + ": Unexpected " + (w == wt ? "end of input" : "'" + (this.terminals_[w] || w) + "'"), this.parseError(nt, {
|
141
|
+
text: A.match,
|
142
|
+
token: this.terminals_[w] || w,
|
143
|
+
line: A.yylineno,
|
144
|
+
loc: et,
|
145
|
+
expected: Q
|
146
|
+
});
|
147
|
+
}
|
148
|
+
if (P[0] instanceof Array && P.length > 1)
|
149
|
+
throw new Error("Parse Error: multiple actions possible at state: " + O + ", token: " + w);
|
150
|
+
switch (P[0]) {
|
151
|
+
case 1:
|
152
|
+
c.push(w), m.push(A.yytext), a.push(A.yylloc), c.push(P[1]), w = null, Ct = A.yyleng, x = A.yytext, G = A.yylineno, et = A.yylloc;
|
153
|
+
break;
|
154
|
+
case 2:
|
155
|
+
if (B = this.productions_[P[1]][1], z.$ = m[m.length - B], z._$ = {
|
156
|
+
first_line: a[a.length - (B || 1)].first_line,
|
157
|
+
last_line: a[a.length - 1].last_line,
|
158
|
+
first_column: a[a.length - (B || 1)].first_column,
|
159
|
+
last_column: a[a.length - 1].last_column
|
160
|
+
}, Jt && (z._$.range = [
|
161
|
+
a[a.length - (B || 1)].range[0],
|
162
|
+
a[a.length - 1].range[1]
|
163
|
+
]), st = this.performAction.apply(z, [
|
164
|
+
x,
|
165
|
+
Ct,
|
166
|
+
G,
|
167
|
+
W.yy,
|
168
|
+
P[1],
|
169
|
+
m,
|
170
|
+
a
|
171
|
+
].concat(Zt)), typeof st < "u")
|
172
|
+
return st;
|
173
|
+
B && (c = c.slice(0, -1 * B * 2), m = m.slice(0, -1 * B), a = a.slice(0, -1 * B)), c.push(this.productions_[P[1]][0]), m.push(z.$), a.push(z._$), _t = N[c[c.length - 2]][c[c.length - 1]], c.push(_t);
|
174
|
+
break;
|
175
|
+
case 3:
|
176
|
+
return !0;
|
177
|
+
}
|
178
|
+
}
|
179
|
+
return !0;
|
180
|
+
}, "parse")
|
181
|
+
}, Qt = /* @__PURE__ */ function() {
|
182
|
+
var M = {
|
183
|
+
EOF: 1,
|
184
|
+
parseError: /* @__PURE__ */ n(function(l, c) {
|
185
|
+
if (this.yy.parser)
|
186
|
+
this.yy.parser.parseError(l, c);
|
187
|
+
else
|
188
|
+
throw new Error(l);
|
189
|
+
}, "parseError"),
|
190
|
+
// resets the lexer, sets new input
|
191
|
+
setInput: /* @__PURE__ */ n(function(h, l) {
|
192
|
+
return this.yy = l || this.yy || {}, this._input = h, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
193
|
+
first_line: 1,
|
194
|
+
first_column: 0,
|
195
|
+
last_line: 1,
|
196
|
+
last_column: 0
|
197
|
+
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
198
|
+
}, "setInput"),
|
199
|
+
// consumes and returns one char from the input
|
200
|
+
input: /* @__PURE__ */ n(function() {
|
201
|
+
var h = this._input[0];
|
202
|
+
this.yytext += h, this.yyleng++, this.offset++, this.match += h, this.matched += h;
|
203
|
+
var l = h.match(/(?:\r\n?|\n).*/g);
|
204
|
+
return l ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), h;
|
205
|
+
}, "input"),
|
206
|
+
// unshifts one char (or a string) into the input
|
207
|
+
unput: /* @__PURE__ */ n(function(h) {
|
208
|
+
var l = h.length, c = h.split(/(?:\r\n?|\n)/g);
|
209
|
+
this._input = h + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - l), this.offset -= l;
|
210
|
+
var u = this.match.split(/(?:\r\n?|\n)/g);
|
211
|
+
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), c.length - 1 && (this.yylineno -= c.length - 1);
|
212
|
+
var m = this.yylloc.range;
|
213
|
+
return this.yylloc = {
|
214
|
+
first_line: this.yylloc.first_line,
|
215
|
+
last_line: this.yylineno + 1,
|
216
|
+
first_column: this.yylloc.first_column,
|
217
|
+
last_column: c ? (c.length === u.length ? this.yylloc.first_column : 0) + u[u.length - c.length].length - c[0].length : this.yylloc.first_column - l
|
218
|
+
}, this.options.ranges && (this.yylloc.range = [m[0], m[0] + this.yyleng - l]), this.yyleng = this.yytext.length, this;
|
219
|
+
}, "unput"),
|
220
|
+
// When called from action, caches matched text and appends it on next action
|
221
|
+
more: /* @__PURE__ */ n(function() {
|
222
|
+
return this._more = !0, this;
|
223
|
+
}, "more"),
|
224
|
+
// 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.
|
225
|
+
reject: /* @__PURE__ */ n(function() {
|
226
|
+
if (this.options.backtrack_lexer)
|
227
|
+
this._backtrack = !0;
|
228
|
+
else
|
229
|
+
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).
|
230
|
+
` + this.showPosition(), {
|
231
|
+
text: "",
|
232
|
+
token: null,
|
233
|
+
line: this.yylineno
|
234
|
+
});
|
235
|
+
return this;
|
236
|
+
}, "reject"),
|
237
|
+
// retain first n characters of the match
|
238
|
+
less: /* @__PURE__ */ n(function(h) {
|
239
|
+
this.unput(this.match.slice(h));
|
240
|
+
}, "less"),
|
241
|
+
// displays already matched input, i.e. for error messages
|
242
|
+
pastInput: /* @__PURE__ */ n(function() {
|
243
|
+
var h = this.matched.substr(0, this.matched.length - this.match.length);
|
244
|
+
return (h.length > 20 ? "..." : "") + h.substr(-20).replace(/\n/g, "");
|
245
|
+
}, "pastInput"),
|
246
|
+
// displays upcoming input, i.e. for error messages
|
247
|
+
upcomingInput: /* @__PURE__ */ n(function() {
|
248
|
+
var h = this.match;
|
249
|
+
return h.length < 20 && (h += this._input.substr(0, 20 - h.length)), (h.substr(0, 20) + (h.length > 20 ? "..." : "")).replace(/\n/g, "");
|
250
|
+
}, "upcomingInput"),
|
251
|
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
252
|
+
showPosition: /* @__PURE__ */ n(function() {
|
253
|
+
var h = this.pastInput(), l = new Array(h.length + 1).join("-");
|
254
|
+
return h + this.upcomingInput() + `
|
255
|
+
` + l + "^";
|
256
|
+
}, "showPosition"),
|
257
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
258
|
+
test_match: /* @__PURE__ */ n(function(h, l) {
|
259
|
+
var c, u, m;
|
260
|
+
if (this.options.backtrack_lexer && (m = {
|
261
|
+
yylineno: this.yylineno,
|
262
|
+
yylloc: {
|
263
|
+
first_line: this.yylloc.first_line,
|
264
|
+
last_line: this.last_line,
|
265
|
+
first_column: this.yylloc.first_column,
|
266
|
+
last_column: this.yylloc.last_column
|
267
|
+
},
|
268
|
+
yytext: this.yytext,
|
269
|
+
match: this.match,
|
270
|
+
matches: this.matches,
|
271
|
+
matched: this.matched,
|
272
|
+
yyleng: this.yyleng,
|
273
|
+
offset: this.offset,
|
274
|
+
_more: this._more,
|
275
|
+
_input: this._input,
|
276
|
+
yy: this.yy,
|
277
|
+
conditionStack: this.conditionStack.slice(0),
|
278
|
+
done: this.done
|
279
|
+
}, this.options.ranges && (m.yylloc.range = this.yylloc.range.slice(0))), u = h[0].match(/(?:\r\n?|\n).*/g), u && (this.yylineno += u.length), this.yylloc = {
|
280
|
+
first_line: this.yylloc.last_line,
|
281
|
+
last_line: this.yylineno + 1,
|
282
|
+
first_column: this.yylloc.last_column,
|
283
|
+
last_column: u ? u[u.length - 1].length - u[u.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + h[0].length
|
284
|
+
}, this.yytext += h[0], this.match += h[0], this.matches = h, 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(h[0].length), this.matched += h[0], c = this.performAction.call(this, this.yy, this, l, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), c)
|
285
|
+
return c;
|
286
|
+
if (this._backtrack) {
|
287
|
+
for (var a in m)
|
288
|
+
this[a] = m[a];
|
289
|
+
return !1;
|
290
|
+
}
|
291
|
+
return !1;
|
292
|
+
}, "test_match"),
|
293
|
+
// return next match in input
|
294
|
+
next: /* @__PURE__ */ n(function() {
|
295
|
+
if (this.done)
|
296
|
+
return this.EOF;
|
297
|
+
this._input || (this.done = !0);
|
298
|
+
var h, l, c, u;
|
299
|
+
this._more || (this.yytext = "", this.match = "");
|
300
|
+
for (var m = this._currentRules(), a = 0; a < m.length; a++)
|
301
|
+
if (c = this._input.match(this.rules[m[a]]), c && (!l || c[0].length > l[0].length)) {
|
302
|
+
if (l = c, u = a, this.options.backtrack_lexer) {
|
303
|
+
if (h = this.test_match(c, m[a]), h !== !1)
|
304
|
+
return h;
|
305
|
+
if (this._backtrack) {
|
306
|
+
l = !1;
|
307
|
+
continue;
|
308
|
+
} else
|
309
|
+
return !1;
|
310
|
+
} else if (!this.options.flex)
|
311
|
+
break;
|
312
|
+
}
|
313
|
+
return l ? (h = this.test_match(l, m[u]), h !== !1 ? h : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
314
|
+
` + this.showPosition(), {
|
315
|
+
text: "",
|
316
|
+
token: null,
|
317
|
+
line: this.yylineno
|
318
|
+
});
|
319
|
+
}, "next"),
|
320
|
+
// return next match that has a token
|
321
|
+
lex: /* @__PURE__ */ n(function() {
|
322
|
+
var l = this.next();
|
323
|
+
return l || this.lex();
|
324
|
+
}, "lex"),
|
325
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
326
|
+
begin: /* @__PURE__ */ n(function(l) {
|
327
|
+
this.conditionStack.push(l);
|
328
|
+
}, "begin"),
|
329
|
+
// pop the previously active lexer condition state off the condition stack
|
330
|
+
popState: /* @__PURE__ */ n(function() {
|
331
|
+
var l = this.conditionStack.length - 1;
|
332
|
+
return l > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
333
|
+
}, "popState"),
|
334
|
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
335
|
+
_currentRules: /* @__PURE__ */ n(function() {
|
336
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
337
|
+
}, "_currentRules"),
|
338
|
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
339
|
+
topState: /* @__PURE__ */ n(function(l) {
|
340
|
+
return l = this.conditionStack.length - 1 - Math.abs(l || 0), l >= 0 ? this.conditionStack[l] : "INITIAL";
|
341
|
+
}, "topState"),
|
342
|
+
// alias for begin(condition)
|
343
|
+
pushState: /* @__PURE__ */ n(function(l) {
|
344
|
+
this.begin(l);
|
345
|
+
}, "pushState"),
|
346
|
+
// return the number of states currently on the stack
|
347
|
+
stateStackSize: /* @__PURE__ */ n(function() {
|
348
|
+
return this.conditionStack.length;
|
349
|
+
}, "stateStackSize"),
|
350
|
+
options: { "case-insensitive": !0 },
|
351
|
+
performAction: /* @__PURE__ */ n(function(l, c, u, m) {
|
352
|
+
switch (u) {
|
353
|
+
case 0:
|
354
|
+
break;
|
355
|
+
case 1:
|
356
|
+
break;
|
357
|
+
case 2:
|
358
|
+
return this.popState(), 34;
|
359
|
+
case 3:
|
360
|
+
return this.popState(), 34;
|
361
|
+
case 4:
|
362
|
+
return 34;
|
363
|
+
case 5:
|
364
|
+
break;
|
365
|
+
case 6:
|
366
|
+
return 10;
|
367
|
+
case 7:
|
368
|
+
return this.pushState("acc_title"), 19;
|
369
|
+
case 8:
|
370
|
+
return this.popState(), "acc_title_value";
|
371
|
+
case 9:
|
372
|
+
return this.pushState("acc_descr"), 21;
|
373
|
+
case 10:
|
374
|
+
return this.popState(), "acc_descr_value";
|
375
|
+
case 11:
|
376
|
+
this.pushState("acc_descr_multiline");
|
377
|
+
break;
|
378
|
+
case 12:
|
379
|
+
this.popState();
|
380
|
+
break;
|
381
|
+
case 13:
|
382
|
+
return "acc_descr_multiline_value";
|
383
|
+
case 14:
|
384
|
+
return 5;
|
385
|
+
case 15:
|
386
|
+
return 8;
|
387
|
+
case 16:
|
388
|
+
return this.pushState("axis_data"), "X_AXIS";
|
389
|
+
case 17:
|
390
|
+
return this.pushState("axis_data"), "Y_AXIS";
|
391
|
+
case 18:
|
392
|
+
return this.pushState("axis_band_data"), 24;
|
393
|
+
case 19:
|
394
|
+
return 31;
|
395
|
+
case 20:
|
396
|
+
return this.pushState("data"), 16;
|
397
|
+
case 21:
|
398
|
+
return this.pushState("data"), 18;
|
399
|
+
case 22:
|
400
|
+
return this.pushState("data_inner"), 24;
|
401
|
+
case 23:
|
402
|
+
return 27;
|
403
|
+
case 24:
|
404
|
+
return this.popState(), 26;
|
405
|
+
case 25:
|
406
|
+
this.popState();
|
407
|
+
break;
|
408
|
+
case 26:
|
409
|
+
this.pushState("string");
|
410
|
+
break;
|
411
|
+
case 27:
|
412
|
+
this.popState();
|
413
|
+
break;
|
414
|
+
case 28:
|
415
|
+
return "STR";
|
416
|
+
case 29:
|
417
|
+
return 24;
|
418
|
+
case 30:
|
419
|
+
return 26;
|
420
|
+
case 31:
|
421
|
+
return 43;
|
422
|
+
case 32:
|
423
|
+
return "COLON";
|
424
|
+
case 33:
|
425
|
+
return 44;
|
426
|
+
case 34:
|
427
|
+
return 28;
|
428
|
+
case 35:
|
429
|
+
return 45;
|
430
|
+
case 36:
|
431
|
+
return 46;
|
432
|
+
case 37:
|
433
|
+
return 48;
|
434
|
+
case 38:
|
435
|
+
return 50;
|
436
|
+
case 39:
|
437
|
+
return 47;
|
438
|
+
case 40:
|
439
|
+
return 41;
|
440
|
+
case 41:
|
441
|
+
return 49;
|
442
|
+
case 42:
|
443
|
+
return 42;
|
444
|
+
case 43:
|
445
|
+
break;
|
446
|
+
case 44:
|
447
|
+
return 35;
|
448
|
+
case 45:
|
449
|
+
return 36;
|
450
|
+
}
|
451
|
+
}, "anonymous"),
|
452
|
+
rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:(\r?\n))/i, /^(?:(\r?\n))/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:\{)/i, /^(?:[^\}]*)/i, /^(?:xychart-beta\b)/i, /^(?:(?:vertical|horizontal))/i, /^(?:x-axis\b)/i, /^(?:y-axis\b)/i, /^(?:\[)/i, /^(?:-->)/i, /^(?:line\b)/i, /^(?:bar\b)/i, /^(?:\[)/i, /^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i, /^(?:\])/i, /^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s+)/i, /^(?:;)/i, /^(?:$)/i],
|
453
|
+
conditions: { data_inner: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, data: { rules: [0, 1, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 22, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, axis_band_data: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, axis_data: { rules: [0, 1, 2, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19, 20, 21, 23, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, title: { rules: [], inclusive: !1 }, md_string: { rules: [], inclusive: !1 }, string: { rules: [27, 28], inclusive: !1 }, INITIAL: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 } }
|
454
|
+
};
|
455
|
+
return M;
|
456
|
+
}();
|
457
|
+
tt.lexer = Qt;
|
458
|
+
function q() {
|
459
|
+
this.yy = {};
|
460
|
+
}
|
461
|
+
return n(q, "Parser"), q.prototype = tt, tt.Parser = q, new q();
|
462
|
+
}();
|
463
|
+
at.parser = at;
|
464
|
+
var xi = at;
|
465
|
+
function ot(t) {
|
466
|
+
return t.type === "bar";
|
467
|
+
}
|
468
|
+
n(ot, "isBarPlot");
|
469
|
+
function ct(t) {
|
470
|
+
return t.type === "band";
|
471
|
+
}
|
472
|
+
n(ct, "isBandAxisData");
|
473
|
+
function F(t) {
|
474
|
+
return t.type === "linear";
|
475
|
+
}
|
476
|
+
n(F, "isLinearAxisData");
|
477
|
+
var It = class {
|
478
|
+
constructor(t) {
|
479
|
+
this.parentGroup = t;
|
480
|
+
}
|
481
|
+
static {
|
482
|
+
n(this, "TextDimensionCalculatorWithFont");
|
483
|
+
}
|
484
|
+
getMaxDimension(t, i) {
|
485
|
+
if (!this.parentGroup)
|
486
|
+
return {
|
487
|
+
width: t.reduce((o, d) => Math.max(d.length, o), 0) * i,
|
488
|
+
height: i
|
489
|
+
};
|
490
|
+
const e = {
|
491
|
+
width: 0,
|
492
|
+
height: 0
|
493
|
+
}, s = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", i);
|
494
|
+
for (const o of t) {
|
495
|
+
const d = gi(s, 1, o), g = d ? d.width : o.length * i, y = d ? d.height : i;
|
496
|
+
e.width = Math.max(e.width, g), e.height = Math.max(e.height, y);
|
497
|
+
}
|
498
|
+
return s.remove(), e;
|
499
|
+
}
|
500
|
+
}, Dt = 0.7, vt = 0.2, Vt = class {
|
501
|
+
constructor(t, i, e, s) {
|
502
|
+
this.axisConfig = t, this.title = i, this.textDimensionCalculator = e, this.axisThemeConfig = s, this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left", this.showTitle = !1, this.showLabel = !1, this.showTick = !1, this.showAxisLine = !1, this.outerPadding = 0, this.titleTextHeight = 0, this.labelTextHeight = 0, this.range = [0, 10], this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left";
|
503
|
+
}
|
504
|
+
static {
|
505
|
+
n(this, "BaseAxis");
|
506
|
+
}
|
507
|
+
setRange(t) {
|
508
|
+
this.range = t, this.axisPosition === "left" || this.axisPosition === "right" ? this.boundingRect.height = t[1] - t[0] : this.boundingRect.width = t[1] - t[0], this.recalculateScale();
|
509
|
+
}
|
510
|
+
getRange() {
|
511
|
+
return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding];
|
512
|
+
}
|
513
|
+
setAxisPosition(t) {
|
514
|
+
this.axisPosition = t, this.setRange(this.range);
|
515
|
+
}
|
516
|
+
getTickDistance() {
|
517
|
+
const t = this.getRange();
|
518
|
+
return Math.abs(t[0] - t[1]) / this.getTickValues().length;
|
519
|
+
}
|
520
|
+
getAxisOuterPadding() {
|
521
|
+
return this.outerPadding;
|
522
|
+
}
|
523
|
+
getLabelDimension() {
|
524
|
+
return this.textDimensionCalculator.getMaxDimension(
|
525
|
+
this.getTickValues().map((t) => t.toString()),
|
526
|
+
this.axisConfig.labelFontSize
|
527
|
+
);
|
528
|
+
}
|
529
|
+
recalculateOuterPaddingToDrawBar() {
|
530
|
+
Dt * this.getTickDistance() > this.outerPadding * 2 && (this.outerPadding = Math.floor(Dt * this.getTickDistance() / 2)), this.recalculateScale();
|
531
|
+
}
|
532
|
+
calculateSpaceIfDrawnHorizontally(t) {
|
533
|
+
let i = t.height;
|
534
|
+
if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) {
|
535
|
+
const e = this.getLabelDimension(), s = vt * t.width;
|
536
|
+
this.outerPadding = Math.min(e.width / 2, s);
|
537
|
+
const o = e.height + this.axisConfig.labelPadding * 2;
|
538
|
+
this.labelTextHeight = e.height, o <= i && (i -= o, this.showLabel = !0);
|
539
|
+
}
|
540
|
+
if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) {
|
541
|
+
const e = this.textDimensionCalculator.getMaxDimension(
|
542
|
+
[this.title],
|
543
|
+
this.axisConfig.titleFontSize
|
544
|
+
), s = e.height + this.axisConfig.titlePadding * 2;
|
545
|
+
this.titleTextHeight = e.height, s <= i && (i -= s, this.showTitle = !0);
|
546
|
+
}
|
547
|
+
this.boundingRect.width = t.width, this.boundingRect.height = t.height - i;
|
548
|
+
}
|
549
|
+
calculateSpaceIfDrawnVertical(t) {
|
550
|
+
let i = t.width;
|
551
|
+
if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) {
|
552
|
+
const e = this.getLabelDimension(), s = vt * t.height;
|
553
|
+
this.outerPadding = Math.min(e.height / 2, s);
|
554
|
+
const o = e.width + this.axisConfig.labelPadding * 2;
|
555
|
+
o <= i && (i -= o, this.showLabel = !0);
|
556
|
+
}
|
557
|
+
if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) {
|
558
|
+
const e = this.textDimensionCalculator.getMaxDimension(
|
559
|
+
[this.title],
|
560
|
+
this.axisConfig.titleFontSize
|
561
|
+
), s = e.height + this.axisConfig.titlePadding * 2;
|
562
|
+
this.titleTextHeight = e.height, s <= i && (i -= s, this.showTitle = !0);
|
563
|
+
}
|
564
|
+
this.boundingRect.width = t.width - i, this.boundingRect.height = t.height;
|
565
|
+
}
|
566
|
+
calculateSpace(t) {
|
567
|
+
return this.axisPosition === "left" || this.axisPosition === "right" ? this.calculateSpaceIfDrawnVertical(t) : this.calculateSpaceIfDrawnHorizontally(t), this.recalculateScale(), {
|
568
|
+
width: this.boundingRect.width,
|
569
|
+
height: this.boundingRect.height
|
570
|
+
};
|
571
|
+
}
|
572
|
+
setBoundingBoxXY(t) {
|
573
|
+
this.boundingRect.x = t.x, this.boundingRect.y = t.y;
|
574
|
+
}
|
575
|
+
getDrawableElementsForLeftAxis() {
|
576
|
+
const t = [];
|
577
|
+
if (this.showAxisLine) {
|
578
|
+
const i = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2;
|
579
|
+
t.push({
|
580
|
+
type: "path",
|
581
|
+
groupTexts: ["left-axis", "axisl-line"],
|
582
|
+
data: [
|
583
|
+
{
|
584
|
+
path: `M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y + this.boundingRect.height} `,
|
585
|
+
strokeFill: this.axisThemeConfig.axisLineColor,
|
586
|
+
strokeWidth: this.axisConfig.axisLineWidth
|
587
|
+
}
|
588
|
+
]
|
589
|
+
});
|
590
|
+
}
|
591
|
+
if (this.showLabel && t.push({
|
592
|
+
type: "text",
|
593
|
+
groupTexts: ["left-axis", "label"],
|
594
|
+
data: this.getTickValues().map((i) => ({
|
595
|
+
text: i.toString(),
|
596
|
+
x: this.boundingRect.x + this.boundingRect.width - (this.showLabel ? this.axisConfig.labelPadding : 0) - (this.showTick ? this.axisConfig.tickLength : 0) - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
|
597
|
+
y: this.getScaleValue(i),
|
598
|
+
fill: this.axisThemeConfig.labelColor,
|
599
|
+
fontSize: this.axisConfig.labelFontSize,
|
600
|
+
rotation: 0,
|
601
|
+
verticalPos: "middle",
|
602
|
+
horizontalPos: "right"
|
603
|
+
}))
|
604
|
+
}), this.showTick) {
|
605
|
+
const i = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
|
606
|
+
t.push({
|
607
|
+
type: "path",
|
608
|
+
groupTexts: ["left-axis", "ticks"],
|
609
|
+
data: this.getTickValues().map((e) => ({
|
610
|
+
path: `M ${i},${this.getScaleValue(e)} L ${i - this.axisConfig.tickLength},${this.getScaleValue(e)}`,
|
611
|
+
strokeFill: this.axisThemeConfig.tickColor,
|
612
|
+
strokeWidth: this.axisConfig.tickWidth
|
613
|
+
}))
|
614
|
+
});
|
615
|
+
}
|
616
|
+
return this.showTitle && t.push({
|
617
|
+
type: "text",
|
618
|
+
groupTexts: ["left-axis", "title"],
|
619
|
+
data: [
|
620
|
+
{
|
621
|
+
text: this.title,
|
622
|
+
x: this.boundingRect.x + this.axisConfig.titlePadding,
|
623
|
+
y: this.boundingRect.y + this.boundingRect.height / 2,
|
624
|
+
fill: this.axisThemeConfig.titleColor,
|
625
|
+
fontSize: this.axisConfig.titleFontSize,
|
626
|
+
rotation: 270,
|
627
|
+
verticalPos: "top",
|
628
|
+
horizontalPos: "center"
|
629
|
+
}
|
630
|
+
]
|
631
|
+
}), t;
|
632
|
+
}
|
633
|
+
getDrawableElementsForBottomAxis() {
|
634
|
+
const t = [];
|
635
|
+
if (this.showAxisLine) {
|
636
|
+
const i = this.boundingRect.y + this.axisConfig.axisLineWidth / 2;
|
637
|
+
t.push({
|
638
|
+
type: "path",
|
639
|
+
groupTexts: ["bottom-axis", "axis-line"],
|
640
|
+
data: [
|
641
|
+
{
|
642
|
+
path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`,
|
643
|
+
strokeFill: this.axisThemeConfig.axisLineColor,
|
644
|
+
strokeWidth: this.axisConfig.axisLineWidth
|
645
|
+
}
|
646
|
+
]
|
647
|
+
});
|
648
|
+
}
|
649
|
+
if (this.showLabel && t.push({
|
650
|
+
type: "text",
|
651
|
+
groupTexts: ["bottom-axis", "label"],
|
652
|
+
data: this.getTickValues().map((i) => ({
|
653
|
+
text: i.toString(),
|
654
|
+
x: this.getScaleValue(i),
|
655
|
+
y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
|
656
|
+
fill: this.axisThemeConfig.labelColor,
|
657
|
+
fontSize: this.axisConfig.labelFontSize,
|
658
|
+
rotation: 0,
|
659
|
+
verticalPos: "top",
|
660
|
+
horizontalPos: "center"
|
661
|
+
}))
|
662
|
+
}), this.showTick) {
|
663
|
+
const i = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
|
664
|
+
t.push({
|
665
|
+
type: "path",
|
666
|
+
groupTexts: ["bottom-axis", "ticks"],
|
667
|
+
data: this.getTickValues().map((e) => ({
|
668
|
+
path: `M ${this.getScaleValue(e)},${i} L ${this.getScaleValue(e)},${i + this.axisConfig.tickLength}`,
|
669
|
+
strokeFill: this.axisThemeConfig.tickColor,
|
670
|
+
strokeWidth: this.axisConfig.tickWidth
|
671
|
+
}))
|
672
|
+
});
|
673
|
+
}
|
674
|
+
return this.showTitle && t.push({
|
675
|
+
type: "text",
|
676
|
+
groupTexts: ["bottom-axis", "title"],
|
677
|
+
data: [
|
678
|
+
{
|
679
|
+
text: this.title,
|
680
|
+
x: this.range[0] + (this.range[1] - this.range[0]) / 2,
|
681
|
+
y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight,
|
682
|
+
fill: this.axisThemeConfig.titleColor,
|
683
|
+
fontSize: this.axisConfig.titleFontSize,
|
684
|
+
rotation: 0,
|
685
|
+
verticalPos: "top",
|
686
|
+
horizontalPos: "center"
|
687
|
+
}
|
688
|
+
]
|
689
|
+
}), t;
|
690
|
+
}
|
691
|
+
getDrawableElementsForTopAxis() {
|
692
|
+
const t = [];
|
693
|
+
if (this.showAxisLine) {
|
694
|
+
const i = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2;
|
695
|
+
t.push({
|
696
|
+
type: "path",
|
697
|
+
groupTexts: ["top-axis", "axis-line"],
|
698
|
+
data: [
|
699
|
+
{
|
700
|
+
path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`,
|
701
|
+
strokeFill: this.axisThemeConfig.axisLineColor,
|
702
|
+
strokeWidth: this.axisConfig.axisLineWidth
|
703
|
+
}
|
704
|
+
]
|
705
|
+
});
|
706
|
+
}
|
707
|
+
if (this.showLabel && t.push({
|
708
|
+
type: "text",
|
709
|
+
groupTexts: ["top-axis", "label"],
|
710
|
+
data: this.getTickValues().map((i) => ({
|
711
|
+
text: i.toString(),
|
712
|
+
x: this.getScaleValue(i),
|
713
|
+
y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding,
|
714
|
+
fill: this.axisThemeConfig.labelColor,
|
715
|
+
fontSize: this.axisConfig.labelFontSize,
|
716
|
+
rotation: 0,
|
717
|
+
verticalPos: "top",
|
718
|
+
horizontalPos: "center"
|
719
|
+
}))
|
720
|
+
}), this.showTick) {
|
721
|
+
const i = this.boundingRect.y;
|
722
|
+
t.push({
|
723
|
+
type: "path",
|
724
|
+
groupTexts: ["top-axis", "ticks"],
|
725
|
+
data: this.getTickValues().map((e) => ({
|
726
|
+
path: `M ${this.getScaleValue(e)},${i + this.boundingRect.height - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)} L ${this.getScaleValue(e)},${i + this.boundingRect.height - this.axisConfig.tickLength - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)}`,
|
727
|
+
strokeFill: this.axisThemeConfig.tickColor,
|
728
|
+
strokeWidth: this.axisConfig.tickWidth
|
729
|
+
}))
|
730
|
+
});
|
731
|
+
}
|
732
|
+
return this.showTitle && t.push({
|
733
|
+
type: "text",
|
734
|
+
groupTexts: ["top-axis", "title"],
|
735
|
+
data: [
|
736
|
+
{
|
737
|
+
text: this.title,
|
738
|
+
x: this.boundingRect.x + this.boundingRect.width / 2,
|
739
|
+
y: this.boundingRect.y + this.axisConfig.titlePadding,
|
740
|
+
fill: this.axisThemeConfig.titleColor,
|
741
|
+
fontSize: this.axisConfig.titleFontSize,
|
742
|
+
rotation: 0,
|
743
|
+
verticalPos: "top",
|
744
|
+
horizontalPos: "center"
|
745
|
+
}
|
746
|
+
]
|
747
|
+
}), t;
|
748
|
+
}
|
749
|
+
getDrawableElements() {
|
750
|
+
if (this.axisPosition === "left")
|
751
|
+
return this.getDrawableElementsForLeftAxis();
|
752
|
+
if (this.axisPosition === "right")
|
753
|
+
throw Error("Drawing of right axis is not implemented");
|
754
|
+
return this.axisPosition === "bottom" ? this.getDrawableElementsForBottomAxis() : this.axisPosition === "top" ? this.getDrawableElementsForTopAxis() : [];
|
755
|
+
}
|
756
|
+
}, di = class extends Vt {
|
757
|
+
static {
|
758
|
+
n(this, "BandAxis");
|
759
|
+
}
|
760
|
+
constructor(t, i, e, s, o) {
|
761
|
+
super(t, s, o, i), this.categories = e, this.scale = kt().domain(this.categories).range(this.getRange());
|
762
|
+
}
|
763
|
+
setRange(t) {
|
764
|
+
super.setRange(t);
|
765
|
+
}
|
766
|
+
recalculateScale() {
|
767
|
+
this.scale = kt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5), Lt.trace("BandAxis axis final categories, range: ", this.categories, this.getRange());
|
768
|
+
}
|
769
|
+
getTickValues() {
|
770
|
+
return this.categories;
|
771
|
+
}
|
772
|
+
getScaleValue(t) {
|
773
|
+
return this.scale(t) ?? this.getRange()[0];
|
774
|
+
}
|
775
|
+
}, pi = class extends Vt {
|
776
|
+
static {
|
777
|
+
n(this, "LinearAxis");
|
778
|
+
}
|
779
|
+
constructor(t, i, e, s, o) {
|
780
|
+
super(t, s, o, i), this.domain = e, this.scale = Tt().domain(this.domain).range(this.getRange());
|
781
|
+
}
|
782
|
+
getTickValues() {
|
783
|
+
return this.scale.ticks();
|
784
|
+
}
|
785
|
+
recalculateScale() {
|
786
|
+
const t = [...this.domain];
|
787
|
+
this.axisPosition === "left" && t.reverse(), this.scale = Tt().domain(t).range(this.getRange());
|
788
|
+
}
|
789
|
+
getScaleValue(t) {
|
790
|
+
return this.scale(t);
|
791
|
+
}
|
792
|
+
};
|
793
|
+
function ht(t, i, e, s) {
|
794
|
+
const o = new It(s);
|
795
|
+
return ct(t) ? new di(
|
796
|
+
i,
|
797
|
+
e,
|
798
|
+
t.categories,
|
799
|
+
t.title,
|
800
|
+
o
|
801
|
+
) : new pi(
|
802
|
+
i,
|
803
|
+
e,
|
804
|
+
[t.min, t.max],
|
805
|
+
t.title,
|
806
|
+
o
|
807
|
+
);
|
808
|
+
}
|
809
|
+
n(ht, "getAxis");
|
810
|
+
var fi = class {
|
811
|
+
constructor(t, i, e, s) {
|
812
|
+
this.textDimensionCalculator = t, this.chartConfig = i, this.chartData = e, this.chartThemeConfig = s, this.boundingRect = {
|
813
|
+
x: 0,
|
814
|
+
y: 0,
|
815
|
+
width: 0,
|
816
|
+
height: 0
|
817
|
+
}, this.showChartTitle = !1;
|
818
|
+
}
|
819
|
+
static {
|
820
|
+
n(this, "ChartTitle");
|
821
|
+
}
|
822
|
+
setBoundingBoxXY(t) {
|
823
|
+
this.boundingRect.x = t.x, this.boundingRect.y = t.y;
|
824
|
+
}
|
825
|
+
calculateSpace(t) {
|
826
|
+
const i = this.textDimensionCalculator.getMaxDimension(
|
827
|
+
[this.chartData.title],
|
828
|
+
this.chartConfig.titleFontSize
|
829
|
+
), e = Math.max(i.width, t.width), s = i.height + 2 * this.chartConfig.titlePadding;
|
830
|
+
return i.width <= e && i.height <= s && this.chartConfig.showTitle && this.chartData.title && (this.boundingRect.width = e, this.boundingRect.height = s, this.showChartTitle = !0), {
|
831
|
+
width: this.boundingRect.width,
|
832
|
+
height: this.boundingRect.height
|
833
|
+
};
|
834
|
+
}
|
835
|
+
getDrawableElements() {
|
836
|
+
const t = [];
|
837
|
+
return this.showChartTitle && t.push({
|
838
|
+
groupTexts: ["chart-title"],
|
839
|
+
type: "text",
|
840
|
+
data: [
|
841
|
+
{
|
842
|
+
fontSize: this.chartConfig.titleFontSize,
|
843
|
+
text: this.chartData.title,
|
844
|
+
verticalPos: "middle",
|
845
|
+
horizontalPos: "center",
|
846
|
+
x: this.boundingRect.x + this.boundingRect.width / 2,
|
847
|
+
y: this.boundingRect.y + this.boundingRect.height / 2,
|
848
|
+
fill: this.chartThemeConfig.titleColor,
|
849
|
+
rotation: 0
|
850
|
+
}
|
851
|
+
]
|
852
|
+
}), t;
|
853
|
+
}
|
854
|
+
};
|
855
|
+
function Bt(t, i, e, s) {
|
856
|
+
const o = new It(s);
|
857
|
+
return new fi(o, t, i, e);
|
858
|
+
}
|
859
|
+
n(Bt, "getChartTitleComponent");
|
860
|
+
var yi = class {
|
861
|
+
constructor(t, i, e, s, o) {
|
862
|
+
this.plotData = t, this.xAxis = i, this.yAxis = e, this.orientation = s, this.plotIndex = o;
|
863
|
+
}
|
864
|
+
static {
|
865
|
+
n(this, "LinePlot");
|
866
|
+
}
|
867
|
+
getDrawableElement() {
|
868
|
+
const t = this.plotData.data.map((e) => [
|
869
|
+
this.xAxis.getScaleValue(e[0]),
|
870
|
+
this.yAxis.getScaleValue(e[1])
|
871
|
+
]);
|
872
|
+
let i;
|
873
|
+
return this.orientation === "horizontal" ? i = Rt().y((e) => e[0]).x((e) => e[1])(t) : i = Rt().x((e) => e[0]).y((e) => e[1])(t), i ? [
|
874
|
+
{
|
875
|
+
groupTexts: ["plot", `line-plot-${this.plotIndex}`],
|
876
|
+
type: "path",
|
877
|
+
data: [
|
878
|
+
{
|
879
|
+
path: i,
|
880
|
+
strokeFill: this.plotData.strokeFill,
|
881
|
+
strokeWidth: this.plotData.strokeWidth
|
882
|
+
}
|
883
|
+
]
|
884
|
+
}
|
885
|
+
] : [];
|
886
|
+
}
|
887
|
+
}, mi = class {
|
888
|
+
constructor(t, i, e, s, o, d) {
|
889
|
+
this.barData = t, this.boundingRect = i, this.xAxis = e, this.yAxis = s, this.orientation = o, this.plotIndex = d;
|
890
|
+
}
|
891
|
+
static {
|
892
|
+
n(this, "BarPlot");
|
893
|
+
}
|
894
|
+
getDrawableElement() {
|
895
|
+
const t = this.barData.data.map((o) => [
|
896
|
+
this.xAxis.getScaleValue(o[0]),
|
897
|
+
this.yAxis.getScaleValue(o[1])
|
898
|
+
]), e = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * (1 - 0.05), s = e / 2;
|
899
|
+
return this.orientation === "horizontal" ? [
|
900
|
+
{
|
901
|
+
groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
|
902
|
+
type: "rect",
|
903
|
+
data: t.map((o) => ({
|
904
|
+
x: this.boundingRect.x,
|
905
|
+
y: o[0] - s,
|
906
|
+
height: e,
|
907
|
+
width: o[1] - this.boundingRect.x,
|
908
|
+
fill: this.barData.fill,
|
909
|
+
strokeWidth: 0,
|
910
|
+
strokeFill: this.barData.fill
|
911
|
+
}))
|
912
|
+
}
|
913
|
+
] : [
|
914
|
+
{
|
915
|
+
groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
|
916
|
+
type: "rect",
|
917
|
+
data: t.map((o) => ({
|
918
|
+
x: o[0] - s,
|
919
|
+
y: o[1],
|
920
|
+
width: e,
|
921
|
+
height: this.boundingRect.y + this.boundingRect.height - o[1],
|
922
|
+
fill: this.barData.fill,
|
923
|
+
strokeWidth: 0,
|
924
|
+
strokeFill: this.barData.fill
|
925
|
+
}))
|
926
|
+
}
|
927
|
+
];
|
928
|
+
}
|
929
|
+
}, bi = class {
|
930
|
+
constructor(t, i, e) {
|
931
|
+
this.chartConfig = t, this.chartData = i, this.chartThemeConfig = e, this.boundingRect = {
|
932
|
+
x: 0,
|
933
|
+
y: 0,
|
934
|
+
width: 0,
|
935
|
+
height: 0
|
936
|
+
};
|
937
|
+
}
|
938
|
+
static {
|
939
|
+
n(this, "BasePlot");
|
940
|
+
}
|
941
|
+
setAxes(t, i) {
|
942
|
+
this.xAxis = t, this.yAxis = i;
|
943
|
+
}
|
944
|
+
setBoundingBoxXY(t) {
|
945
|
+
this.boundingRect.x = t.x, this.boundingRect.y = t.y;
|
946
|
+
}
|
947
|
+
calculateSpace(t) {
|
948
|
+
return this.boundingRect.width = t.width, this.boundingRect.height = t.height, {
|
949
|
+
width: this.boundingRect.width,
|
950
|
+
height: this.boundingRect.height
|
951
|
+
};
|
952
|
+
}
|
953
|
+
getDrawableElements() {
|
954
|
+
if (!(this.xAxis && this.yAxis))
|
955
|
+
throw Error("Axes must be passed to render Plots");
|
956
|
+
const t = [];
|
957
|
+
for (const [i, e] of this.chartData.plots.entries())
|
958
|
+
switch (e.type) {
|
959
|
+
case "line":
|
960
|
+
{
|
961
|
+
const s = new yi(
|
962
|
+
e,
|
963
|
+
this.xAxis,
|
964
|
+
this.yAxis,
|
965
|
+
this.chartConfig.chartOrientation,
|
966
|
+
i
|
967
|
+
);
|
968
|
+
t.push(...s.getDrawableElement());
|
969
|
+
}
|
970
|
+
break;
|
971
|
+
case "bar":
|
972
|
+
{
|
973
|
+
const s = new mi(
|
974
|
+
e,
|
975
|
+
this.boundingRect,
|
976
|
+
this.xAxis,
|
977
|
+
this.yAxis,
|
978
|
+
this.chartConfig.chartOrientation,
|
979
|
+
i
|
980
|
+
);
|
981
|
+
t.push(...s.getDrawableElement());
|
982
|
+
}
|
983
|
+
break;
|
984
|
+
}
|
985
|
+
return t;
|
986
|
+
}
|
987
|
+
};
|
988
|
+
function Mt(t, i, e) {
|
989
|
+
return new bi(t, i, e);
|
990
|
+
}
|
991
|
+
n(Mt, "getPlotComponent");
|
992
|
+
var Ai = class {
|
993
|
+
constructor(t, i, e, s) {
|
994
|
+
this.chartConfig = t, this.chartData = i, this.componentStore = {
|
995
|
+
title: Bt(t, i, e, s),
|
996
|
+
plot: Mt(t, i, e),
|
997
|
+
xAxis: ht(
|
998
|
+
i.xAxis,
|
999
|
+
t.xAxis,
|
1000
|
+
{
|
1001
|
+
titleColor: e.xAxisTitleColor,
|
1002
|
+
labelColor: e.xAxisLabelColor,
|
1003
|
+
tickColor: e.xAxisTickColor,
|
1004
|
+
axisLineColor: e.xAxisLineColor
|
1005
|
+
},
|
1006
|
+
s
|
1007
|
+
),
|
1008
|
+
yAxis: ht(
|
1009
|
+
i.yAxis,
|
1010
|
+
t.yAxis,
|
1011
|
+
{
|
1012
|
+
titleColor: e.yAxisTitleColor,
|
1013
|
+
labelColor: e.yAxisLabelColor,
|
1014
|
+
tickColor: e.yAxisTickColor,
|
1015
|
+
axisLineColor: e.yAxisLineColor
|
1016
|
+
},
|
1017
|
+
s
|
1018
|
+
)
|
1019
|
+
};
|
1020
|
+
}
|
1021
|
+
static {
|
1022
|
+
n(this, "Orchestrator");
|
1023
|
+
}
|
1024
|
+
calculateVerticalSpace() {
|
1025
|
+
let t = this.chartConfig.width, i = this.chartConfig.height, e = 0, s = 0, o = Math.floor(t * this.chartConfig.plotReservedSpacePercent / 100), d = Math.floor(
|
1026
|
+
i * this.chartConfig.plotReservedSpacePercent / 100
|
1027
|
+
), g = this.componentStore.plot.calculateSpace({
|
1028
|
+
width: o,
|
1029
|
+
height: d
|
1030
|
+
});
|
1031
|
+
t -= g.width, i -= g.height, g = this.componentStore.title.calculateSpace({
|
1032
|
+
width: this.chartConfig.width,
|
1033
|
+
height: i
|
1034
|
+
}), s = g.height, i -= g.height, this.componentStore.xAxis.setAxisPosition("bottom"), g = this.componentStore.xAxis.calculateSpace({
|
1035
|
+
width: t,
|
1036
|
+
height: i
|
1037
|
+
}), i -= g.height, this.componentStore.yAxis.setAxisPosition("left"), g = this.componentStore.yAxis.calculateSpace({
|
1038
|
+
width: t,
|
1039
|
+
height: i
|
1040
|
+
}), e = g.width, t -= g.width, t > 0 && (o += t, t = 0), i > 0 && (d += i, i = 0), this.componentStore.plot.calculateSpace({
|
1041
|
+
width: o,
|
1042
|
+
height: d
|
1043
|
+
}), this.componentStore.plot.setBoundingBoxXY({ x: e, y: s }), this.componentStore.xAxis.setRange([e, e + o]), this.componentStore.xAxis.setBoundingBoxXY({ x: e, y: s + d }), this.componentStore.yAxis.setRange([s, s + d]), this.componentStore.yAxis.setBoundingBoxXY({ x: 0, y: s }), this.chartData.plots.some((y) => ot(y)) && this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
|
1044
|
+
}
|
1045
|
+
calculateHorizontalSpace() {
|
1046
|
+
let t = this.chartConfig.width, i = this.chartConfig.height, e = 0, s = 0, o = 0, d = Math.floor(t * this.chartConfig.plotReservedSpacePercent / 100), g = Math.floor(
|
1047
|
+
i * this.chartConfig.plotReservedSpacePercent / 100
|
1048
|
+
), y = this.componentStore.plot.calculateSpace({
|
1049
|
+
width: d,
|
1050
|
+
height: g
|
1051
|
+
});
|
1052
|
+
t -= y.width, i -= y.height, y = this.componentStore.title.calculateSpace({
|
1053
|
+
width: this.chartConfig.width,
|
1054
|
+
height: i
|
1055
|
+
}), e = y.height, i -= y.height, this.componentStore.xAxis.setAxisPosition("left"), y = this.componentStore.xAxis.calculateSpace({
|
1056
|
+
width: t,
|
1057
|
+
height: i
|
1058
|
+
}), t -= y.width, s = y.width, this.componentStore.yAxis.setAxisPosition("top"), y = this.componentStore.yAxis.calculateSpace({
|
1059
|
+
width: t,
|
1060
|
+
height: i
|
1061
|
+
}), i -= y.height, o = e + y.height, t > 0 && (d += t, t = 0), i > 0 && (g += i, i = 0), this.componentStore.plot.calculateSpace({
|
1062
|
+
width: d,
|
1063
|
+
height: g
|
1064
|
+
}), this.componentStore.plot.setBoundingBoxXY({ x: s, y: o }), this.componentStore.yAxis.setRange([s, s + d]), this.componentStore.yAxis.setBoundingBoxXY({ x: s, y: e }), this.componentStore.xAxis.setRange([o, o + g]), this.componentStore.xAxis.setBoundingBoxXY({ x: 0, y: o }), this.chartData.plots.some((T) => ot(T)) && this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
|
1065
|
+
}
|
1066
|
+
calculateSpace() {
|
1067
|
+
this.chartConfig.chartOrientation === "horizontal" ? this.calculateHorizontalSpace() : this.calculateVerticalSpace();
|
1068
|
+
}
|
1069
|
+
getDrawableElement() {
|
1070
|
+
this.calculateSpace();
|
1071
|
+
const t = [];
|
1072
|
+
this.componentStore.plot.setAxes(this.componentStore.xAxis, this.componentStore.yAxis);
|
1073
|
+
for (const i of Object.values(this.componentStore))
|
1074
|
+
t.push(...i.getDrawableElements());
|
1075
|
+
return t;
|
1076
|
+
}
|
1077
|
+
}, Ci = class {
|
1078
|
+
static {
|
1079
|
+
n(this, "XYChartBuilder");
|
1080
|
+
}
|
1081
|
+
static build(t, i, e, s) {
|
1082
|
+
return new Ai(t, i, e, s).getDrawableElement();
|
1083
|
+
}
|
1084
|
+
}, Y = 0, Wt, H = xt(), U = gt(), p = dt(), rt = U.plotColorPalette.split(",").map((t) => t.trim()), K = !1, ut = !1;
|
1085
|
+
function gt() {
|
1086
|
+
const t = ci(), i = lt();
|
1087
|
+
return Et(t.xyChart, i.themeVariables.xyChart);
|
1088
|
+
}
|
1089
|
+
n(gt, "getChartDefaultThemeConfig");
|
1090
|
+
function xt() {
|
1091
|
+
const t = lt();
|
1092
|
+
return Et(
|
1093
|
+
li.xyChart,
|
1094
|
+
t.xyChart
|
1095
|
+
);
|
1096
|
+
}
|
1097
|
+
n(xt, "getChartDefaultConfig");
|
1098
|
+
function dt() {
|
1099
|
+
return {
|
1100
|
+
yAxis: {
|
1101
|
+
type: "linear",
|
1102
|
+
title: "",
|
1103
|
+
min: 1 / 0,
|
1104
|
+
max: -1 / 0
|
1105
|
+
},
|
1106
|
+
xAxis: {
|
1107
|
+
type: "band",
|
1108
|
+
title: "",
|
1109
|
+
categories: []
|
1110
|
+
},
|
1111
|
+
title: "",
|
1112
|
+
plots: []
|
1113
|
+
};
|
1114
|
+
}
|
1115
|
+
n(dt, "getChartDefaultData");
|
1116
|
+
function Z(t) {
|
1117
|
+
const i = lt();
|
1118
|
+
return ui(t.trim(), i);
|
1119
|
+
}
|
1120
|
+
n(Z, "textSanitizer");
|
1121
|
+
function Ot(t) {
|
1122
|
+
Wt = t;
|
1123
|
+
}
|
1124
|
+
n(Ot, "setTmpSVGG");
|
1125
|
+
function zt(t) {
|
1126
|
+
t === "horizontal" ? H.chartOrientation = "horizontal" : H.chartOrientation = "vertical";
|
1127
|
+
}
|
1128
|
+
n(zt, "setOrientation");
|
1129
|
+
function Ft(t) {
|
1130
|
+
p.xAxis.title = Z(t.text);
|
1131
|
+
}
|
1132
|
+
n(Ft, "setXAxisTitle");
|
1133
|
+
function pt(t, i) {
|
1134
|
+
p.xAxis = { type: "linear", title: p.xAxis.title, min: t, max: i }, K = !0;
|
1135
|
+
}
|
1136
|
+
n(pt, "setXAxisRangeData");
|
1137
|
+
function Xt(t) {
|
1138
|
+
p.xAxis = {
|
1139
|
+
type: "band",
|
1140
|
+
title: p.xAxis.title,
|
1141
|
+
categories: t.map((i) => Z(i.text))
|
1142
|
+
}, K = !0;
|
1143
|
+
}
|
1144
|
+
n(Xt, "setXAxisBand");
|
1145
|
+
function Nt(t) {
|
1146
|
+
p.yAxis.title = Z(t.text);
|
1147
|
+
}
|
1148
|
+
n(Nt, "setYAxisTitle");
|
1149
|
+
function Yt(t, i) {
|
1150
|
+
p.yAxis = { type: "linear", title: p.yAxis.title, min: t, max: i }, ut = !0;
|
1151
|
+
}
|
1152
|
+
n(Yt, "setYAxisRangeData");
|
1153
|
+
function Ht(t) {
|
1154
|
+
const i = Math.min(...t), e = Math.max(...t), s = F(p.yAxis) ? p.yAxis.min : 1 / 0, o = F(p.yAxis) ? p.yAxis.max : -1 / 0;
|
1155
|
+
p.yAxis = {
|
1156
|
+
type: "linear",
|
1157
|
+
title: p.yAxis.title,
|
1158
|
+
min: Math.min(s, i),
|
1159
|
+
max: Math.max(o, e)
|
1160
|
+
};
|
1161
|
+
}
|
1162
|
+
n(Ht, "setYAxisRangeFromPlotData");
|
1163
|
+
function ft(t) {
|
1164
|
+
let i = [];
|
1165
|
+
if (t.length === 0)
|
1166
|
+
return i;
|
1167
|
+
if (!K) {
|
1168
|
+
const e = F(p.xAxis) ? p.xAxis.min : 1 / 0, s = F(p.xAxis) ? p.xAxis.max : -1 / 0;
|
1169
|
+
pt(Math.min(e, 1), Math.max(s, t.length));
|
1170
|
+
}
|
1171
|
+
if (ut || Ht(t), ct(p.xAxis) && (i = p.xAxis.categories.map((e, s) => [e, t[s]])), F(p.xAxis)) {
|
1172
|
+
const e = p.xAxis.min, s = p.xAxis.max, o = (s - e) / (t.length - 1), d = [];
|
1173
|
+
for (let g = e; g <= s; g += o)
|
1174
|
+
d.push(`${g}`);
|
1175
|
+
i = d.map((g, y) => [g, t[y]]);
|
1176
|
+
}
|
1177
|
+
return i;
|
1178
|
+
}
|
1179
|
+
n(ft, "transformDataWithoutCategory");
|
1180
|
+
function yt(t) {
|
1181
|
+
return rt[t === 0 ? 0 : t % rt.length];
|
1182
|
+
}
|
1183
|
+
n(yt, "getPlotColorFromPalette");
|
1184
|
+
function Ut(t, i) {
|
1185
|
+
const e = ft(i);
|
1186
|
+
p.plots.push({
|
1187
|
+
type: "line",
|
1188
|
+
strokeFill: yt(Y),
|
1189
|
+
strokeWidth: 2,
|
1190
|
+
data: e
|
1191
|
+
}), Y++;
|
1192
|
+
}
|
1193
|
+
n(Ut, "setLineData");
|
1194
|
+
function $t(t, i) {
|
1195
|
+
const e = ft(i);
|
1196
|
+
p.plots.push({
|
1197
|
+
type: "bar",
|
1198
|
+
fill: yt(Y),
|
1199
|
+
data: e
|
1200
|
+
}), Y++;
|
1201
|
+
}
|
1202
|
+
n($t, "setBarData");
|
1203
|
+
function qt() {
|
1204
|
+
if (p.plots.length === 0)
|
1205
|
+
throw Error("No Plot to render, please provide a plot with some data");
|
1206
|
+
return p.title = Pt(), Ci.build(H, p, U, Wt);
|
1207
|
+
}
|
1208
|
+
n(qt, "getDrawableElem");
|
1209
|
+
function Gt() {
|
1210
|
+
return U;
|
1211
|
+
}
|
1212
|
+
n(Gt, "getChartThemeConfig");
|
1213
|
+
function jt() {
|
1214
|
+
return H;
|
1215
|
+
}
|
1216
|
+
n(jt, "getChartConfig");
|
1217
|
+
var wi = /* @__PURE__ */ n(function() {
|
1218
|
+
ri(), Y = 0, H = xt(), p = dt(), U = gt(), rt = U.plotColorPalette.split(",").map((t) => t.trim()), K = !1, ut = !1;
|
1219
|
+
}, "clear"), Si = {
|
1220
|
+
getDrawableElem: qt,
|
1221
|
+
clear: wi,
|
1222
|
+
setAccTitle: ai,
|
1223
|
+
getAccTitle: ni,
|
1224
|
+
setDiagramTitle: si,
|
1225
|
+
getDiagramTitle: Pt,
|
1226
|
+
getAccDescription: ei,
|
1227
|
+
setAccDescription: ii,
|
1228
|
+
setOrientation: zt,
|
1229
|
+
setXAxisTitle: Ft,
|
1230
|
+
setXAxisRangeData: pt,
|
1231
|
+
setXAxisBand: Xt,
|
1232
|
+
setYAxisTitle: Nt,
|
1233
|
+
setYAxisRangeData: Yt,
|
1234
|
+
setLineData: Ut,
|
1235
|
+
setBarData: $t,
|
1236
|
+
setTmpSVGG: Ot,
|
1237
|
+
getChartThemeConfig: Gt,
|
1238
|
+
getChartConfig: jt
|
1239
|
+
}, _i = /* @__PURE__ */ n((t, i, e, s) => {
|
1240
|
+
const o = s.db, d = o.getChartThemeConfig(), g = o.getChartConfig();
|
1241
|
+
function y(f) {
|
1242
|
+
return f === "top" ? "text-before-edge" : "middle";
|
1243
|
+
}
|
1244
|
+
n(y, "getDominantBaseLine");
|
1245
|
+
function T(f) {
|
1246
|
+
return f === "left" ? "start" : f === "right" ? "end" : "middle";
|
1247
|
+
}
|
1248
|
+
n(T, "getTextAnchor");
|
1249
|
+
function E(f) {
|
1250
|
+
return `translate(${f.x}, ${f.y}) rotate(${f.rotation || 0})`;
|
1251
|
+
}
|
1252
|
+
n(E, "getTextTransformation"), Lt.debug(`Rendering xychart chart
|
1253
|
+
` + t);
|
1254
|
+
const S = oi(i), R = S.append("g").attr("class", "main"), I = R.append("rect").attr("width", g.width).attr("height", g.height).attr("class", "background");
|
1255
|
+
hi(S, g.height, g.width, !0), S.attr("viewBox", `0 0 ${g.width} ${g.height}`), I.attr("fill", d.backgroundColor), o.setTmpSVGG(S.append("g").attr("class", "mermaid-tmp-group"));
|
1256
|
+
const V = o.getDrawableElem(), _ = {};
|
1257
|
+
function L(f) {
|
1258
|
+
let C = R, r = "";
|
1259
|
+
for (const [D] of f.entries()) {
|
1260
|
+
let X = R;
|
1261
|
+
D > 0 && _[r] && (X = _[r]), r += f[D], C = _[r], C || (C = _[r] = X.append("g").attr("class", f[D]));
|
1262
|
+
}
|
1263
|
+
return C;
|
1264
|
+
}
|
1265
|
+
n(L, "getGroup");
|
1266
|
+
for (const f of V) {
|
1267
|
+
if (f.data.length === 0)
|
1268
|
+
continue;
|
1269
|
+
const C = L(f.groupTexts);
|
1270
|
+
switch (f.type) {
|
1271
|
+
case "rect":
|
1272
|
+
C.selectAll("rect").data(f.data).enter().append("rect").attr("x", (r) => r.x).attr("y", (r) => r.y).attr("width", (r) => r.width).attr("height", (r) => r.height).attr("fill", (r) => r.fill).attr("stroke", (r) => r.strokeFill).attr("stroke-width", (r) => r.strokeWidth);
|
1273
|
+
break;
|
1274
|
+
case "text":
|
1275
|
+
C.selectAll("text").data(f.data).enter().append("text").attr("x", 0).attr("y", 0).attr("fill", (r) => r.fill).attr("font-size", (r) => r.fontSize).attr("dominant-baseline", (r) => y(r.verticalPos)).attr("text-anchor", (r) => T(r.horizontalPos)).attr("transform", (r) => E(r)).text((r) => r.text);
|
1276
|
+
break;
|
1277
|
+
case "path":
|
1278
|
+
C.selectAll("path").data(f.data).enter().append("path").attr("d", (r) => r.path).attr("fill", (r) => r.fill ? r.fill : "none").attr("stroke", (r) => r.strokeFill).attr("stroke-width", (r) => r.strokeWidth);
|
1279
|
+
break;
|
1280
|
+
}
|
1281
|
+
}
|
1282
|
+
}, "draw"), ki = {
|
1283
|
+
draw: _i
|
1284
|
+
}, Ri = {
|
1285
|
+
parser: xi,
|
1286
|
+
db: Si,
|
1287
|
+
renderer: ki
|
1288
|
+
};
|
1289
|
+
export {
|
1290
|
+
Ri as diagram
|
1291
|
+
};
|