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