@oxide/design-system 1.7.7--canary.fc65d31.0 → 1.7.7--canary.5c25e1b.0

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