lowcoder-comps 0.0.20 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/029c585a.js +825 -0
  2. package/0f49842f.js +915 -0
  3. package/14c95def.js +2396 -0
  4. package/{5a7c40d7.js → 14de54b2.js} +7120 -6939
  5. package/17b0984b.js +1116 -0
  6. package/{a1f987b7.js → 1a4b39ab.js} +29 -30
  7. package/1e35aee7.js +932 -0
  8. package/{804e952b.js → 1f97d569.js} +73 -76
  9. package/3120eee5.js +1235 -0
  10. package/313e94fb.js +796 -0
  11. package/{384b70d4.js → 41a4677f.js} +10 -12
  12. package/{e1466a22.js → 48a69d01.js} +89 -97
  13. package/4a8006fe.js +2501 -0
  14. package/{a06ced05.js → 585231df.js} +64 -71
  15. package/5e96f5d8.js +64 -0
  16. package/5f9be850.js +1055 -0
  17. package/{3196b84f.js → 6e0c66a6.js} +97 -109
  18. package/76d315c1.js +2192 -0
  19. package/{31c6e136.js → 867cdd47.js} +1 -1
  20. package/{0d5d7030.js → 8a65542f.js} +58 -64
  21. package/913e1a65.js +804 -0
  22. package/92e85b65.js +65 -0
  23. package/97298a99.js +2966 -0
  24. package/{5fd0f607.js → a396e61e.js} +44 -44
  25. package/a6d42292.js +1284 -0
  26. package/afd2e4d5.js +86 -0
  27. package/be5f3226.js +768 -0
  28. package/{4791bdd6.js → bf75928a.js} +30142 -30663
  29. package/{011ccb4a.js → bfd01456.js} +4257 -4221
  30. package/c239ec69.js +1000 -0
  31. package/e731f493.js +502 -0
  32. package/ef3524ce.js +960 -0
  33. package/f5b4a4bc.js +365 -0
  34. package/{8d714103.js → fa29410e.js} +598 -622
  35. package/fbc7bdd4.js +218 -0
  36. package/index.js +2 -2
  37. package/package.json +2 -2
  38. package/01102044.js +0 -940
  39. package/0e8dfd52.js +0 -793
  40. package/0f25771b.js +0 -1118
  41. package/2470e1d8.js +0 -91
  42. package/32432dc3.js +0 -86
  43. package/36552e14.js +0 -849
  44. package/3ad35722.js +0 -365
  45. package/3f4db197.js +0 -943
  46. package/71827e37.js +0 -1032
  47. package/7a200c6a.js +0 -607
  48. package/872f2918.js +0 -7
  49. package/93b98f3e.js +0 -832
  50. package/a42a2ba9.js +0 -2103
  51. package/af0489f3.js +0 -2456
  52. package/b56f953d.js +0 -985
  53. package/b89c6a6a.js +0 -159
  54. package/bc7030d3.js +0 -70
  55. package/c739ba3e.js +0 -2679
  56. package/d306d59c.js +0 -2827
  57. package/d8adcd1e.js +0 -823
  58. package/ef845d7f.js +0 -1246
package/01102044.js DELETED
@@ -1,940 +0,0 @@
1
- var It = Object.defineProperty;
2
- var vt = Object.getOwnPropertySymbols;
3
- var Bt = Object.prototype.hasOwnProperty, Vt = Object.prototype.propertyIsEnumerable;
4
- var kt = (e, i, r) => i in e ? It(e, i, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[i] = r, tt = (e, i) => {
5
- for (var r in i || (i = {}))
6
- Bt.call(i, r) && kt(e, r, i[r]);
7
- if (vt)
8
- for (var r of vt(i))
9
- Vt.call(i, r) && kt(e, r, i[r]);
10
- return e;
11
- };
12
- import { T as wt, c as Tt, U as I, l as ht, s as Rt, g as Wt, z as Nt, A as Pt, a as Ut, b as Qt, m as Ht, B as Mt, h as qt, i as Xt, d as Ot } from "./4791bdd6.js";
13
- import { l as Ft } from "./5fd0f607.js";
14
- import "./f9637058.js";
15
- var _t = function() {
16
- var e = function(K, n, s, d) {
17
- for (s = s || {}, d = K.length; d--; s[K[d]] = n)
18
- ;
19
- return s;
20
- }, i = [1, 3], r = [1, 5], f = [1, 6], g = [1, 7], x = [1, 8], h = [1, 10], p = [1, 5, 14, 16, 18, 20, 21, 26, 28, 29, 30, 31, 32, 38, 39, 40, 41, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60], l = [1, 5, 7, 14, 16, 18, 20, 21, 26, 28, 29, 30, 31, 32, 38, 39, 40, 41, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60], o = [38, 39, 40], y = [2, 8], B = [1, 19], W = [1, 23], L = [1, 24], C = [1, 25], N = [1, 26], M = [1, 27], X = [1, 29], D = [1, 30], at = [1, 31], nt = [1, 32], rt = [1, 33], st = [1, 34], Q = [1, 37], U = [1, 38], T = [1, 39], _ = [1, 40], t = [1, 41], m = [1, 42], b = [1, 43], A = [1, 44], S = [1, 45], v = [1, 46], k = [1, 47], F = [1, 48], P = [1, 49], mt = [1, 52], O = [1, 67], Y = [1, 68], z = [5, 23, 27, 38, 39, 40, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61], dt = [5, 7, 38, 39, 40, 41], ut = {
21
- trace: function() {
22
- },
23
- yy: {},
24
- symbols_: { error: 2, start: 3, eol: 4, SPACE: 5, directive: 6, QUADRANT: 7, document: 8, line: 9, statement: 10, axisDetails: 11, quadrantDetails: 12, points: 13, title: 14, title_value: 15, acc_title: 16, acc_title_value: 17, acc_descr: 18, acc_descr_value: 19, acc_descr_multiline_value: 20, section: 21, text: 22, point_start: 23, point_x: 24, point_y: 25, "X-AXIS": 26, "AXIS-TEXT-DELIMITER": 27, "Y-AXIS": 28, QUADRANT_1: 29, QUADRANT_2: 30, QUADRANT_3: 31, QUADRANT_4: 32, openDirective: 33, typeDirective: 34, closeDirective: 35, ":": 36, argDirective: 37, NEWLINE: 38, SEMI: 39, EOF: 40, open_directive: 41, type_directive: 42, arg_directive: 43, close_directive: 44, alphaNumToken: 45, textNoTagsToken: 46, STR: 47, MD_STR: 48, alphaNum: 49, PUNCTUATION: 50, AMP: 51, NUM: 52, ALPHA: 53, COMMA: 54, PLUS: 55, EQUALS: 56, MULT: 57, DOT: 58, BRKT: 59, UNDERSCORE: 60, MINUS: 61, $accept: 0, $end: 1 },
25
- terminals_: { 2: "error", 5: "SPACE", 7: "QUADRANT", 14: "title", 15: "title_value", 16: "acc_title", 17: "acc_title_value", 18: "acc_descr", 19: "acc_descr_value", 20: "acc_descr_multiline_value", 21: "section", 23: "point_start", 24: "point_x", 25: "point_y", 26: "X-AXIS", 27: "AXIS-TEXT-DELIMITER", 28: "Y-AXIS", 29: "QUADRANT_1", 30: "QUADRANT_2", 31: "QUADRANT_3", 32: "QUADRANT_4", 36: ":", 38: "NEWLINE", 39: "SEMI", 40: "EOF", 41: "open_directive", 42: "type_directive", 43: "arg_directive", 44: "close_directive", 47: "STR", 48: "MD_STR", 50: "PUNCTUATION", 51: "AMP", 52: "NUM", 53: "ALPHA", 54: "COMMA", 55: "PLUS", 56: "EQUALS", 57: "MULT", 58: "DOT", 59: "BRKT", 60: "UNDERSCORE", 61: "MINUS" },
26
- productions_: [0, [3, 2], [3, 2], [3, 2], [3, 2], [8, 0], [8, 2], [9, 2], [10, 0], [10, 2], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [10, 2], [10, 1], [10, 1], [10, 1], [13, 4], [11, 4], [11, 3], [11, 2], [11, 4], [11, 3], [11, 2], [12, 2], [12, 2], [12, 2], [12, 2], [6, 3], [6, 5], [4, 1], [4, 1], [4, 1], [33, 1], [34, 1], [37, 1], [35, 1], [22, 1], [22, 2], [22, 1], [22, 1], [49, 1], [49, 2], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [45, 1], [46, 1], [46, 1], [46, 1]],
27
- performAction: function(n, s, d, c, q, a, it) {
28
- var u = a.length - 1;
29
- switch (q) {
30
- case 13:
31
- this.$ = a[u].trim(), c.setDiagramTitle(this.$);
32
- break;
33
- case 14:
34
- this.$ = a[u].trim(), c.setAccTitle(this.$);
35
- break;
36
- case 15:
37
- case 16:
38
- this.$ = a[u].trim(), c.setAccDescription(this.$);
39
- break;
40
- case 17:
41
- c.addSection(a[u].substr(8)), this.$ = a[u].substr(8);
42
- break;
43
- case 19:
44
- c.addPoint(a[u - 3], a[u - 1], a[u]);
45
- break;
46
- case 20:
47
- c.setXAxisLeftText(a[u - 2]), c.setXAxisRightText(a[u]);
48
- break;
49
- case 21:
50
- a[u - 1].text += " ⟶ ", c.setXAxisLeftText(a[u - 1]);
51
- break;
52
- case 22:
53
- c.setXAxisLeftText(a[u]);
54
- break;
55
- case 23:
56
- c.setYAxisBottomText(a[u - 2]), c.setYAxisTopText(a[u]);
57
- break;
58
- case 24:
59
- a[u - 1].text += " ⟶ ", c.setYAxisBottomText(a[u - 1]);
60
- break;
61
- case 25:
62
- c.setYAxisBottomText(a[u]);
63
- break;
64
- case 26:
65
- c.setQuadrant1Text(a[u]);
66
- break;
67
- case 27:
68
- c.setQuadrant2Text(a[u]);
69
- break;
70
- case 28:
71
- c.setQuadrant3Text(a[u]);
72
- break;
73
- case 29:
74
- c.setQuadrant4Text(a[u]);
75
- break;
76
- case 35:
77
- c.parseDirective("%%{", "open_directive");
78
- break;
79
- case 36:
80
- c.parseDirective(a[u], "type_directive");
81
- break;
82
- case 37:
83
- a[u] = a[u].trim().replace(/'/g, '"'), c.parseDirective(a[u], "arg_directive");
84
- break;
85
- case 38:
86
- c.parseDirective("}%%", "close_directive", "quadrantChart");
87
- break;
88
- case 39:
89
- this.$ = { text: a[u], type: "text" };
90
- break;
91
- case 40:
92
- this.$ = { text: a[u - 1].text + "" + a[u], type: a[u - 1].type };
93
- break;
94
- case 41:
95
- this.$ = { text: a[u], type: "text" };
96
- break;
97
- case 42:
98
- this.$ = { text: a[u], type: "markdown" };
99
- break;
100
- case 43:
101
- this.$ = a[u];
102
- break;
103
- case 44:
104
- this.$ = a[u - 1] + "" + a[u];
105
- break;
106
- }
107
- },
108
- table: [{ 3: 1, 4: 2, 5: i, 6: 4, 7: r, 33: 9, 38: f, 39: g, 40: x, 41: h }, { 1: [3] }, { 3: 11, 4: 2, 5: i, 6: 4, 7: r, 33: 9, 38: f, 39: g, 40: x, 41: h }, { 3: 12, 4: 2, 5: i, 6: 4, 7: r, 33: 9, 38: f, 39: g, 40: x, 41: h }, { 3: 13, 4: 2, 5: i, 6: 4, 7: r, 33: 9, 38: f, 39: g, 40: x, 41: h }, e(p, [2, 5], { 8: 14 }), e(l, [2, 32]), e(l, [2, 33]), e(l, [2, 34]), { 34: 15, 42: [1, 16] }, { 42: [2, 35] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, e(o, y, { 33: 9, 9: 17, 10: 18, 11: 20, 12: 21, 13: 22, 6: 28, 22: 35, 45: 36, 1: [2, 4], 5: B, 14: W, 16: L, 18: C, 20: N, 21: M, 26: X, 28: D, 29: at, 30: nt, 31: rt, 32: st, 41: h, 47: Q, 48: U, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P }), { 35: 50, 36: [1, 51], 44: mt }, e([36, 44], [2, 36]), e(p, [2, 6]), { 4: 53, 38: f, 39: g, 40: x }, e(o, y, { 33: 9, 11: 20, 12: 21, 13: 22, 6: 28, 22: 35, 45: 36, 10: 54, 5: B, 14: W, 16: L, 18: C, 20: N, 21: M, 26: X, 28: D, 29: at, 30: nt, 31: rt, 32: st, 41: h, 47: Q, 48: U, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P }), e(o, [2, 10]), e(o, [2, 11]), e(o, [2, 12]), { 15: [1, 55] }, { 17: [1, 56] }, { 19: [1, 57] }, e(o, [2, 16]), e(o, [2, 17]), e(o, [2, 18]), { 22: 58, 45: 36, 47: Q, 48: U, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P }, { 22: 59, 45: 36, 47: Q, 48: U, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P }, { 22: 60, 45: 36, 47: Q, 48: U, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P }, { 22: 61, 45: 36, 47: Q, 48: U, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P }, { 22: 62, 45: 36, 47: Q, 48: U, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P }, { 22: 63, 45: 36, 47: Q, 48: U, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P }, { 5: O, 23: [1, 64], 45: 66, 46: 65, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P, 61: Y }, e(z, [2, 39]), e(z, [2, 41]), e(z, [2, 42]), e(z, [2, 45]), e(z, [2, 46]), e(z, [2, 47]), e(z, [2, 48]), e(z, [2, 49]), e(z, [2, 50]), e(z, [2, 51]), e(z, [2, 52]), e(z, [2, 53]), e(z, [2, 54]), e(z, [2, 55]), e(dt, [2, 30]), { 37: 69, 43: [1, 70] }, e(dt, [2, 38]), e(p, [2, 7]), e(o, [2, 9]), e(o, [2, 13]), e(o, [2, 14]), e(o, [2, 15]), e(o, [2, 22], { 46: 65, 45: 66, 5: O, 27: [1, 71], 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P, 61: Y }), e(o, [2, 25], { 46: 65, 45: 66, 5: O, 27: [1, 72], 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P, 61: Y }), e(o, [2, 26], { 46: 65, 45: 66, 5: O, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P, 61: Y }), e(o, [2, 27], { 46: 65, 45: 66, 5: O, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P, 61: Y }), e(o, [2, 28], { 46: 65, 45: 66, 5: O, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P, 61: Y }), e(o, [2, 29], { 46: 65, 45: 66, 5: O, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P, 61: Y }), { 24: [1, 73] }, e(z, [2, 40]), e(z, [2, 56]), e(z, [2, 57]), e(z, [2, 58]), { 35: 74, 44: mt }, { 44: [2, 37] }, e(o, [2, 21], { 45: 36, 22: 75, 47: Q, 48: U, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P }), e(o, [2, 24], { 45: 36, 22: 76, 47: Q, 48: U, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P }), { 25: [1, 77] }, e(dt, [2, 31]), e(o, [2, 20], { 46: 65, 45: 66, 5: O, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P, 61: Y }), e(o, [2, 23], { 46: 65, 45: 66, 5: O, 50: T, 51: _, 52: t, 53: m, 54: b, 55: A, 56: S, 57: v, 58: k, 59: F, 60: P, 61: Y }), e(o, [2, 19])],
109
- defaultActions: { 10: [2, 35], 11: [2, 1], 12: [2, 2], 13: [2, 3], 70: [2, 37] },
110
- parseError: function(n, s) {
111
- if (s.recoverable)
112
- this.trace(n);
113
- else {
114
- var d = new Error(n);
115
- throw d.hash = s, d;
116
- }
117
- },
118
- parse: function(n) {
119
- var s = this, d = [0], c = [], q = [null], a = [], it = this.table, u = "", lt = 0, bt = 0, Ct = 2, At = 1, Dt = a.slice.call(arguments, 1), E = Object.create(this.lexer), Z = { yy: {} };
120
- for (var ft in this.yy)
121
- Object.prototype.hasOwnProperty.call(this.yy, ft) && (Z.yy[ft] = this.yy[ft]);
122
- E.setInput(n, Z.yy), Z.yy.lexer = E, Z.yy.parser = this, typeof E.yylloc == "undefined" && (E.yylloc = {});
123
- var gt = E.yylloc;
124
- a.push(gt);
125
- var zt = E.options && E.options.ranges;
126
- typeof Z.yy.parseError == "function" ? this.parseError = Z.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
127
- function Et() {
128
- var G;
129
- return G = c.pop() || E.lex() || At, typeof G != "number" && (G instanceof Array && (c = G, G = c.pop()), G = s.symbols_[G] || G), G;
130
- }
131
- for (var R, J, H, pt, et = {}, ot, j, St, ct; ; ) {
132
- if (J = d[d.length - 1], this.defaultActions[J] ? H = this.defaultActions[J] : ((R === null || typeof R == "undefined") && (R = Et()), H = it[J] && it[J][R]), typeof H == "undefined" || !H.length || !H[0]) {
133
- var yt = "";
134
- ct = [];
135
- for (ot in it[J])
136
- this.terminals_[ot] && ot > Ct && ct.push("'" + this.terminals_[ot] + "'");
137
- E.showPosition ? yt = "Parse error on line " + (lt + 1) + `:
138
- ` + E.showPosition() + `
139
- Expecting ` + ct.join(", ") + ", got '" + (this.terminals_[R] || R) + "'" : yt = "Parse error on line " + (lt + 1) + ": Unexpected " + (R == At ? "end of input" : "'" + (this.terminals_[R] || R) + "'"), this.parseError(yt, {
140
- text: E.match,
141
- token: this.terminals_[R] || R,
142
- line: E.yylineno,
143
- loc: gt,
144
- expected: ct
145
- });
146
- }
147
- if (H[0] instanceof Array && H.length > 1)
148
- throw new Error("Parse Error: multiple actions possible at state: " + J + ", token: " + R);
149
- switch (H[0]) {
150
- case 1:
151
- d.push(R), q.push(E.yytext), a.push(E.yylloc), d.push(H[1]), R = null, bt = E.yyleng, u = E.yytext, lt = E.yylineno, gt = E.yylloc;
152
- break;
153
- case 2:
154
- if (j = this.productions_[H[1]][1], et.$ = q[q.length - j], et._$ = {
155
- first_line: a[a.length - (j || 1)].first_line,
156
- last_line: a[a.length - 1].last_line,
157
- first_column: a[a.length - (j || 1)].first_column,
158
- last_column: a[a.length - 1].last_column
159
- }, zt && (et._$.range = [
160
- a[a.length - (j || 1)].range[0],
161
- a[a.length - 1].range[1]
162
- ]), pt = this.performAction.apply(et, [
163
- u,
164
- bt,
165
- lt,
166
- Z.yy,
167
- H[1],
168
- q,
169
- a
170
- ].concat(Dt)), typeof pt != "undefined")
171
- return pt;
172
- j && (d = d.slice(0, -1 * j * 2), q = q.slice(0, -1 * j), a = a.slice(0, -1 * j)), d.push(this.productions_[H[1]][0]), q.push(et.$), a.push(et._$), St = it[d[d.length - 2]][d[d.length - 1]], d.push(St);
173
- break;
174
- case 3:
175
- return !0;
176
- }
177
- }
178
- return !0;
179
- }
180
- }, Lt = function() {
181
- var K = {
182
- EOF: 1,
183
- parseError: function(s, d) {
184
- if (this.yy.parser)
185
- this.yy.parser.parseError(s, d);
186
- else
187
- throw new Error(s);
188
- },
189
- // resets the lexer, sets new input
190
- setInput: function(n, s) {
191
- return this.yy = s || this.yy || {}, this._input = n, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
192
- first_line: 1,
193
- first_column: 0,
194
- last_line: 1,
195
- last_column: 0
196
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
197
- },
198
- // consumes and returns one char from the input
199
- input: function() {
200
- var n = this._input[0];
201
- this.yytext += n, this.yyleng++, this.offset++, this.match += n, this.matched += n;
202
- var s = n.match(/(?:\r\n?|\n).*/g);
203
- return s ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), n;
204
- },
205
- // unshifts one char (or a string) into the input
206
- unput: function(n) {
207
- var s = n.length, d = n.split(/(?:\r\n?|\n)/g);
208
- this._input = n + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - s), this.offset -= s;
209
- var c = this.match.split(/(?:\r\n?|\n)/g);
210
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), d.length - 1 && (this.yylineno -= d.length - 1);
211
- var q = this.yylloc.range;
212
- return this.yylloc = {
213
- first_line: this.yylloc.first_line,
214
- last_line: this.yylineno + 1,
215
- first_column: this.yylloc.first_column,
216
- last_column: d ? (d.length === c.length ? this.yylloc.first_column : 0) + c[c.length - d.length].length - d[0].length : this.yylloc.first_column - s
217
- }, this.options.ranges && (this.yylloc.range = [q[0], q[0] + this.yyleng - s]), this.yyleng = this.yytext.length, this;
218
- },
219
- // When called from action, caches matched text and appends it on next action
220
- more: function() {
221
- return this._more = !0, this;
222
- },
223
- // 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.
224
- reject: function() {
225
- if (this.options.backtrack_lexer)
226
- this._backtrack = !0;
227
- else
228
- 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).
229
- ` + this.showPosition(), {
230
- text: "",
231
- token: null,
232
- line: this.yylineno
233
- });
234
- return this;
235
- },
236
- // retain first n characters of the match
237
- less: function(n) {
238
- this.unput(this.match.slice(n));
239
- },
240
- // displays already matched input, i.e. for error messages
241
- pastInput: function() {
242
- var n = this.matched.substr(0, this.matched.length - this.match.length);
243
- return (n.length > 20 ? "..." : "") + n.substr(-20).replace(/\n/g, "");
244
- },
245
- // displays upcoming input, i.e. for error messages
246
- upcomingInput: function() {
247
- var n = this.match;
248
- return n.length < 20 && (n += this._input.substr(0, 20 - n.length)), (n.substr(0, 20) + (n.length > 20 ? "..." : "")).replace(/\n/g, "");
249
- },
250
- // displays the character position where the lexing error occurred, i.e. for error messages
251
- showPosition: function() {
252
- var n = this.pastInput(), s = new Array(n.length + 1).join("-");
253
- return n + this.upcomingInput() + `
254
- ` + s + "^";
255
- },
256
- // test the lexed token: return FALSE when not a match, otherwise return token
257
- test_match: function(n, s) {
258
- var d, c, q;
259
- if (this.options.backtrack_lexer && (q = {
260
- yylineno: this.yylineno,
261
- yylloc: {
262
- first_line: this.yylloc.first_line,
263
- last_line: this.last_line,
264
- first_column: this.yylloc.first_column,
265
- last_column: this.yylloc.last_column
266
- },
267
- yytext: this.yytext,
268
- match: this.match,
269
- matches: this.matches,
270
- matched: this.matched,
271
- yyleng: this.yyleng,
272
- offset: this.offset,
273
- _more: this._more,
274
- _input: this._input,
275
- yy: this.yy,
276
- conditionStack: this.conditionStack.slice(0),
277
- done: this.done
278
- }, this.options.ranges && (q.yylloc.range = this.yylloc.range.slice(0))), c = n[0].match(/(?:\r\n?|\n).*/g), c && (this.yylineno += c.length), this.yylloc = {
279
- first_line: this.yylloc.last_line,
280
- last_line: this.yylineno + 1,
281
- first_column: this.yylloc.last_column,
282
- last_column: c ? c[c.length - 1].length - c[c.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + n[0].length
283
- }, this.yytext += n[0], this.match += n[0], this.matches = n, 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(n[0].length), this.matched += n[0], d = this.performAction.call(this, this.yy, this, s, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), d)
284
- return d;
285
- if (this._backtrack) {
286
- for (var a in q)
287
- this[a] = q[a];
288
- return !1;
289
- }
290
- return !1;
291
- },
292
- // return next match in input
293
- next: function() {
294
- if (this.done)
295
- return this.EOF;
296
- this._input || (this.done = !0);
297
- var n, s, d, c;
298
- this._more || (this.yytext = "", this.match = "");
299
- for (var q = this._currentRules(), a = 0; a < q.length; a++)
300
- if (d = this._input.match(this.rules[q[a]]), d && (!s || d[0].length > s[0].length)) {
301
- if (s = d, c = a, this.options.backtrack_lexer) {
302
- if (n = this.test_match(d, q[a]), n !== !1)
303
- return n;
304
- if (this._backtrack) {
305
- s = !1;
306
- continue;
307
- } else
308
- return !1;
309
- } else if (!this.options.flex)
310
- break;
311
- }
312
- return s ? (n = this.test_match(s, q[c]), n !== !1 ? n : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
313
- ` + this.showPosition(), {
314
- text: "",
315
- token: null,
316
- line: this.yylineno
317
- });
318
- },
319
- // return next match that has a token
320
- lex: function() {
321
- var s = this.next();
322
- return s || this.lex();
323
- },
324
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
325
- begin: function(s) {
326
- this.conditionStack.push(s);
327
- },
328
- // pop the previously active lexer condition state off the condition stack
329
- popState: function() {
330
- var s = this.conditionStack.length - 1;
331
- return s > 0 ? this.conditionStack.pop() : this.conditionStack[0];
332
- },
333
- // produce the lexer rule set which is active for the currently active lexer condition state
334
- _currentRules: function() {
335
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
336
- },
337
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
338
- topState: function(s) {
339
- return s = this.conditionStack.length - 1 - Math.abs(s || 0), s >= 0 ? this.conditionStack[s] : "INITIAL";
340
- },
341
- // alias for begin(condition)
342
- pushState: function(s) {
343
- this.begin(s);
344
- },
345
- // return the number of states currently on the stack
346
- stateStackSize: function() {
347
- return this.conditionStack.length;
348
- },
349
- options: { "case-insensitive": !0 },
350
- performAction: function(s, d, c, q) {
351
- switch (c) {
352
- case 0:
353
- return this.begin("open_directive"), 41;
354
- case 1:
355
- return this.begin("type_directive"), 42;
356
- case 2:
357
- return this.popState(), this.begin("arg_directive"), 36;
358
- case 3:
359
- return this.popState(), this.popState(), 44;
360
- case 4:
361
- return 43;
362
- case 5:
363
- break;
364
- case 6:
365
- break;
366
- case 7:
367
- return 38;
368
- case 8:
369
- break;
370
- case 9:
371
- return this.begin("title"), 14;
372
- case 10:
373
- return this.popState(), "title_value";
374
- case 11:
375
- return this.begin("acc_title"), 16;
376
- case 12:
377
- return this.popState(), "acc_title_value";
378
- case 13:
379
- return this.begin("acc_descr"), 18;
380
- case 14:
381
- return this.popState(), "acc_descr_value";
382
- case 15:
383
- this.begin("acc_descr_multiline");
384
- break;
385
- case 16:
386
- this.popState();
387
- break;
388
- case 17:
389
- return "acc_descr_multiline_value";
390
- case 18:
391
- return 26;
392
- case 19:
393
- return 28;
394
- case 20:
395
- return 27;
396
- case 21:
397
- return 29;
398
- case 22:
399
- return 30;
400
- case 23:
401
- return 31;
402
- case 24:
403
- return 32;
404
- case 25:
405
- this.begin("md_string");
406
- break;
407
- case 26:
408
- return "MD_STR";
409
- case 27:
410
- this.popState();
411
- break;
412
- case 28:
413
- this.begin("string");
414
- break;
415
- case 29:
416
- this.popState();
417
- break;
418
- case 30:
419
- return "STR";
420
- case 31:
421
- return this.begin("point_start"), 23;
422
- case 32:
423
- return this.begin("point_x"), 24;
424
- case 33:
425
- this.popState();
426
- break;
427
- case 34:
428
- this.popState(), this.begin("point_y");
429
- break;
430
- case 35:
431
- return this.popState(), 25;
432
- case 36:
433
- return 7;
434
- case 37:
435
- return 53;
436
- case 38:
437
- return "COLON";
438
- case 39:
439
- return 55;
440
- case 40:
441
- return 54;
442
- case 41:
443
- return 56;
444
- case 42:
445
- return 56;
446
- case 43:
447
- return 57;
448
- case 44:
449
- return 59;
450
- case 45:
451
- return 60;
452
- case 46:
453
- return 58;
454
- case 47:
455
- return 51;
456
- case 48:
457
- return 61;
458
- case 49:
459
- return 52;
460
- case 50:
461
- return 5;
462
- case 51:
463
- return 39;
464
- case 52:
465
- return 50;
466
- case 53:
467
- return 40;
468
- }
469
- },
470
- rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?: *x-axis *)/i, /^(?: *y-axis *)/i, /^(?: *--+> *)/i, /^(?: *quadrant-1 *)/i, /^(?: *quadrant-2 *)/i, /^(?: *quadrant-3 *)/i, /^(?: *quadrant-4 *)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:\s*:\s*\[\s*)/i, /^(?:(1)|(0(.\d+)?))/i, /^(?:\s*\] *)/i, /^(?:\s*,\s*)/i, /^(?:(1)|(0(.\d+)?))/i, /^(?: *quadrantChart *)/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s)/i, /^(?:;)/i, /^(?:[!"#$%&'*+,-.`?\\_/])/i, /^(?:$)/i],
471
- conditions: { point_y: { rules: [35], inclusive: !1 }, point_x: { rules: [34], inclusive: !1 }, point_start: { rules: [32, 33], inclusive: !1 }, acc_descr_multiline: { rules: [16, 17], inclusive: !1 }, acc_descr: { rules: [14], inclusive: !1 }, acc_title: { rules: [12], inclusive: !1 }, close_directive: { rules: [], inclusive: !1 }, arg_directive: { rules: [3, 4], inclusive: !1 }, type_directive: { rules: [2, 3], inclusive: !1 }, open_directive: { rules: [1], inclusive: !1 }, title: { rules: [10], inclusive: !1 }, md_string: { rules: [26, 27], inclusive: !1 }, string: { rules: [29, 30], inclusive: !1 }, INITIAL: { rules: [0, 5, 6, 7, 8, 9, 11, 13, 15, 18, 19, 20, 21, 22, 23, 24, 25, 28, 31, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53], inclusive: !0 } }
472
- };
473
- return K;
474
- }();
475
- ut.lexer = Lt;
476
- function xt() {
477
- this.yy = {};
478
- }
479
- return xt.prototype = ut, ut.Parser = xt, new xt();
480
- }();
481
- _t.parser = _t;
482
- const Yt = _t, w = wt();
483
- class jt {
484
- constructor() {
485
- this.config = this.getDefaultConfig(), this.themeConfig = this.getDefaultThemeConfig(), this.data = this.getDefaultData();
486
- }
487
- getDefaultData() {
488
- return {
489
- titleText: "",
490
- quadrant1Text: "",
491
- quadrant2Text: "",
492
- quadrant3Text: "",
493
- quadrant4Text: "",
494
- xAxisLeftText: "",
495
- xAxisRightText: "",
496
- yAxisBottomText: "",
497
- yAxisTopText: "",
498
- points: []
499
- };
500
- }
501
- getDefaultConfig() {
502
- var i, r, f, g, x, h, p, l, o, y, B, W, L, C, N, M, X, D;
503
- return {
504
- showXAxis: !0,
505
- showYAxis: !0,
506
- showTitle: !0,
507
- chartHeight: ((i = I.quadrantChart) == null ? void 0 : i.chartWidth) || 500,
508
- chartWidth: ((r = I.quadrantChart) == null ? void 0 : r.chartHeight) || 500,
509
- titlePadding: ((f = I.quadrantChart) == null ? void 0 : f.titlePadding) || 10,
510
- titleFontSize: ((g = I.quadrantChart) == null ? void 0 : g.titleFontSize) || 20,
511
- quadrantPadding: ((x = I.quadrantChart) == null ? void 0 : x.quadrantPadding) || 5,
512
- xAxisLabelPadding: ((h = I.quadrantChart) == null ? void 0 : h.xAxisLabelPadding) || 5,
513
- yAxisLabelPadding: ((p = I.quadrantChart) == null ? void 0 : p.yAxisLabelPadding) || 5,
514
- xAxisLabelFontSize: ((l = I.quadrantChart) == null ? void 0 : l.xAxisLabelFontSize) || 16,
515
- yAxisLabelFontSize: ((o = I.quadrantChart) == null ? void 0 : o.yAxisLabelFontSize) || 16,
516
- quadrantLabelFontSize: ((y = I.quadrantChart) == null ? void 0 : y.quadrantLabelFontSize) || 16,
517
- quadrantTextTopPadding: ((B = I.quadrantChart) == null ? void 0 : B.quadrantTextTopPadding) || 5,
518
- pointTextPadding: ((W = I.quadrantChart) == null ? void 0 : W.pointTextPadding) || 5,
519
- pointLabelFontSize: ((L = I.quadrantChart) == null ? void 0 : L.pointLabelFontSize) || 12,
520
- pointRadius: ((C = I.quadrantChart) == null ? void 0 : C.pointRadius) || 5,
521
- xAxisPosition: ((N = I.quadrantChart) == null ? void 0 : N.xAxisPosition) || "top",
522
- yAxisPosition: ((M = I.quadrantChart) == null ? void 0 : M.yAxisPosition) || "left",
523
- quadrantInternalBorderStrokeWidth: ((X = I.quadrantChart) == null ? void 0 : X.quadrantInternalBorderStrokeWidth) || 1,
524
- quadrantExternalBorderStrokeWidth: ((D = I.quadrantChart) == null ? void 0 : D.quadrantExternalBorderStrokeWidth) || 2
525
- };
526
- }
527
- getDefaultThemeConfig() {
528
- return {
529
- quadrant1Fill: w.quadrant1Fill,
530
- quadrant2Fill: w.quadrant2Fill,
531
- quadrant3Fill: w.quadrant3Fill,
532
- quadrant4Fill: w.quadrant4Fill,
533
- quadrant1TextFill: w.quadrant1TextFill,
534
- quadrant2TextFill: w.quadrant2TextFill,
535
- quadrant3TextFill: w.quadrant3TextFill,
536
- quadrant4TextFill: w.quadrant4TextFill,
537
- quadrantPointFill: w.quadrantPointFill,
538
- quadrantPointTextFill: w.quadrantPointTextFill,
539
- quadrantXAxisTextFill: w.quadrantXAxisTextFill,
540
- quadrantYAxisTextFill: w.quadrantYAxisTextFill,
541
- quadrantTitleFill: w.quadrantTitleFill,
542
- quadrantInternalBorderStrokeFill: w.quadrantInternalBorderStrokeFill,
543
- quadrantExternalBorderStrokeFill: w.quadrantExternalBorderStrokeFill
544
- };
545
- }
546
- clear() {
547
- this.config = this.getDefaultConfig(), this.themeConfig = this.getDefaultThemeConfig(), this.data = this.getDefaultData(), ht.info("clear called");
548
- }
549
- setData(i) {
550
- this.data = tt(tt({}, this.data), i);
551
- }
552
- addPoints(i) {
553
- this.data.points = [...i, ...this.data.points];
554
- }
555
- setConfig(i) {
556
- ht.trace("setConfig called with: ", i), this.config = tt(tt({}, this.config), i);
557
- }
558
- setThemeConfig(i) {
559
- ht.trace("setThemeConfig called with: ", i), this.themeConfig = tt(tt({}, this.themeConfig), i);
560
- }
561
- calculateSpace(i, r, f, g) {
562
- const x = this.config.xAxisLabelPadding * 2 + this.config.xAxisLabelFontSize, h = {
563
- top: i === "top" && r ? x : 0,
564
- bottom: i === "bottom" && r ? x : 0
565
- }, p = this.config.yAxisLabelPadding * 2 + this.config.yAxisLabelFontSize, l = {
566
- left: this.config.yAxisPosition === "left" && f ? p : 0,
567
- right: this.config.yAxisPosition === "right" && f ? p : 0
568
- }, o = this.config.titleFontSize + this.config.titlePadding * 2, y = {
569
- top: g ? o : 0
570
- }, B = this.config.quadrantPadding + l.left, W = this.config.quadrantPadding + h.top + y.top, L = this.config.chartWidth - this.config.quadrantPadding * 2 - l.left - l.right, C = this.config.chartHeight - this.config.quadrantPadding * 2 - h.top - h.bottom - y.top, N = L / 2, M = C / 2;
571
- return {
572
- xAxisSpace: h,
573
- yAxisSpace: l,
574
- titleSpace: y,
575
- quadrantSpace: {
576
- quadrantLeft: B,
577
- quadrantTop: W,
578
- quadrantWidth: L,
579
- quadrantHalfWidth: N,
580
- quadrantHeight: C,
581
- quadrantHalfHeight: M
582
- }
583
- };
584
- }
585
- getAxisLabels(i, r, f, g) {
586
- const { quadrantSpace: x, titleSpace: h } = g, {
587
- quadrantHalfHeight: p,
588
- quadrantHeight: l,
589
- quadrantLeft: o,
590
- quadrantHalfWidth: y,
591
- quadrantTop: B,
592
- quadrantWidth: W
593
- } = x, L = this.data.points.length === 0, C = [];
594
- return this.data.xAxisLeftText && r && C.push({
595
- text: this.data.xAxisLeftText,
596
- fill: this.themeConfig.quadrantXAxisTextFill,
597
- x: o + (L ? y / 2 : 0),
598
- y: i === "top" ? this.config.xAxisLabelPadding + h.top : this.config.xAxisLabelPadding + B + l + this.config.quadrantPadding,
599
- fontSize: this.config.xAxisLabelFontSize,
600
- verticalPos: L ? "center" : "left",
601
- horizontalPos: "top",
602
- rotation: 0
603
- }), this.data.xAxisRightText && r && C.push({
604
- text: this.data.xAxisRightText,
605
- fill: this.themeConfig.quadrantXAxisTextFill,
606
- x: o + y + (L ? y / 2 : 0),
607
- y: i === "top" ? this.config.xAxisLabelPadding + h.top : this.config.xAxisLabelPadding + B + l + this.config.quadrantPadding,
608
- fontSize: this.config.xAxisLabelFontSize,
609
- verticalPos: L ? "center" : "left",
610
- horizontalPos: "top",
611
- rotation: 0
612
- }), this.data.yAxisBottomText && f && C.push({
613
- text: this.data.yAxisBottomText,
614
- fill: this.themeConfig.quadrantYAxisTextFill,
615
- x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + o + W + this.config.quadrantPadding,
616
- y: B + l - (L ? p / 2 : 0),
617
- fontSize: this.config.yAxisLabelFontSize,
618
- verticalPos: L ? "center" : "left",
619
- horizontalPos: "top",
620
- rotation: -90
621
- }), this.data.yAxisTopText && f && C.push({
622
- text: this.data.yAxisTopText,
623
- fill: this.themeConfig.quadrantYAxisTextFill,
624
- x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + o + W + this.config.quadrantPadding,
625
- y: B + p - (L ? p / 2 : 0),
626
- fontSize: this.config.yAxisLabelFontSize,
627
- verticalPos: L ? "center" : "left",
628
- horizontalPos: "top",
629
- rotation: -90
630
- }), C;
631
- }
632
- getQuadrants(i) {
633
- const { quadrantSpace: r } = i, { quadrantHalfHeight: f, quadrantLeft: g, quadrantHalfWidth: x, quadrantTop: h } = r, p = [
634
- {
635
- text: {
636
- text: this.data.quadrant1Text,
637
- fill: this.themeConfig.quadrant1TextFill,
638
- x: 0,
639
- y: 0,
640
- fontSize: this.config.quadrantLabelFontSize,
641
- verticalPos: "center",
642
- horizontalPos: "middle",
643
- rotation: 0
644
- },
645
- x: g + x,
646
- y: h,
647
- width: x,
648
- height: f,
649
- fill: this.themeConfig.quadrant1Fill
650
- },
651
- {
652
- text: {
653
- text: this.data.quadrant2Text,
654
- fill: this.themeConfig.quadrant2TextFill,
655
- x: 0,
656
- y: 0,
657
- fontSize: this.config.quadrantLabelFontSize,
658
- verticalPos: "center",
659
- horizontalPos: "middle",
660
- rotation: 0
661
- },
662
- x: g,
663
- y: h,
664
- width: x,
665
- height: f,
666
- fill: this.themeConfig.quadrant2Fill
667
- },
668
- {
669
- text: {
670
- text: this.data.quadrant3Text,
671
- fill: this.themeConfig.quadrant3TextFill,
672
- x: 0,
673
- y: 0,
674
- fontSize: this.config.quadrantLabelFontSize,
675
- verticalPos: "center",
676
- horizontalPos: "middle",
677
- rotation: 0
678
- },
679
- x: g,
680
- y: h + f,
681
- width: x,
682
- height: f,
683
- fill: this.themeConfig.quadrant3Fill
684
- },
685
- {
686
- text: {
687
- text: this.data.quadrant4Text,
688
- fill: this.themeConfig.quadrant4TextFill,
689
- x: 0,
690
- y: 0,
691
- fontSize: this.config.quadrantLabelFontSize,
692
- verticalPos: "center",
693
- horizontalPos: "middle",
694
- rotation: 0
695
- },
696
- x: g + x,
697
- y: h + f,
698
- width: x,
699
- height: f,
700
- fill: this.themeConfig.quadrant4Fill
701
- }
702
- ];
703
- for (const l of p)
704
- l.text.x = l.x + l.width / 2, this.data.points.length === 0 ? (l.text.y = l.y + l.height / 2, l.text.horizontalPos = "middle") : (l.text.y = l.y + this.config.quadrantTextTopPadding, l.text.horizontalPos = "top");
705
- return p;
706
- }
707
- getQuadrantPoints(i) {
708
- const { quadrantSpace: r } = i, { quadrantHeight: f, quadrantLeft: g, quadrantTop: x, quadrantWidth: h } = r, p = Ft().domain([0, 1]).range([g, h + g]), l = Ft().domain([0, 1]).range([f + x, x]);
709
- return this.data.points.map((y) => ({
710
- x: p(y.x),
711
- y: l(y.y),
712
- fill: this.themeConfig.quadrantPointFill,
713
- radius: this.config.pointRadius,
714
- text: {
715
- text: y.text,
716
- fill: this.themeConfig.quadrantPointTextFill,
717
- x: p(y.x),
718
- y: l(y.y) + this.config.pointTextPadding,
719
- verticalPos: "center",
720
- horizontalPos: "top",
721
- fontSize: this.config.pointLabelFontSize,
722
- rotation: 0
723
- }
724
- }));
725
- }
726
- getBorders(i) {
727
- const r = this.config.quadrantExternalBorderStrokeWidth / 2, { quadrantSpace: f } = i, {
728
- quadrantHalfHeight: g,
729
- quadrantHeight: x,
730
- quadrantLeft: h,
731
- quadrantHalfWidth: p,
732
- quadrantTop: l,
733
- quadrantWidth: o
734
- } = f;
735
- return [
736
- // top border
737
- {
738
- strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
739
- strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
740
- x1: h - r,
741
- y1: l,
742
- x2: h + o + r,
743
- y2: l
744
- },
745
- // right border
746
- {
747
- strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
748
- strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
749
- x1: h + o,
750
- y1: l + r,
751
- x2: h + o,
752
- y2: l + x - r
753
- },
754
- // bottom border
755
- {
756
- strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
757
- strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
758
- x1: h - r,
759
- y1: l + x,
760
- x2: h + o + r,
761
- y2: l + x
762
- },
763
- // left border
764
- {
765
- strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
766
- strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
767
- x1: h,
768
- y1: l + r,
769
- x2: h,
770
- y2: l + x - r
771
- },
772
- // vertical inner border
773
- {
774
- strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
775
- strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
776
- x1: h + p,
777
- y1: l + r,
778
- x2: h + p,
779
- y2: l + x - r
780
- },
781
- // horizontal inner border
782
- {
783
- strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
784
- strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
785
- x1: h + r,
786
- y1: l + g,
787
- x2: h + o - r,
788
- y2: l + g
789
- }
790
- ];
791
- }
792
- getTitle(i) {
793
- if (i)
794
- return {
795
- text: this.data.titleText,
796
- fill: this.themeConfig.quadrantTitleFill,
797
- fontSize: this.config.titleFontSize,
798
- horizontalPos: "top",
799
- verticalPos: "center",
800
- rotation: 0,
801
- y: this.config.titlePadding,
802
- x: this.config.chartWidth / 2
803
- };
804
- }
805
- build() {
806
- const i = this.config.showXAxis && !!(this.data.xAxisLeftText || this.data.xAxisRightText), r = this.config.showYAxis && !!(this.data.yAxisTopText || this.data.yAxisBottomText), f = this.config.showTitle && !!this.data.titleText, g = this.data.points.length > 0 ? "bottom" : this.config.xAxisPosition, x = this.calculateSpace(g, i, r, f);
807
- return {
808
- points: this.getQuadrantPoints(x),
809
- quadrants: this.getQuadrants(x),
810
- axisLabels: this.getAxisLabels(g, i, r, x),
811
- borderLines: this.getBorders(x),
812
- title: this.getTitle(f)
813
- };
814
- }
815
- }
816
- const Gt = Tt();
817
- function $(e) {
818
- return Ot(e.trim(), Gt);
819
- }
820
- const V = new jt();
821
- function $t(e) {
822
- V.setData({ quadrant1Text: $(e.text) });
823
- }
824
- function Kt(e) {
825
- V.setData({ quadrant2Text: $(e.text) });
826
- }
827
- function Zt(e) {
828
- V.setData({ quadrant3Text: $(e.text) });
829
- }
830
- function Jt(e) {
831
- V.setData({ quadrant4Text: $(e.text) });
832
- }
833
- function te(e) {
834
- V.setData({ xAxisLeftText: $(e.text) });
835
- }
836
- function ee(e) {
837
- V.setData({ xAxisRightText: $(e.text) });
838
- }
839
- function ie(e) {
840
- V.setData({ yAxisTopText: $(e.text) });
841
- }
842
- function ae(e) {
843
- V.setData({ yAxisBottomText: $(e.text) });
844
- }
845
- function ne(e, i, r) {
846
- V.addPoints([{ x: i, y: r, text: $(e.text) }]);
847
- }
848
- function re(e) {
849
- V.setConfig({ chartWidth: e });
850
- }
851
- function se(e) {
852
- V.setConfig({ chartHeight: e });
853
- }
854
- function le() {
855
- const e = Tt(), { themeVariables: i, quadrantChart: r } = e;
856
- return r && V.setConfig(r), V.setThemeConfig({
857
- quadrant1Fill: i.quadrant1Fill,
858
- quadrant2Fill: i.quadrant2Fill,
859
- quadrant3Fill: i.quadrant3Fill,
860
- quadrant4Fill: i.quadrant4Fill,
861
- quadrant1TextFill: i.quadrant1TextFill,
862
- quadrant2TextFill: i.quadrant2TextFill,
863
- quadrant3TextFill: i.quadrant3TextFill,
864
- quadrant4TextFill: i.quadrant4TextFill,
865
- quadrantPointFill: i.quadrantPointFill,
866
- quadrantPointTextFill: i.quadrantPointTextFill,
867
- quadrantXAxisTextFill: i.quadrantXAxisTextFill,
868
- quadrantYAxisTextFill: i.quadrantYAxisTextFill,
869
- quadrantExternalBorderStrokeFill: i.quadrantExternalBorderStrokeFill,
870
- quadrantInternalBorderStrokeFill: i.quadrantInternalBorderStrokeFill,
871
- quadrantTitleFill: i.quadrantTitleFill
872
- }), V.setData({ titleText: Pt() }), V.build();
873
- }
874
- const oe = function(e, i, r) {
875
- Ht.parseDirective(this, e, i, r);
876
- }, ce = function() {
877
- V.clear(), Mt();
878
- }, he = {
879
- setWidth: re,
880
- setHeight: se,
881
- setQuadrant1Text: $t,
882
- setQuadrant2Text: Kt,
883
- setQuadrant3Text: Zt,
884
- setQuadrant4Text: Jt,
885
- setXAxisLeftText: te,
886
- setXAxisRightText: ee,
887
- setYAxisTopText: ie,
888
- setYAxisBottomText: ae,
889
- addPoint: ne,
890
- getQuadrantData: le,
891
- parseDirective: oe,
892
- clear: ce,
893
- setAccTitle: Rt,
894
- getAccTitle: Wt,
895
- setDiagramTitle: Nt,
896
- getDiagramTitle: Pt,
897
- getAccDescription: Ut,
898
- setAccDescription: Qt
899
- }, de = (e, i, r, f) => {
900
- var g, x, h;
901
- function p(t) {
902
- return t === "top" ? "hanging" : "middle";
903
- }
904
- function l(t) {
905
- return t === "left" ? "start" : "middle";
906
- }
907
- function o(t) {
908
- return `translate(${t.x}, ${t.y}) rotate(${t.rotation || 0})`;
909
- }
910
- const y = Tt();
911
- ht.debug(`Rendering quadrant chart
912
- ` + e);
913
- const B = y.securityLevel;
914
- let W;
915
- B === "sandbox" && (W = qt("#i" + i));
916
- const C = (B === "sandbox" ? qt(W.nodes()[0].contentDocument.body) : qt("body")).select(`[id="${i}"]`), N = C.append("g").attr("class", "main"), M = ((g = y.quadrantChart) == null ? void 0 : g.chartWidth) || 500, X = ((x = y.quadrantChart) == null ? void 0 : x.chartHeight) || 500;
917
- Xt(C, X, M, ((h = y.quadrantChart) == null ? void 0 : h.useMaxWidth) || !0), C.attr("viewBox", "0 0 " + M + " " + X), f.db.setHeight(X), f.db.setWidth(M);
918
- const D = f.db.getQuadrantData(), at = N.append("g").attr("class", "quadrants"), nt = N.append("g").attr("class", "border"), rt = N.append("g").attr("class", "data-points"), st = N.append("g").attr("class", "labels"), Q = N.append("g").attr("class", "title");
919
- D.title && Q.append("text").attr("x", 0).attr("y", 0).attr("fill", D.title.fill).attr("font-size", D.title.fontSize).attr("dominant-baseline", p(D.title.horizontalPos)).attr("text-anchor", l(D.title.verticalPos)).attr("transform", o(D.title)).text(D.title.text), D.borderLines && nt.selectAll("line").data(D.borderLines).enter().append("line").attr("x1", (t) => t.x1).attr("y1", (t) => t.y1).attr("x2", (t) => t.x2).attr("y2", (t) => t.y2).style("stroke", (t) => t.strokeFill).style("stroke-width", (t) => t.strokeWidth);
920
- const U = at.selectAll("g.quadrant").data(D.quadrants).enter().append("g").attr("class", "quadrant");
921
- U.append("rect").attr("x", (t) => t.x).attr("y", (t) => t.y).attr("width", (t) => t.width).attr("height", (t) => t.height).attr("fill", (t) => t.fill), U.append("text").attr("x", 0).attr("y", 0).attr("fill", (t) => t.text.fill).attr("font-size", (t) => t.text.fontSize).attr(
922
- "dominant-baseline",
923
- (t) => p(t.text.horizontalPos)
924
- ).attr("text-anchor", (t) => l(t.text.verticalPos)).attr("transform", (t) => o(t.text)).text((t) => t.text.text), st.selectAll("g.label").data(D.axisLabels).enter().append("g").attr("class", "label").append("text").attr("x", 0).attr("y", 0).text((t) => t.text).attr("fill", (t) => t.fill).attr("font-size", (t) => t.fontSize).attr("dominant-baseline", (t) => p(t.horizontalPos)).attr("text-anchor", (t) => l(t.verticalPos)).attr("transform", (t) => o(t));
925
- const _ = rt.selectAll("g.data-point").data(D.points).enter().append("g").attr("class", "data-point");
926
- _.append("circle").attr("cx", (t) => t.x).attr("cy", (t) => t.y).attr("r", (t) => t.radius).attr("fill", (t) => t.fill), _.append("text").attr("x", 0).attr("y", 0).text((t) => t.text.text).attr("fill", (t) => t.text.fill).attr("font-size", (t) => t.text.fontSize).attr(
927
- "dominant-baseline",
928
- (t) => p(t.text.horizontalPos)
929
- ).attr("text-anchor", (t) => l(t.text.verticalPos)).attr("transform", (t) => o(t.text));
930
- }, ue = {
931
- draw: de
932
- }, ye = {
933
- parser: Yt,
934
- db: he,
935
- renderer: ue,
936
- styles: () => ""
937
- };
938
- export {
939
- ye as diagram
940
- };