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