lowcoder-comps 0.0.29 → 0.0.31

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