bg-editor 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/umo-editor.js +89809 -7
  2. package/package.json +21 -1
  3. package/dist/_baseUniq-CK68Es8H.js +0 -473
  4. package/dist/arc-cD-4ba7d.js +0 -84
  5. package/dist/architecture-U656AL7Q-jxTBuJdN.js +0 -6
  6. package/dist/architectureDiagram-VXUJARFQ-D3XlpFhb.js +0 -4660
  7. package/dist/blockDiagram-VD42YOAC-BslbvMOG.js +0 -2262
  8. package/dist/c4Diagram-YG6GDRKO-DD3uWYPM.js +0 -1581
  9. package/dist/channel-DjTSKqWx.js +0 -6
  10. package/dist/chunk-4BX2VUAB-lfhsh4gk.js +0 -9
  11. package/dist/chunk-55IACEB6-O42zw0MT.js +0 -9
  12. package/dist/chunk-B4BG7PRW-CAose2Ox.js +0 -1376
  13. package/dist/chunk-DI55MBZ5-DkOlwdzs.js +0 -1371
  14. package/dist/chunk-FMBD7UC4-XviEvZms.js +0 -20
  15. package/dist/chunk-QN33PNHL-CNGSzgpw.js +0 -20
  16. package/dist/chunk-QZHKN3VN-CRgLUJXR.js +0 -16
  17. package/dist/chunk-TZMSLE5B-BkHNUxTN.js +0 -65
  18. package/dist/classDiagram-2ON5EDUG-Cakz_SCw.js +0 -17
  19. package/dist/classDiagram-v2-WZHVMYZB-Cakz_SCw.js +0 -17
  20. package/dist/clone-CIrbb4_D.js +0 -9
  21. package/dist/cose-bilkent-S5V4N54A-EoSlB5N_.js +0 -2606
  22. package/dist/cytoscape.esm-DoU_GB5M.js +0 -18732
  23. package/dist/dagre-6UL2VRFP-BPH1NIvl.js +0 -444
  24. package/dist/defaultLocale-DEnRyJdC.js +0 -172
  25. package/dist/diagram-PSM6KHXK-DCRoLhFv.js +0 -396
  26. package/dist/diagram-QEK2KX5R-2gxFpsCA.js +0 -218
  27. package/dist/diagram-S2PKOQOG-BIPpN2G8.js +0 -143
  28. package/dist/erDiagram-Q2GNP2WA-pfb2dpnp.js +0 -842
  29. package/dist/flowDiagram-NV44I4VS-Dv631-Fh.js +0 -1621
  30. package/dist/ganttDiagram-LVOFAZNH-BOKYXijK.js +0 -2500
  31. package/dist/gitGraph-F6HP7TQM-CRerkbyh.js +0 -6
  32. package/dist/gitGraphDiagram-NY62KEGX-CgO9x7O1.js +0 -700
  33. package/dist/graph-CG-rVaun.js +0 -382
  34. package/dist/index-LPeu-5gp.js +0 -164788
  35. package/dist/info-NVLQJR56-CZcMDuD4.js +0 -6
  36. package/dist/infoDiagram-ER5ION4S-CpfjxDXT.js +0 -25
  37. package/dist/init-Dbt-6wo9.js +0 -17
  38. package/dist/journeyDiagram-XKPGCS4Q-D4m1xk_j.js +0 -837
  39. package/dist/kanban-definition-3W4ZIXB7-GUMW-GDO.js +0 -719
  40. package/dist/layout-C7pGfQvF.js +0 -1416
  41. package/dist/linear-CQdBpz9H.js +0 -260
  42. package/dist/mermaid-parser.core-C3Lk4un7.js +0 -14143
  43. package/dist/min-D7xNMq31.js +0 -39
  44. package/dist/mindmap-definition-VGOIOE7T-GfQh2q9s.js +0 -784
  45. package/dist/ordinal-mgyNSFm_.js +0 -62
  46. package/dist/packet-BFZMPI3H-DughJE3g.js +0 -6
  47. package/dist/pie-7BOR55EZ-B1py7mee.js +0 -6
  48. package/dist/pieDiagram-ADFJNKIX-DENmX4xL.js +0 -162
  49. package/dist/quadrantDiagram-AYHSOK5B-BFVycH-W.js +0 -1023
  50. package/dist/radar-NHE76QYJ-DuTW4rXt.js +0 -6
  51. package/dist/requirementDiagram-UZGBJVZJ-f8rb43Mp.js +0 -851
  52. package/dist/sankeyDiagram-TZEHDZUN-CUN0tZ5p.js +0 -811
  53. package/dist/sequenceDiagram-WL72ISMW-7X4nul9T.js +0 -2512
  54. package/dist/stateDiagram-FKZM4ZOC-CypL793K.js +0 -264
  55. package/dist/stateDiagram-v2-4FDKWEC3-D5vS5FM5.js +0 -17
  56. package/dist/timeline-definition-IT6M3QCI-B_WOoOGO.js +0 -798
  57. package/dist/treemap-KMMF4GRG-BzINyJBJ.js +0 -6
  58. package/dist/xychartDiagram-PRI3JC2R-Llw16NDY.js +0 -1341
@@ -1,1023 +0,0 @@
1
- import "./style.css";
2
- import { _ as o, s as _e, g as Ae, q as ie, p as ke, a as Fe, b as Pe, c as zt, l as bt, d as Lt, e as ve, y as Ce, F as D, K as Le, i as Ee } from "./index-LPeu-5gp.js";
3
- import { l as ee } from "./linear-CQdBpz9H.js";
4
- var Et = function() {
5
- var t = /* @__PURE__ */ o(function(M, r, l, x) {
6
- for (l = l || {}, x = M.length; x--; l[M[x]] = r) ;
7
- return l;
8
- }, "o"), n = [1, 3], f = [1, 4], d = [1, 5], h = [1, 6], p = [1, 7], y = [1, 4, 5, 10, 12, 13, 14, 18, 25, 35, 37, 39, 41, 42, 48, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 63, 64, 65, 66, 67], _ = [1, 4, 5, 10, 12, 13, 14, 18, 25, 28, 35, 37, 39, 41, 42, 48, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 63, 64, 65, 66, 67], a = [55, 56, 57], A = [2, 36], u = [1, 37], T = [1, 36], q = [1, 38], m = [1, 35], b = [1, 43], g = [1, 41], G = [1, 14], ht = [1, 23], xt = [1, 18], ft = [1, 19], gt = [1, 20], ct = [1, 21], _t = [1, 22], dt = [1, 24], i = [1, 25], Vt = [1, 26], It = [1, 27], wt = [1, 28], Bt = [1, 29], W = [1, 32], U = [1, 33], k = [1, 34], F = [1, 39], P = [1, 40], v = [1, 42], C = [1, 44], O = [1, 62], H = [1, 61], L = [4, 5, 8, 10, 12, 13, 14, 18, 44, 47, 49, 55, 56, 57, 63, 64, 65, 66, 67], Rt = [1, 65], Nt = [1, 66], Wt = [1, 67], Ut = [1, 68], Qt = [1, 69], Ot = [1, 70], Ht = [1, 71], Xt = [1, 72], Mt = [1, 73], Yt = [1, 74], jt = [1, 75], Gt = [1, 76], I = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18], K = [1, 90], Z = [1, 91], J = [1, 92], $ = [1, 99], tt = [1, 93], et = [1, 96], it = [1, 94], at = [1, 95], nt = [1, 97], st = [1, 98], At = [1, 102], Kt = [10, 55, 56, 57], R = [4, 5, 6, 8, 10, 11, 13, 17, 18, 19, 20, 55, 56, 57], kt = {
9
- trace: /* @__PURE__ */ o(function() {
10
- }, "trace"),
11
- yy: {},
12
- symbols_: { error: 2, idStringToken: 3, ALPHA: 4, NUM: 5, NODE_STRING: 6, DOWN: 7, MINUS: 8, DEFAULT: 9, COMMA: 10, COLON: 11, AMP: 12, BRKT: 13, MULT: 14, UNICODE_TEXT: 15, styleComponent: 16, UNIT: 17, SPACE: 18, STYLE: 19, PCT: 20, idString: 21, style: 22, stylesOpt: 23, classDefStatement: 24, CLASSDEF: 25, start: 26, eol: 27, QUADRANT: 28, document: 29, line: 30, statement: 31, axisDetails: 32, quadrantDetails: 33, points: 34, title: 35, title_value: 36, acc_title: 37, acc_title_value: 38, acc_descr: 39, acc_descr_value: 40, acc_descr_multiline_value: 41, section: 42, text: 43, point_start: 44, point_x: 45, point_y: 46, class_name: 47, "X-AXIS": 48, "AXIS-TEXT-DELIMITER": 49, "Y-AXIS": 50, QUADRANT_1: 51, QUADRANT_2: 52, QUADRANT_3: 53, QUADRANT_4: 54, NEWLINE: 55, SEMI: 56, EOF: 57, alphaNumToken: 58, textNoTagsToken: 59, STR: 60, MD_STR: 61, alphaNum: 62, PUNCTUATION: 63, PLUS: 64, EQUALS: 65, DOT: 66, UNDERSCORE: 67, $accept: 0, $end: 1 },
13
- terminals_: { 2: "error", 4: "ALPHA", 5: "NUM", 6: "NODE_STRING", 7: "DOWN", 8: "MINUS", 9: "DEFAULT", 10: "COMMA", 11: "COLON", 12: "AMP", 13: "BRKT", 14: "MULT", 15: "UNICODE_TEXT", 17: "UNIT", 18: "SPACE", 19: "STYLE", 20: "PCT", 25: "CLASSDEF", 28: "QUADRANT", 35: "title", 36: "title_value", 37: "acc_title", 38: "acc_title_value", 39: "acc_descr", 40: "acc_descr_value", 41: "acc_descr_multiline_value", 42: "section", 44: "point_start", 45: "point_x", 46: "point_y", 47: "class_name", 48: "X-AXIS", 49: "AXIS-TEXT-DELIMITER", 50: "Y-AXIS", 51: "QUADRANT_1", 52: "QUADRANT_2", 53: "QUADRANT_3", 54: "QUADRANT_4", 55: "NEWLINE", 56: "SEMI", 57: "EOF", 60: "STR", 61: "MD_STR", 63: "PUNCTUATION", 64: "PLUS", 65: "EQUALS", 66: "DOT", 67: "UNDERSCORE" },
14
- productions_: [0, [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [21, 1], [21, 2], [22, 1], [22, 2], [23, 1], [23, 3], [24, 5], [26, 2], [26, 2], [26, 2], [29, 0], [29, 2], [30, 2], [31, 0], [31, 1], [31, 2], [31, 1], [31, 1], [31, 1], [31, 2], [31, 2], [31, 2], [31, 1], [31, 1], [34, 4], [34, 5], [34, 5], [34, 6], [32, 4], [32, 3], [32, 2], [32, 4], [32, 3], [32, 2], [33, 2], [33, 2], [33, 2], [33, 2], [27, 1], [27, 1], [27, 1], [43, 1], [43, 2], [43, 1], [43, 1], [62, 1], [62, 2], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [59, 1], [59, 1], [59, 1]],
15
- performAction: /* @__PURE__ */ o(function(r, l, x, c, S, e, ut) {
16
- var s = e.length - 1;
17
- switch (S) {
18
- case 23:
19
- this.$ = e[s];
20
- break;
21
- case 24:
22
- this.$ = e[s - 1] + "" + e[s];
23
- break;
24
- case 26:
25
- this.$ = e[s - 1] + e[s];
26
- break;
27
- case 27:
28
- this.$ = [e[s].trim()];
29
- break;
30
- case 28:
31
- e[s - 2].push(e[s].trim()), this.$ = e[s - 2];
32
- break;
33
- case 29:
34
- this.$ = e[s - 4], c.addClass(e[s - 2], e[s]);
35
- break;
36
- case 37:
37
- this.$ = [];
38
- break;
39
- case 42:
40
- this.$ = e[s].trim(), c.setDiagramTitle(this.$);
41
- break;
42
- case 43:
43
- this.$ = e[s].trim(), c.setAccTitle(this.$);
44
- break;
45
- case 44:
46
- case 45:
47
- this.$ = e[s].trim(), c.setAccDescription(this.$);
48
- break;
49
- case 46:
50
- c.addSection(e[s].substr(8)), this.$ = e[s].substr(8);
51
- break;
52
- case 47:
53
- c.addPoint(e[s - 3], "", e[s - 1], e[s], []);
54
- break;
55
- case 48:
56
- c.addPoint(e[s - 4], e[s - 3], e[s - 1], e[s], []);
57
- break;
58
- case 49:
59
- c.addPoint(e[s - 4], "", e[s - 2], e[s - 1], e[s]);
60
- break;
61
- case 50:
62
- c.addPoint(e[s - 5], e[s - 4], e[s - 2], e[s - 1], e[s]);
63
- break;
64
- case 51:
65
- c.setXAxisLeftText(e[s - 2]), c.setXAxisRightText(e[s]);
66
- break;
67
- case 52:
68
- e[s - 1].text += " ⟶ ", c.setXAxisLeftText(e[s - 1]);
69
- break;
70
- case 53:
71
- c.setXAxisLeftText(e[s]);
72
- break;
73
- case 54:
74
- c.setYAxisBottomText(e[s - 2]), c.setYAxisTopText(e[s]);
75
- break;
76
- case 55:
77
- e[s - 1].text += " ⟶ ", c.setYAxisBottomText(e[s - 1]);
78
- break;
79
- case 56:
80
- c.setYAxisBottomText(e[s]);
81
- break;
82
- case 57:
83
- c.setQuadrant1Text(e[s]);
84
- break;
85
- case 58:
86
- c.setQuadrant2Text(e[s]);
87
- break;
88
- case 59:
89
- c.setQuadrant3Text(e[s]);
90
- break;
91
- case 60:
92
- c.setQuadrant4Text(e[s]);
93
- break;
94
- case 64:
95
- this.$ = { text: e[s], type: "text" };
96
- break;
97
- case 65:
98
- this.$ = { text: e[s - 1].text + "" + e[s], type: e[s - 1].type };
99
- break;
100
- case 66:
101
- this.$ = { text: e[s], type: "text" };
102
- break;
103
- case 67:
104
- this.$ = { text: e[s], type: "markdown" };
105
- break;
106
- case 68:
107
- this.$ = e[s];
108
- break;
109
- case 69:
110
- this.$ = e[s - 1] + "" + e[s];
111
- break;
112
- }
113
- }, "anonymous"),
114
- table: [{ 18: n, 26: 1, 27: 2, 28: f, 55: d, 56: h, 57: p }, { 1: [3] }, { 18: n, 26: 8, 27: 2, 28: f, 55: d, 56: h, 57: p }, { 18: n, 26: 9, 27: 2, 28: f, 55: d, 56: h, 57: p }, t(y, [2, 33], { 29: 10 }), t(_, [2, 61]), t(_, [2, 62]), t(_, [2, 63]), { 1: [2, 30] }, { 1: [2, 31] }, t(a, A, { 30: 11, 31: 12, 24: 13, 32: 15, 33: 16, 34: 17, 43: 30, 58: 31, 1: [2, 32], 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 18: G, 25: ht, 35: xt, 37: ft, 39: gt, 41: ct, 42: _t, 48: dt, 50: i, 51: Vt, 52: It, 53: wt, 54: Bt, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }), t(y, [2, 34]), { 27: 45, 55: d, 56: h, 57: p }, t(a, [2, 37]), t(a, A, { 24: 13, 32: 15, 33: 16, 34: 17, 43: 30, 58: 31, 31: 46, 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 18: G, 25: ht, 35: xt, 37: ft, 39: gt, 41: ct, 42: _t, 48: dt, 50: i, 51: Vt, 52: It, 53: wt, 54: Bt, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 39]), t(a, [2, 40]), t(a, [2, 41]), { 36: [1, 47] }, { 38: [1, 48] }, { 40: [1, 49] }, t(a, [2, 45]), t(a, [2, 46]), { 18: [1, 50] }, { 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 43: 51, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 43: 52, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 43: 53, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 43: 54, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 43: 55, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 43: 56, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 44: [1, 57], 47: [1, 58], 58: 60, 59: 59, 63: k, 64: F, 65: P, 66: v, 67: C }, t(L, [2, 64]), t(L, [2, 66]), t(L, [2, 67]), t(L, [2, 70]), t(L, [2, 71]), t(L, [2, 72]), t(L, [2, 73]), t(L, [2, 74]), t(L, [2, 75]), t(L, [2, 76]), t(L, [2, 77]), t(L, [2, 78]), t(L, [2, 79]), t(L, [2, 80]), t(y, [2, 35]), t(a, [2, 38]), t(a, [2, 42]), t(a, [2, 43]), t(a, [2, 44]), { 3: 64, 4: Rt, 5: Nt, 6: Wt, 7: Ut, 8: Qt, 9: Ot, 10: Ht, 11: Xt, 12: Mt, 13: Yt, 14: jt, 15: Gt, 21: 63 }, t(a, [2, 53], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 49: [1, 77], 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 56], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 49: [1, 78], 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 57], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 58], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 59], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 60], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 63: k, 64: F, 65: P, 66: v, 67: C }), { 45: [1, 79] }, { 44: [1, 80] }, t(L, [2, 65]), t(L, [2, 81]), t(L, [2, 82]), t(L, [2, 83]), { 3: 82, 4: Rt, 5: Nt, 6: Wt, 7: Ut, 8: Qt, 9: Ot, 10: Ht, 11: Xt, 12: Mt, 13: Yt, 14: jt, 15: Gt, 18: [1, 81] }, t(I, [2, 23]), t(I, [2, 1]), t(I, [2, 2]), t(I, [2, 3]), t(I, [2, 4]), t(I, [2, 5]), t(I, [2, 6]), t(I, [2, 7]), t(I, [2, 8]), t(I, [2, 9]), t(I, [2, 10]), t(I, [2, 11]), t(I, [2, 12]), t(a, [2, 52], { 58: 31, 43: 83, 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 55], { 58: 31, 43: 84, 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }), { 46: [1, 85] }, { 45: [1, 86] }, { 4: K, 5: Z, 6: J, 8: $, 11: tt, 13: et, 16: 89, 17: it, 18: at, 19: nt, 20: st, 22: 88, 23: 87 }, t(I, [2, 24]), t(a, [2, 51], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 54], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 47], { 22: 88, 16: 89, 23: 100, 4: K, 5: Z, 6: J, 8: $, 11: tt, 13: et, 17: it, 18: at, 19: nt, 20: st }), { 46: [1, 101] }, t(a, [2, 29], { 10: At }), t(Kt, [2, 27], { 16: 103, 4: K, 5: Z, 6: J, 8: $, 11: tt, 13: et, 17: it, 18: at, 19: nt, 20: st }), t(R, [2, 25]), t(R, [2, 13]), t(R, [2, 14]), t(R, [2, 15]), t(R, [2, 16]), t(R, [2, 17]), t(R, [2, 18]), t(R, [2, 19]), t(R, [2, 20]), t(R, [2, 21]), t(R, [2, 22]), t(a, [2, 49], { 10: At }), t(a, [2, 48], { 22: 88, 16: 89, 23: 104, 4: K, 5: Z, 6: J, 8: $, 11: tt, 13: et, 17: it, 18: at, 19: nt, 20: st }), { 4: K, 5: Z, 6: J, 8: $, 11: tt, 13: et, 16: 89, 17: it, 18: at, 19: nt, 20: st, 22: 105 }, t(R, [2, 26]), t(a, [2, 50], { 10: At }), t(Kt, [2, 28], { 16: 103, 4: K, 5: Z, 6: J, 8: $, 11: tt, 13: et, 17: it, 18: at, 19: nt, 20: st })],
115
- defaultActions: { 8: [2, 30], 9: [2, 31] },
116
- parseError: /* @__PURE__ */ o(function(r, l) {
117
- if (l.recoverable)
118
- this.trace(r);
119
- else {
120
- var x = new Error(r);
121
- throw x.hash = l, x;
122
- }
123
- }, "parseError"),
124
- parse: /* @__PURE__ */ o(function(r) {
125
- var l = this, x = [0], c = [], S = [null], e = [], ut = this.table, s = "", yt = 0, Zt = 0, qe = 2, Jt = 1, me = e.slice.call(arguments, 1), E = Object.create(this.lexer), Y = { yy: {} };
126
- for (var Ft in this.yy)
127
- Object.prototype.hasOwnProperty.call(this.yy, Ft) && (Y.yy[Ft] = this.yy[Ft]);
128
- E.setInput(r, Y.yy), Y.yy.lexer = E, Y.yy.parser = this, typeof E.yylloc > "u" && (E.yylloc = {});
129
- var Pt = E.yylloc;
130
- e.push(Pt);
131
- var be = E.options && E.options.ranges;
132
- typeof Y.yy.parseError == "function" ? this.parseError = Y.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
133
- function Se(B) {
134
- x.length = x.length - 2 * B, S.length = S.length - B, e.length = e.length - B;
135
- }
136
- o(Se, "popStack");
137
- function $t() {
138
- var B;
139
- return B = c.pop() || E.lex() || Jt, typeof B != "number" && (B instanceof Array && (c = B, B = c.pop()), B = l.symbols_[B] || B), B;
140
- }
141
- o($t, "lex");
142
- for (var w, j, N, vt, rt = {}, Tt, X, te, qt; ; ) {
143
- if (j = x[x.length - 1], this.defaultActions[j] ? N = this.defaultActions[j] : ((w === null || typeof w > "u") && (w = $t()), N = ut[j] && ut[j][w]), typeof N > "u" || !N.length || !N[0]) {
144
- var Ct = "";
145
- qt = [];
146
- for (Tt in ut[j])
147
- this.terminals_[Tt] && Tt > qe && qt.push("'" + this.terminals_[Tt] + "'");
148
- E.showPosition ? Ct = "Parse error on line " + (yt + 1) + `:
149
- ` + E.showPosition() + `
150
- Expecting ` + qt.join(", ") + ", got '" + (this.terminals_[w] || w) + "'" : Ct = "Parse error on line " + (yt + 1) + ": Unexpected " + (w == Jt ? "end of input" : "'" + (this.terminals_[w] || w) + "'"), this.parseError(Ct, {
151
- text: E.match,
152
- token: this.terminals_[w] || w,
153
- line: E.yylineno,
154
- loc: Pt,
155
- expected: qt
156
- });
157
- }
158
- if (N[0] instanceof Array && N.length > 1)
159
- throw new Error("Parse Error: multiple actions possible at state: " + j + ", token: " + w);
160
- switch (N[0]) {
161
- case 1:
162
- x.push(w), S.push(E.yytext), e.push(E.yylloc), x.push(N[1]), w = null, Zt = E.yyleng, s = E.yytext, yt = E.yylineno, Pt = E.yylloc;
163
- break;
164
- case 2:
165
- if (X = this.productions_[N[1]][1], rt.$ = S[S.length - X], rt._$ = {
166
- first_line: e[e.length - (X || 1)].first_line,
167
- last_line: e[e.length - 1].last_line,
168
- first_column: e[e.length - (X || 1)].first_column,
169
- last_column: e[e.length - 1].last_column
170
- }, be && (rt._$.range = [
171
- e[e.length - (X || 1)].range[0],
172
- e[e.length - 1].range[1]
173
- ]), vt = this.performAction.apply(rt, [
174
- s,
175
- Zt,
176
- yt,
177
- Y.yy,
178
- N[1],
179
- S,
180
- e
181
- ].concat(me)), typeof vt < "u")
182
- return vt;
183
- X && (x = x.slice(0, -1 * X * 2), S = S.slice(0, -1 * X), e = e.slice(0, -1 * X)), x.push(this.productions_[N[1]][0]), S.push(rt.$), e.push(rt._$), te = ut[x[x.length - 2]][x[x.length - 1]], x.push(te);
184
- break;
185
- case 3:
186
- return !0;
187
- }
188
- }
189
- return !0;
190
- }, "parse")
191
- }, Te = /* @__PURE__ */ function() {
192
- var M = {
193
- EOF: 1,
194
- parseError: /* @__PURE__ */ o(function(l, x) {
195
- if (this.yy.parser)
196
- this.yy.parser.parseError(l, x);
197
- else
198
- throw new Error(l);
199
- }, "parseError"),
200
- // resets the lexer, sets new input
201
- setInput: /* @__PURE__ */ o(function(r, l) {
202
- return this.yy = l || 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 = {
203
- first_line: 1,
204
- first_column: 0,
205
- last_line: 1,
206
- last_column: 0
207
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
208
- }, "setInput"),
209
- // consumes and returns one char from the input
210
- input: /* @__PURE__ */ o(function() {
211
- var r = this._input[0];
212
- this.yytext += r, this.yyleng++, this.offset++, this.match += r, this.matched += r;
213
- var l = r.match(/(?:\r\n?|\n).*/g);
214
- 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), r;
215
- }, "input"),
216
- // unshifts one char (or a string) into the input
217
- unput: /* @__PURE__ */ o(function(r) {
218
- var l = r.length, x = r.split(/(?:\r\n?|\n)/g);
219
- this._input = r + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - l), this.offset -= l;
220
- var c = this.match.split(/(?:\r\n?|\n)/g);
221
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), x.length - 1 && (this.yylineno -= x.length - 1);
222
- var S = this.yylloc.range;
223
- return this.yylloc = {
224
- first_line: this.yylloc.first_line,
225
- last_line: this.yylineno + 1,
226
- first_column: this.yylloc.first_column,
227
- last_column: x ? (x.length === c.length ? this.yylloc.first_column : 0) + c[c.length - x.length].length - x[0].length : this.yylloc.first_column - l
228
- }, this.options.ranges && (this.yylloc.range = [S[0], S[0] + this.yyleng - l]), this.yyleng = this.yytext.length, this;
229
- }, "unput"),
230
- // When called from action, caches matched text and appends it on next action
231
- more: /* @__PURE__ */ o(function() {
232
- return this._more = !0, this;
233
- }, "more"),
234
- // 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.
235
- reject: /* @__PURE__ */ o(function() {
236
- if (this.options.backtrack_lexer)
237
- this._backtrack = !0;
238
- else
239
- 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).
240
- ` + this.showPosition(), {
241
- text: "",
242
- token: null,
243
- line: this.yylineno
244
- });
245
- return this;
246
- }, "reject"),
247
- // retain first n characters of the match
248
- less: /* @__PURE__ */ o(function(r) {
249
- this.unput(this.match.slice(r));
250
- }, "less"),
251
- // displays already matched input, i.e. for error messages
252
- pastInput: /* @__PURE__ */ o(function() {
253
- var r = this.matched.substr(0, this.matched.length - this.match.length);
254
- return (r.length > 20 ? "..." : "") + r.substr(-20).replace(/\n/g, "");
255
- }, "pastInput"),
256
- // displays upcoming input, i.e. for error messages
257
- upcomingInput: /* @__PURE__ */ o(function() {
258
- var r = this.match;
259
- return r.length < 20 && (r += this._input.substr(0, 20 - r.length)), (r.substr(0, 20) + (r.length > 20 ? "..." : "")).replace(/\n/g, "");
260
- }, "upcomingInput"),
261
- // displays the character position where the lexing error occurred, i.e. for error messages
262
- showPosition: /* @__PURE__ */ o(function() {
263
- var r = this.pastInput(), l = new Array(r.length + 1).join("-");
264
- return r + this.upcomingInput() + `
265
- ` + l + "^";
266
- }, "showPosition"),
267
- // test the lexed token: return FALSE when not a match, otherwise return token
268
- test_match: /* @__PURE__ */ o(function(r, l) {
269
- var x, c, S;
270
- if (this.options.backtrack_lexer && (S = {
271
- yylineno: this.yylineno,
272
- yylloc: {
273
- first_line: this.yylloc.first_line,
274
- last_line: this.last_line,
275
- first_column: this.yylloc.first_column,
276
- last_column: this.yylloc.last_column
277
- },
278
- yytext: this.yytext,
279
- match: this.match,
280
- matches: this.matches,
281
- matched: this.matched,
282
- yyleng: this.yyleng,
283
- offset: this.offset,
284
- _more: this._more,
285
- _input: this._input,
286
- yy: this.yy,
287
- conditionStack: this.conditionStack.slice(0),
288
- done: this.done
289
- }, this.options.ranges && (S.yylloc.range = this.yylloc.range.slice(0))), c = r[0].match(/(?:\r\n?|\n).*/g), c && (this.yylineno += c.length), this.yylloc = {
290
- first_line: this.yylloc.last_line,
291
- last_line: this.yylineno + 1,
292
- first_column: this.yylloc.last_column,
293
- last_column: c ? c[c.length - 1].length - c[c.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + r[0].length
294
- }, 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], x = this.performAction.call(this, this.yy, this, l, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), x)
295
- return x;
296
- if (this._backtrack) {
297
- for (var e in S)
298
- this[e] = S[e];
299
- return !1;
300
- }
301
- return !1;
302
- }, "test_match"),
303
- // return next match in input
304
- next: /* @__PURE__ */ o(function() {
305
- if (this.done)
306
- return this.EOF;
307
- this._input || (this.done = !0);
308
- var r, l, x, c;
309
- this._more || (this.yytext = "", this.match = "");
310
- for (var S = this._currentRules(), e = 0; e < S.length; e++)
311
- if (x = this._input.match(this.rules[S[e]]), x && (!l || x[0].length > l[0].length)) {
312
- if (l = x, c = e, this.options.backtrack_lexer) {
313
- if (r = this.test_match(x, S[e]), r !== !1)
314
- return r;
315
- if (this._backtrack) {
316
- l = !1;
317
- continue;
318
- } else
319
- return !1;
320
- } else if (!this.options.flex)
321
- break;
322
- }
323
- return l ? (r = this.test_match(l, S[c]), r !== !1 ? r : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
324
- ` + this.showPosition(), {
325
- text: "",
326
- token: null,
327
- line: this.yylineno
328
- });
329
- }, "next"),
330
- // return next match that has a token
331
- lex: /* @__PURE__ */ o(function() {
332
- var l = this.next();
333
- return l || this.lex();
334
- }, "lex"),
335
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
336
- begin: /* @__PURE__ */ o(function(l) {
337
- this.conditionStack.push(l);
338
- }, "begin"),
339
- // pop the previously active lexer condition state off the condition stack
340
- popState: /* @__PURE__ */ o(function() {
341
- var l = this.conditionStack.length - 1;
342
- return l > 0 ? this.conditionStack.pop() : this.conditionStack[0];
343
- }, "popState"),
344
- // produce the lexer rule set which is active for the currently active lexer condition state
345
- _currentRules: /* @__PURE__ */ o(function() {
346
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
347
- }, "_currentRules"),
348
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
349
- topState: /* @__PURE__ */ o(function(l) {
350
- return l = this.conditionStack.length - 1 - Math.abs(l || 0), l >= 0 ? this.conditionStack[l] : "INITIAL";
351
- }, "topState"),
352
- // alias for begin(condition)
353
- pushState: /* @__PURE__ */ o(function(l) {
354
- this.begin(l);
355
- }, "pushState"),
356
- // return the number of states currently on the stack
357
- stateStackSize: /* @__PURE__ */ o(function() {
358
- return this.conditionStack.length;
359
- }, "stateStackSize"),
360
- options: { "case-insensitive": !0 },
361
- performAction: /* @__PURE__ */ o(function(l, x, c, S) {
362
- switch (c) {
363
- case 0:
364
- break;
365
- case 1:
366
- break;
367
- case 2:
368
- return 55;
369
- case 3:
370
- break;
371
- case 4:
372
- return this.begin("title"), 35;
373
- case 5:
374
- return this.popState(), "title_value";
375
- case 6:
376
- return this.begin("acc_title"), 37;
377
- case 7:
378
- return this.popState(), "acc_title_value";
379
- case 8:
380
- return this.begin("acc_descr"), 39;
381
- case 9:
382
- return this.popState(), "acc_descr_value";
383
- case 10:
384
- this.begin("acc_descr_multiline");
385
- break;
386
- case 11:
387
- this.popState();
388
- break;
389
- case 12:
390
- return "acc_descr_multiline_value";
391
- case 13:
392
- return 48;
393
- case 14:
394
- return 50;
395
- case 15:
396
- return 49;
397
- case 16:
398
- return 51;
399
- case 17:
400
- return 52;
401
- case 18:
402
- return 53;
403
- case 19:
404
- return 54;
405
- case 20:
406
- return 25;
407
- case 21:
408
- this.begin("md_string");
409
- break;
410
- case 22:
411
- return "MD_STR";
412
- case 23:
413
- this.popState();
414
- break;
415
- case 24:
416
- this.begin("string");
417
- break;
418
- case 25:
419
- this.popState();
420
- break;
421
- case 26:
422
- return "STR";
423
- case 27:
424
- this.begin("class_name");
425
- break;
426
- case 28:
427
- return this.popState(), 47;
428
- case 29:
429
- return this.begin("point_start"), 44;
430
- case 30:
431
- return this.begin("point_x"), 45;
432
- case 31:
433
- this.popState();
434
- break;
435
- case 32:
436
- this.popState(), this.begin("point_y");
437
- break;
438
- case 33:
439
- return this.popState(), 46;
440
- case 34:
441
- return 28;
442
- case 35:
443
- return 4;
444
- case 36:
445
- return 11;
446
- case 37:
447
- return 64;
448
- case 38:
449
- return 10;
450
- case 39:
451
- return 65;
452
- case 40:
453
- return 65;
454
- case 41:
455
- return 14;
456
- case 42:
457
- return 13;
458
- case 43:
459
- return 67;
460
- case 44:
461
- return 66;
462
- case 45:
463
- return 12;
464
- case 46:
465
- return 8;
466
- case 47:
467
- return 5;
468
- case 48:
469
- return 18;
470
- case 49:
471
- return 56;
472
- case 50:
473
- return 63;
474
- case 51:
475
- return 57;
476
- }
477
- }, "anonymous"),
478
- 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, /^(?:classDef\b)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?::::)/i, /^(?:^\w+)/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],
479
- conditions: { class_name: { rules: [28], inclusive: !1 }, point_y: { rules: [33], inclusive: !1 }, point_x: { rules: [32], inclusive: !1 }, point_start: { rules: [30, 31], 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: [22, 23], inclusive: !1 }, string: { rules: [25, 26], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 27, 29, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51], inclusive: !0 } }
480
- };
481
- return M;
482
- }();
483
- kt.lexer = Te;
484
- function pt() {
485
- this.yy = {};
486
- }
487
- return o(pt, "Parser"), pt.prototype = kt, kt.Parser = pt, new pt();
488
- }();
489
- Et.parser = Et;
490
- var De = Et, V = Le(), ot, ze = (ot = class {
491
- constructor() {
492
- this.classes = /* @__PURE__ */ new Map(), this.config = this.getDefaultConfig(), this.themeConfig = this.getDefaultThemeConfig(), this.data = this.getDefaultData();
493
- }
494
- getDefaultData() {
495
- return {
496
- titleText: "",
497
- quadrant1Text: "",
498
- quadrant2Text: "",
499
- quadrant3Text: "",
500
- quadrant4Text: "",
501
- xAxisLeftText: "",
502
- xAxisRightText: "",
503
- yAxisBottomText: "",
504
- yAxisTopText: "",
505
- points: []
506
- };
507
- }
508
- getDefaultConfig() {
509
- return {
510
- showXAxis: !0,
511
- showYAxis: !0,
512
- showTitle: !0,
513
- chartHeight: D.quadrantChart?.chartWidth || 500,
514
- chartWidth: D.quadrantChart?.chartHeight || 500,
515
- titlePadding: D.quadrantChart?.titlePadding || 10,
516
- titleFontSize: D.quadrantChart?.titleFontSize || 20,
517
- quadrantPadding: D.quadrantChart?.quadrantPadding || 5,
518
- xAxisLabelPadding: D.quadrantChart?.xAxisLabelPadding || 5,
519
- yAxisLabelPadding: D.quadrantChart?.yAxisLabelPadding || 5,
520
- xAxisLabelFontSize: D.quadrantChart?.xAxisLabelFontSize || 16,
521
- yAxisLabelFontSize: D.quadrantChart?.yAxisLabelFontSize || 16,
522
- quadrantLabelFontSize: D.quadrantChart?.quadrantLabelFontSize || 16,
523
- quadrantTextTopPadding: D.quadrantChart?.quadrantTextTopPadding || 5,
524
- pointTextPadding: D.quadrantChart?.pointTextPadding || 5,
525
- pointLabelFontSize: D.quadrantChart?.pointLabelFontSize || 12,
526
- pointRadius: D.quadrantChart?.pointRadius || 5,
527
- xAxisPosition: D.quadrantChart?.xAxisPosition || "top",
528
- yAxisPosition: D.quadrantChart?.yAxisPosition || "left",
529
- quadrantInternalBorderStrokeWidth: D.quadrantChart?.quadrantInternalBorderStrokeWidth || 1,
530
- quadrantExternalBorderStrokeWidth: D.quadrantChart?.quadrantExternalBorderStrokeWidth || 2
531
- };
532
- }
533
- getDefaultThemeConfig() {
534
- return {
535
- quadrant1Fill: V.quadrant1Fill,
536
- quadrant2Fill: V.quadrant2Fill,
537
- quadrant3Fill: V.quadrant3Fill,
538
- quadrant4Fill: V.quadrant4Fill,
539
- quadrant1TextFill: V.quadrant1TextFill,
540
- quadrant2TextFill: V.quadrant2TextFill,
541
- quadrant3TextFill: V.quadrant3TextFill,
542
- quadrant4TextFill: V.quadrant4TextFill,
543
- quadrantPointFill: V.quadrantPointFill,
544
- quadrantPointTextFill: V.quadrantPointTextFill,
545
- quadrantXAxisTextFill: V.quadrantXAxisTextFill,
546
- quadrantYAxisTextFill: V.quadrantYAxisTextFill,
547
- quadrantTitleFill: V.quadrantTitleFill,
548
- quadrantInternalBorderStrokeFill: V.quadrantInternalBorderStrokeFill,
549
- quadrantExternalBorderStrokeFill: V.quadrantExternalBorderStrokeFill
550
- };
551
- }
552
- clear() {
553
- this.config = this.getDefaultConfig(), this.themeConfig = this.getDefaultThemeConfig(), this.data = this.getDefaultData(), this.classes = /* @__PURE__ */ new Map(), bt.info("clear called");
554
- }
555
- setData(n) {
556
- this.data = { ...this.data, ...n };
557
- }
558
- addPoints(n) {
559
- this.data.points = [...n, ...this.data.points];
560
- }
561
- addClass(n, f) {
562
- this.classes.set(n, f);
563
- }
564
- setConfig(n) {
565
- bt.trace("setConfig called with: ", n), this.config = { ...this.config, ...n };
566
- }
567
- setThemeConfig(n) {
568
- bt.trace("setThemeConfig called with: ", n), this.themeConfig = { ...this.themeConfig, ...n };
569
- }
570
- calculateSpace(n, f, d, h) {
571
- const p = this.config.xAxisLabelPadding * 2 + this.config.xAxisLabelFontSize, y = {
572
- top: n === "top" && f ? p : 0,
573
- bottom: n === "bottom" && f ? p : 0
574
- }, _ = this.config.yAxisLabelPadding * 2 + this.config.yAxisLabelFontSize, a = {
575
- left: this.config.yAxisPosition === "left" && d ? _ : 0,
576
- right: this.config.yAxisPosition === "right" && d ? _ : 0
577
- }, A = this.config.titleFontSize + this.config.titlePadding * 2, u = {
578
- top: h ? A : 0
579
- }, T = this.config.quadrantPadding + a.left, q = this.config.quadrantPadding + y.top + u.top, m = this.config.chartWidth - this.config.quadrantPadding * 2 - a.left - a.right, b = this.config.chartHeight - this.config.quadrantPadding * 2 - y.top - y.bottom - u.top, g = m / 2, G = b / 2;
580
- return {
581
- xAxisSpace: y,
582
- yAxisSpace: a,
583
- titleSpace: u,
584
- quadrantSpace: {
585
- quadrantLeft: T,
586
- quadrantTop: q,
587
- quadrantWidth: m,
588
- quadrantHalfWidth: g,
589
- quadrantHeight: b,
590
- quadrantHalfHeight: G
591
- }
592
- };
593
- }
594
- getAxisLabels(n, f, d, h) {
595
- const { quadrantSpace: p, titleSpace: y } = h, {
596
- quadrantHalfHeight: _,
597
- quadrantHeight: a,
598
- quadrantLeft: A,
599
- quadrantHalfWidth: u,
600
- quadrantTop: T,
601
- quadrantWidth: q
602
- } = p, m = !!this.data.xAxisRightText, b = !!this.data.yAxisTopText, g = [];
603
- return this.data.xAxisLeftText && f && g.push({
604
- text: this.data.xAxisLeftText,
605
- fill: this.themeConfig.quadrantXAxisTextFill,
606
- x: A + (m ? u / 2 : 0),
607
- y: n === "top" ? this.config.xAxisLabelPadding + y.top : this.config.xAxisLabelPadding + T + a + this.config.quadrantPadding,
608
- fontSize: this.config.xAxisLabelFontSize,
609
- verticalPos: m ? "center" : "left",
610
- horizontalPos: "top",
611
- rotation: 0
612
- }), this.data.xAxisRightText && f && g.push({
613
- text: this.data.xAxisRightText,
614
- fill: this.themeConfig.quadrantXAxisTextFill,
615
- x: A + u + (m ? u / 2 : 0),
616
- y: n === "top" ? this.config.xAxisLabelPadding + y.top : this.config.xAxisLabelPadding + T + a + this.config.quadrantPadding,
617
- fontSize: this.config.xAxisLabelFontSize,
618
- verticalPos: m ? "center" : "left",
619
- horizontalPos: "top",
620
- rotation: 0
621
- }), this.data.yAxisBottomText && d && g.push({
622
- text: this.data.yAxisBottomText,
623
- fill: this.themeConfig.quadrantYAxisTextFill,
624
- x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + A + q + this.config.quadrantPadding,
625
- y: T + a - (b ? _ / 2 : 0),
626
- fontSize: this.config.yAxisLabelFontSize,
627
- verticalPos: b ? "center" : "left",
628
- horizontalPos: "top",
629
- rotation: -90
630
- }), this.data.yAxisTopText && d && g.push({
631
- text: this.data.yAxisTopText,
632
- fill: this.themeConfig.quadrantYAxisTextFill,
633
- x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + A + q + this.config.quadrantPadding,
634
- y: T + _ - (b ? _ / 2 : 0),
635
- fontSize: this.config.yAxisLabelFontSize,
636
- verticalPos: b ? "center" : "left",
637
- horizontalPos: "top",
638
- rotation: -90
639
- }), g;
640
- }
641
- getQuadrants(n) {
642
- const { quadrantSpace: f } = n, { quadrantHalfHeight: d, quadrantLeft: h, quadrantHalfWidth: p, quadrantTop: y } = f, _ = [
643
- {
644
- text: {
645
- text: this.data.quadrant1Text,
646
- fill: this.themeConfig.quadrant1TextFill,
647
- x: 0,
648
- y: 0,
649
- fontSize: this.config.quadrantLabelFontSize,
650
- verticalPos: "center",
651
- horizontalPos: "middle",
652
- rotation: 0
653
- },
654
- x: h + p,
655
- y,
656
- width: p,
657
- height: d,
658
- fill: this.themeConfig.quadrant1Fill
659
- },
660
- {
661
- text: {
662
- text: this.data.quadrant2Text,
663
- fill: this.themeConfig.quadrant2TextFill,
664
- x: 0,
665
- y: 0,
666
- fontSize: this.config.quadrantLabelFontSize,
667
- verticalPos: "center",
668
- horizontalPos: "middle",
669
- rotation: 0
670
- },
671
- x: h,
672
- y,
673
- width: p,
674
- height: d,
675
- fill: this.themeConfig.quadrant2Fill
676
- },
677
- {
678
- text: {
679
- text: this.data.quadrant3Text,
680
- fill: this.themeConfig.quadrant3TextFill,
681
- x: 0,
682
- y: 0,
683
- fontSize: this.config.quadrantLabelFontSize,
684
- verticalPos: "center",
685
- horizontalPos: "middle",
686
- rotation: 0
687
- },
688
- x: h,
689
- y: y + d,
690
- width: p,
691
- height: d,
692
- fill: this.themeConfig.quadrant3Fill
693
- },
694
- {
695
- text: {
696
- text: this.data.quadrant4Text,
697
- fill: this.themeConfig.quadrant4TextFill,
698
- x: 0,
699
- y: 0,
700
- fontSize: this.config.quadrantLabelFontSize,
701
- verticalPos: "center",
702
- horizontalPos: "middle",
703
- rotation: 0
704
- },
705
- x: h + p,
706
- y: y + d,
707
- width: p,
708
- height: d,
709
- fill: this.themeConfig.quadrant4Fill
710
- }
711
- ];
712
- for (const a of _)
713
- a.text.x = a.x + a.width / 2, this.data.points.length === 0 ? (a.text.y = a.y + a.height / 2, a.text.horizontalPos = "middle") : (a.text.y = a.y + this.config.quadrantTextTopPadding, a.text.horizontalPos = "top");
714
- return _;
715
- }
716
- getQuadrantPoints(n) {
717
- const { quadrantSpace: f } = n, { quadrantHeight: d, quadrantLeft: h, quadrantTop: p, quadrantWidth: y } = f, _ = ee().domain([0, 1]).range([h, y + h]), a = ee().domain([0, 1]).range([d + p, p]);
718
- return this.data.points.map((u) => {
719
- const T = this.classes.get(u.className);
720
- return T && (u = { ...T, ...u }), {
721
- x: _(u.x),
722
- y: a(u.y),
723
- fill: u.color ?? this.themeConfig.quadrantPointFill,
724
- radius: u.radius ?? this.config.pointRadius,
725
- text: {
726
- text: u.text,
727
- fill: this.themeConfig.quadrantPointTextFill,
728
- x: _(u.x),
729
- y: a(u.y) + this.config.pointTextPadding,
730
- verticalPos: "center",
731
- horizontalPos: "top",
732
- fontSize: this.config.pointLabelFontSize,
733
- rotation: 0
734
- },
735
- strokeColor: u.strokeColor ?? this.themeConfig.quadrantPointFill,
736
- strokeWidth: u.strokeWidth ?? "0px"
737
- };
738
- });
739
- }
740
- getBorders(n) {
741
- const f = this.config.quadrantExternalBorderStrokeWidth / 2, { quadrantSpace: d } = n, {
742
- quadrantHalfHeight: h,
743
- quadrantHeight: p,
744
- quadrantLeft: y,
745
- quadrantHalfWidth: _,
746
- quadrantTop: a,
747
- quadrantWidth: A
748
- } = d;
749
- return [
750
- // top border
751
- {
752
- strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
753
- strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
754
- x1: y - f,
755
- y1: a,
756
- x2: y + A + f,
757
- y2: a
758
- },
759
- // right border
760
- {
761
- strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
762
- strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
763
- x1: y + A,
764
- y1: a + f,
765
- x2: y + A,
766
- y2: a + p - f
767
- },
768
- // bottom border
769
- {
770
- strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
771
- strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
772
- x1: y - f,
773
- y1: a + p,
774
- x2: y + A + f,
775
- y2: a + p
776
- },
777
- // left border
778
- {
779
- strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
780
- strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
781
- x1: y,
782
- y1: a + f,
783
- x2: y,
784
- y2: a + p - f
785
- },
786
- // vertical inner border
787
- {
788
- strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
789
- strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
790
- x1: y + _,
791
- y1: a + f,
792
- x2: y + _,
793
- y2: a + p - f
794
- },
795
- // horizontal inner border
796
- {
797
- strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
798
- strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
799
- x1: y + f,
800
- y1: a + h,
801
- x2: y + A - f,
802
- y2: a + h
803
- }
804
- ];
805
- }
806
- getTitle(n) {
807
- if (n)
808
- return {
809
- text: this.data.titleText,
810
- fill: this.themeConfig.quadrantTitleFill,
811
- fontSize: this.config.titleFontSize,
812
- horizontalPos: "top",
813
- verticalPos: "center",
814
- rotation: 0,
815
- y: this.config.titlePadding,
816
- x: this.config.chartWidth / 2
817
- };
818
- }
819
- build() {
820
- const n = this.config.showXAxis && !!(this.data.xAxisLeftText || this.data.xAxisRightText), f = this.config.showYAxis && !!(this.data.yAxisTopText || this.data.yAxisBottomText), d = this.config.showTitle && !!this.data.titleText, h = this.data.points.length > 0 ? "bottom" : this.config.xAxisPosition, p = this.calculateSpace(h, n, f, d);
821
- return {
822
- points: this.getQuadrantPoints(p),
823
- quadrants: this.getQuadrants(p),
824
- axisLabels: this.getAxisLabels(h, n, f, p),
825
- borderLines: this.getBorders(p),
826
- title: this.getTitle(d)
827
- };
828
- }
829
- }, o(ot, "QuadrantBuilder"), ot), lt, mt = (lt = class extends Error {
830
- constructor(n, f, d) {
831
- super(`value for ${n} ${f} is invalid, please use a valid ${d}`), this.name = "InvalidStyleError";
832
- }
833
- }, o(lt, "InvalidStyleError"), lt);
834
- function Dt(t) {
835
- return !/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t);
836
- }
837
- o(Dt, "validateHexCode");
838
- function ae(t) {
839
- return !/^\d+$/.test(t);
840
- }
841
- o(ae, "validateNumber");
842
- function ne(t) {
843
- return !/^\d+px$/.test(t);
844
- }
845
- o(ne, "validateSizeInPixels");
846
- var Ve = zt();
847
- function Q(t) {
848
- return Ee(t.trim(), Ve);
849
- }
850
- o(Q, "textSanitizer");
851
- var z = new ze();
852
- function se(t) {
853
- z.setData({ quadrant1Text: Q(t.text) });
854
- }
855
- o(se, "setQuadrant1Text");
856
- function re(t) {
857
- z.setData({ quadrant2Text: Q(t.text) });
858
- }
859
- o(re, "setQuadrant2Text");
860
- function oe(t) {
861
- z.setData({ quadrant3Text: Q(t.text) });
862
- }
863
- o(oe, "setQuadrant3Text");
864
- function le(t) {
865
- z.setData({ quadrant4Text: Q(t.text) });
866
- }
867
- o(le, "setQuadrant4Text");
868
- function he(t) {
869
- z.setData({ xAxisLeftText: Q(t.text) });
870
- }
871
- o(he, "setXAxisLeftText");
872
- function ce(t) {
873
- z.setData({ xAxisRightText: Q(t.text) });
874
- }
875
- o(ce, "setXAxisRightText");
876
- function de(t) {
877
- z.setData({ yAxisTopText: Q(t.text) });
878
- }
879
- o(de, "setYAxisTopText");
880
- function ue(t) {
881
- z.setData({ yAxisBottomText: Q(t.text) });
882
- }
883
- o(ue, "setYAxisBottomText");
884
- function St(t) {
885
- const n = {};
886
- for (const f of t) {
887
- const [d, h] = f.trim().split(/\s*:\s*/);
888
- if (d === "radius") {
889
- if (ae(h))
890
- throw new mt(d, h, "number");
891
- n.radius = parseInt(h);
892
- } else if (d === "color") {
893
- if (Dt(h))
894
- throw new mt(d, h, "hex code");
895
- n.color = h;
896
- } else if (d === "stroke-color") {
897
- if (Dt(h))
898
- throw new mt(d, h, "hex code");
899
- n.strokeColor = h;
900
- } else if (d === "stroke-width") {
901
- if (ne(h))
902
- throw new mt(d, h, "number of pixels (eg. 10px)");
903
- n.strokeWidth = h;
904
- } else
905
- throw new Error(`style named ${d} is not supported.`);
906
- }
907
- return n;
908
- }
909
- o(St, "parseStyles");
910
- function xe(t, n, f, d, h) {
911
- const p = St(h);
912
- z.addPoints([
913
- {
914
- x: f,
915
- y: d,
916
- text: Q(t.text),
917
- className: n,
918
- ...p
919
- }
920
- ]);
921
- }
922
- o(xe, "addPoint");
923
- function fe(t, n) {
924
- z.addClass(t, St(n));
925
- }
926
- o(fe, "addClass");
927
- function ge(t) {
928
- z.setConfig({ chartWidth: t });
929
- }
930
- o(ge, "setWidth");
931
- function pe(t) {
932
- z.setConfig({ chartHeight: t });
933
- }
934
- o(pe, "setHeight");
935
- function ye() {
936
- const t = zt(), { themeVariables: n, quadrantChart: f } = t;
937
- return f && z.setConfig(f), z.setThemeConfig({
938
- quadrant1Fill: n.quadrant1Fill,
939
- quadrant2Fill: n.quadrant2Fill,
940
- quadrant3Fill: n.quadrant3Fill,
941
- quadrant4Fill: n.quadrant4Fill,
942
- quadrant1TextFill: n.quadrant1TextFill,
943
- quadrant2TextFill: n.quadrant2TextFill,
944
- quadrant3TextFill: n.quadrant3TextFill,
945
- quadrant4TextFill: n.quadrant4TextFill,
946
- quadrantPointFill: n.quadrantPointFill,
947
- quadrantPointTextFill: n.quadrantPointTextFill,
948
- quadrantXAxisTextFill: n.quadrantXAxisTextFill,
949
- quadrantYAxisTextFill: n.quadrantYAxisTextFill,
950
- quadrantExternalBorderStrokeFill: n.quadrantExternalBorderStrokeFill,
951
- quadrantInternalBorderStrokeFill: n.quadrantInternalBorderStrokeFill,
952
- quadrantTitleFill: n.quadrantTitleFill
953
- }), z.setData({ titleText: ie() }), z.build();
954
- }
955
- o(ye, "getQuadrantData");
956
- var Ie = /* @__PURE__ */ o(function() {
957
- z.clear(), Ce();
958
- }, "clear"), we = {
959
- setWidth: ge,
960
- setHeight: pe,
961
- setQuadrant1Text: se,
962
- setQuadrant2Text: re,
963
- setQuadrant3Text: oe,
964
- setQuadrant4Text: le,
965
- setXAxisLeftText: he,
966
- setXAxisRightText: ce,
967
- setYAxisTopText: de,
968
- setYAxisBottomText: ue,
969
- parseStyles: St,
970
- addPoint: xe,
971
- addClass: fe,
972
- getQuadrantData: ye,
973
- clear: Ie,
974
- setAccTitle: Pe,
975
- getAccTitle: Fe,
976
- setDiagramTitle: ke,
977
- getDiagramTitle: ie,
978
- getAccDescription: Ae,
979
- setAccDescription: _e
980
- }, Be = /* @__PURE__ */ o((t, n, f, d) => {
981
- function h(i) {
982
- return i === "top" ? "hanging" : "middle";
983
- }
984
- o(h, "getDominantBaseLine");
985
- function p(i) {
986
- return i === "left" ? "start" : "middle";
987
- }
988
- o(p, "getTextAnchor");
989
- function y(i) {
990
- return `translate(${i.x}, ${i.y}) rotate(${i.rotation || 0})`;
991
- }
992
- o(y, "getTransformation");
993
- const _ = zt();
994
- bt.debug(`Rendering quadrant chart
995
- ` + t);
996
- const a = _.securityLevel;
997
- let A;
998
- a === "sandbox" && (A = Lt("#i" + n));
999
- const T = (a === "sandbox" ? Lt(A.nodes()[0].contentDocument.body) : Lt("body")).select(`[id="${n}"]`), q = T.append("g").attr("class", "main"), m = _.quadrantChart?.chartWidth ?? 500, b = _.quadrantChart?.chartHeight ?? 500;
1000
- ve(T, b, m, _.quadrantChart?.useMaxWidth ?? !0), T.attr("viewBox", "0 0 " + m + " " + b), d.db.setHeight(b), d.db.setWidth(m);
1001
- const g = d.db.getQuadrantData(), G = q.append("g").attr("class", "quadrants"), ht = q.append("g").attr("class", "border"), xt = q.append("g").attr("class", "data-points"), ft = q.append("g").attr("class", "labels"), gt = q.append("g").attr("class", "title");
1002
- g.title && gt.append("text").attr("x", 0).attr("y", 0).attr("fill", g.title.fill).attr("font-size", g.title.fontSize).attr("dominant-baseline", h(g.title.horizontalPos)).attr("text-anchor", p(g.title.verticalPos)).attr("transform", y(g.title)).text(g.title.text), g.borderLines && ht.selectAll("line").data(g.borderLines).enter().append("line").attr("x1", (i) => i.x1).attr("y1", (i) => i.y1).attr("x2", (i) => i.x2).attr("y2", (i) => i.y2).style("stroke", (i) => i.strokeFill).style("stroke-width", (i) => i.strokeWidth);
1003
- const ct = G.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class", "quadrant");
1004
- ct.append("rect").attr("x", (i) => i.x).attr("y", (i) => i.y).attr("width", (i) => i.width).attr("height", (i) => i.height).attr("fill", (i) => i.fill), ct.append("text").attr("x", 0).attr("y", 0).attr("fill", (i) => i.text.fill).attr("font-size", (i) => i.text.fontSize).attr(
1005
- "dominant-baseline",
1006
- (i) => h(i.text.horizontalPos)
1007
- ).attr("text-anchor", (i) => p(i.text.verticalPos)).attr("transform", (i) => y(i.text)).text((i) => i.text.text), ft.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class", "label").append("text").attr("x", 0).attr("y", 0).text((i) => i.text).attr("fill", (i) => i.fill).attr("font-size", (i) => i.fontSize).attr("dominant-baseline", (i) => h(i.horizontalPos)).attr("text-anchor", (i) => p(i.verticalPos)).attr("transform", (i) => y(i));
1008
- const dt = xt.selectAll("g.data-point").data(g.points).enter().append("g").attr("class", "data-point");
1009
- dt.append("circle").attr("cx", (i) => i.x).attr("cy", (i) => i.y).attr("r", (i) => i.radius).attr("fill", (i) => i.fill).attr("stroke", (i) => i.strokeColor).attr("stroke-width", (i) => i.strokeWidth), dt.append("text").attr("x", 0).attr("y", 0).text((i) => i.text.text).attr("fill", (i) => i.text.fill).attr("font-size", (i) => i.text.fontSize).attr(
1010
- "dominant-baseline",
1011
- (i) => h(i.text.horizontalPos)
1012
- ).attr("text-anchor", (i) => p(i.text.verticalPos)).attr("transform", (i) => y(i.text));
1013
- }, "draw"), Re = {
1014
- draw: Be
1015
- }, Qe = {
1016
- parser: De,
1017
- db: we,
1018
- renderer: Re,
1019
- styles: /* @__PURE__ */ o(() => "", "styles")
1020
- };
1021
- export {
1022
- Qe as diagram
1023
- };