@readme/markdown 9.3.0 → 9.3.1

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 (122) hide show
  1. package/dist/10.node.js +20064 -19229
  2. package/dist/10.node.js.map +1 -1
  3. package/dist/122.node.js +23 -0
  4. package/dist/122.node.js.map +1 -0
  5. package/dist/{17.node.js → 135.node.js} +109 -110
  6. package/dist/135.node.js.map +1 -0
  7. package/dist/136.node.js +23 -0
  8. package/dist/136.node.js.map +1 -0
  9. package/dist/{52.node.js → 188.node.js} +211 -196
  10. package/dist/188.node.js.map +1 -0
  11. package/dist/214.node.js +1280 -0
  12. package/dist/214.node.js.map +1 -0
  13. package/dist/23.node.js +2563 -0
  14. package/dist/23.node.js.map +1 -0
  15. package/dist/{867.node.js → 311.node.js} +95 -95
  16. package/dist/{867.node.js.map → 311.node.js.map} +1 -1
  17. package/dist/{940.node.js → 339.node.js} +3 -75
  18. package/dist/339.node.js.map +1 -0
  19. package/dist/354.node.js +23 -0
  20. package/dist/354.node.js.map +1 -0
  21. package/dist/359.node.js +2001 -0
  22. package/dist/359.node.js.map +1 -0
  23. package/dist/364.node.js +4435 -0
  24. package/dist/364.node.js.map +1 -0
  25. package/dist/{429.node.js → 371.node.js} +196 -139
  26. package/dist/371.node.js.map +1 -0
  27. package/dist/{687.node.js → 38.node.js} +761 -761
  28. package/dist/38.node.js.map +1 -0
  29. package/dist/391.node.js +522 -0
  30. package/dist/391.node.js.map +1 -0
  31. package/dist/462.node.js +23 -0
  32. package/dist/462.node.js.map +1 -0
  33. package/dist/48.node.js +57 -0
  34. package/dist/48.node.js.map +1 -0
  35. package/dist/486.node.js +16267 -14851
  36. package/dist/486.node.js.map +1 -1
  37. package/dist/537.node.js +59 -0
  38. package/dist/537.node.js.map +1 -0
  39. package/dist/550.node.js +201 -1408
  40. package/dist/550.node.js.map +1 -1
  41. package/dist/{403.node.js → 572.node.js} +118 -118
  42. package/dist/572.node.js.map +1 -0
  43. package/dist/580.node.js +1324 -0
  44. package/dist/580.node.js.map +1 -0
  45. package/dist/{952.node.js → 649.node.js} +39 -39
  46. package/dist/{952.node.js.map → 649.node.js.map} +1 -1
  47. package/dist/740.node.js +23 -0
  48. package/dist/740.node.js.map +1 -0
  49. package/dist/741.node.js +23 -0
  50. package/dist/741.node.js.map +1 -0
  51. package/dist/779.node.js +57 -0
  52. package/dist/779.node.js.map +1 -0
  53. package/dist/805.node.js +1355 -0
  54. package/dist/805.node.js.map +1 -0
  55. package/dist/{246.node.js → 855.node.js} +671 -495
  56. package/dist/855.node.js.map +1 -0
  57. package/dist/{11.node.js → 870.node.js} +70 -63
  58. package/dist/870.node.js.map +1 -0
  59. package/dist/874.node.js +57 -0
  60. package/dist/874.node.js.map +1 -0
  61. package/dist/881.node.js +1344 -720
  62. package/dist/881.node.js.map +1 -1
  63. package/dist/{906.node.js → 890.node.js} +147 -147
  64. package/dist/{906.node.js.map → 890.node.js.map} +1 -1
  65. package/dist/898.node.js +361 -0
  66. package/dist/898.node.js.map +1 -0
  67. package/dist/{551.node.js → 912.node.js} +133 -133
  68. package/dist/{551.node.js.map → 912.node.js.map} +1 -1
  69. package/dist/{745.node.js → 915.node.js} +86 -85
  70. package/dist/915.node.js.map +1 -0
  71. package/dist/982.node.js +1132 -0
  72. package/dist/982.node.js.map +1 -0
  73. package/dist/995.node.js +189 -159
  74. package/dist/995.node.js.map +1 -1
  75. package/dist/lib/plain.d.ts +1 -1
  76. package/dist/main.js +1881 -331
  77. package/dist/main.node.js +1872 -332
  78. package/dist/main.node.js.map +1 -1
  79. package/package.json +1 -2
  80. package/dist/11.node.js.map +0 -1
  81. package/dist/120.node.js +0 -23
  82. package/dist/120.node.js.map +0 -1
  83. package/dist/134.node.js +0 -23
  84. package/dist/134.node.js.map +0 -1
  85. package/dist/150.node.js +0 -1892
  86. package/dist/150.node.js.map +0 -1
  87. package/dist/17.node.js.map +0 -1
  88. package/dist/246.node.js.map +0 -1
  89. package/dist/351.node.js +0 -2404
  90. package/dist/351.node.js.map +0 -1
  91. package/dist/366.node.js +0 -1185
  92. package/dist/366.node.js.map +0 -1
  93. package/dist/403.node.js.map +0 -1
  94. package/dist/429.node.js.map +0 -1
  95. package/dist/485.node.js +0 -518
  96. package/dist/485.node.js.map +0 -1
  97. package/dist/488.node.js +0 -59
  98. package/dist/488.node.js.map +0 -1
  99. package/dist/510.node.js +0 -250
  100. package/dist/510.node.js.map +0 -1
  101. package/dist/52.node.js.map +0 -1
  102. package/dist/617.node.js +0 -23
  103. package/dist/617.node.js.map +0 -1
  104. package/dist/687.node.js.map +0 -1
  105. package/dist/745.node.js.map +0 -1
  106. package/dist/775.node.js +0 -1904
  107. package/dist/775.node.js.map +0 -1
  108. package/dist/788.node.js +0 -1025
  109. package/dist/788.node.js.map +0 -1
  110. package/dist/81.node.js +0 -386
  111. package/dist/81.node.js.map +0 -1
  112. package/dist/849.node.js +0 -2590
  113. package/dist/849.node.js.map +0 -1
  114. package/dist/863.node.js +0 -23
  115. package/dist/863.node.js.map +0 -1
  116. package/dist/885.node.js +0 -52
  117. package/dist/885.node.js.map +0 -1
  118. package/dist/896.node.js +0 -1617
  119. package/dist/896.node.js.map +0 -1
  120. package/dist/91.node.js +0 -23
  121. package/dist/91.node.js.map +0 -1
  122. package/dist/940.node.js.map +0 -1
package/dist/775.node.js DELETED
@@ -1,1904 +0,0 @@
1
- "use strict";
2
- exports.id = 775;
3
- exports.ids = [775];
4
- exports.modules = {
5
-
6
- /***/ 3775:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10
- /* harmony export */ diagram: () => (/* binding */ diagram)
11
- /* harmony export */ });
12
- /* harmony import */ var _chunk_U7L4IQIU_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5449);
13
- /* harmony import */ var _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2843);
14
- /* harmony import */ var _chunk_OBAELV6Q_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4196);
15
- /* harmony import */ var _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6322);
16
- /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8066);
17
-
18
-
19
-
20
-
21
-
22
- // src/diagrams/xychart/parser/xychart.jison
23
- var parser = function() {
24
- var o = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(k, v, o2, l) {
25
- for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
26
- return o2;
27
- }, "o"), $V0 = [1, 10, 12, 14, 16, 18, 19, 21, 23], $V1 = [2, 6], $V2 = [1, 3], $V3 = [1, 5], $V4 = [1, 6], $V5 = [1, 7], $V6 = [1, 5, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], $V7 = [1, 25], $V8 = [1, 26], $V9 = [1, 28], $Va = [1, 29], $Vb = [1, 30], $Vc = [1, 31], $Vd = [1, 32], $Ve = [1, 33], $Vf = [1, 34], $Vg = [1, 35], $Vh = [1, 36], $Vi = [1, 37], $Vj = [1, 43], $Vk = [1, 42], $Vl = [1, 47], $Vm = [1, 50], $Vn = [1, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], $Vo = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36], $Vp = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], $Vq = [1, 64];
28
- var parser2 = {
29
- trace: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function trace() {
30
- }, "trace"),
31
- yy: {},
32
- symbols_: { "error": 2, "start": 3, "eol": 4, "XYCHART": 5, "chartConfig": 6, "document": 7, "CHART_ORIENTATION": 8, "statement": 9, "title": 10, "text": 11, "X_AXIS": 12, "parseXAxis": 13, "Y_AXIS": 14, "parseYAxis": 15, "LINE": 16, "plotData": 17, "BAR": 18, "acc_title": 19, "acc_title_value": 20, "acc_descr": 21, "acc_descr_value": 22, "acc_descr_multiline_value": 23, "SQUARE_BRACES_START": 24, "commaSeparatedNumbers": 25, "SQUARE_BRACES_END": 26, "NUMBER_WITH_DECIMAL": 27, "COMMA": 28, "xAxisData": 29, "bandData": 30, "ARROW_DELIMITER": 31, "commaSeparatedTexts": 32, "yAxisData": 33, "NEWLINE": 34, "SEMI": 35, "EOF": 36, "alphaNum": 37, "STR": 38, "MD_STR": 39, "alphaNumToken": 40, "AMP": 41, "NUM": 42, "ALPHA": 43, "PLUS": 44, "EQUALS": 45, "MULT": 46, "DOT": 47, "BRKT": 48, "MINUS": 49, "UNDERSCORE": 50, "$accept": 0, "$end": 1 },
33
- terminals_: { 2: "error", 5: "XYCHART", 8: "CHART_ORIENTATION", 10: "title", 12: "X_AXIS", 14: "Y_AXIS", 16: "LINE", 18: "BAR", 19: "acc_title", 20: "acc_title_value", 21: "acc_descr", 22: "acc_descr_value", 23: "acc_descr_multiline_value", 24: "SQUARE_BRACES_START", 26: "SQUARE_BRACES_END", 27: "NUMBER_WITH_DECIMAL", 28: "COMMA", 31: "ARROW_DELIMITER", 34: "NEWLINE", 35: "SEMI", 36: "EOF", 38: "STR", 39: "MD_STR", 41: "AMP", 42: "NUM", 43: "ALPHA", 44: "PLUS", 45: "EQUALS", 46: "MULT", 47: "DOT", 48: "BRKT", 49: "MINUS", 50: "UNDERSCORE" },
34
- productions_: [0, [3, 2], [3, 3], [3, 2], [3, 1], [6, 1], [7, 0], [7, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 3], [9, 2], [9, 3], [9, 2], [9, 2], [9, 1], [17, 3], [25, 3], [25, 1], [13, 1], [13, 2], [13, 1], [29, 1], [29, 3], [30, 3], [32, 3], [32, 1], [15, 1], [15, 2], [15, 1], [33, 3], [4, 1], [4, 1], [4, 1], [11, 1], [11, 1], [11, 1], [37, 1], [37, 2], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1]],
35
- performAction: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
36
- var $0 = $$.length - 1;
37
- switch (yystate) {
38
- case 5:
39
- yy.setOrientation($$[$0]);
40
- break;
41
- case 9:
42
- yy.setDiagramTitle($$[$0].text.trim());
43
- break;
44
- case 12:
45
- yy.setLineData({ text: "", type: "text" }, $$[$0]);
46
- break;
47
- case 13:
48
- yy.setLineData($$[$0 - 1], $$[$0]);
49
- break;
50
- case 14:
51
- yy.setBarData({ text: "", type: "text" }, $$[$0]);
52
- break;
53
- case 15:
54
- yy.setBarData($$[$0 - 1], $$[$0]);
55
- break;
56
- case 16:
57
- this.$ = $$[$0].trim();
58
- yy.setAccTitle(this.$);
59
- break;
60
- case 17:
61
- case 18:
62
- this.$ = $$[$0].trim();
63
- yy.setAccDescription(this.$);
64
- break;
65
- case 19:
66
- this.$ = $$[$0 - 1];
67
- break;
68
- case 20:
69
- this.$ = [Number($$[$0 - 2]), ...$$[$0]];
70
- break;
71
- case 21:
72
- this.$ = [Number($$[$0])];
73
- break;
74
- case 22:
75
- yy.setXAxisTitle($$[$0]);
76
- break;
77
- case 23:
78
- yy.setXAxisTitle($$[$0 - 1]);
79
- break;
80
- case 24:
81
- yy.setXAxisTitle({ type: "text", text: "" });
82
- break;
83
- case 25:
84
- yy.setXAxisBand($$[$0]);
85
- break;
86
- case 26:
87
- yy.setXAxisRangeData(Number($$[$0 - 2]), Number($$[$0]));
88
- break;
89
- case 27:
90
- this.$ = $$[$0 - 1];
91
- break;
92
- case 28:
93
- this.$ = [$$[$0 - 2], ...$$[$0]];
94
- break;
95
- case 29:
96
- this.$ = [$$[$0]];
97
- break;
98
- case 30:
99
- yy.setYAxisTitle($$[$0]);
100
- break;
101
- case 31:
102
- yy.setYAxisTitle($$[$0 - 1]);
103
- break;
104
- case 32:
105
- yy.setYAxisTitle({ type: "text", text: "" });
106
- break;
107
- case 33:
108
- yy.setYAxisRangeData(Number($$[$0 - 2]), Number($$[$0]));
109
- break;
110
- case 37:
111
- this.$ = { text: $$[$0], type: "text" };
112
- break;
113
- case 38:
114
- this.$ = { text: $$[$0], type: "text" };
115
- break;
116
- case 39:
117
- this.$ = { text: $$[$0], type: "markdown" };
118
- break;
119
- case 40:
120
- this.$ = $$[$0];
121
- break;
122
- case 41:
123
- this.$ = $$[$0 - 1] + "" + $$[$0];
124
- break;
125
- }
126
- }, "anonymous"),
127
- table: [o($V0, $V1, { 3: 1, 4: 2, 7: 4, 5: $V2, 34: $V3, 35: $V4, 36: $V5 }), { 1: [3] }, o($V0, $V1, { 4: 2, 7: 4, 3: 8, 5: $V2, 34: $V3, 35: $V4, 36: $V5 }), o($V0, $V1, { 4: 2, 7: 4, 6: 9, 3: 10, 5: $V2, 8: [1, 11], 34: $V3, 35: $V4, 36: $V5 }), { 1: [2, 4], 9: 12, 10: [1, 13], 12: [1, 14], 14: [1, 15], 16: [1, 16], 18: [1, 17], 19: [1, 18], 21: [1, 19], 23: [1, 20] }, o($V6, [2, 34]), o($V6, [2, 35]), o($V6, [2, 36]), { 1: [2, 1] }, o($V0, $V1, { 4: 2, 7: 4, 3: 21, 5: $V2, 34: $V3, 35: $V4, 36: $V5 }), { 1: [2, 3] }, o($V6, [2, 5]), o($V0, [2, 7], { 4: 22, 34: $V3, 35: $V4, 36: $V5 }), { 11: 23, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, { 11: 39, 13: 38, 24: $Vj, 27: $Vk, 29: 40, 30: 41, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, { 11: 45, 15: 44, 27: $Vl, 33: 46, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, { 11: 49, 17: 48, 24: $Vm, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, { 11: 52, 17: 51, 24: $Vm, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, { 20: [1, 53] }, { 22: [1, 54] }, o($Vn, [2, 18]), { 1: [2, 2] }, o($Vn, [2, 8]), o($Vn, [2, 9]), o($Vo, [2, 37], { 40: 55, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }), o($Vo, [2, 38]), o($Vo, [2, 39]), o($Vp, [2, 40]), o($Vp, [2, 42]), o($Vp, [2, 43]), o($Vp, [2, 44]), o($Vp, [2, 45]), o($Vp, [2, 46]), o($Vp, [2, 47]), o($Vp, [2, 48]), o($Vp, [2, 49]), o($Vp, [2, 50]), o($Vp, [2, 51]), o($Vn, [2, 10]), o($Vn, [2, 22], { 30: 41, 29: 56, 24: $Vj, 27: $Vk }), o($Vn, [2, 24]), o($Vn, [2, 25]), { 31: [1, 57] }, { 11: 59, 32: 58, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, o($Vn, [2, 11]), o($Vn, [2, 30], { 33: 60, 27: $Vl }), o($Vn, [2, 32]), { 31: [1, 61] }, o($Vn, [2, 12]), { 17: 62, 24: $Vm }, { 25: 63, 27: $Vq }, o($Vn, [2, 14]), { 17: 65, 24: $Vm }, o($Vn, [2, 16]), o($Vn, [2, 17]), o($Vp, [2, 41]), o($Vn, [2, 23]), { 27: [1, 66] }, { 26: [1, 67] }, { 26: [2, 29], 28: [1, 68] }, o($Vn, [2, 31]), { 27: [1, 69] }, o($Vn, [2, 13]), { 26: [1, 70] }, { 26: [2, 21], 28: [1, 71] }, o($Vn, [2, 15]), o($Vn, [2, 26]), o($Vn, [2, 27]), { 11: 59, 32: 72, 37: 24, 38: $V7, 39: $V8, 40: 27, 41: $V9, 42: $Va, 43: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi }, o($Vn, [2, 33]), o($Vn, [2, 19]), { 25: 73, 27: $Vq }, { 26: [2, 28] }, { 26: [2, 20] }],
128
- defaultActions: { 8: [2, 1], 10: [2, 3], 21: [2, 2], 72: [2, 28], 73: [2, 20] },
129
- parseError: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function parseError(str, hash) {
130
- if (hash.recoverable) {
131
- this.trace(str);
132
- } else {
133
- var error = new Error(str);
134
- error.hash = hash;
135
- throw error;
136
- }
137
- }, "parseError"),
138
- parse: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function parse(input) {
139
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
140
- var args = lstack.slice.call(arguments, 1);
141
- var lexer2 = Object.create(this.lexer);
142
- var sharedState = { yy: {} };
143
- for (var k in this.yy) {
144
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
145
- sharedState.yy[k] = this.yy[k];
146
- }
147
- }
148
- lexer2.setInput(input, sharedState.yy);
149
- sharedState.yy.lexer = lexer2;
150
- sharedState.yy.parser = this;
151
- if (typeof lexer2.yylloc == "undefined") {
152
- lexer2.yylloc = {};
153
- }
154
- var yyloc = lexer2.yylloc;
155
- lstack.push(yyloc);
156
- var ranges = lexer2.options && lexer2.options.ranges;
157
- if (typeof sharedState.yy.parseError === "function") {
158
- this.parseError = sharedState.yy.parseError;
159
- } else {
160
- this.parseError = Object.getPrototypeOf(this).parseError;
161
- }
162
- function popStack(n) {
163
- stack.length = stack.length - 2 * n;
164
- vstack.length = vstack.length - n;
165
- lstack.length = lstack.length - n;
166
- }
167
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(popStack, "popStack");
168
- function lex() {
169
- var token;
170
- token = tstack.pop() || lexer2.lex() || EOF;
171
- if (typeof token !== "number") {
172
- if (token instanceof Array) {
173
- tstack = token;
174
- token = tstack.pop();
175
- }
176
- token = self.symbols_[token] || token;
177
- }
178
- return token;
179
- }
180
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(lex, "lex");
181
- var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
182
- while (true) {
183
- state = stack[stack.length - 1];
184
- if (this.defaultActions[state]) {
185
- action = this.defaultActions[state];
186
- } else {
187
- if (symbol === null || typeof symbol == "undefined") {
188
- symbol = lex();
189
- }
190
- action = table[state] && table[state][symbol];
191
- }
192
- if (typeof action === "undefined" || !action.length || !action[0]) {
193
- var errStr = "";
194
- expected = [];
195
- for (p in table[state]) {
196
- if (this.terminals_[p] && p > TERROR) {
197
- expected.push("'" + this.terminals_[p] + "'");
198
- }
199
- }
200
- if (lexer2.showPosition) {
201
- errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
202
- } else {
203
- errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
204
- }
205
- this.parseError(errStr, {
206
- text: lexer2.match,
207
- token: this.terminals_[symbol] || symbol,
208
- line: lexer2.yylineno,
209
- loc: yyloc,
210
- expected
211
- });
212
- }
213
- if (action[0] instanceof Array && action.length > 1) {
214
- throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
215
- }
216
- switch (action[0]) {
217
- case 1:
218
- stack.push(symbol);
219
- vstack.push(lexer2.yytext);
220
- lstack.push(lexer2.yylloc);
221
- stack.push(action[1]);
222
- symbol = null;
223
- if (!preErrorSymbol) {
224
- yyleng = lexer2.yyleng;
225
- yytext = lexer2.yytext;
226
- yylineno = lexer2.yylineno;
227
- yyloc = lexer2.yylloc;
228
- if (recovering > 0) {
229
- recovering--;
230
- }
231
- } else {
232
- symbol = preErrorSymbol;
233
- preErrorSymbol = null;
234
- }
235
- break;
236
- case 2:
237
- len = this.productions_[action[1]][1];
238
- yyval.$ = vstack[vstack.length - len];
239
- yyval._$ = {
240
- first_line: lstack[lstack.length - (len || 1)].first_line,
241
- last_line: lstack[lstack.length - 1].last_line,
242
- first_column: lstack[lstack.length - (len || 1)].first_column,
243
- last_column: lstack[lstack.length - 1].last_column
244
- };
245
- if (ranges) {
246
- yyval._$.range = [
247
- lstack[lstack.length - (len || 1)].range[0],
248
- lstack[lstack.length - 1].range[1]
249
- ];
250
- }
251
- r = this.performAction.apply(yyval, [
252
- yytext,
253
- yyleng,
254
- yylineno,
255
- sharedState.yy,
256
- action[1],
257
- vstack,
258
- lstack
259
- ].concat(args));
260
- if (typeof r !== "undefined") {
261
- return r;
262
- }
263
- if (len) {
264
- stack = stack.slice(0, -1 * len * 2);
265
- vstack = vstack.slice(0, -1 * len);
266
- lstack = lstack.slice(0, -1 * len);
267
- }
268
- stack.push(this.productions_[action[1]][0]);
269
- vstack.push(yyval.$);
270
- lstack.push(yyval._$);
271
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
272
- stack.push(newState);
273
- break;
274
- case 3:
275
- return true;
276
- }
277
- }
278
- return true;
279
- }, "parse")
280
- };
281
- var lexer = /* @__PURE__ */ function() {
282
- var lexer2 = {
283
- EOF: 1,
284
- parseError: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function parseError(str, hash) {
285
- if (this.yy.parser) {
286
- this.yy.parser.parseError(str, hash);
287
- } else {
288
- throw new Error(str);
289
- }
290
- }, "parseError"),
291
- // resets the lexer, sets new input
292
- setInput: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(input, yy) {
293
- this.yy = yy || this.yy || {};
294
- this._input = input;
295
- this._more = this._backtrack = this.done = false;
296
- this.yylineno = this.yyleng = 0;
297
- this.yytext = this.matched = this.match = "";
298
- this.conditionStack = ["INITIAL"];
299
- this.yylloc = {
300
- first_line: 1,
301
- first_column: 0,
302
- last_line: 1,
303
- last_column: 0
304
- };
305
- if (this.options.ranges) {
306
- this.yylloc.range = [0, 0];
307
- }
308
- this.offset = 0;
309
- return this;
310
- }, "setInput"),
311
- // consumes and returns one char from the input
312
- input: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
313
- var ch = this._input[0];
314
- this.yytext += ch;
315
- this.yyleng++;
316
- this.offset++;
317
- this.match += ch;
318
- this.matched += ch;
319
- var lines = ch.match(/(?:\r\n?|\n).*/g);
320
- if (lines) {
321
- this.yylineno++;
322
- this.yylloc.last_line++;
323
- } else {
324
- this.yylloc.last_column++;
325
- }
326
- if (this.options.ranges) {
327
- this.yylloc.range[1]++;
328
- }
329
- this._input = this._input.slice(1);
330
- return ch;
331
- }, "input"),
332
- // unshifts one char (or a string) into the input
333
- unput: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(ch) {
334
- var len = ch.length;
335
- var lines = ch.split(/(?:\r\n?|\n)/g);
336
- this._input = ch + this._input;
337
- this.yytext = this.yytext.substr(0, this.yytext.length - len);
338
- this.offset -= len;
339
- var oldLines = this.match.split(/(?:\r\n?|\n)/g);
340
- this.match = this.match.substr(0, this.match.length - 1);
341
- this.matched = this.matched.substr(0, this.matched.length - 1);
342
- if (lines.length - 1) {
343
- this.yylineno -= lines.length - 1;
344
- }
345
- var r = this.yylloc.range;
346
- this.yylloc = {
347
- first_line: this.yylloc.first_line,
348
- last_line: this.yylineno + 1,
349
- first_column: this.yylloc.first_column,
350
- last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
351
- };
352
- if (this.options.ranges) {
353
- this.yylloc.range = [r[0], r[0] + this.yyleng - len];
354
- }
355
- this.yyleng = this.yytext.length;
356
- return this;
357
- }, "unput"),
358
- // When called from action, caches matched text and appends it on next action
359
- more: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
360
- this._more = true;
361
- return this;
362
- }, "more"),
363
- // 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.
364
- reject: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
365
- if (this.options.backtrack_lexer) {
366
- this._backtrack = true;
367
- } else {
368
- 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).\n" + this.showPosition(), {
369
- text: "",
370
- token: null,
371
- line: this.yylineno
372
- });
373
- }
374
- return this;
375
- }, "reject"),
376
- // retain first n characters of the match
377
- less: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(n) {
378
- this.unput(this.match.slice(n));
379
- }, "less"),
380
- // displays already matched input, i.e. for error messages
381
- pastInput: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
382
- var past = this.matched.substr(0, this.matched.length - this.match.length);
383
- return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
384
- }, "pastInput"),
385
- // displays upcoming input, i.e. for error messages
386
- upcomingInput: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
387
- var next = this.match;
388
- if (next.length < 20) {
389
- next += this._input.substr(0, 20 - next.length);
390
- }
391
- return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
392
- }, "upcomingInput"),
393
- // displays the character position where the lexing error occurred, i.e. for error messages
394
- showPosition: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
395
- var pre = this.pastInput();
396
- var c = new Array(pre.length + 1).join("-");
397
- return pre + this.upcomingInput() + "\n" + c + "^";
398
- }, "showPosition"),
399
- // test the lexed token: return FALSE when not a match, otherwise return token
400
- test_match: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(match, indexed_rule) {
401
- var token, lines, backup;
402
- if (this.options.backtrack_lexer) {
403
- backup = {
404
- yylineno: this.yylineno,
405
- yylloc: {
406
- first_line: this.yylloc.first_line,
407
- last_line: this.last_line,
408
- first_column: this.yylloc.first_column,
409
- last_column: this.yylloc.last_column
410
- },
411
- yytext: this.yytext,
412
- match: this.match,
413
- matches: this.matches,
414
- matched: this.matched,
415
- yyleng: this.yyleng,
416
- offset: this.offset,
417
- _more: this._more,
418
- _input: this._input,
419
- yy: this.yy,
420
- conditionStack: this.conditionStack.slice(0),
421
- done: this.done
422
- };
423
- if (this.options.ranges) {
424
- backup.yylloc.range = this.yylloc.range.slice(0);
425
- }
426
- }
427
- lines = match[0].match(/(?:\r\n?|\n).*/g);
428
- if (lines) {
429
- this.yylineno += lines.length;
430
- }
431
- this.yylloc = {
432
- first_line: this.yylloc.last_line,
433
- last_line: this.yylineno + 1,
434
- first_column: this.yylloc.last_column,
435
- last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
436
- };
437
- this.yytext += match[0];
438
- this.match += match[0];
439
- this.matches = match;
440
- this.yyleng = this.yytext.length;
441
- if (this.options.ranges) {
442
- this.yylloc.range = [this.offset, this.offset += this.yyleng];
443
- }
444
- this._more = false;
445
- this._backtrack = false;
446
- this._input = this._input.slice(match[0].length);
447
- this.matched += match[0];
448
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
449
- if (this.done && this._input) {
450
- this.done = false;
451
- }
452
- if (token) {
453
- return token;
454
- } else if (this._backtrack) {
455
- for (var k in backup) {
456
- this[k] = backup[k];
457
- }
458
- return false;
459
- }
460
- return false;
461
- }, "test_match"),
462
- // return next match in input
463
- next: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
464
- if (this.done) {
465
- return this.EOF;
466
- }
467
- if (!this._input) {
468
- this.done = true;
469
- }
470
- var token, match, tempMatch, index;
471
- if (!this._more) {
472
- this.yytext = "";
473
- this.match = "";
474
- }
475
- var rules = this._currentRules();
476
- for (var i = 0; i < rules.length; i++) {
477
- tempMatch = this._input.match(this.rules[rules[i]]);
478
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
479
- match = tempMatch;
480
- index = i;
481
- if (this.options.backtrack_lexer) {
482
- token = this.test_match(tempMatch, rules[i]);
483
- if (token !== false) {
484
- return token;
485
- } else if (this._backtrack) {
486
- match = false;
487
- continue;
488
- } else {
489
- return false;
490
- }
491
- } else if (!this.options.flex) {
492
- break;
493
- }
494
- }
495
- }
496
- if (match) {
497
- token = this.test_match(match, rules[index]);
498
- if (token !== false) {
499
- return token;
500
- }
501
- return false;
502
- }
503
- if (this._input === "") {
504
- return this.EOF;
505
- } else {
506
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
507
- text: "",
508
- token: null,
509
- line: this.yylineno
510
- });
511
- }
512
- }, "next"),
513
- // return next match that has a token
514
- lex: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function lex() {
515
- var r = this.next();
516
- if (r) {
517
- return r;
518
- } else {
519
- return this.lex();
520
- }
521
- }, "lex"),
522
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
523
- begin: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function begin(condition) {
524
- this.conditionStack.push(condition);
525
- }, "begin"),
526
- // pop the previously active lexer condition state off the condition stack
527
- popState: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function popState() {
528
- var n = this.conditionStack.length - 1;
529
- if (n > 0) {
530
- return this.conditionStack.pop();
531
- } else {
532
- return this.conditionStack[0];
533
- }
534
- }, "popState"),
535
- // produce the lexer rule set which is active for the currently active lexer condition state
536
- _currentRules: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function _currentRules() {
537
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
538
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
539
- } else {
540
- return this.conditions["INITIAL"].rules;
541
- }
542
- }, "_currentRules"),
543
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
544
- topState: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function topState(n) {
545
- n = this.conditionStack.length - 1 - Math.abs(n || 0);
546
- if (n >= 0) {
547
- return this.conditionStack[n];
548
- } else {
549
- return "INITIAL";
550
- }
551
- }, "topState"),
552
- // alias for begin(condition)
553
- pushState: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function pushState(condition) {
554
- this.begin(condition);
555
- }, "pushState"),
556
- // return the number of states currently on the stack
557
- stateStackSize: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function stateStackSize() {
558
- return this.conditionStack.length;
559
- }, "stateStackSize"),
560
- options: { "case-insensitive": true },
561
- performAction: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
562
- var YYSTATE = YY_START;
563
- switch ($avoiding_name_collisions) {
564
- case 0:
565
- break;
566
- case 1:
567
- break;
568
- case 2:
569
- this.popState();
570
- return 34;
571
- break;
572
- case 3:
573
- this.popState();
574
- return 34;
575
- break;
576
- case 4:
577
- return 34;
578
- break;
579
- case 5:
580
- break;
581
- case 6:
582
- return 10;
583
- break;
584
- case 7:
585
- this.pushState("acc_title");
586
- return 19;
587
- break;
588
- case 8:
589
- this.popState();
590
- return "acc_title_value";
591
- break;
592
- case 9:
593
- this.pushState("acc_descr");
594
- return 21;
595
- break;
596
- case 10:
597
- this.popState();
598
- return "acc_descr_value";
599
- break;
600
- case 11:
601
- this.pushState("acc_descr_multiline");
602
- break;
603
- case 12:
604
- this.popState();
605
- break;
606
- case 13:
607
- return "acc_descr_multiline_value";
608
- break;
609
- case 14:
610
- return 5;
611
- break;
612
- case 15:
613
- return 8;
614
- break;
615
- case 16:
616
- this.pushState("axis_data");
617
- return "X_AXIS";
618
- break;
619
- case 17:
620
- this.pushState("axis_data");
621
- return "Y_AXIS";
622
- break;
623
- case 18:
624
- this.pushState("axis_band_data");
625
- return 24;
626
- break;
627
- case 19:
628
- return 31;
629
- break;
630
- case 20:
631
- this.pushState("data");
632
- return 16;
633
- break;
634
- case 21:
635
- this.pushState("data");
636
- return 18;
637
- break;
638
- case 22:
639
- this.pushState("data_inner");
640
- return 24;
641
- break;
642
- case 23:
643
- return 27;
644
- break;
645
- case 24:
646
- this.popState();
647
- return 26;
648
- break;
649
- case 25:
650
- this.popState();
651
- break;
652
- case 26:
653
- this.pushState("string");
654
- break;
655
- case 27:
656
- this.popState();
657
- break;
658
- case 28:
659
- return "STR";
660
- break;
661
- case 29:
662
- return 24;
663
- break;
664
- case 30:
665
- return 26;
666
- break;
667
- case 31:
668
- return 43;
669
- break;
670
- case 32:
671
- return "COLON";
672
- break;
673
- case 33:
674
- return 44;
675
- break;
676
- case 34:
677
- return 28;
678
- break;
679
- case 35:
680
- return 45;
681
- break;
682
- case 36:
683
- return 46;
684
- break;
685
- case 37:
686
- return 48;
687
- break;
688
- case 38:
689
- return 50;
690
- break;
691
- case 39:
692
- return 47;
693
- break;
694
- case 40:
695
- return 41;
696
- break;
697
- case 41:
698
- return 49;
699
- break;
700
- case 42:
701
- return 42;
702
- break;
703
- case 43:
704
- break;
705
- case 44:
706
- return 35;
707
- break;
708
- case 45:
709
- return 36;
710
- break;
711
- }
712
- }, "anonymous"),
713
- rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:(\r?\n))/i, /^(?:(\r?\n))/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:\{)/i, /^(?:[^\}]*)/i, /^(?:xychart-beta\b)/i, /^(?:(?:vertical|horizontal))/i, /^(?:x-axis\b)/i, /^(?:y-axis\b)/i, /^(?:\[)/i, /^(?:-->)/i, /^(?:line\b)/i, /^(?:bar\b)/i, /^(?:\[)/i, /^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i, /^(?:\])/i, /^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s+)/i, /^(?:;)/i, /^(?:$)/i],
714
- conditions: { "data_inner": { "rules": [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "data": { "rules": [0, 1, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 22, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "axis_band_data": { "rules": [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "axis_data": { "rules": [0, 1, 2, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19, 20, 21, 23, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "acc_descr_multiline": { "rules": [12, 13], "inclusive": false }, "acc_descr": { "rules": [10], "inclusive": false }, "acc_title": { "rules": [8], "inclusive": false }, "title": { "rules": [], "inclusive": false }, "md_string": { "rules": [], "inclusive": false }, "string": { "rules": [27, 28], "inclusive": false }, "INITIAL": { "rules": [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true } }
715
- };
716
- return lexer2;
717
- }();
718
- parser2.lexer = lexer;
719
- function Parser() {
720
- this.yy = {};
721
- }
722
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(Parser, "Parser");
723
- Parser.prototype = parser2;
724
- parser2.Parser = Parser;
725
- return new Parser();
726
- }();
727
- parser.parser = parser;
728
- var xychart_default = parser;
729
-
730
- // src/diagrams/xychart/chartBuilder/interfaces.ts
731
- function isBarPlot(data) {
732
- return data.type === "bar";
733
- }
734
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(isBarPlot, "isBarPlot");
735
- function isBandAxisData(data) {
736
- return data.type === "band";
737
- }
738
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(isBandAxisData, "isBandAxisData");
739
- function isLinearAxisData(data) {
740
- return data.type === "linear";
741
- }
742
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(isLinearAxisData, "isLinearAxisData");
743
-
744
- // src/diagrams/xychart/chartBuilder/textDimensionCalculator.ts
745
- var TextDimensionCalculatorWithFont = class {
746
- constructor(parentGroup) {
747
- this.parentGroup = parentGroup;
748
- }
749
- static {
750
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(this, "TextDimensionCalculatorWithFont");
751
- }
752
- getMaxDimension(texts, fontSize) {
753
- if (!this.parentGroup) {
754
- return {
755
- width: texts.reduce((acc, cur) => Math.max(cur.length, acc), 0) * fontSize,
756
- height: fontSize
757
- };
758
- }
759
- const dimension = {
760
- width: 0,
761
- height: 0
762
- };
763
- const elem = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", fontSize);
764
- for (const t of texts) {
765
- const bbox = (0,_chunk_U7L4IQIU_mjs__WEBPACK_IMPORTED_MODULE_0__/* .computeDimensionOfText */ .W6)(elem, 1, t);
766
- const width = bbox ? bbox.width : t.length * fontSize;
767
- const height = bbox ? bbox.height : fontSize;
768
- dimension.width = Math.max(dimension.width, width);
769
- dimension.height = Math.max(dimension.height, height);
770
- }
771
- elem.remove();
772
- return dimension;
773
- }
774
- };
775
-
776
- // src/diagrams/xychart/chartBuilder/components/axis/bandAxis.ts
777
-
778
-
779
- // src/diagrams/xychart/chartBuilder/components/axis/baseAxis.ts
780
- var BAR_WIDTH_TO_TICK_WIDTH_RATIO = 0.7;
781
- var MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL = 0.2;
782
- var BaseAxis = class {
783
- constructor(axisConfig, title, textDimensionCalculator, axisThemeConfig) {
784
- this.axisConfig = axisConfig;
785
- this.title = title;
786
- this.textDimensionCalculator = textDimensionCalculator;
787
- this.axisThemeConfig = axisThemeConfig;
788
- this.boundingRect = { x: 0, y: 0, width: 0, height: 0 };
789
- this.axisPosition = "left";
790
- this.showTitle = false;
791
- this.showLabel = false;
792
- this.showTick = false;
793
- this.showAxisLine = false;
794
- this.outerPadding = 0;
795
- this.titleTextHeight = 0;
796
- this.labelTextHeight = 0;
797
- this.range = [0, 10];
798
- this.boundingRect = { x: 0, y: 0, width: 0, height: 0 };
799
- this.axisPosition = "left";
800
- }
801
- static {
802
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(this, "BaseAxis");
803
- }
804
- setRange(range) {
805
- this.range = range;
806
- if (this.axisPosition === "left" || this.axisPosition === "right") {
807
- this.boundingRect.height = range[1] - range[0];
808
- } else {
809
- this.boundingRect.width = range[1] - range[0];
810
- }
811
- this.recalculateScale();
812
- }
813
- getRange() {
814
- return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding];
815
- }
816
- setAxisPosition(axisPosition) {
817
- this.axisPosition = axisPosition;
818
- this.setRange(this.range);
819
- }
820
- getTickDistance() {
821
- const range = this.getRange();
822
- return Math.abs(range[0] - range[1]) / this.getTickValues().length;
823
- }
824
- getAxisOuterPadding() {
825
- return this.outerPadding;
826
- }
827
- getLabelDimension() {
828
- return this.textDimensionCalculator.getMaxDimension(
829
- this.getTickValues().map((tick) => tick.toString()),
830
- this.axisConfig.labelFontSize
831
- );
832
- }
833
- recalculateOuterPaddingToDrawBar() {
834
- if (BAR_WIDTH_TO_TICK_WIDTH_RATIO * this.getTickDistance() > this.outerPadding * 2) {
835
- this.outerPadding = Math.floor(BAR_WIDTH_TO_TICK_WIDTH_RATIO * this.getTickDistance() / 2);
836
- }
837
- this.recalculateScale();
838
- }
839
- calculateSpaceIfDrawnHorizontally(availableSpace) {
840
- let availableHeight = availableSpace.height;
841
- if (this.axisConfig.showAxisLine && availableHeight > this.axisConfig.axisLineWidth) {
842
- availableHeight -= this.axisConfig.axisLineWidth;
843
- this.showAxisLine = true;
844
- }
845
- if (this.axisConfig.showLabel) {
846
- const spaceRequired = this.getLabelDimension();
847
- const maxPadding = MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL * availableSpace.width;
848
- this.outerPadding = Math.min(spaceRequired.width / 2, maxPadding);
849
- const heightRequired = spaceRequired.height + this.axisConfig.labelPadding * 2;
850
- this.labelTextHeight = spaceRequired.height;
851
- if (heightRequired <= availableHeight) {
852
- availableHeight -= heightRequired;
853
- this.showLabel = true;
854
- }
855
- }
856
- if (this.axisConfig.showTick && availableHeight >= this.axisConfig.tickLength) {
857
- this.showTick = true;
858
- availableHeight -= this.axisConfig.tickLength;
859
- }
860
- if (this.axisConfig.showTitle && this.title) {
861
- const spaceRequired = this.textDimensionCalculator.getMaxDimension(
862
- [this.title],
863
- this.axisConfig.titleFontSize
864
- );
865
- const heightRequired = spaceRequired.height + this.axisConfig.titlePadding * 2;
866
- this.titleTextHeight = spaceRequired.height;
867
- if (heightRequired <= availableHeight) {
868
- availableHeight -= heightRequired;
869
- this.showTitle = true;
870
- }
871
- }
872
- this.boundingRect.width = availableSpace.width;
873
- this.boundingRect.height = availableSpace.height - availableHeight;
874
- }
875
- calculateSpaceIfDrawnVertical(availableSpace) {
876
- let availableWidth = availableSpace.width;
877
- if (this.axisConfig.showAxisLine && availableWidth > this.axisConfig.axisLineWidth) {
878
- availableWidth -= this.axisConfig.axisLineWidth;
879
- this.showAxisLine = true;
880
- }
881
- if (this.axisConfig.showLabel) {
882
- const spaceRequired = this.getLabelDimension();
883
- const maxPadding = MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL * availableSpace.height;
884
- this.outerPadding = Math.min(spaceRequired.height / 2, maxPadding);
885
- const widthRequired = spaceRequired.width + this.axisConfig.labelPadding * 2;
886
- if (widthRequired <= availableWidth) {
887
- availableWidth -= widthRequired;
888
- this.showLabel = true;
889
- }
890
- }
891
- if (this.axisConfig.showTick && availableWidth >= this.axisConfig.tickLength) {
892
- this.showTick = true;
893
- availableWidth -= this.axisConfig.tickLength;
894
- }
895
- if (this.axisConfig.showTitle && this.title) {
896
- const spaceRequired = this.textDimensionCalculator.getMaxDimension(
897
- [this.title],
898
- this.axisConfig.titleFontSize
899
- );
900
- const widthRequired = spaceRequired.height + this.axisConfig.titlePadding * 2;
901
- this.titleTextHeight = spaceRequired.height;
902
- if (widthRequired <= availableWidth) {
903
- availableWidth -= widthRequired;
904
- this.showTitle = true;
905
- }
906
- }
907
- this.boundingRect.width = availableSpace.width - availableWidth;
908
- this.boundingRect.height = availableSpace.height;
909
- }
910
- calculateSpace(availableSpace) {
911
- if (this.axisPosition === "left" || this.axisPosition === "right") {
912
- this.calculateSpaceIfDrawnVertical(availableSpace);
913
- } else {
914
- this.calculateSpaceIfDrawnHorizontally(availableSpace);
915
- }
916
- this.recalculateScale();
917
- return {
918
- width: this.boundingRect.width,
919
- height: this.boundingRect.height
920
- };
921
- }
922
- setBoundingBoxXY(point) {
923
- this.boundingRect.x = point.x;
924
- this.boundingRect.y = point.y;
925
- }
926
- getDrawableElementsForLeftAxis() {
927
- const drawableElement = [];
928
- if (this.showAxisLine) {
929
- const x = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2;
930
- drawableElement.push({
931
- type: "path",
932
- groupTexts: ["left-axis", "axisl-line"],
933
- data: [
934
- {
935
- path: `M ${x},${this.boundingRect.y} L ${x},${this.boundingRect.y + this.boundingRect.height} `,
936
- strokeFill: this.axisThemeConfig.axisLineColor,
937
- strokeWidth: this.axisConfig.axisLineWidth
938
- }
939
- ]
940
- });
941
- }
942
- if (this.showLabel) {
943
- drawableElement.push({
944
- type: "text",
945
- groupTexts: ["left-axis", "label"],
946
- data: this.getTickValues().map((tick) => ({
947
- text: tick.toString(),
948
- x: this.boundingRect.x + this.boundingRect.width - (this.showLabel ? this.axisConfig.labelPadding : 0) - (this.showTick ? this.axisConfig.tickLength : 0) - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
949
- y: this.getScaleValue(tick),
950
- fill: this.axisThemeConfig.labelColor,
951
- fontSize: this.axisConfig.labelFontSize,
952
- rotation: 0,
953
- verticalPos: "middle",
954
- horizontalPos: "right"
955
- }))
956
- });
957
- }
958
- if (this.showTick) {
959
- const x = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
960
- drawableElement.push({
961
- type: "path",
962
- groupTexts: ["left-axis", "ticks"],
963
- data: this.getTickValues().map((tick) => ({
964
- path: `M ${x},${this.getScaleValue(tick)} L ${x - this.axisConfig.tickLength},${this.getScaleValue(tick)}`,
965
- strokeFill: this.axisThemeConfig.tickColor,
966
- strokeWidth: this.axisConfig.tickWidth
967
- }))
968
- });
969
- }
970
- if (this.showTitle) {
971
- drawableElement.push({
972
- type: "text",
973
- groupTexts: ["left-axis", "title"],
974
- data: [
975
- {
976
- text: this.title,
977
- x: this.boundingRect.x + this.axisConfig.titlePadding,
978
- y: this.boundingRect.y + this.boundingRect.height / 2,
979
- fill: this.axisThemeConfig.titleColor,
980
- fontSize: this.axisConfig.titleFontSize,
981
- rotation: 270,
982
- verticalPos: "top",
983
- horizontalPos: "center"
984
- }
985
- ]
986
- });
987
- }
988
- return drawableElement;
989
- }
990
- getDrawableElementsForBottomAxis() {
991
- const drawableElement = [];
992
- if (this.showAxisLine) {
993
- const y = this.boundingRect.y + this.axisConfig.axisLineWidth / 2;
994
- drawableElement.push({
995
- type: "path",
996
- groupTexts: ["bottom-axis", "axis-line"],
997
- data: [
998
- {
999
- path: `M ${this.boundingRect.x},${y} L ${this.boundingRect.x + this.boundingRect.width},${y}`,
1000
- strokeFill: this.axisThemeConfig.axisLineColor,
1001
- strokeWidth: this.axisConfig.axisLineWidth
1002
- }
1003
- ]
1004
- });
1005
- }
1006
- if (this.showLabel) {
1007
- drawableElement.push({
1008
- type: "text",
1009
- groupTexts: ["bottom-axis", "label"],
1010
- data: this.getTickValues().map((tick) => ({
1011
- text: tick.toString(),
1012
- x: this.getScaleValue(tick),
1013
- y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
1014
- fill: this.axisThemeConfig.labelColor,
1015
- fontSize: this.axisConfig.labelFontSize,
1016
- rotation: 0,
1017
- verticalPos: "top",
1018
- horizontalPos: "center"
1019
- }))
1020
- });
1021
- }
1022
- if (this.showTick) {
1023
- const y = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
1024
- drawableElement.push({
1025
- type: "path",
1026
- groupTexts: ["bottom-axis", "ticks"],
1027
- data: this.getTickValues().map((tick) => ({
1028
- path: `M ${this.getScaleValue(tick)},${y} L ${this.getScaleValue(tick)},${y + this.axisConfig.tickLength}`,
1029
- strokeFill: this.axisThemeConfig.tickColor,
1030
- strokeWidth: this.axisConfig.tickWidth
1031
- }))
1032
- });
1033
- }
1034
- if (this.showTitle) {
1035
- drawableElement.push({
1036
- type: "text",
1037
- groupTexts: ["bottom-axis", "title"],
1038
- data: [
1039
- {
1040
- text: this.title,
1041
- x: this.range[0] + (this.range[1] - this.range[0]) / 2,
1042
- y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight,
1043
- fill: this.axisThemeConfig.titleColor,
1044
- fontSize: this.axisConfig.titleFontSize,
1045
- rotation: 0,
1046
- verticalPos: "top",
1047
- horizontalPos: "center"
1048
- }
1049
- ]
1050
- });
1051
- }
1052
- return drawableElement;
1053
- }
1054
- getDrawableElementsForTopAxis() {
1055
- const drawableElement = [];
1056
- if (this.showAxisLine) {
1057
- const y = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2;
1058
- drawableElement.push({
1059
- type: "path",
1060
- groupTexts: ["top-axis", "axis-line"],
1061
- data: [
1062
- {
1063
- path: `M ${this.boundingRect.x},${y} L ${this.boundingRect.x + this.boundingRect.width},${y}`,
1064
- strokeFill: this.axisThemeConfig.axisLineColor,
1065
- strokeWidth: this.axisConfig.axisLineWidth
1066
- }
1067
- ]
1068
- });
1069
- }
1070
- if (this.showLabel) {
1071
- drawableElement.push({
1072
- type: "text",
1073
- groupTexts: ["top-axis", "label"],
1074
- data: this.getTickValues().map((tick) => ({
1075
- text: tick.toString(),
1076
- x: this.getScaleValue(tick),
1077
- y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding,
1078
- fill: this.axisThemeConfig.labelColor,
1079
- fontSize: this.axisConfig.labelFontSize,
1080
- rotation: 0,
1081
- verticalPos: "top",
1082
- horizontalPos: "center"
1083
- }))
1084
- });
1085
- }
1086
- if (this.showTick) {
1087
- const y = this.boundingRect.y;
1088
- drawableElement.push({
1089
- type: "path",
1090
- groupTexts: ["top-axis", "ticks"],
1091
- data: this.getTickValues().map((tick) => ({
1092
- path: `M ${this.getScaleValue(tick)},${y + this.boundingRect.height - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)} L ${this.getScaleValue(tick)},${y + this.boundingRect.height - this.axisConfig.tickLength - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)}`,
1093
- strokeFill: this.axisThemeConfig.tickColor,
1094
- strokeWidth: this.axisConfig.tickWidth
1095
- }))
1096
- });
1097
- }
1098
- if (this.showTitle) {
1099
- drawableElement.push({
1100
- type: "text",
1101
- groupTexts: ["top-axis", "title"],
1102
- data: [
1103
- {
1104
- text: this.title,
1105
- x: this.boundingRect.x + this.boundingRect.width / 2,
1106
- y: this.boundingRect.y + this.axisConfig.titlePadding,
1107
- fill: this.axisThemeConfig.titleColor,
1108
- fontSize: this.axisConfig.titleFontSize,
1109
- rotation: 0,
1110
- verticalPos: "top",
1111
- horizontalPos: "center"
1112
- }
1113
- ]
1114
- });
1115
- }
1116
- return drawableElement;
1117
- }
1118
- getDrawableElements() {
1119
- if (this.axisPosition === "left") {
1120
- return this.getDrawableElementsForLeftAxis();
1121
- }
1122
- if (this.axisPosition === "right") {
1123
- throw Error("Drawing of right axis is not implemented");
1124
- }
1125
- if (this.axisPosition === "bottom") {
1126
- return this.getDrawableElementsForBottomAxis();
1127
- }
1128
- if (this.axisPosition === "top") {
1129
- return this.getDrawableElementsForTopAxis();
1130
- }
1131
- return [];
1132
- }
1133
- };
1134
-
1135
- // src/diagrams/xychart/chartBuilder/components/axis/bandAxis.ts
1136
- var BandAxis = class extends BaseAxis {
1137
- static {
1138
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(this, "BandAxis");
1139
- }
1140
- constructor(axisConfig, axisThemeConfig, categories, title, textDimensionCalculator) {
1141
- super(axisConfig, title, textDimensionCalculator, axisThemeConfig);
1142
- this.categories = categories;
1143
- this.scale = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .scaleBand */ .WH)().domain(this.categories).range(this.getRange());
1144
- }
1145
- setRange(range) {
1146
- super.setRange(range);
1147
- }
1148
- recalculateScale() {
1149
- this.scale = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .scaleBand */ .WH)().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5);
1150
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.trace("BandAxis axis final categories, range: ", this.categories, this.getRange());
1151
- }
1152
- getTickValues() {
1153
- return this.categories;
1154
- }
1155
- getScaleValue(value) {
1156
- return this.scale(value) ?? this.getRange()[0];
1157
- }
1158
- };
1159
-
1160
- // src/diagrams/xychart/chartBuilder/components/axis/linearAxis.ts
1161
-
1162
- var LinearAxis = class extends BaseAxis {
1163
- static {
1164
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(this, "LinearAxis");
1165
- }
1166
- constructor(axisConfig, axisThemeConfig, domain, title, textDimensionCalculator) {
1167
- super(axisConfig, title, textDimensionCalculator, axisThemeConfig);
1168
- this.domain = domain;
1169
- this.scale = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .scaleLinear */ .m4Y)().domain(this.domain).range(this.getRange());
1170
- }
1171
- getTickValues() {
1172
- return this.scale.ticks();
1173
- }
1174
- recalculateScale() {
1175
- const domain = [...this.domain];
1176
- if (this.axisPosition === "left") {
1177
- domain.reverse();
1178
- }
1179
- this.scale = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .scaleLinear */ .m4Y)().domain(domain).range(this.getRange());
1180
- }
1181
- getScaleValue(value) {
1182
- return this.scale(value);
1183
- }
1184
- };
1185
-
1186
- // src/diagrams/xychart/chartBuilder/components/axis/index.ts
1187
- function getAxis(data, axisConfig, axisThemeConfig, tmpSVGGroup2) {
1188
- const textDimensionCalculator = new TextDimensionCalculatorWithFont(tmpSVGGroup2);
1189
- if (isBandAxisData(data)) {
1190
- return new BandAxis(
1191
- axisConfig,
1192
- axisThemeConfig,
1193
- data.categories,
1194
- data.title,
1195
- textDimensionCalculator
1196
- );
1197
- }
1198
- return new LinearAxis(
1199
- axisConfig,
1200
- axisThemeConfig,
1201
- [data.min, data.max],
1202
- data.title,
1203
- textDimensionCalculator
1204
- );
1205
- }
1206
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(getAxis, "getAxis");
1207
-
1208
- // src/diagrams/xychart/chartBuilder/components/chartTitle.ts
1209
- var ChartTitle = class {
1210
- constructor(textDimensionCalculator, chartConfig, chartData, chartThemeConfig) {
1211
- this.textDimensionCalculator = textDimensionCalculator;
1212
- this.chartConfig = chartConfig;
1213
- this.chartData = chartData;
1214
- this.chartThemeConfig = chartThemeConfig;
1215
- this.boundingRect = {
1216
- x: 0,
1217
- y: 0,
1218
- width: 0,
1219
- height: 0
1220
- };
1221
- this.showChartTitle = false;
1222
- }
1223
- static {
1224
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(this, "ChartTitle");
1225
- }
1226
- setBoundingBoxXY(point) {
1227
- this.boundingRect.x = point.x;
1228
- this.boundingRect.y = point.y;
1229
- }
1230
- calculateSpace(availableSpace) {
1231
- const titleDimension = this.textDimensionCalculator.getMaxDimension(
1232
- [this.chartData.title],
1233
- this.chartConfig.titleFontSize
1234
- );
1235
- const widthRequired = Math.max(titleDimension.width, availableSpace.width);
1236
- const heightRequired = titleDimension.height + 2 * this.chartConfig.titlePadding;
1237
- if (titleDimension.width <= widthRequired && titleDimension.height <= heightRequired && this.chartConfig.showTitle && this.chartData.title) {
1238
- this.boundingRect.width = widthRequired;
1239
- this.boundingRect.height = heightRequired;
1240
- this.showChartTitle = true;
1241
- }
1242
- return {
1243
- width: this.boundingRect.width,
1244
- height: this.boundingRect.height
1245
- };
1246
- }
1247
- getDrawableElements() {
1248
- const drawableElem = [];
1249
- if (this.showChartTitle) {
1250
- drawableElem.push({
1251
- groupTexts: ["chart-title"],
1252
- type: "text",
1253
- data: [
1254
- {
1255
- fontSize: this.chartConfig.titleFontSize,
1256
- text: this.chartData.title,
1257
- verticalPos: "middle",
1258
- horizontalPos: "center",
1259
- x: this.boundingRect.x + this.boundingRect.width / 2,
1260
- y: this.boundingRect.y + this.boundingRect.height / 2,
1261
- fill: this.chartThemeConfig.titleColor,
1262
- rotation: 0
1263
- }
1264
- ]
1265
- });
1266
- }
1267
- return drawableElem;
1268
- }
1269
- };
1270
- function getChartTitleComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2) {
1271
- const textDimensionCalculator = new TextDimensionCalculatorWithFont(tmpSVGGroup2);
1272
- return new ChartTitle(textDimensionCalculator, chartConfig, chartData, chartThemeConfig);
1273
- }
1274
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(getChartTitleComponent, "getChartTitleComponent");
1275
-
1276
- // src/diagrams/xychart/chartBuilder/components/plot/linePlot.ts
1277
-
1278
- var LinePlot = class {
1279
- constructor(plotData, xAxis, yAxis, orientation, plotIndex2) {
1280
- this.plotData = plotData;
1281
- this.xAxis = xAxis;
1282
- this.yAxis = yAxis;
1283
- this.orientation = orientation;
1284
- this.plotIndex = plotIndex2;
1285
- }
1286
- static {
1287
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(this, "LinePlot");
1288
- }
1289
- getDrawableElement() {
1290
- const finalData = this.plotData.data.map((d) => [
1291
- this.xAxis.getScaleValue(d[0]),
1292
- this.yAxis.getScaleValue(d[1])
1293
- ]);
1294
- let path;
1295
- if (this.orientation === "horizontal") {
1296
- path = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .line */ .n8j)().y((d) => d[0]).x((d) => d[1])(finalData);
1297
- } else {
1298
- path = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .line */ .n8j)().x((d) => d[0]).y((d) => d[1])(finalData);
1299
- }
1300
- if (!path) {
1301
- return [];
1302
- }
1303
- return [
1304
- {
1305
- groupTexts: ["plot", `line-plot-${this.plotIndex}`],
1306
- type: "path",
1307
- data: [
1308
- {
1309
- path,
1310
- strokeFill: this.plotData.strokeFill,
1311
- strokeWidth: this.plotData.strokeWidth
1312
- }
1313
- ]
1314
- }
1315
- ];
1316
- }
1317
- };
1318
-
1319
- // src/diagrams/xychart/chartBuilder/components/plot/barPlot.ts
1320
- var BarPlot = class {
1321
- constructor(barData, boundingRect, xAxis, yAxis, orientation, plotIndex2) {
1322
- this.barData = barData;
1323
- this.boundingRect = boundingRect;
1324
- this.xAxis = xAxis;
1325
- this.yAxis = yAxis;
1326
- this.orientation = orientation;
1327
- this.plotIndex = plotIndex2;
1328
- }
1329
- static {
1330
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(this, "BarPlot");
1331
- }
1332
- getDrawableElement() {
1333
- const finalData = this.barData.data.map((d) => [
1334
- this.xAxis.getScaleValue(d[0]),
1335
- this.yAxis.getScaleValue(d[1])
1336
- ]);
1337
- const barPaddingPercent = 0.05;
1338
- const barWidth = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * (1 - barPaddingPercent);
1339
- const barWidthHalf = barWidth / 2;
1340
- if (this.orientation === "horizontal") {
1341
- return [
1342
- {
1343
- groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
1344
- type: "rect",
1345
- data: finalData.map((data) => ({
1346
- x: this.boundingRect.x,
1347
- y: data[0] - barWidthHalf,
1348
- height: barWidth,
1349
- width: data[1] - this.boundingRect.x,
1350
- fill: this.barData.fill,
1351
- strokeWidth: 0,
1352
- strokeFill: this.barData.fill
1353
- }))
1354
- }
1355
- ];
1356
- }
1357
- return [
1358
- {
1359
- groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
1360
- type: "rect",
1361
- data: finalData.map((data) => ({
1362
- x: data[0] - barWidthHalf,
1363
- y: data[1],
1364
- width: barWidth,
1365
- height: this.boundingRect.y + this.boundingRect.height - data[1],
1366
- fill: this.barData.fill,
1367
- strokeWidth: 0,
1368
- strokeFill: this.barData.fill
1369
- }))
1370
- }
1371
- ];
1372
- }
1373
- };
1374
-
1375
- // src/diagrams/xychart/chartBuilder/components/plot/index.ts
1376
- var BasePlot = class {
1377
- constructor(chartConfig, chartData, chartThemeConfig) {
1378
- this.chartConfig = chartConfig;
1379
- this.chartData = chartData;
1380
- this.chartThemeConfig = chartThemeConfig;
1381
- this.boundingRect = {
1382
- x: 0,
1383
- y: 0,
1384
- width: 0,
1385
- height: 0
1386
- };
1387
- }
1388
- static {
1389
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(this, "BasePlot");
1390
- }
1391
- setAxes(xAxis, yAxis) {
1392
- this.xAxis = xAxis;
1393
- this.yAxis = yAxis;
1394
- }
1395
- setBoundingBoxXY(point) {
1396
- this.boundingRect.x = point.x;
1397
- this.boundingRect.y = point.y;
1398
- }
1399
- calculateSpace(availableSpace) {
1400
- this.boundingRect.width = availableSpace.width;
1401
- this.boundingRect.height = availableSpace.height;
1402
- return {
1403
- width: this.boundingRect.width,
1404
- height: this.boundingRect.height
1405
- };
1406
- }
1407
- getDrawableElements() {
1408
- if (!(this.xAxis && this.yAxis)) {
1409
- throw Error("Axes must be passed to render Plots");
1410
- }
1411
- const drawableElem = [];
1412
- for (const [i, plot] of this.chartData.plots.entries()) {
1413
- switch (plot.type) {
1414
- case "line":
1415
- {
1416
- const linePlot = new LinePlot(
1417
- plot,
1418
- this.xAxis,
1419
- this.yAxis,
1420
- this.chartConfig.chartOrientation,
1421
- i
1422
- );
1423
- drawableElem.push(...linePlot.getDrawableElement());
1424
- }
1425
- break;
1426
- case "bar":
1427
- {
1428
- const barPlot = new BarPlot(
1429
- plot,
1430
- this.boundingRect,
1431
- this.xAxis,
1432
- this.yAxis,
1433
- this.chartConfig.chartOrientation,
1434
- i
1435
- );
1436
- drawableElem.push(...barPlot.getDrawableElement());
1437
- }
1438
- break;
1439
- }
1440
- }
1441
- return drawableElem;
1442
- }
1443
- };
1444
- function getPlotComponent(chartConfig, chartData, chartThemeConfig) {
1445
- return new BasePlot(chartConfig, chartData, chartThemeConfig);
1446
- }
1447
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(getPlotComponent, "getPlotComponent");
1448
-
1449
- // src/diagrams/xychart/chartBuilder/orchestrator.ts
1450
- var Orchestrator = class {
1451
- constructor(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2) {
1452
- this.chartConfig = chartConfig;
1453
- this.chartData = chartData;
1454
- this.componentStore = {
1455
- title: getChartTitleComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2),
1456
- plot: getPlotComponent(chartConfig, chartData, chartThemeConfig),
1457
- xAxis: getAxis(
1458
- chartData.xAxis,
1459
- chartConfig.xAxis,
1460
- {
1461
- titleColor: chartThemeConfig.xAxisTitleColor,
1462
- labelColor: chartThemeConfig.xAxisLabelColor,
1463
- tickColor: chartThemeConfig.xAxisTickColor,
1464
- axisLineColor: chartThemeConfig.xAxisLineColor
1465
- },
1466
- tmpSVGGroup2
1467
- ),
1468
- yAxis: getAxis(
1469
- chartData.yAxis,
1470
- chartConfig.yAxis,
1471
- {
1472
- titleColor: chartThemeConfig.yAxisTitleColor,
1473
- labelColor: chartThemeConfig.yAxisLabelColor,
1474
- tickColor: chartThemeConfig.yAxisTickColor,
1475
- axisLineColor: chartThemeConfig.yAxisLineColor
1476
- },
1477
- tmpSVGGroup2
1478
- )
1479
- };
1480
- }
1481
- static {
1482
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(this, "Orchestrator");
1483
- }
1484
- calculateVerticalSpace() {
1485
- let availableWidth = this.chartConfig.width;
1486
- let availableHeight = this.chartConfig.height;
1487
- let plotX = 0;
1488
- let plotY = 0;
1489
- let chartWidth = Math.floor(availableWidth * this.chartConfig.plotReservedSpacePercent / 100);
1490
- let chartHeight = Math.floor(
1491
- availableHeight * this.chartConfig.plotReservedSpacePercent / 100
1492
- );
1493
- let spaceUsed = this.componentStore.plot.calculateSpace({
1494
- width: chartWidth,
1495
- height: chartHeight
1496
- });
1497
- availableWidth -= spaceUsed.width;
1498
- availableHeight -= spaceUsed.height;
1499
- spaceUsed = this.componentStore.title.calculateSpace({
1500
- width: this.chartConfig.width,
1501
- height: availableHeight
1502
- });
1503
- plotY = spaceUsed.height;
1504
- availableHeight -= spaceUsed.height;
1505
- this.componentStore.xAxis.setAxisPosition("bottom");
1506
- spaceUsed = this.componentStore.xAxis.calculateSpace({
1507
- width: availableWidth,
1508
- height: availableHeight
1509
- });
1510
- availableHeight -= spaceUsed.height;
1511
- this.componentStore.yAxis.setAxisPosition("left");
1512
- spaceUsed = this.componentStore.yAxis.calculateSpace({
1513
- width: availableWidth,
1514
- height: availableHeight
1515
- });
1516
- plotX = spaceUsed.width;
1517
- availableWidth -= spaceUsed.width;
1518
- if (availableWidth > 0) {
1519
- chartWidth += availableWidth;
1520
- availableWidth = 0;
1521
- }
1522
- if (availableHeight > 0) {
1523
- chartHeight += availableHeight;
1524
- availableHeight = 0;
1525
- }
1526
- this.componentStore.plot.calculateSpace({
1527
- width: chartWidth,
1528
- height: chartHeight
1529
- });
1530
- this.componentStore.plot.setBoundingBoxXY({ x: plotX, y: plotY });
1531
- this.componentStore.xAxis.setRange([plotX, plotX + chartWidth]);
1532
- this.componentStore.xAxis.setBoundingBoxXY({ x: plotX, y: plotY + chartHeight });
1533
- this.componentStore.yAxis.setRange([plotY, plotY + chartHeight]);
1534
- this.componentStore.yAxis.setBoundingBoxXY({ x: 0, y: plotY });
1535
- if (this.chartData.plots.some((p) => isBarPlot(p))) {
1536
- this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1537
- }
1538
- }
1539
- calculateHorizontalSpace() {
1540
- let availableWidth = this.chartConfig.width;
1541
- let availableHeight = this.chartConfig.height;
1542
- let titleYEnd = 0;
1543
- let plotX = 0;
1544
- let plotY = 0;
1545
- let chartWidth = Math.floor(availableWidth * this.chartConfig.plotReservedSpacePercent / 100);
1546
- let chartHeight = Math.floor(
1547
- availableHeight * this.chartConfig.plotReservedSpacePercent / 100
1548
- );
1549
- let spaceUsed = this.componentStore.plot.calculateSpace({
1550
- width: chartWidth,
1551
- height: chartHeight
1552
- });
1553
- availableWidth -= spaceUsed.width;
1554
- availableHeight -= spaceUsed.height;
1555
- spaceUsed = this.componentStore.title.calculateSpace({
1556
- width: this.chartConfig.width,
1557
- height: availableHeight
1558
- });
1559
- titleYEnd = spaceUsed.height;
1560
- availableHeight -= spaceUsed.height;
1561
- this.componentStore.xAxis.setAxisPosition("left");
1562
- spaceUsed = this.componentStore.xAxis.calculateSpace({
1563
- width: availableWidth,
1564
- height: availableHeight
1565
- });
1566
- availableWidth -= spaceUsed.width;
1567
- plotX = spaceUsed.width;
1568
- this.componentStore.yAxis.setAxisPosition("top");
1569
- spaceUsed = this.componentStore.yAxis.calculateSpace({
1570
- width: availableWidth,
1571
- height: availableHeight
1572
- });
1573
- availableHeight -= spaceUsed.height;
1574
- plotY = titleYEnd + spaceUsed.height;
1575
- if (availableWidth > 0) {
1576
- chartWidth += availableWidth;
1577
- availableWidth = 0;
1578
- }
1579
- if (availableHeight > 0) {
1580
- chartHeight += availableHeight;
1581
- availableHeight = 0;
1582
- }
1583
- this.componentStore.plot.calculateSpace({
1584
- width: chartWidth,
1585
- height: chartHeight
1586
- });
1587
- this.componentStore.plot.setBoundingBoxXY({ x: plotX, y: plotY });
1588
- this.componentStore.yAxis.setRange([plotX, plotX + chartWidth]);
1589
- this.componentStore.yAxis.setBoundingBoxXY({ x: plotX, y: titleYEnd });
1590
- this.componentStore.xAxis.setRange([plotY, plotY + chartHeight]);
1591
- this.componentStore.xAxis.setBoundingBoxXY({ x: 0, y: plotY });
1592
- if (this.chartData.plots.some((p) => isBarPlot(p))) {
1593
- this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1594
- }
1595
- }
1596
- calculateSpace() {
1597
- if (this.chartConfig.chartOrientation === "horizontal") {
1598
- this.calculateHorizontalSpace();
1599
- } else {
1600
- this.calculateVerticalSpace();
1601
- }
1602
- }
1603
- getDrawableElement() {
1604
- this.calculateSpace();
1605
- const drawableElem = [];
1606
- this.componentStore.plot.setAxes(this.componentStore.xAxis, this.componentStore.yAxis);
1607
- for (const component of Object.values(this.componentStore)) {
1608
- drawableElem.push(...component.getDrawableElements());
1609
- }
1610
- return drawableElem;
1611
- }
1612
- };
1613
-
1614
- // src/diagrams/xychart/chartBuilder/index.ts
1615
- var XYChartBuilder = class {
1616
- static {
1617
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(this, "XYChartBuilder");
1618
- }
1619
- static build(config, chartData, chartThemeConfig, tmpSVGGroup2) {
1620
- const orchestrator = new Orchestrator(config, chartData, chartThemeConfig, tmpSVGGroup2);
1621
- return orchestrator.getDrawableElement();
1622
- }
1623
- };
1624
-
1625
- // src/diagrams/xychart/xychartDb.ts
1626
- var plotIndex = 0;
1627
- var tmpSVGGroup;
1628
- var xyChartConfig = getChartDefaultConfig();
1629
- var xyChartThemeConfig = getChartDefaultThemeConfig();
1630
- var xyChartData = getChartDefaultData();
1631
- var plotColorPalette = xyChartThemeConfig.plotColorPalette.split(",").map((color) => color.trim());
1632
- var hasSetXAxis = false;
1633
- var hasSetYAxis = false;
1634
- function getChartDefaultThemeConfig() {
1635
- const defaultThemeVariables = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getThemeVariables */ .P$)();
1636
- const config = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig */ .zj)();
1637
- return (0,_chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_1__/* .cleanAndMerge */ .$t)(defaultThemeVariables.xyChart, config.themeVariables.xyChart);
1638
- }
1639
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(getChartDefaultThemeConfig, "getChartDefaultThemeConfig");
1640
- function getChartDefaultConfig() {
1641
- const config = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig */ .zj)();
1642
- return (0,_chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_1__/* .cleanAndMerge */ .$t)(
1643
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .defaultConfig_default */ .UI.xyChart,
1644
- config.xyChart
1645
- );
1646
- }
1647
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(getChartDefaultConfig, "getChartDefaultConfig");
1648
- function getChartDefaultData() {
1649
- return {
1650
- yAxis: {
1651
- type: "linear",
1652
- title: "",
1653
- min: Infinity,
1654
- max: -Infinity
1655
- },
1656
- xAxis: {
1657
- type: "band",
1658
- title: "",
1659
- categories: []
1660
- },
1661
- title: "",
1662
- plots: []
1663
- };
1664
- }
1665
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(getChartDefaultData, "getChartDefaultData");
1666
- function textSanitizer(text) {
1667
- const config = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig */ .zj)();
1668
- return (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .sanitizeText */ .jZ)(text.trim(), config);
1669
- }
1670
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(textSanitizer, "textSanitizer");
1671
- function setTmpSVGG(SVGG) {
1672
- tmpSVGGroup = SVGG;
1673
- }
1674
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(setTmpSVGG, "setTmpSVGG");
1675
- function setOrientation(orientation) {
1676
- if (orientation === "horizontal") {
1677
- xyChartConfig.chartOrientation = "horizontal";
1678
- } else {
1679
- xyChartConfig.chartOrientation = "vertical";
1680
- }
1681
- }
1682
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(setOrientation, "setOrientation");
1683
- function setXAxisTitle(title) {
1684
- xyChartData.xAxis.title = textSanitizer(title.text);
1685
- }
1686
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(setXAxisTitle, "setXAxisTitle");
1687
- function setXAxisRangeData(min, max) {
1688
- xyChartData.xAxis = { type: "linear", title: xyChartData.xAxis.title, min, max };
1689
- hasSetXAxis = true;
1690
- }
1691
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(setXAxisRangeData, "setXAxisRangeData");
1692
- function setXAxisBand(categories) {
1693
- xyChartData.xAxis = {
1694
- type: "band",
1695
- title: xyChartData.xAxis.title,
1696
- categories: categories.map((c) => textSanitizer(c.text))
1697
- };
1698
- hasSetXAxis = true;
1699
- }
1700
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(setXAxisBand, "setXAxisBand");
1701
- function setYAxisTitle(title) {
1702
- xyChartData.yAxis.title = textSanitizer(title.text);
1703
- }
1704
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(setYAxisTitle, "setYAxisTitle");
1705
- function setYAxisRangeData(min, max) {
1706
- xyChartData.yAxis = { type: "linear", title: xyChartData.yAxis.title, min, max };
1707
- hasSetYAxis = true;
1708
- }
1709
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(setYAxisRangeData, "setYAxisRangeData");
1710
- function setYAxisRangeFromPlotData(data) {
1711
- const minValue = Math.min(...data);
1712
- const maxValue = Math.max(...data);
1713
- const prevMinValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.min : Infinity;
1714
- const prevMaxValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.max : -Infinity;
1715
- xyChartData.yAxis = {
1716
- type: "linear",
1717
- title: xyChartData.yAxis.title,
1718
- min: Math.min(prevMinValue, minValue),
1719
- max: Math.max(prevMaxValue, maxValue)
1720
- };
1721
- }
1722
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(setYAxisRangeFromPlotData, "setYAxisRangeFromPlotData");
1723
- function transformDataWithoutCategory(data) {
1724
- let retData = [];
1725
- if (data.length === 0) {
1726
- return retData;
1727
- }
1728
- if (!hasSetXAxis) {
1729
- const prevMinValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.min : Infinity;
1730
- const prevMaxValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.max : -Infinity;
1731
- setXAxisRangeData(Math.min(prevMinValue, 1), Math.max(prevMaxValue, data.length));
1732
- }
1733
- if (!hasSetYAxis) {
1734
- setYAxisRangeFromPlotData(data);
1735
- }
1736
- if (isBandAxisData(xyChartData.xAxis)) {
1737
- retData = xyChartData.xAxis.categories.map((c, i) => [c, data[i]]);
1738
- }
1739
- if (isLinearAxisData(xyChartData.xAxis)) {
1740
- const min = xyChartData.xAxis.min;
1741
- const max = xyChartData.xAxis.max;
1742
- const step = (max - min) / (data.length - 1);
1743
- const categories = [];
1744
- for (let i = min; i <= max; i += step) {
1745
- categories.push(`${i}`);
1746
- }
1747
- retData = categories.map((c, i) => [c, data[i]]);
1748
- }
1749
- return retData;
1750
- }
1751
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(transformDataWithoutCategory, "transformDataWithoutCategory");
1752
- function getPlotColorFromPalette(plotIndex2) {
1753
- return plotColorPalette[plotIndex2 === 0 ? 0 : plotIndex2 % plotColorPalette.length];
1754
- }
1755
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(getPlotColorFromPalette, "getPlotColorFromPalette");
1756
- function setLineData(title, data) {
1757
- const plotData = transformDataWithoutCategory(data);
1758
- xyChartData.plots.push({
1759
- type: "line",
1760
- strokeFill: getPlotColorFromPalette(plotIndex),
1761
- strokeWidth: 2,
1762
- data: plotData
1763
- });
1764
- plotIndex++;
1765
- }
1766
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(setLineData, "setLineData");
1767
- function setBarData(title, data) {
1768
- const plotData = transformDataWithoutCategory(data);
1769
- xyChartData.plots.push({
1770
- type: "bar",
1771
- fill: getPlotColorFromPalette(plotIndex),
1772
- data: plotData
1773
- });
1774
- plotIndex++;
1775
- }
1776
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(setBarData, "setBarData");
1777
- function getDrawableElem() {
1778
- if (xyChartData.plots.length === 0) {
1779
- throw Error("No Plot to render, please provide a plot with some data");
1780
- }
1781
- xyChartData.title = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getDiagramTitle */ .ab)();
1782
- return XYChartBuilder.build(xyChartConfig, xyChartData, xyChartThemeConfig, tmpSVGGroup);
1783
- }
1784
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(getDrawableElem, "getDrawableElem");
1785
- function getChartThemeConfig() {
1786
- return xyChartThemeConfig;
1787
- }
1788
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(getChartThemeConfig, "getChartThemeConfig");
1789
- function getChartConfig() {
1790
- return xyChartConfig;
1791
- }
1792
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(getChartConfig, "getChartConfig");
1793
- var clear2 = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
1794
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .clear */ .IU)();
1795
- plotIndex = 0;
1796
- xyChartConfig = getChartDefaultConfig();
1797
- xyChartData = getChartDefaultData();
1798
- xyChartThemeConfig = getChartDefaultThemeConfig();
1799
- plotColorPalette = xyChartThemeConfig.plotColorPalette.split(",").map((color) => color.trim());
1800
- hasSetXAxis = false;
1801
- hasSetYAxis = false;
1802
- }, "clear");
1803
- var xychartDb_default = {
1804
- getDrawableElem,
1805
- clear: clear2,
1806
- setAccTitle: _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .setAccTitle */ .SV,
1807
- getAccTitle: _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getAccTitle */ .iN,
1808
- setDiagramTitle: _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .setDiagramTitle */ .ke,
1809
- getDiagramTitle: _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getDiagramTitle */ .ab,
1810
- getAccDescription: _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getAccDescription */ .m7,
1811
- setAccDescription: _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .setAccDescription */ .EI,
1812
- setOrientation,
1813
- setXAxisTitle,
1814
- setXAxisRangeData,
1815
- setXAxisBand,
1816
- setYAxisTitle,
1817
- setYAxisRangeData,
1818
- setLineData,
1819
- setBarData,
1820
- setTmpSVGG,
1821
- getChartThemeConfig,
1822
- getChartConfig
1823
- };
1824
-
1825
- // src/diagrams/xychart/xychartRenderer.ts
1826
- var draw = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((txt, id, _version, diagObj) => {
1827
- const db = diagObj.db;
1828
- const themeConfig = db.getChartThemeConfig();
1829
- const chartConfig = db.getChartConfig();
1830
- function getDominantBaseLine(horizontalPos) {
1831
- return horizontalPos === "top" ? "text-before-edge" : "middle";
1832
- }
1833
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(getDominantBaseLine, "getDominantBaseLine");
1834
- function getTextAnchor(verticalPos) {
1835
- return verticalPos === "left" ? "start" : verticalPos === "right" ? "end" : "middle";
1836
- }
1837
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(getTextAnchor, "getTextAnchor");
1838
- function getTextTransformation(data) {
1839
- return `translate(${data.x}, ${data.y}) rotate(${data.rotation || 0})`;
1840
- }
1841
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(getTextTransformation, "getTextTransformation");
1842
- _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("Rendering xychart chart\n" + txt);
1843
- const svg = (0,_chunk_OBAELV6Q_mjs__WEBPACK_IMPORTED_MODULE_2__/* .selectSvgElement */ .D)(id);
1844
- const group = svg.append("g").attr("class", "main");
1845
- const background = group.append("rect").attr("width", chartConfig.width).attr("height", chartConfig.height).attr("class", "background");
1846
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .configureSvgSize */ .a$)(svg, chartConfig.height, chartConfig.width, true);
1847
- svg.attr("viewBox", `0 0 ${chartConfig.width} ${chartConfig.height}`);
1848
- background.attr("fill", themeConfig.backgroundColor);
1849
- db.setTmpSVGG(svg.append("g").attr("class", "mermaid-tmp-group"));
1850
- const shapes = db.getDrawableElem();
1851
- const groups = {};
1852
- function getGroup(gList) {
1853
- let elem = group;
1854
- let prefix = "";
1855
- for (const [i] of gList.entries()) {
1856
- let parent = group;
1857
- if (i > 0 && groups[prefix]) {
1858
- parent = groups[prefix];
1859
- }
1860
- prefix += gList[i];
1861
- elem = groups[prefix];
1862
- if (!elem) {
1863
- elem = groups[prefix] = parent.append("g").attr("class", gList[i]);
1864
- }
1865
- }
1866
- return elem;
1867
- }
1868
- (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(getGroup, "getGroup");
1869
- for (const shape of shapes) {
1870
- if (shape.data.length === 0) {
1871
- continue;
1872
- }
1873
- const shapeGroup = getGroup(shape.groupTexts);
1874
- switch (shape.type) {
1875
- case "rect":
1876
- shapeGroup.selectAll("rect").data(shape.data).enter().append("rect").attr("x", (data) => data.x).attr("y", (data) => data.y).attr("width", (data) => data.width).attr("height", (data) => data.height).attr("fill", (data) => data.fill).attr("stroke", (data) => data.strokeFill).attr("stroke-width", (data) => data.strokeWidth);
1877
- break;
1878
- case "text":
1879
- shapeGroup.selectAll("text").data(shape.data).enter().append("text").attr("x", 0).attr("y", 0).attr("fill", (data) => data.fill).attr("font-size", (data) => data.fontSize).attr("dominant-baseline", (data) => getDominantBaseLine(data.verticalPos)).attr("text-anchor", (data) => getTextAnchor(data.horizontalPos)).attr("transform", (data) => getTextTransformation(data)).text((data) => data.text);
1880
- break;
1881
- case "path":
1882
- shapeGroup.selectAll("path").data(shape.data).enter().append("path").attr("d", (data) => data.path).attr("fill", (data) => data.fill ? data.fill : "none").attr("stroke", (data) => data.strokeFill).attr("stroke-width", (data) => data.strokeWidth);
1883
- break;
1884
- }
1885
- }
1886
- }, "draw");
1887
- var xychartRenderer_default = {
1888
- draw
1889
- };
1890
-
1891
- // src/diagrams/xychart/xychartDiagram.ts
1892
- var diagram = {
1893
- parser: xychart_default,
1894
- db: xychartDb_default,
1895
- renderer: xychartRenderer_default
1896
- };
1897
-
1898
-
1899
-
1900
- /***/ })
1901
-
1902
- };
1903
- ;
1904
- //# sourceMappingURL=775.node.js.map