@copilotkitnext/react 0.0.22-alpha.7 → 0.0.22-alpha.8

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