@zythum02/fello-server 0.1.28

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 (369) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +213 -0
  3. package/out/renderer/assets/_baseUniq-C01H-TTl.js +660 -0
  4. package/out/renderer/assets/abap-B7h4dtBh.js +7 -0
  5. package/out/renderer/assets/actionscript-3-DtnkuHN2.js +7 -0
  6. package/out/renderer/assets/ada-BZS802Se.js +7 -0
  7. package/out/renderer/assets/andromeeda-C847lm7Z.js +4 -0
  8. package/out/renderer/assets/angular-html-BYG42TJr.js +42 -0
  9. package/out/renderer/assets/angular-ts-BftcHvZ6.js +29 -0
  10. package/out/renderer/assets/apache-D4roVlsU.js +7 -0
  11. package/out/renderer/assets/apex-B-mI3Md2.js +7 -0
  12. package/out/renderer/assets/apl-CGZawg-A.js +18 -0
  13. package/out/renderer/assets/applescript-C43Knf0G.js +7 -0
  14. package/out/renderer/assets/ara-DRBH84ND.js +7 -0
  15. package/out/renderer/assets/arc-BXqrFYj-.js +131 -0
  16. package/out/renderer/assets/architectureDiagram-Q4EWVU46-DlFz_4yO.js +8718 -0
  17. package/out/renderer/assets/asciidoc-CT8_dLUs.js +7 -0
  18. package/out/renderer/assets/asm-3tg4MVib.js +7 -0
  19. package/out/renderer/assets/astro-BxdWOZvM.js +19 -0
  20. package/out/renderer/assets/aurora-x-wJ4-eM2h.js +4 -0
  21. package/out/renderer/assets/awk-ChreaG-G.js +7 -0
  22. package/out/renderer/assets/ayu-dark-rtpbXCNg.js +4 -0
  23. package/out/renderer/assets/ayu-light-BCZDSyV8.js +4 -0
  24. package/out/renderer/assets/ayu-mirage-BVoH71sA.js +4 -0
  25. package/out/renderer/assets/ballerina-B0yt0TYU.js +7 -0
  26. package/out/renderer/assets/bat-BzNgQIA7.js +7 -0
  27. package/out/renderer/assets/beancount-aZWrE5WV.js +7 -0
  28. package/out/renderer/assets/berry--Qc8OslH.js +7 -0
  29. package/out/renderer/assets/bibtex-BLeFwAes.js +7 -0
  30. package/out/renderer/assets/bicep-DbBeGdXQ.js +7 -0
  31. package/out/renderer/assets/bird2-aXhIUHPg.js +7 -0
  32. package/out/renderer/assets/blade-BbH7YAUi.js +22 -0
  33. package/out/renderer/assets/blockDiagram-DXYQGD6D-B_jYpKkP.js +3637 -0
  34. package/out/renderer/assets/bsl-DwPS0BId.js +9 -0
  35. package/out/renderer/assets/c-C4VtT7JA.js +7 -0
  36. package/out/renderer/assets/c3-CWHczQMq.js +7 -0
  37. package/out/renderer/assets/c4Diagram-AHTNJAMY-DWRXz6-S.js +2482 -0
  38. package/out/renderer/assets/cadence-S_NtR5Dy.js +7 -0
  39. package/out/renderer/assets/cairo-BtYx2aM5.js +9 -0
  40. package/out/renderer/assets/catppuccin-frappe-C21OPQfC.js +4 -0
  41. package/out/renderer/assets/catppuccin-latte-0ZtXlsrX.js +4 -0
  42. package/out/renderer/assets/catppuccin-macchiato-BD_FR4sl.js +4 -0
  43. package/out/renderer/assets/catppuccin-mocha-C653csR5.js +4 -0
  44. package/out/renderer/assets/channel-iMh-jYBg.js +7 -0
  45. package/out/renderer/assets/chunk-4BX2VUAB-CDXuLHIo.js +16 -0
  46. package/out/renderer/assets/chunk-4TB4RGXK-Bs-z-5kA.js +1920 -0
  47. package/out/renderer/assets/chunk-55IACEB6-DBmLw2WJ.js +13 -0
  48. package/out/renderer/assets/chunk-EDXVE4YY-BhsDT27O.js +24 -0
  49. package/out/renderer/assets/chunk-FMBD7UC4-C_qJYK5q.js +19 -0
  50. package/out/renderer/assets/chunk-OYMX7WX6-DIh7s3uw.js +1939 -0
  51. package/out/renderer/assets/chunk-QZHKN3VN-CYa45CSJ.js +19 -0
  52. package/out/renderer/assets/chunk-YZCP3GAM-BeF07Xv_.js +116 -0
  53. package/out/renderer/assets/clarity-D2ViJC0i.js +7 -0
  54. package/out/renderer/assets/classDiagram-6PBFFD2Q-B12_6ldG.js +23 -0
  55. package/out/renderer/assets/classDiagram-v2-HSJHXN6E-B12_6ldG.js +23 -0
  56. package/out/renderer/assets/clojure-C_G4_w5x.js +7 -0
  57. package/out/renderer/assets/clone-1GZJZPn3.js +8 -0
  58. package/out/renderer/assets/cmake-CDfQILeU.js +7 -0
  59. package/out/renderer/assets/cobol-B8r1pfPr.js +13 -0
  60. package/out/renderer/assets/codeowners-awy7PWCD.js +7 -0
  61. package/out/renderer/assets/codeql-lfK8ppuq.js +7 -0
  62. package/out/renderer/assets/coffee-XLjtuEYs.js +9 -0
  63. package/out/renderer/assets/common-lisp-DAq1kaby.js +7 -0
  64. package/out/renderer/assets/coq-l_JvzFJl.js +7 -0
  65. package/out/renderer/assets/cose-bilkent-S5V4N54A-CuSnz9Ro.js +4942 -0
  66. package/out/renderer/assets/cpp-zh2ePAE_.js +22 -0
  67. package/out/renderer/assets/crystal-BqBRy7Ec.js +19 -0
  68. package/out/renderer/assets/csharp-DxX_6tHh.js +7 -0
  69. package/out/renderer/assets/css-BtVcDqlU.js +7 -0
  70. package/out/renderer/assets/csv-Ba84L8e5.js +7 -0
  71. package/out/renderer/assets/cue-BFSVLV6N.js +7 -0
  72. package/out/renderer/assets/cypher-DbUmWIxC.js +7 -0
  73. package/out/renderer/assets/cytoscape.esm-Bm8DJGmZ.js +30239 -0
  74. package/out/renderer/assets/d-9qSZPw74.js +7 -0
  75. package/out/renderer/assets/dagre-KV5264BT-LHPLEy9g.js +694 -0
  76. package/out/renderer/assets/dark-plus-DmZ1Dzd4.js +4 -0
  77. package/out/renderer/assets/dart-CCSsOg9l.js +7 -0
  78. package/out/renderer/assets/dax-CvsmLV-B.js +7 -0
  79. package/out/renderer/assets/defaultLocale-B2RvLBDe.js +206 -0
  80. package/out/renderer/assets/desktop-_xiGZ9X1.js +7 -0
  81. package/out/renderer/assets/diagram-5BDNPKRD-DWjP3Jzr.js +171 -0
  82. package/out/renderer/assets/diagram-G4DWMVQ6-CM3uASto.js +853 -0
  83. package/out/renderer/assets/diagram-MMDJMWI5-X5oh5RON.js +303 -0
  84. package/out/renderer/assets/diagram-TYMM5635-iO4Xohj9.js +214 -0
  85. package/out/renderer/assets/diff-BEdzuHlE.js +7 -0
  86. package/out/renderer/assets/docker-CUaLOm2I.js +7 -0
  87. package/out/renderer/assets/dotenv-Bb4iNxXK.js +7 -0
  88. package/out/renderer/assets/dracula-B8-AVrwI.js +4 -0
  89. package/out/renderer/assets/dracula-soft-BHeefow7.js +4 -0
  90. package/out/renderer/assets/dream-maker-CNLQpoF-.js +7 -0
  91. package/out/renderer/assets/edge-CnHxQ_FD.js +15 -0
  92. package/out/renderer/assets/elixir-B_LIBv5J.js +11 -0
  93. package/out/renderer/assets/elm-BlO7pcFp.js +10 -0
  94. package/out/renderer/assets/emacs-lisp-4gdXY_g3.js +7 -0
  95. package/out/renderer/assets/erDiagram-SMLLAGMA-4xwE7Ysd.js +1227 -0
  96. package/out/renderer/assets/erb-Bzn22wO6.js +28 -0
  97. package/out/renderer/assets/erlang-Ch5kuXHm.js +9 -0
  98. package/out/renderer/assets/everforest-dark-Cg1xdODP.js +4 -0
  99. package/out/renderer/assets/everforest-light-BmTD3bxe.js +4 -0
  100. package/out/renderer/assets/fennel-BTELNkeT.js +7 -0
  101. package/out/renderer/assets/fish-kGF2-4SL.js +7 -0
  102. package/out/renderer/assets/flowDiagram-DWJPFMVM-DoIqEJWm.js +2332 -0
  103. package/out/renderer/assets/fluent-YyC28MRr.js +7 -0
  104. package/out/renderer/assets/fortran-fixed-form-CpmOyvS5.js +9 -0
  105. package/out/renderer/assets/fortran-free-form-5X94ETMi.js +7 -0
  106. package/out/renderer/assets/fsharp-5vtGqRR9.js +9 -0
  107. package/out/renderer/assets/ganttDiagram-T4ZO3ILL-C48vXSUK.js +3714 -0
  108. package/out/renderer/assets/gdresource-B5TLWiFO.js +11 -0
  109. package/out/renderer/assets/gdscript-CNW3Aj-d.js +7 -0
  110. package/out/renderer/assets/gdshader-BEzE4j_3.js +7 -0
  111. package/out/renderer/assets/genie-BvhtM5Ga.js +7 -0
  112. package/out/renderer/assets/gherkin-xCNF9gh8.js +7 -0
  113. package/out/renderer/assets/git-commit-PP9xCApN.js +9 -0
  114. package/out/renderer/assets/git-rebase-D-XQSvDj.js +9 -0
  115. package/out/renderer/assets/gitGraphDiagram-UUTBAWPF-D3YiiEhK.js +1375 -0
  116. package/out/renderer/assets/github-dark-O22yVQaY.js +4 -0
  117. package/out/renderer/assets/github-dark-default-DB2Hkvqn.js +4 -0
  118. package/out/renderer/assets/github-dark-dimmed-CMZ_OfqC.js +4 -0
  119. package/out/renderer/assets/github-dark-high-contrast-DmxWVmCU.js +4 -0
  120. package/out/renderer/assets/github-light-BTbR9xVK.js +4 -0
  121. package/out/renderer/assets/github-light-default-DWEonwFe.js +4 -0
  122. package/out/renderer/assets/github-light-high-contrast-WJ_cPDts.js +4 -0
  123. package/out/renderer/assets/gleam-LmNxrMsN.js +7 -0
  124. package/out/renderer/assets/glimmer-js-h2QNNiD7.js +15 -0
  125. package/out/renderer/assets/glimmer-ts-Bk3uX6Ae.js +15 -0
  126. package/out/renderer/assets/glsl-CGsiYPcu.js +9 -0
  127. package/out/renderer/assets/gn-OUMx7fqt.js +7 -0
  128. package/out/renderer/assets/gnuplot-tV8vezdE.js +7 -0
  129. package/out/renderer/assets/go-DRMr3iML.js +7 -0
  130. package/out/renderer/assets/graph-CYPfPCZi.js +953 -0
  131. package/out/renderer/assets/graphql-CwmtR1ib.js +15 -0
  132. package/out/renderer/assets/groovy-Bn4MhXgW.js +7 -0
  133. package/out/renderer/assets/gruvbox-dark-hard-DVsRsETr.js +4 -0
  134. package/out/renderer/assets/gruvbox-dark-medium-B5JBrQdg.js +4 -0
  135. package/out/renderer/assets/gruvbox-dark-soft-Db-YOqRx.js +4 -0
  136. package/out/renderer/assets/gruvbox-light-hard-CXzJt7DI.js +4 -0
  137. package/out/renderer/assets/gruvbox-light-medium-B89RAI1Y.js +4 -0
  138. package/out/renderer/assets/gruvbox-light-soft-Cs0hTZYv.js +4 -0
  139. package/out/renderer/assets/hack-BTX3ICIE.js +13 -0
  140. package/out/renderer/assets/haml-DrIklt7F.js +11 -0
  141. package/out/renderer/assets/handlebars-yWFGGD2R.js +15 -0
  142. package/out/renderer/assets/haskell-CzPS7wjM.js +7 -0
  143. package/out/renderer/assets/haxe-BpobLYM9.js +7 -0
  144. package/out/renderer/assets/hcl-axoq0Ycu.js +7 -0
  145. package/out/renderer/assets/highlighted-body-OFNGDK62-B6M-kMLU.js +17 -0
  146. package/out/renderer/assets/hjson-I7LcauIB.js +7 -0
  147. package/out/renderer/assets/hlsl-TRzjajlb.js +7 -0
  148. package/out/renderer/assets/horizon-DWzh3z5C.js +4 -0
  149. package/out/renderer/assets/horizon-bright-C1AFkPsv.js +4 -0
  150. package/out/renderer/assets/houston-CF_ws8Cq.js +4 -0
  151. package/out/renderer/assets/html-GC16tDh9.js +11 -0
  152. package/out/renderer/assets/html-derivative-HU9p64q4.js +11 -0
  153. package/out/renderer/assets/http-DjsOm9E4.js +20 -0
  154. package/out/renderer/assets/hurl-Am2cDU4f.js +18 -0
  155. package/out/renderer/assets/hxml-Jle7oGdm.js +9 -0
  156. package/out/renderer/assets/hy-B1k9U6S8.js +7 -0
  157. package/out/renderer/assets/imba-C4923lSV.js +7 -0
  158. package/out/renderer/assets/index-D8H7Q_md.css +382 -0
  159. package/out/renderer/assets/index-Dabo17L1.js +236275 -0
  160. package/out/renderer/assets/infoDiagram-42DDH7IO-ur7rRidE.js +33 -0
  161. package/out/renderer/assets/ini-B84Ha1bx.js +7 -0
  162. package/out/renderer/assets/init-ZxktEp_H.js +16 -0
  163. package/out/renderer/assets/ishikawaDiagram-UXIWVN3A-fJSipMV8.js +967 -0
  164. package/out/renderer/assets/java-BfXh-0uJ.js +7 -0
  165. package/out/renderer/assets/javascript-BsAkV7mL.js +7 -0
  166. package/out/renderer/assets/jinja-FkIlHBgj.js +16 -0
  167. package/out/renderer/assets/jison-BkdOIOd4.js +9 -0
  168. package/out/renderer/assets/journeyDiagram-VCZTEJTY-TxjKxXBo.js +1255 -0
  169. package/out/renderer/assets/json-TjWBGEk1.js +7 -0
  170. package/out/renderer/assets/json5-DCGCKrmX.js +7 -0
  171. package/out/renderer/assets/jsonc-DLVLp8id.js +7 -0
  172. package/out/renderer/assets/jsonl-B-R_pDGg.js +7 -0
  173. package/out/renderer/assets/jsonnet-Cs8BnnC6.js +7 -0
  174. package/out/renderer/assets/jssm-DDuANZ2u.js +7 -0
  175. package/out/renderer/assets/jsx-BPmvoin2.js +7 -0
  176. package/out/renderer/assets/julia-CU_UwNb8.js +20 -0
  177. package/out/renderer/assets/just-tGFryTtU.js +34 -0
  178. package/out/renderer/assets/kanagawa-dragon-DU8n2NNT.js +4 -0
  179. package/out/renderer/assets/kanagawa-lotus-Byd0CDet.js +4 -0
  180. package/out/renderer/assets/kanagawa-wave-DExoagcR.js +4 -0
  181. package/out/renderer/assets/kanban-definition-6JOO6SKY-DJwjRjlE.js +1052 -0
  182. package/out/renderer/assets/kdl-DzNQTDs7.js +7 -0
  183. package/out/renderer/assets/kotlin-BM2ZNTMh.js +7 -0
  184. package/out/renderer/assets/kusto-dtpuxMFE.js +7 -0
  185. package/out/renderer/assets/laserwave-DF03wMlf.js +4 -0
  186. package/out/renderer/assets/latex-B0gTO9uZ.js +10 -0
  187. package/out/renderer/assets/layout-BT1ASsLg.js +2217 -0
  188. package/out/renderer/assets/lean-CTow-IzD.js +7 -0
  189. package/out/renderer/assets/less-BAzLMJNR.js +7 -0
  190. package/out/renderer/assets/light-plus-DS08Xg5J.js +4 -0
  191. package/out/renderer/assets/linear-ecuEcPGt.js +340 -0
  192. package/out/renderer/assets/liquid-QmJ_LYTW.js +15 -0
  193. package/out/renderer/assets/llvm-CTKcAHbb.js +7 -0
  194. package/out/renderer/assets/log-BF22rfM9.js +7 -0
  195. package/out/renderer/assets/logo-D9l7oEJ8.js +7 -0
  196. package/out/renderer/assets/lua-BVbbqwZC.js +9 -0
  197. package/out/renderer/assets/luau-CdZ6BoEa.js +7 -0
  198. package/out/renderer/assets/make-DLtqaK4D.js +7 -0
  199. package/out/renderer/assets/markdown-F_EULe_G.js +7 -0
  200. package/out/renderer/assets/marko-BAWrmNIa.js +15 -0
  201. package/out/renderer/assets/material-theme-B8B2U48Q.js +4 -0
  202. package/out/renderer/assets/material-theme-darker-BV0iY_T3.js +4 -0
  203. package/out/renderer/assets/material-theme-lighter-DrzybSTF.js +4 -0
  204. package/out/renderer/assets/material-theme-ocean-BRPLVReX.js +4 -0
  205. package/out/renderer/assets/material-theme-palenight-DSJwsR_D.js +4 -0
  206. package/out/renderer/assets/matlab-7XHduepk.js +7 -0
  207. package/out/renderer/assets/mdc-Ca0ft0PS.js +16 -0
  208. package/out/renderer/assets/mdx-D5wExp-O.js +7 -0
  209. package/out/renderer/assets/mermaid-z_1ejSlp.js +7 -0
  210. package/out/renderer/assets/min-BYCDJeWK.js +41 -0
  211. package/out/renderer/assets/min-dark-BNaN9fWk.js +4 -0
  212. package/out/renderer/assets/min-light-CMrjentn.js +4 -0
  213. package/out/renderer/assets/mindmap-definition-QFDTVHPH-D2MxZmzw.js +1186 -0
  214. package/out/renderer/assets/mipsasm-BQyyUrpa.js +7 -0
  215. package/out/renderer/assets/mojo-ByCRDvCf.js +7 -0
  216. package/out/renderer/assets/monokai-DelygWXa.js +4 -0
  217. package/out/renderer/assets/moonbit-CqjK87KZ.js +7 -0
  218. package/out/renderer/assets/move-DhTNmxqC.js +7 -0
  219. package/out/renderer/assets/narrat-CLjGcbCy.js +7 -0
  220. package/out/renderer/assets/nextflow-B166B-y1.js +9 -0
  221. package/out/renderer/assets/nextflow-groovy-BOO9s0iq.js +7 -0
  222. package/out/renderer/assets/nginx-BFAkI5_-.js +10 -0
  223. package/out/renderer/assets/night-owl-DSS199ra.js +4 -0
  224. package/out/renderer/assets/night-owl-light-gC6E-Eh2.js +4 -0
  225. package/out/renderer/assets/nim-B3PAIZ4D.js +22 -0
  226. package/out/renderer/assets/nix-ByWcmvXF.js +12 -0
  227. package/out/renderer/assets/nord-CvDbBq5M.js +4 -0
  228. package/out/renderer/assets/nushell-DB8ZUEbK.js +7 -0
  229. package/out/renderer/assets/objective-c-BRoNQF42.js +7 -0
  230. package/out/renderer/assets/objective-cpp-DEoN9Fe5.js +7 -0
  231. package/out/renderer/assets/ocaml-B1kfGk9Y.js +7 -0
  232. package/out/renderer/assets/odin-CNQ56Ay2.js +7 -0
  233. package/out/renderer/assets/one-dark-pro-CsMf0BoJ.js +4 -0
  234. package/out/renderer/assets/one-light-B0cTzZyr.js +4 -0
  235. package/out/renderer/assets/openscad-C_m7ehZF.js +7 -0
  236. package/out/renderer/assets/ordinal-CxptdPJm.js +76 -0
  237. package/out/renderer/assets/pascal-CU8Kjkr_.js +7 -0
  238. package/out/renderer/assets/pdf-worker-wrapper-Do-ikGHl.js +46762 -0
  239. package/out/renderer/assets/perl-HITCDkgu.js +18 -0
  240. package/out/renderer/assets/php-C2HieitX.js +20 -0
  241. package/out/renderer/assets/pieDiagram-DEJITSTG-Cew7QWxE.js +248 -0
  242. package/out/renderer/assets/pierre-dark-C-Drv5KU.js +4 -0
  243. package/out/renderer/assets/pierre-dark-soft-Cd74uQaL.js +4 -0
  244. package/out/renderer/assets/pierre-light-CfQnmt6J.js +4 -0
  245. package/out/renderer/assets/pierre-light-soft-DMVdU74b.js +4 -0
  246. package/out/renderer/assets/pkl-BsByaYax.js +7 -0
  247. package/out/renderer/assets/plastic-BjwMpBc0.js +4 -0
  248. package/out/renderer/assets/plsql-B3Na24V4.js +7 -0
  249. package/out/renderer/assets/po-BajfNjc5.js +7 -0
  250. package/out/renderer/assets/poimandres-ChWyhPrn.js +4 -0
  251. package/out/renderer/assets/polar-BB-dlxnO.js +7 -0
  252. package/out/renderer/assets/postcss-kj1IbjVd.js +7 -0
  253. package/out/renderer/assets/powerquery-B-e1fO-k.js +7 -0
  254. package/out/renderer/assets/powershell-BcMVbGpk.js +7 -0
  255. package/out/renderer/assets/prisma-bmxcSDxq.js +7 -0
  256. package/out/renderer/assets/prolog-BT9GCzqD.js +7 -0
  257. package/out/renderer/assets/proto-Ds-m32NR.js +7 -0
  258. package/out/renderer/assets/pug-BwQB43qN.js +13 -0
  259. package/out/renderer/assets/puppet-N15G4Usj.js +7 -0
  260. package/out/renderer/assets/purescript-DrwsEYNH.js +7 -0
  261. package/out/renderer/assets/python-CrdIx4PZ.js +7 -0
  262. package/out/renderer/assets/qml-jtL8okyu.js +9 -0
  263. package/out/renderer/assets/qmldir-DuMSk0Oz.js +7 -0
  264. package/out/renderer/assets/qss-BFrB6p4y.js +7 -0
  265. package/out/renderer/assets/quadrantDiagram-34T5L4WZ-CrZCtVJh.js +1342 -0
  266. package/out/renderer/assets/r-Dpdc-Kyk.js +7 -0
  267. package/out/renderer/assets/racket-DbA06HL7.js +7 -0
  268. package/out/renderer/assets/raku-6v-Y17bs.js +7 -0
  269. package/out/renderer/assets/razor-gBXW6YBJ.js +13 -0
  270. package/out/renderer/assets/red-DByOl5N0.js +4 -0
  271. package/out/renderer/assets/reg-CULnG2WX.js +7 -0
  272. package/out/renderer/assets/regexp-BxWeO75u.js +7 -0
  273. package/out/renderer/assets/rel-CHRwzjd4.js +7 -0
  274. package/out/renderer/assets/requirementDiagram-MS252O5E-C69IGxW8.js +1204 -0
  275. package/out/renderer/assets/riscv-BNQ9cVpw.js +7 -0
  276. package/out/renderer/assets/ron-CUEPaFZU.js +7 -0
  277. package/out/renderer/assets/rose-pine-B-kZ4Z9q.js +4 -0
  278. package/out/renderer/assets/rose-pine-dawn-efeVGdSI.js +4 -0
  279. package/out/renderer/assets/rose-pine-moon-DmodZNzl.js +4 -0
  280. package/out/renderer/assets/rosmsg-Bfahr6vb.js +7 -0
  281. package/out/renderer/assets/rst-by6KAwTb.js +37 -0
  282. package/out/renderer/assets/ruby-C13Bjepi.js +37 -0
  283. package/out/renderer/assets/rust-CMNYZh5a.js +7 -0
  284. package/out/renderer/assets/sankeyDiagram-XADWPNL6-B2tuS_nG.js +1205 -0
  285. package/out/renderer/assets/sas-BLBgC3TA.js +9 -0
  286. package/out/renderer/assets/sass-BheygBdF.js +7 -0
  287. package/out/renderer/assets/scala-B-_7vFVn.js +7 -0
  288. package/out/renderer/assets/scheme-BSHdPinv.js +7 -0
  289. package/out/renderer/assets/scss-Dq-LbI_c.js +9 -0
  290. package/out/renderer/assets/sdbl-BBUhycGU.js +7 -0
  291. package/out/renderer/assets/sequenceDiagram-FGHM5R23-Dv_lOZN1.js +4502 -0
  292. package/out/renderer/assets/shaderlab-C07uO3dL.js +9 -0
  293. package/out/renderer/assets/shellscript-CQ8MXh-D.js +7 -0
  294. package/out/renderer/assets/shellsession-CkeTp4M1.js +9 -0
  295. package/out/renderer/assets/slack-dark-BEe10hxO.js +4 -0
  296. package/out/renderer/assets/slack-ochin-BKmu9pBc.js +4 -0
  297. package/out/renderer/assets/smalltalk-qxcGy4fT.js +7 -0
  298. package/out/renderer/assets/snazzy-light-Dcvd-ZyI.js +4 -0
  299. package/out/renderer/assets/solarized-dark-BBl5y5sR.js +4 -0
  300. package/out/renderer/assets/solarized-light-DW9b_AY8.js +4 -0
  301. package/out/renderer/assets/solidity-CSTQ0FCC.js +7 -0
  302. package/out/renderer/assets/soy-BHaHgMUy.js +11 -0
  303. package/out/renderer/assets/sparql-DswowMAp.js +9 -0
  304. package/out/renderer/assets/splunk-DcGJXIDa.js +7 -0
  305. package/out/renderer/assets/sql-DzUuSofg.js +7 -0
  306. package/out/renderer/assets/ssh-config-Bk_I5wDR.js +7 -0
  307. package/out/renderer/assets/stata-Dl7wDdBE.js +9 -0
  308. package/out/renderer/assets/stateDiagram-FHFEXIEX-D9dJAqtV.js +452 -0
  309. package/out/renderer/assets/stateDiagram-v2-QKLJ7IA2-CQXoaDY1.js +21 -0
  310. package/out/renderer/assets/stylus-DXFa_2Jl.js +7 -0
  311. package/out/renderer/assets/surrealql-Bs3vUeKA.js +9 -0
  312. package/out/renderer/assets/svelte-fC0HkEkx.js +15 -0
  313. package/out/renderer/assets/swift-Cohr-WZC.js +7 -0
  314. package/out/renderer/assets/synthwave-84-CoUef9sh.js +4 -0
  315. package/out/renderer/assets/system-verilog-BcESSvRn.js +7 -0
  316. package/out/renderer/assets/systemd-DJPFjU02.js +7 -0
  317. package/out/renderer/assets/talonscript-CEEMXJTH.js +7 -0
  318. package/out/renderer/assets/tasl-DfOr2qHi.js +7 -0
  319. package/out/renderer/assets/tcl-CTsc4-t7.js +7 -0
  320. package/out/renderer/assets/templ-CSEiQwNm.js +13 -0
  321. package/out/renderer/assets/terraform-CeztUfUr.js +7 -0
  322. package/out/renderer/assets/tex-CGVqF8nD.js +9 -0
  323. package/out/renderer/assets/timeline-definition-GMOUNBTQ-DnnX0Ml0.js +1596 -0
  324. package/out/renderer/assets/tokyo-night-DjtLpAEY.js +4 -0
  325. package/out/renderer/assets/toml-vHPzWDj6.js +7 -0
  326. package/out/renderer/assets/ts-tags-cG2hZuda.js +54 -0
  327. package/out/renderer/assets/tsv-ChRVFvMy.js +7 -0
  328. package/out/renderer/assets/tsx-CmGGo4Hm.js +7 -0
  329. package/out/renderer/assets/turtle-BnC7StHY.js +7 -0
  330. package/out/renderer/assets/twig-CwEEYIBf.js +36 -0
  331. package/out/renderer/assets/typescript-CP6ECzON.js +7 -0
  332. package/out/renderer/assets/typespec-CkDVVIcK.js +7 -0
  333. package/out/renderer/assets/typst-XYLFxYau.js +7 -0
  334. package/out/renderer/assets/v-BSYXvR4g.js +7 -0
  335. package/out/renderer/assets/vala-qJa5rry9.js +7 -0
  336. package/out/renderer/assets/vb-Bzg9rspf.js +7 -0
  337. package/out/renderer/assets/vennDiagram-DHZGUBPP-BCIC8HTk.js +2486 -0
  338. package/out/renderer/assets/verilog-CCb_iTfF.js +7 -0
  339. package/out/renderer/assets/vesper-4Q1cEwPL.js +4 -0
  340. package/out/renderer/assets/vhdl-DMqk4T2s.js +7 -0
  341. package/out/renderer/assets/viml--FINbfoq.js +7 -0
  342. package/out/renderer/assets/vitesse-black-BqNLki8b.js +4 -0
  343. package/out/renderer/assets/vitesse-dark-jJ32WhwH.js +4 -0
  344. package/out/renderer/assets/vitesse-light-476zM4e6.js +4 -0
  345. package/out/renderer/assets/vue-K-7Ga-y8.js +40 -0
  346. package/out/renderer/assets/vue-html-DhreShjd.js +9 -0
  347. package/out/renderer/assets/vue-vine-rMIwOpFf.js +19 -0
  348. package/out/renderer/assets/vyper-DP4whl13.js +7 -0
  349. package/out/renderer/assets/wardley-RL74JXVD-B35jxdMa.js +27371 -0
  350. package/out/renderer/assets/wardleyDiagram-NUSXRM2D-D3rjXear.js +901 -0
  351. package/out/renderer/assets/wasm-BBh6f151.js +7 -0
  352. package/out/renderer/assets/wasm-DDgzZJey.js +10 -0
  353. package/out/renderer/assets/wenyan-BdqozpMZ.js +7 -0
  354. package/out/renderer/assets/wgsl-Vo-hHVWH.js +7 -0
  355. package/out/renderer/assets/wikitext-BDjE6pmL.js +7 -0
  356. package/out/renderer/assets/wit-C_nQzOkY.js +7 -0
  357. package/out/renderer/assets/wolfram-CRmjUoI4.js +7 -0
  358. package/out/renderer/assets/xml-BMzZeaqs.js +9 -0
  359. package/out/renderer/assets/xsl-CnwVr_6q.js +10 -0
  360. package/out/renderer/assets/xychartDiagram-5P7HB3ND-095YR9W9.js +1932 -0
  361. package/out/renderer/assets/yaml-B_vW5iTY.js +7 -0
  362. package/out/renderer/assets/zenscript-DFINJL6j.js +7 -0
  363. package/out/renderer/assets/zig-CS4FMAZp.js +7 -0
  364. package/out/renderer/index.html +13 -0
  365. package/out/scripts/electron-preload/preload.mjs +35 -0
  366. package/out/scripts/mcp-ask-user/server.mjs +126 -0
  367. package/out/scripts/mcp-skills/server.mjs +163 -0
  368. package/out/server/main.js +7000 -0
  369. package/package.json +44 -0
@@ -0,0 +1,1932 @@
1
+ import { s as setAccDescription, g as getAccDescription, v as getDiagramTitle, t as setDiagramTitle, a as getAccTitle, b as setAccTitle, _ as __name, l as log, N as selectSvgElement, e as configureSvgSize, C as clear, G as getConfig, i as sanitizeText, I as cleanAndMerge, K as defaultConfig_default, O as getThemeVariables3, aH as computeDimensionOfText, W as line } from "./index-Dabo17L1.js";
2
+ import { i as initRange } from "./init-ZxktEp_H.js";
3
+ import { o as ordinal } from "./ordinal-CxptdPJm.js";
4
+ import { l as linear } from "./linear-ecuEcPGt.js";
5
+ import "./defaultLocale-B2RvLBDe.js";
6
+ function range(start, stop, step) {
7
+ start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
8
+ var i = -1, n = Math.max(0, Math.ceil((stop - start) / step)) | 0, range2 = new Array(n);
9
+ while (++i < n) {
10
+ range2[i] = start + i * step;
11
+ }
12
+ return range2;
13
+ }
14
+ function band() {
15
+ var scale = ordinal().unknown(void 0), domain = scale.domain, ordinalRange = scale.range, r0 = 0, r1 = 1, step, bandwidth, round = false, paddingInner = 0, paddingOuter = 0, align = 0.5;
16
+ delete scale.unknown;
17
+ function rescale() {
18
+ var n = domain().length, reverse = r1 < r0, start = reverse ? r1 : r0, stop = reverse ? r0 : r1;
19
+ step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);
20
+ if (round) step = Math.floor(step);
21
+ start += (stop - start - step * (n - paddingInner)) * align;
22
+ bandwidth = step * (1 - paddingInner);
23
+ if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);
24
+ var values = range(n).map(function(i) {
25
+ return start + step * i;
26
+ });
27
+ return ordinalRange(reverse ? values.reverse() : values);
28
+ }
29
+ scale.domain = function(_) {
30
+ return arguments.length ? (domain(_), rescale()) : domain();
31
+ };
32
+ scale.range = function(_) {
33
+ return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
34
+ };
35
+ scale.rangeRound = function(_) {
36
+ return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();
37
+ };
38
+ scale.bandwidth = function() {
39
+ return bandwidth;
40
+ };
41
+ scale.step = function() {
42
+ return step;
43
+ };
44
+ scale.round = function(_) {
45
+ return arguments.length ? (round = !!_, rescale()) : round;
46
+ };
47
+ scale.padding = function(_) {
48
+ return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;
49
+ };
50
+ scale.paddingInner = function(_) {
51
+ return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;
52
+ };
53
+ scale.paddingOuter = function(_) {
54
+ return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;
55
+ };
56
+ scale.align = function(_) {
57
+ return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
58
+ };
59
+ scale.copy = function() {
60
+ return band(domain(), [r0, r1]).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);
61
+ };
62
+ return initRange.apply(rescale(), arguments);
63
+ }
64
+ var parser = (function() {
65
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
66
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
67
+ return o2;
68
+ }, "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];
69
+ var parser2 = {
70
+ trace: /* @__PURE__ */ __name(function trace() {
71
+ }, "trace"),
72
+ yy: {},
73
+ 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 },
74
+ 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" },
75
+ 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]],
76
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
77
+ var $0 = $$.length - 1;
78
+ switch (yystate) {
79
+ case 5:
80
+ yy.setOrientation($$[$0]);
81
+ break;
82
+ case 9:
83
+ yy.setDiagramTitle($$[$0].text.trim());
84
+ break;
85
+ case 12:
86
+ yy.setLineData({ text: "", type: "text" }, $$[$0]);
87
+ break;
88
+ case 13:
89
+ yy.setLineData($$[$0 - 1], $$[$0]);
90
+ break;
91
+ case 14:
92
+ yy.setBarData({ text: "", type: "text" }, $$[$0]);
93
+ break;
94
+ case 15:
95
+ yy.setBarData($$[$0 - 1], $$[$0]);
96
+ break;
97
+ case 16:
98
+ this.$ = $$[$0].trim();
99
+ yy.setAccTitle(this.$);
100
+ break;
101
+ case 17:
102
+ case 18:
103
+ this.$ = $$[$0].trim();
104
+ yy.setAccDescription(this.$);
105
+ break;
106
+ case 19:
107
+ this.$ = $$[$0 - 1];
108
+ break;
109
+ case 20:
110
+ this.$ = [Number($$[$0 - 2]), ...$$[$0]];
111
+ break;
112
+ case 21:
113
+ this.$ = [Number($$[$0])];
114
+ break;
115
+ case 22:
116
+ yy.setXAxisTitle($$[$0]);
117
+ break;
118
+ case 23:
119
+ yy.setXAxisTitle($$[$0 - 1]);
120
+ break;
121
+ case 24:
122
+ yy.setXAxisTitle({ type: "text", text: "" });
123
+ break;
124
+ case 25:
125
+ yy.setXAxisBand($$[$0]);
126
+ break;
127
+ case 26:
128
+ yy.setXAxisRangeData(Number($$[$0 - 2]), Number($$[$0]));
129
+ break;
130
+ case 27:
131
+ this.$ = $$[$0 - 1];
132
+ break;
133
+ case 28:
134
+ this.$ = [$$[$0 - 2], ...$$[$0]];
135
+ break;
136
+ case 29:
137
+ this.$ = [$$[$0]];
138
+ break;
139
+ case 30:
140
+ yy.setYAxisTitle($$[$0]);
141
+ break;
142
+ case 31:
143
+ yy.setYAxisTitle($$[$0 - 1]);
144
+ break;
145
+ case 32:
146
+ yy.setYAxisTitle({ type: "text", text: "" });
147
+ break;
148
+ case 33:
149
+ yy.setYAxisRangeData(Number($$[$0 - 2]), Number($$[$0]));
150
+ break;
151
+ case 37:
152
+ this.$ = { text: $$[$0], type: "text" };
153
+ break;
154
+ case 38:
155
+ this.$ = { text: $$[$0], type: "text" };
156
+ break;
157
+ case 39:
158
+ this.$ = { text: $$[$0], type: "markdown" };
159
+ break;
160
+ case 40:
161
+ this.$ = $$[$0];
162
+ break;
163
+ case 41:
164
+ this.$ = $$[$0 - 1] + "" + $$[$0];
165
+ break;
166
+ }
167
+ }, "anonymous"),
168
+ 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] }],
169
+ defaultActions: { 8: [2, 1], 10: [2, 3], 21: [2, 2], 72: [2, 28], 73: [2, 20] },
170
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
171
+ if (hash.recoverable) {
172
+ this.trace(str);
173
+ } else {
174
+ var error = new Error(str);
175
+ error.hash = hash;
176
+ throw error;
177
+ }
178
+ }, "parseError"),
179
+ parse: /* @__PURE__ */ __name(function parse(input) {
180
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
181
+ var args = lstack.slice.call(arguments, 1);
182
+ var lexer2 = Object.create(this.lexer);
183
+ var sharedState = { yy: {} };
184
+ for (var k in this.yy) {
185
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
186
+ sharedState.yy[k] = this.yy[k];
187
+ }
188
+ }
189
+ lexer2.setInput(input, sharedState.yy);
190
+ sharedState.yy.lexer = lexer2;
191
+ sharedState.yy.parser = this;
192
+ if (typeof lexer2.yylloc == "undefined") {
193
+ lexer2.yylloc = {};
194
+ }
195
+ var yyloc = lexer2.yylloc;
196
+ lstack.push(yyloc);
197
+ var ranges = lexer2.options && lexer2.options.ranges;
198
+ if (typeof sharedState.yy.parseError === "function") {
199
+ this.parseError = sharedState.yy.parseError;
200
+ } else {
201
+ this.parseError = Object.getPrototypeOf(this).parseError;
202
+ }
203
+ function popStack(n) {
204
+ stack.length = stack.length - 2 * n;
205
+ vstack.length = vstack.length - n;
206
+ lstack.length = lstack.length - n;
207
+ }
208
+ __name(popStack, "popStack");
209
+ function lex() {
210
+ var token;
211
+ token = tstack.pop() || lexer2.lex() || EOF;
212
+ if (typeof token !== "number") {
213
+ if (token instanceof Array) {
214
+ tstack = token;
215
+ token = tstack.pop();
216
+ }
217
+ token = self.symbols_[token] || token;
218
+ }
219
+ return token;
220
+ }
221
+ __name(lex, "lex");
222
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
223
+ while (true) {
224
+ state = stack[stack.length - 1];
225
+ if (this.defaultActions[state]) {
226
+ action = this.defaultActions[state];
227
+ } else {
228
+ if (symbol === null || typeof symbol == "undefined") {
229
+ symbol = lex();
230
+ }
231
+ action = table[state] && table[state][symbol];
232
+ }
233
+ if (typeof action === "undefined" || !action.length || !action[0]) {
234
+ var errStr = "";
235
+ expected = [];
236
+ for (p in table[state]) {
237
+ if (this.terminals_[p] && p > TERROR) {
238
+ expected.push("'" + this.terminals_[p] + "'");
239
+ }
240
+ }
241
+ if (lexer2.showPosition) {
242
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
243
+ } else {
244
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
245
+ }
246
+ this.parseError(errStr, {
247
+ text: lexer2.match,
248
+ token: this.terminals_[symbol] || symbol,
249
+ line: lexer2.yylineno,
250
+ loc: yyloc,
251
+ expected
252
+ });
253
+ }
254
+ if (action[0] instanceof Array && action.length > 1) {
255
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
256
+ }
257
+ switch (action[0]) {
258
+ case 1:
259
+ stack.push(symbol);
260
+ vstack.push(lexer2.yytext);
261
+ lstack.push(lexer2.yylloc);
262
+ stack.push(action[1]);
263
+ symbol = null;
264
+ {
265
+ yyleng = lexer2.yyleng;
266
+ yytext = lexer2.yytext;
267
+ yylineno = lexer2.yylineno;
268
+ yyloc = lexer2.yylloc;
269
+ }
270
+ break;
271
+ case 2:
272
+ len = this.productions_[action[1]][1];
273
+ yyval.$ = vstack[vstack.length - len];
274
+ yyval._$ = {
275
+ first_line: lstack[lstack.length - (len || 1)].first_line,
276
+ last_line: lstack[lstack.length - 1].last_line,
277
+ first_column: lstack[lstack.length - (len || 1)].first_column,
278
+ last_column: lstack[lstack.length - 1].last_column
279
+ };
280
+ if (ranges) {
281
+ yyval._$.range = [
282
+ lstack[lstack.length - (len || 1)].range[0],
283
+ lstack[lstack.length - 1].range[1]
284
+ ];
285
+ }
286
+ r = this.performAction.apply(yyval, [
287
+ yytext,
288
+ yyleng,
289
+ yylineno,
290
+ sharedState.yy,
291
+ action[1],
292
+ vstack,
293
+ lstack
294
+ ].concat(args));
295
+ if (typeof r !== "undefined") {
296
+ return r;
297
+ }
298
+ if (len) {
299
+ stack = stack.slice(0, -1 * len * 2);
300
+ vstack = vstack.slice(0, -1 * len);
301
+ lstack = lstack.slice(0, -1 * len);
302
+ }
303
+ stack.push(this.productions_[action[1]][0]);
304
+ vstack.push(yyval.$);
305
+ lstack.push(yyval._$);
306
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
307
+ stack.push(newState);
308
+ break;
309
+ case 3:
310
+ return true;
311
+ }
312
+ }
313
+ return true;
314
+ }, "parse")
315
+ };
316
+ var lexer = /* @__PURE__ */ (function() {
317
+ var lexer2 = {
318
+ EOF: 1,
319
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
320
+ if (this.yy.parser) {
321
+ this.yy.parser.parseError(str, hash);
322
+ } else {
323
+ throw new Error(str);
324
+ }
325
+ }, "parseError"),
326
+ // resets the lexer, sets new input
327
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
328
+ this.yy = yy || this.yy || {};
329
+ this._input = input;
330
+ this._more = this._backtrack = this.done = false;
331
+ this.yylineno = this.yyleng = 0;
332
+ this.yytext = this.matched = this.match = "";
333
+ this.conditionStack = ["INITIAL"];
334
+ this.yylloc = {
335
+ first_line: 1,
336
+ first_column: 0,
337
+ last_line: 1,
338
+ last_column: 0
339
+ };
340
+ if (this.options.ranges) {
341
+ this.yylloc.range = [0, 0];
342
+ }
343
+ this.offset = 0;
344
+ return this;
345
+ }, "setInput"),
346
+ // consumes and returns one char from the input
347
+ input: /* @__PURE__ */ __name(function() {
348
+ var ch = this._input[0];
349
+ this.yytext += ch;
350
+ this.yyleng++;
351
+ this.offset++;
352
+ this.match += ch;
353
+ this.matched += ch;
354
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
355
+ if (lines) {
356
+ this.yylineno++;
357
+ this.yylloc.last_line++;
358
+ } else {
359
+ this.yylloc.last_column++;
360
+ }
361
+ if (this.options.ranges) {
362
+ this.yylloc.range[1]++;
363
+ }
364
+ this._input = this._input.slice(1);
365
+ return ch;
366
+ }, "input"),
367
+ // unshifts one char (or a string) into the input
368
+ unput: /* @__PURE__ */ __name(function(ch) {
369
+ var len = ch.length;
370
+ var lines = ch.split(/(?:\r\n?|\n)/g);
371
+ this._input = ch + this._input;
372
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
373
+ this.offset -= len;
374
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
375
+ this.match = this.match.substr(0, this.match.length - 1);
376
+ this.matched = this.matched.substr(0, this.matched.length - 1);
377
+ if (lines.length - 1) {
378
+ this.yylineno -= lines.length - 1;
379
+ }
380
+ var r = this.yylloc.range;
381
+ this.yylloc = {
382
+ first_line: this.yylloc.first_line,
383
+ last_line: this.yylineno + 1,
384
+ first_column: this.yylloc.first_column,
385
+ 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
386
+ };
387
+ if (this.options.ranges) {
388
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
389
+ }
390
+ this.yyleng = this.yytext.length;
391
+ return this;
392
+ }, "unput"),
393
+ // When called from action, caches matched text and appends it on next action
394
+ more: /* @__PURE__ */ __name(function() {
395
+ this._more = true;
396
+ return this;
397
+ }, "more"),
398
+ // 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.
399
+ reject: /* @__PURE__ */ __name(function() {
400
+ if (this.options.backtrack_lexer) {
401
+ this._backtrack = true;
402
+ } else {
403
+ 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(), {
404
+ text: "",
405
+ token: null,
406
+ line: this.yylineno
407
+ });
408
+ }
409
+ return this;
410
+ }, "reject"),
411
+ // retain first n characters of the match
412
+ less: /* @__PURE__ */ __name(function(n) {
413
+ this.unput(this.match.slice(n));
414
+ }, "less"),
415
+ // displays already matched input, i.e. for error messages
416
+ pastInput: /* @__PURE__ */ __name(function() {
417
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
418
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
419
+ }, "pastInput"),
420
+ // displays upcoming input, i.e. for error messages
421
+ upcomingInput: /* @__PURE__ */ __name(function() {
422
+ var next = this.match;
423
+ if (next.length < 20) {
424
+ next += this._input.substr(0, 20 - next.length);
425
+ }
426
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
427
+ }, "upcomingInput"),
428
+ // displays the character position where the lexing error occurred, i.e. for error messages
429
+ showPosition: /* @__PURE__ */ __name(function() {
430
+ var pre = this.pastInput();
431
+ var c = new Array(pre.length + 1).join("-");
432
+ return pre + this.upcomingInput() + "\n" + c + "^";
433
+ }, "showPosition"),
434
+ // test the lexed token: return FALSE when not a match, otherwise return token
435
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
436
+ var token, lines, backup;
437
+ if (this.options.backtrack_lexer) {
438
+ backup = {
439
+ yylineno: this.yylineno,
440
+ yylloc: {
441
+ first_line: this.yylloc.first_line,
442
+ last_line: this.last_line,
443
+ first_column: this.yylloc.first_column,
444
+ last_column: this.yylloc.last_column
445
+ },
446
+ yytext: this.yytext,
447
+ match: this.match,
448
+ matches: this.matches,
449
+ matched: this.matched,
450
+ yyleng: this.yyleng,
451
+ offset: this.offset,
452
+ _more: this._more,
453
+ _input: this._input,
454
+ yy: this.yy,
455
+ conditionStack: this.conditionStack.slice(0),
456
+ done: this.done
457
+ };
458
+ if (this.options.ranges) {
459
+ backup.yylloc.range = this.yylloc.range.slice(0);
460
+ }
461
+ }
462
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
463
+ if (lines) {
464
+ this.yylineno += lines.length;
465
+ }
466
+ this.yylloc = {
467
+ first_line: this.yylloc.last_line,
468
+ last_line: this.yylineno + 1,
469
+ first_column: this.yylloc.last_column,
470
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
471
+ };
472
+ this.yytext += match[0];
473
+ this.match += match[0];
474
+ this.matches = match;
475
+ this.yyleng = this.yytext.length;
476
+ if (this.options.ranges) {
477
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
478
+ }
479
+ this._more = false;
480
+ this._backtrack = false;
481
+ this._input = this._input.slice(match[0].length);
482
+ this.matched += match[0];
483
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
484
+ if (this.done && this._input) {
485
+ this.done = false;
486
+ }
487
+ if (token) {
488
+ return token;
489
+ } else if (this._backtrack) {
490
+ for (var k in backup) {
491
+ this[k] = backup[k];
492
+ }
493
+ return false;
494
+ }
495
+ return false;
496
+ }, "test_match"),
497
+ // return next match in input
498
+ next: /* @__PURE__ */ __name(function() {
499
+ if (this.done) {
500
+ return this.EOF;
501
+ }
502
+ if (!this._input) {
503
+ this.done = true;
504
+ }
505
+ var token, match, tempMatch, index;
506
+ if (!this._more) {
507
+ this.yytext = "";
508
+ this.match = "";
509
+ }
510
+ var rules = this._currentRules();
511
+ for (var i = 0; i < rules.length; i++) {
512
+ tempMatch = this._input.match(this.rules[rules[i]]);
513
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
514
+ match = tempMatch;
515
+ index = i;
516
+ if (this.options.backtrack_lexer) {
517
+ token = this.test_match(tempMatch, rules[i]);
518
+ if (token !== false) {
519
+ return token;
520
+ } else if (this._backtrack) {
521
+ match = false;
522
+ continue;
523
+ } else {
524
+ return false;
525
+ }
526
+ } else if (!this.options.flex) {
527
+ break;
528
+ }
529
+ }
530
+ }
531
+ if (match) {
532
+ token = this.test_match(match, rules[index]);
533
+ if (token !== false) {
534
+ return token;
535
+ }
536
+ return false;
537
+ }
538
+ if (this._input === "") {
539
+ return this.EOF;
540
+ } else {
541
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
542
+ text: "",
543
+ token: null,
544
+ line: this.yylineno
545
+ });
546
+ }
547
+ }, "next"),
548
+ // return next match that has a token
549
+ lex: /* @__PURE__ */ __name(function lex() {
550
+ var r = this.next();
551
+ if (r) {
552
+ return r;
553
+ } else {
554
+ return this.lex();
555
+ }
556
+ }, "lex"),
557
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
558
+ begin: /* @__PURE__ */ __name(function begin(condition) {
559
+ this.conditionStack.push(condition);
560
+ }, "begin"),
561
+ // pop the previously active lexer condition state off the condition stack
562
+ popState: /* @__PURE__ */ __name(function popState() {
563
+ var n = this.conditionStack.length - 1;
564
+ if (n > 0) {
565
+ return this.conditionStack.pop();
566
+ } else {
567
+ return this.conditionStack[0];
568
+ }
569
+ }, "popState"),
570
+ // produce the lexer rule set which is active for the currently active lexer condition state
571
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
572
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
573
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
574
+ } else {
575
+ return this.conditions["INITIAL"].rules;
576
+ }
577
+ }, "_currentRules"),
578
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
579
+ topState: /* @__PURE__ */ __name(function topState(n) {
580
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
581
+ if (n >= 0) {
582
+ return this.conditionStack[n];
583
+ } else {
584
+ return "INITIAL";
585
+ }
586
+ }, "topState"),
587
+ // alias for begin(condition)
588
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
589
+ this.begin(condition);
590
+ }, "pushState"),
591
+ // return the number of states currently on the stack
592
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
593
+ return this.conditionStack.length;
594
+ }, "stateStackSize"),
595
+ options: { "case-insensitive": true },
596
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
597
+ switch ($avoiding_name_collisions) {
598
+ case 0:
599
+ break;
600
+ case 1:
601
+ break;
602
+ case 2:
603
+ this.popState();
604
+ return 34;
605
+ case 3:
606
+ this.popState();
607
+ return 34;
608
+ case 4:
609
+ return 34;
610
+ case 5:
611
+ break;
612
+ case 6:
613
+ return 10;
614
+ case 7:
615
+ this.pushState("acc_title");
616
+ return 19;
617
+ case 8:
618
+ this.popState();
619
+ return "acc_title_value";
620
+ case 9:
621
+ this.pushState("acc_descr");
622
+ return 21;
623
+ case 10:
624
+ this.popState();
625
+ return "acc_descr_value";
626
+ case 11:
627
+ this.pushState("acc_descr_multiline");
628
+ break;
629
+ case 12:
630
+ this.popState();
631
+ break;
632
+ case 13:
633
+ return "acc_descr_multiline_value";
634
+ case 14:
635
+ return 5;
636
+ case 15:
637
+ return 5;
638
+ case 16:
639
+ return 8;
640
+ case 17:
641
+ this.pushState("axis_data");
642
+ return "X_AXIS";
643
+ case 18:
644
+ this.pushState("axis_data");
645
+ return "Y_AXIS";
646
+ case 19:
647
+ this.pushState("axis_band_data");
648
+ return 24;
649
+ case 20:
650
+ return 31;
651
+ case 21:
652
+ this.pushState("data");
653
+ return 16;
654
+ case 22:
655
+ this.pushState("data");
656
+ return 18;
657
+ case 23:
658
+ this.pushState("data_inner");
659
+ return 24;
660
+ case 24:
661
+ return 27;
662
+ case 25:
663
+ this.popState();
664
+ return 26;
665
+ case 26:
666
+ this.popState();
667
+ break;
668
+ case 27:
669
+ this.pushState("string");
670
+ break;
671
+ case 28:
672
+ this.popState();
673
+ break;
674
+ case 29:
675
+ return "STR";
676
+ case 30:
677
+ return 24;
678
+ case 31:
679
+ return 26;
680
+ case 32:
681
+ return 43;
682
+ case 33:
683
+ return "COLON";
684
+ case 34:
685
+ return 44;
686
+ case 35:
687
+ return 28;
688
+ case 36:
689
+ return 45;
690
+ case 37:
691
+ return 46;
692
+ case 38:
693
+ return 48;
694
+ case 39:
695
+ return 50;
696
+ case 40:
697
+ return 47;
698
+ case 41:
699
+ return 41;
700
+ case 42:
701
+ return 49;
702
+ case 43:
703
+ return 42;
704
+ case 44:
705
+ break;
706
+ case 45:
707
+ return 35;
708
+ case 46:
709
+ return 36;
710
+ }
711
+ }, "anonymous"),
712
+ 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],
713
+ 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 } }
714
+ };
715
+ return lexer2;
716
+ })();
717
+ parser2.lexer = lexer;
718
+ function Parser() {
719
+ this.yy = {};
720
+ }
721
+ __name(Parser, "Parser");
722
+ Parser.prototype = parser2;
723
+ parser2.Parser = Parser;
724
+ return new Parser();
725
+ })();
726
+ parser.parser = parser;
727
+ var xychart_default = parser;
728
+ function isBarPlot(data) {
729
+ return data.type === "bar";
730
+ }
731
+ __name(isBarPlot, "isBarPlot");
732
+ function isBandAxisData(data) {
733
+ return data.type === "band";
734
+ }
735
+ __name(isBandAxisData, "isBandAxisData");
736
+ function isLinearAxisData(data) {
737
+ return data.type === "linear";
738
+ }
739
+ __name(isLinearAxisData, "isLinearAxisData");
740
+ var TextDimensionCalculatorWithFont = class {
741
+ constructor(parentGroup) {
742
+ this.parentGroup = parentGroup;
743
+ }
744
+ static {
745
+ __name(this, "TextDimensionCalculatorWithFont");
746
+ }
747
+ getMaxDimension(texts, fontSize) {
748
+ if (!this.parentGroup) {
749
+ return {
750
+ width: texts.reduce((acc, cur) => Math.max(cur.length, acc), 0) * fontSize,
751
+ height: fontSize
752
+ };
753
+ }
754
+ const dimension = {
755
+ width: 0,
756
+ height: 0
757
+ };
758
+ const elem = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", fontSize);
759
+ for (const t of texts) {
760
+ const bbox = computeDimensionOfText(elem, 1, t);
761
+ const width = bbox ? bbox.width : t.length * fontSize;
762
+ const height = bbox ? bbox.height : fontSize;
763
+ dimension.width = Math.max(dimension.width, width);
764
+ dimension.height = Math.max(dimension.height, height);
765
+ }
766
+ elem.remove();
767
+ return dimension;
768
+ }
769
+ };
770
+ var BAR_WIDTH_TO_TICK_WIDTH_RATIO = 0.7;
771
+ var MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL = 0.2;
772
+ var BaseAxis = class {
773
+ constructor(axisConfig, title, textDimensionCalculator, axisThemeConfig) {
774
+ this.axisConfig = axisConfig;
775
+ this.title = title;
776
+ this.textDimensionCalculator = textDimensionCalculator;
777
+ this.axisThemeConfig = axisThemeConfig;
778
+ this.boundingRect = { x: 0, y: 0, width: 0, height: 0 };
779
+ this.axisPosition = "left";
780
+ this.showTitle = false;
781
+ this.showLabel = false;
782
+ this.showTick = false;
783
+ this.showAxisLine = false;
784
+ this.outerPadding = 0;
785
+ this.titleTextHeight = 0;
786
+ this.labelTextHeight = 0;
787
+ this.range = [0, 10];
788
+ this.boundingRect = { x: 0, y: 0, width: 0, height: 0 };
789
+ this.axisPosition = "left";
790
+ }
791
+ static {
792
+ __name(this, "BaseAxis");
793
+ }
794
+ setRange(range2) {
795
+ this.range = range2;
796
+ if (this.axisPosition === "left" || this.axisPosition === "right") {
797
+ this.boundingRect.height = range2[1] - range2[0];
798
+ } else {
799
+ this.boundingRect.width = range2[1] - range2[0];
800
+ }
801
+ this.recalculateScale();
802
+ }
803
+ getRange() {
804
+ return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding];
805
+ }
806
+ setAxisPosition(axisPosition) {
807
+ this.axisPosition = axisPosition;
808
+ this.setRange(this.range);
809
+ }
810
+ getTickDistance() {
811
+ const range2 = this.getRange();
812
+ return Math.abs(range2[0] - range2[1]) / this.getTickValues().length;
813
+ }
814
+ getAxisOuterPadding() {
815
+ return this.outerPadding;
816
+ }
817
+ getLabelDimension() {
818
+ return this.textDimensionCalculator.getMaxDimension(
819
+ this.getTickValues().map((tick) => tick.toString()),
820
+ this.axisConfig.labelFontSize
821
+ );
822
+ }
823
+ recalculateOuterPaddingToDrawBar() {
824
+ if (BAR_WIDTH_TO_TICK_WIDTH_RATIO * this.getTickDistance() > this.outerPadding * 2) {
825
+ this.outerPadding = Math.floor(BAR_WIDTH_TO_TICK_WIDTH_RATIO * this.getTickDistance() / 2);
826
+ }
827
+ this.recalculateScale();
828
+ }
829
+ calculateSpaceIfDrawnHorizontally(availableSpace) {
830
+ let availableHeight = availableSpace.height;
831
+ if (this.axisConfig.showAxisLine && availableHeight > this.axisConfig.axisLineWidth) {
832
+ availableHeight -= this.axisConfig.axisLineWidth;
833
+ this.showAxisLine = true;
834
+ }
835
+ if (this.axisConfig.showLabel) {
836
+ const spaceRequired = this.getLabelDimension();
837
+ const maxPadding = MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL * availableSpace.width;
838
+ this.outerPadding = Math.min(spaceRequired.width / 2, maxPadding);
839
+ const heightRequired = spaceRequired.height + this.axisConfig.labelPadding * 2;
840
+ this.labelTextHeight = spaceRequired.height;
841
+ if (heightRequired <= availableHeight) {
842
+ availableHeight -= heightRequired;
843
+ this.showLabel = true;
844
+ }
845
+ }
846
+ if (this.axisConfig.showTick && availableHeight >= this.axisConfig.tickLength) {
847
+ this.showTick = true;
848
+ availableHeight -= this.axisConfig.tickLength;
849
+ }
850
+ if (this.axisConfig.showTitle && this.title) {
851
+ const spaceRequired = this.textDimensionCalculator.getMaxDimension(
852
+ [this.title],
853
+ this.axisConfig.titleFontSize
854
+ );
855
+ const heightRequired = spaceRequired.height + this.axisConfig.titlePadding * 2;
856
+ this.titleTextHeight = spaceRequired.height;
857
+ if (heightRequired <= availableHeight) {
858
+ availableHeight -= heightRequired;
859
+ this.showTitle = true;
860
+ }
861
+ }
862
+ this.boundingRect.width = availableSpace.width;
863
+ this.boundingRect.height = availableSpace.height - availableHeight;
864
+ }
865
+ calculateSpaceIfDrawnVertical(availableSpace) {
866
+ let availableWidth = availableSpace.width;
867
+ if (this.axisConfig.showAxisLine && availableWidth > this.axisConfig.axisLineWidth) {
868
+ availableWidth -= this.axisConfig.axisLineWidth;
869
+ this.showAxisLine = true;
870
+ }
871
+ if (this.axisConfig.showLabel) {
872
+ const spaceRequired = this.getLabelDimension();
873
+ const maxPadding = MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL * availableSpace.height;
874
+ this.outerPadding = Math.min(spaceRequired.height / 2, maxPadding);
875
+ const widthRequired = spaceRequired.width + this.axisConfig.labelPadding * 2;
876
+ if (widthRequired <= availableWidth) {
877
+ availableWidth -= widthRequired;
878
+ this.showLabel = true;
879
+ }
880
+ }
881
+ if (this.axisConfig.showTick && availableWidth >= this.axisConfig.tickLength) {
882
+ this.showTick = true;
883
+ availableWidth -= this.axisConfig.tickLength;
884
+ }
885
+ if (this.axisConfig.showTitle && this.title) {
886
+ const spaceRequired = this.textDimensionCalculator.getMaxDimension(
887
+ [this.title],
888
+ this.axisConfig.titleFontSize
889
+ );
890
+ const widthRequired = spaceRequired.height + this.axisConfig.titlePadding * 2;
891
+ this.titleTextHeight = spaceRequired.height;
892
+ if (widthRequired <= availableWidth) {
893
+ availableWidth -= widthRequired;
894
+ this.showTitle = true;
895
+ }
896
+ }
897
+ this.boundingRect.width = availableSpace.width - availableWidth;
898
+ this.boundingRect.height = availableSpace.height;
899
+ }
900
+ calculateSpace(availableSpace) {
901
+ if (this.axisPosition === "left" || this.axisPosition === "right") {
902
+ this.calculateSpaceIfDrawnVertical(availableSpace);
903
+ } else {
904
+ this.calculateSpaceIfDrawnHorizontally(availableSpace);
905
+ }
906
+ this.recalculateScale();
907
+ return {
908
+ width: this.boundingRect.width,
909
+ height: this.boundingRect.height
910
+ };
911
+ }
912
+ setBoundingBoxXY(point) {
913
+ this.boundingRect.x = point.x;
914
+ this.boundingRect.y = point.y;
915
+ }
916
+ getDrawableElementsForLeftAxis() {
917
+ const drawableElement = [];
918
+ if (this.showAxisLine) {
919
+ const x = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2;
920
+ drawableElement.push({
921
+ type: "path",
922
+ groupTexts: ["left-axis", "axisl-line"],
923
+ data: [
924
+ {
925
+ path: `M ${x},${this.boundingRect.y} L ${x},${this.boundingRect.y + this.boundingRect.height} `,
926
+ strokeFill: this.axisThemeConfig.axisLineColor,
927
+ strokeWidth: this.axisConfig.axisLineWidth
928
+ }
929
+ ]
930
+ });
931
+ }
932
+ if (this.showLabel) {
933
+ drawableElement.push({
934
+ type: "text",
935
+ groupTexts: ["left-axis", "label"],
936
+ data: this.getTickValues().map((tick) => ({
937
+ text: tick.toString(),
938
+ 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),
939
+ y: this.getScaleValue(tick),
940
+ fill: this.axisThemeConfig.labelColor,
941
+ fontSize: this.axisConfig.labelFontSize,
942
+ rotation: 0,
943
+ verticalPos: "middle",
944
+ horizontalPos: "right"
945
+ }))
946
+ });
947
+ }
948
+ if (this.showTick) {
949
+ const x = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
950
+ drawableElement.push({
951
+ type: "path",
952
+ groupTexts: ["left-axis", "ticks"],
953
+ data: this.getTickValues().map((tick) => ({
954
+ path: `M ${x},${this.getScaleValue(tick)} L ${x - this.axisConfig.tickLength},${this.getScaleValue(tick)}`,
955
+ strokeFill: this.axisThemeConfig.tickColor,
956
+ strokeWidth: this.axisConfig.tickWidth
957
+ }))
958
+ });
959
+ }
960
+ if (this.showTitle) {
961
+ drawableElement.push({
962
+ type: "text",
963
+ groupTexts: ["left-axis", "title"],
964
+ data: [
965
+ {
966
+ text: this.title,
967
+ x: this.boundingRect.x + this.axisConfig.titlePadding,
968
+ y: this.boundingRect.y + this.boundingRect.height / 2,
969
+ fill: this.axisThemeConfig.titleColor,
970
+ fontSize: this.axisConfig.titleFontSize,
971
+ rotation: 270,
972
+ verticalPos: "top",
973
+ horizontalPos: "center"
974
+ }
975
+ ]
976
+ });
977
+ }
978
+ return drawableElement;
979
+ }
980
+ getDrawableElementsForBottomAxis() {
981
+ const drawableElement = [];
982
+ if (this.showAxisLine) {
983
+ const y = this.boundingRect.y + this.axisConfig.axisLineWidth / 2;
984
+ drawableElement.push({
985
+ type: "path",
986
+ groupTexts: ["bottom-axis", "axis-line"],
987
+ data: [
988
+ {
989
+ path: `M ${this.boundingRect.x},${y} L ${this.boundingRect.x + this.boundingRect.width},${y}`,
990
+ strokeFill: this.axisThemeConfig.axisLineColor,
991
+ strokeWidth: this.axisConfig.axisLineWidth
992
+ }
993
+ ]
994
+ });
995
+ }
996
+ if (this.showLabel) {
997
+ drawableElement.push({
998
+ type: "text",
999
+ groupTexts: ["bottom-axis", "label"],
1000
+ data: this.getTickValues().map((tick) => ({
1001
+ text: tick.toString(),
1002
+ x: this.getScaleValue(tick),
1003
+ y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
1004
+ fill: this.axisThemeConfig.labelColor,
1005
+ fontSize: this.axisConfig.labelFontSize,
1006
+ rotation: 0,
1007
+ verticalPos: "top",
1008
+ horizontalPos: "center"
1009
+ }))
1010
+ });
1011
+ }
1012
+ if (this.showTick) {
1013
+ const y = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
1014
+ drawableElement.push({
1015
+ type: "path",
1016
+ groupTexts: ["bottom-axis", "ticks"],
1017
+ data: this.getTickValues().map((tick) => ({
1018
+ path: `M ${this.getScaleValue(tick)},${y} L ${this.getScaleValue(tick)},${y + this.axisConfig.tickLength}`,
1019
+ strokeFill: this.axisThemeConfig.tickColor,
1020
+ strokeWidth: this.axisConfig.tickWidth
1021
+ }))
1022
+ });
1023
+ }
1024
+ if (this.showTitle) {
1025
+ drawableElement.push({
1026
+ type: "text",
1027
+ groupTexts: ["bottom-axis", "title"],
1028
+ data: [
1029
+ {
1030
+ text: this.title,
1031
+ x: this.range[0] + (this.range[1] - this.range[0]) / 2,
1032
+ y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight,
1033
+ fill: this.axisThemeConfig.titleColor,
1034
+ fontSize: this.axisConfig.titleFontSize,
1035
+ rotation: 0,
1036
+ verticalPos: "top",
1037
+ horizontalPos: "center"
1038
+ }
1039
+ ]
1040
+ });
1041
+ }
1042
+ return drawableElement;
1043
+ }
1044
+ getDrawableElementsForTopAxis() {
1045
+ const drawableElement = [];
1046
+ if (this.showAxisLine) {
1047
+ const y = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2;
1048
+ drawableElement.push({
1049
+ type: "path",
1050
+ groupTexts: ["top-axis", "axis-line"],
1051
+ data: [
1052
+ {
1053
+ path: `M ${this.boundingRect.x},${y} L ${this.boundingRect.x + this.boundingRect.width},${y}`,
1054
+ strokeFill: this.axisThemeConfig.axisLineColor,
1055
+ strokeWidth: this.axisConfig.axisLineWidth
1056
+ }
1057
+ ]
1058
+ });
1059
+ }
1060
+ if (this.showLabel) {
1061
+ drawableElement.push({
1062
+ type: "text",
1063
+ groupTexts: ["top-axis", "label"],
1064
+ data: this.getTickValues().map((tick) => ({
1065
+ text: tick.toString(),
1066
+ x: this.getScaleValue(tick),
1067
+ y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding,
1068
+ fill: this.axisThemeConfig.labelColor,
1069
+ fontSize: this.axisConfig.labelFontSize,
1070
+ rotation: 0,
1071
+ verticalPos: "top",
1072
+ horizontalPos: "center"
1073
+ }))
1074
+ });
1075
+ }
1076
+ if (this.showTick) {
1077
+ const y = this.boundingRect.y;
1078
+ drawableElement.push({
1079
+ type: "path",
1080
+ groupTexts: ["top-axis", "ticks"],
1081
+ data: this.getTickValues().map((tick) => ({
1082
+ 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)}`,
1083
+ strokeFill: this.axisThemeConfig.tickColor,
1084
+ strokeWidth: this.axisConfig.tickWidth
1085
+ }))
1086
+ });
1087
+ }
1088
+ if (this.showTitle) {
1089
+ drawableElement.push({
1090
+ type: "text",
1091
+ groupTexts: ["top-axis", "title"],
1092
+ data: [
1093
+ {
1094
+ text: this.title,
1095
+ x: this.boundingRect.x + this.boundingRect.width / 2,
1096
+ y: this.boundingRect.y + this.axisConfig.titlePadding,
1097
+ fill: this.axisThemeConfig.titleColor,
1098
+ fontSize: this.axisConfig.titleFontSize,
1099
+ rotation: 0,
1100
+ verticalPos: "top",
1101
+ horizontalPos: "center"
1102
+ }
1103
+ ]
1104
+ });
1105
+ }
1106
+ return drawableElement;
1107
+ }
1108
+ getDrawableElements() {
1109
+ if (this.axisPosition === "left") {
1110
+ return this.getDrawableElementsForLeftAxis();
1111
+ }
1112
+ if (this.axisPosition === "right") {
1113
+ throw Error("Drawing of right axis is not implemented");
1114
+ }
1115
+ if (this.axisPosition === "bottom") {
1116
+ return this.getDrawableElementsForBottomAxis();
1117
+ }
1118
+ if (this.axisPosition === "top") {
1119
+ return this.getDrawableElementsForTopAxis();
1120
+ }
1121
+ return [];
1122
+ }
1123
+ };
1124
+ var BandAxis = class extends BaseAxis {
1125
+ static {
1126
+ __name(this, "BandAxis");
1127
+ }
1128
+ constructor(axisConfig, axisThemeConfig, categories, title, textDimensionCalculator) {
1129
+ super(axisConfig, title, textDimensionCalculator, axisThemeConfig);
1130
+ this.categories = categories;
1131
+ this.scale = band().domain(this.categories).range(this.getRange());
1132
+ }
1133
+ setRange(range2) {
1134
+ super.setRange(range2);
1135
+ }
1136
+ recalculateScale() {
1137
+ this.scale = band().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5);
1138
+ log.trace("BandAxis axis final categories, range: ", this.categories, this.getRange());
1139
+ }
1140
+ getTickValues() {
1141
+ return this.categories;
1142
+ }
1143
+ getScaleValue(value) {
1144
+ return this.scale(value) ?? this.getRange()[0];
1145
+ }
1146
+ };
1147
+ var LinearAxis = class extends BaseAxis {
1148
+ static {
1149
+ __name(this, "LinearAxis");
1150
+ }
1151
+ constructor(axisConfig, axisThemeConfig, domain, title, textDimensionCalculator) {
1152
+ super(axisConfig, title, textDimensionCalculator, axisThemeConfig);
1153
+ this.domain = domain;
1154
+ this.scale = linear().domain(this.domain).range(this.getRange());
1155
+ }
1156
+ getTickValues() {
1157
+ return this.scale.ticks();
1158
+ }
1159
+ recalculateScale() {
1160
+ const domain = [...this.domain];
1161
+ if (this.axisPosition === "left") {
1162
+ domain.reverse();
1163
+ }
1164
+ this.scale = linear().domain(domain).range(this.getRange());
1165
+ }
1166
+ getScaleValue(value) {
1167
+ return this.scale(value);
1168
+ }
1169
+ };
1170
+ function getAxis(data, axisConfig, axisThemeConfig, tmpSVGGroup2) {
1171
+ const textDimensionCalculator = new TextDimensionCalculatorWithFont(tmpSVGGroup2);
1172
+ if (isBandAxisData(data)) {
1173
+ return new BandAxis(
1174
+ axisConfig,
1175
+ axisThemeConfig,
1176
+ data.categories,
1177
+ data.title,
1178
+ textDimensionCalculator
1179
+ );
1180
+ }
1181
+ return new LinearAxis(
1182
+ axisConfig,
1183
+ axisThemeConfig,
1184
+ [data.min, data.max],
1185
+ data.title,
1186
+ textDimensionCalculator
1187
+ );
1188
+ }
1189
+ __name(getAxis, "getAxis");
1190
+ var ChartTitle = class {
1191
+ constructor(textDimensionCalculator, chartConfig, chartData, chartThemeConfig) {
1192
+ this.textDimensionCalculator = textDimensionCalculator;
1193
+ this.chartConfig = chartConfig;
1194
+ this.chartData = chartData;
1195
+ this.chartThemeConfig = chartThemeConfig;
1196
+ this.boundingRect = {
1197
+ x: 0,
1198
+ y: 0,
1199
+ width: 0,
1200
+ height: 0
1201
+ };
1202
+ this.showChartTitle = false;
1203
+ }
1204
+ static {
1205
+ __name(this, "ChartTitle");
1206
+ }
1207
+ setBoundingBoxXY(point) {
1208
+ this.boundingRect.x = point.x;
1209
+ this.boundingRect.y = point.y;
1210
+ }
1211
+ calculateSpace(availableSpace) {
1212
+ const titleDimension = this.textDimensionCalculator.getMaxDimension(
1213
+ [this.chartData.title],
1214
+ this.chartConfig.titleFontSize
1215
+ );
1216
+ const widthRequired = Math.max(titleDimension.width, availableSpace.width);
1217
+ const heightRequired = titleDimension.height + 2 * this.chartConfig.titlePadding;
1218
+ if (titleDimension.width <= widthRequired && titleDimension.height <= heightRequired && this.chartConfig.showTitle && this.chartData.title) {
1219
+ this.boundingRect.width = widthRequired;
1220
+ this.boundingRect.height = heightRequired;
1221
+ this.showChartTitle = true;
1222
+ }
1223
+ return {
1224
+ width: this.boundingRect.width,
1225
+ height: this.boundingRect.height
1226
+ };
1227
+ }
1228
+ getDrawableElements() {
1229
+ const drawableElem = [];
1230
+ if (this.showChartTitle) {
1231
+ drawableElem.push({
1232
+ groupTexts: ["chart-title"],
1233
+ type: "text",
1234
+ data: [
1235
+ {
1236
+ fontSize: this.chartConfig.titleFontSize,
1237
+ text: this.chartData.title,
1238
+ verticalPos: "middle",
1239
+ horizontalPos: "center",
1240
+ x: this.boundingRect.x + this.boundingRect.width / 2,
1241
+ y: this.boundingRect.y + this.boundingRect.height / 2,
1242
+ fill: this.chartThemeConfig.titleColor,
1243
+ rotation: 0
1244
+ }
1245
+ ]
1246
+ });
1247
+ }
1248
+ return drawableElem;
1249
+ }
1250
+ };
1251
+ function getChartTitleComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2) {
1252
+ const textDimensionCalculator = new TextDimensionCalculatorWithFont(tmpSVGGroup2);
1253
+ return new ChartTitle(textDimensionCalculator, chartConfig, chartData, chartThemeConfig);
1254
+ }
1255
+ __name(getChartTitleComponent, "getChartTitleComponent");
1256
+ var LinePlot = class {
1257
+ constructor(plotData, xAxis, yAxis, orientation, plotIndex2) {
1258
+ this.plotData = plotData;
1259
+ this.xAxis = xAxis;
1260
+ this.yAxis = yAxis;
1261
+ this.orientation = orientation;
1262
+ this.plotIndex = plotIndex2;
1263
+ }
1264
+ static {
1265
+ __name(this, "LinePlot");
1266
+ }
1267
+ getDrawableElement() {
1268
+ const finalData = this.plotData.data.map((d) => [
1269
+ this.xAxis.getScaleValue(d[0]),
1270
+ this.yAxis.getScaleValue(d[1])
1271
+ ]);
1272
+ let path;
1273
+ if (this.orientation === "horizontal") {
1274
+ path = line().y((d) => d[0]).x((d) => d[1])(finalData);
1275
+ } else {
1276
+ path = line().x((d) => d[0]).y((d) => d[1])(finalData);
1277
+ }
1278
+ if (!path) {
1279
+ return [];
1280
+ }
1281
+ return [
1282
+ {
1283
+ groupTexts: ["plot", `line-plot-${this.plotIndex}`],
1284
+ type: "path",
1285
+ data: [
1286
+ {
1287
+ path,
1288
+ strokeFill: this.plotData.strokeFill,
1289
+ strokeWidth: this.plotData.strokeWidth
1290
+ }
1291
+ ]
1292
+ }
1293
+ ];
1294
+ }
1295
+ };
1296
+ var BarPlot = class {
1297
+ constructor(barData, boundingRect, xAxis, yAxis, orientation, plotIndex2) {
1298
+ this.barData = barData;
1299
+ this.boundingRect = boundingRect;
1300
+ this.xAxis = xAxis;
1301
+ this.yAxis = yAxis;
1302
+ this.orientation = orientation;
1303
+ this.plotIndex = plotIndex2;
1304
+ }
1305
+ static {
1306
+ __name(this, "BarPlot");
1307
+ }
1308
+ getDrawableElement() {
1309
+ const finalData = this.barData.data.map((d) => [
1310
+ this.xAxis.getScaleValue(d[0]),
1311
+ this.yAxis.getScaleValue(d[1])
1312
+ ]);
1313
+ const barPaddingPercent = 0.05;
1314
+ const barWidth = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * (1 - barPaddingPercent);
1315
+ const barWidthHalf = barWidth / 2;
1316
+ if (this.orientation === "horizontal") {
1317
+ return [
1318
+ {
1319
+ groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
1320
+ type: "rect",
1321
+ data: finalData.map((data) => ({
1322
+ x: this.boundingRect.x,
1323
+ y: data[0] - barWidthHalf,
1324
+ height: barWidth,
1325
+ width: data[1] - this.boundingRect.x,
1326
+ fill: this.barData.fill,
1327
+ strokeWidth: 0,
1328
+ strokeFill: this.barData.fill
1329
+ }))
1330
+ }
1331
+ ];
1332
+ }
1333
+ return [
1334
+ {
1335
+ groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
1336
+ type: "rect",
1337
+ data: finalData.map((data) => ({
1338
+ x: data[0] - barWidthHalf,
1339
+ y: data[1],
1340
+ width: barWidth,
1341
+ height: this.boundingRect.y + this.boundingRect.height - data[1],
1342
+ fill: this.barData.fill,
1343
+ strokeWidth: 0,
1344
+ strokeFill: this.barData.fill
1345
+ }))
1346
+ }
1347
+ ];
1348
+ }
1349
+ };
1350
+ var BasePlot = class {
1351
+ constructor(chartConfig, chartData, chartThemeConfig) {
1352
+ this.chartConfig = chartConfig;
1353
+ this.chartData = chartData;
1354
+ this.chartThemeConfig = chartThemeConfig;
1355
+ this.boundingRect = {
1356
+ x: 0,
1357
+ y: 0,
1358
+ width: 0,
1359
+ height: 0
1360
+ };
1361
+ }
1362
+ static {
1363
+ __name(this, "BasePlot");
1364
+ }
1365
+ setAxes(xAxis, yAxis) {
1366
+ this.xAxis = xAxis;
1367
+ this.yAxis = yAxis;
1368
+ }
1369
+ setBoundingBoxXY(point) {
1370
+ this.boundingRect.x = point.x;
1371
+ this.boundingRect.y = point.y;
1372
+ }
1373
+ calculateSpace(availableSpace) {
1374
+ this.boundingRect.width = availableSpace.width;
1375
+ this.boundingRect.height = availableSpace.height;
1376
+ return {
1377
+ width: this.boundingRect.width,
1378
+ height: this.boundingRect.height
1379
+ };
1380
+ }
1381
+ getDrawableElements() {
1382
+ if (!(this.xAxis && this.yAxis)) {
1383
+ throw Error("Axes must be passed to render Plots");
1384
+ }
1385
+ const drawableElem = [];
1386
+ for (const [i, plot] of this.chartData.plots.entries()) {
1387
+ switch (plot.type) {
1388
+ case "line":
1389
+ {
1390
+ const linePlot = new LinePlot(
1391
+ plot,
1392
+ this.xAxis,
1393
+ this.yAxis,
1394
+ this.chartConfig.chartOrientation,
1395
+ i
1396
+ );
1397
+ drawableElem.push(...linePlot.getDrawableElement());
1398
+ }
1399
+ break;
1400
+ case "bar":
1401
+ {
1402
+ const barPlot = new BarPlot(
1403
+ plot,
1404
+ this.boundingRect,
1405
+ this.xAxis,
1406
+ this.yAxis,
1407
+ this.chartConfig.chartOrientation,
1408
+ i
1409
+ );
1410
+ drawableElem.push(...barPlot.getDrawableElement());
1411
+ }
1412
+ break;
1413
+ }
1414
+ }
1415
+ return drawableElem;
1416
+ }
1417
+ };
1418
+ function getPlotComponent(chartConfig, chartData, chartThemeConfig) {
1419
+ return new BasePlot(chartConfig, chartData, chartThemeConfig);
1420
+ }
1421
+ __name(getPlotComponent, "getPlotComponent");
1422
+ var Orchestrator = class {
1423
+ constructor(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2) {
1424
+ this.chartConfig = chartConfig;
1425
+ this.chartData = chartData;
1426
+ this.componentStore = {
1427
+ title: getChartTitleComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2),
1428
+ plot: getPlotComponent(chartConfig, chartData, chartThemeConfig),
1429
+ xAxis: getAxis(
1430
+ chartData.xAxis,
1431
+ chartConfig.xAxis,
1432
+ {
1433
+ titleColor: chartThemeConfig.xAxisTitleColor,
1434
+ labelColor: chartThemeConfig.xAxisLabelColor,
1435
+ tickColor: chartThemeConfig.xAxisTickColor,
1436
+ axisLineColor: chartThemeConfig.xAxisLineColor
1437
+ },
1438
+ tmpSVGGroup2
1439
+ ),
1440
+ yAxis: getAxis(
1441
+ chartData.yAxis,
1442
+ chartConfig.yAxis,
1443
+ {
1444
+ titleColor: chartThemeConfig.yAxisTitleColor,
1445
+ labelColor: chartThemeConfig.yAxisLabelColor,
1446
+ tickColor: chartThemeConfig.yAxisTickColor,
1447
+ axisLineColor: chartThemeConfig.yAxisLineColor
1448
+ },
1449
+ tmpSVGGroup2
1450
+ )
1451
+ };
1452
+ }
1453
+ static {
1454
+ __name(this, "Orchestrator");
1455
+ }
1456
+ calculateVerticalSpace() {
1457
+ let availableWidth = this.chartConfig.width;
1458
+ let availableHeight = this.chartConfig.height;
1459
+ let plotX = 0;
1460
+ let plotY = 0;
1461
+ let chartWidth = Math.floor(availableWidth * this.chartConfig.plotReservedSpacePercent / 100);
1462
+ let chartHeight = Math.floor(
1463
+ availableHeight * this.chartConfig.plotReservedSpacePercent / 100
1464
+ );
1465
+ let spaceUsed = this.componentStore.plot.calculateSpace({
1466
+ width: chartWidth,
1467
+ height: chartHeight
1468
+ });
1469
+ availableWidth -= spaceUsed.width;
1470
+ availableHeight -= spaceUsed.height;
1471
+ spaceUsed = this.componentStore.title.calculateSpace({
1472
+ width: this.chartConfig.width,
1473
+ height: availableHeight
1474
+ });
1475
+ plotY = spaceUsed.height;
1476
+ availableHeight -= spaceUsed.height;
1477
+ this.componentStore.xAxis.setAxisPosition("bottom");
1478
+ spaceUsed = this.componentStore.xAxis.calculateSpace({
1479
+ width: availableWidth,
1480
+ height: availableHeight
1481
+ });
1482
+ availableHeight -= spaceUsed.height;
1483
+ this.componentStore.yAxis.setAxisPosition("left");
1484
+ spaceUsed = this.componentStore.yAxis.calculateSpace({
1485
+ width: availableWidth,
1486
+ height: availableHeight
1487
+ });
1488
+ plotX = spaceUsed.width;
1489
+ availableWidth -= spaceUsed.width;
1490
+ if (availableWidth > 0) {
1491
+ chartWidth += availableWidth;
1492
+ availableWidth = 0;
1493
+ }
1494
+ if (availableHeight > 0) {
1495
+ chartHeight += availableHeight;
1496
+ availableHeight = 0;
1497
+ }
1498
+ this.componentStore.plot.calculateSpace({
1499
+ width: chartWidth,
1500
+ height: chartHeight
1501
+ });
1502
+ this.componentStore.plot.setBoundingBoxXY({ x: plotX, y: plotY });
1503
+ this.componentStore.xAxis.setRange([plotX, plotX + chartWidth]);
1504
+ this.componentStore.xAxis.setBoundingBoxXY({ x: plotX, y: plotY + chartHeight });
1505
+ this.componentStore.yAxis.setRange([plotY, plotY + chartHeight]);
1506
+ this.componentStore.yAxis.setBoundingBoxXY({ x: 0, y: plotY });
1507
+ if (this.chartData.plots.some((p) => isBarPlot(p))) {
1508
+ this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1509
+ }
1510
+ }
1511
+ calculateHorizontalSpace() {
1512
+ let availableWidth = this.chartConfig.width;
1513
+ let availableHeight = this.chartConfig.height;
1514
+ let titleYEnd = 0;
1515
+ let plotX = 0;
1516
+ let plotY = 0;
1517
+ let chartWidth = Math.floor(availableWidth * this.chartConfig.plotReservedSpacePercent / 100);
1518
+ let chartHeight = Math.floor(
1519
+ availableHeight * this.chartConfig.plotReservedSpacePercent / 100
1520
+ );
1521
+ let spaceUsed = this.componentStore.plot.calculateSpace({
1522
+ width: chartWidth,
1523
+ height: chartHeight
1524
+ });
1525
+ availableWidth -= spaceUsed.width;
1526
+ availableHeight -= spaceUsed.height;
1527
+ spaceUsed = this.componentStore.title.calculateSpace({
1528
+ width: this.chartConfig.width,
1529
+ height: availableHeight
1530
+ });
1531
+ titleYEnd = spaceUsed.height;
1532
+ availableHeight -= spaceUsed.height;
1533
+ this.componentStore.xAxis.setAxisPosition("left");
1534
+ spaceUsed = this.componentStore.xAxis.calculateSpace({
1535
+ width: availableWidth,
1536
+ height: availableHeight
1537
+ });
1538
+ availableWidth -= spaceUsed.width;
1539
+ plotX = spaceUsed.width;
1540
+ this.componentStore.yAxis.setAxisPosition("top");
1541
+ spaceUsed = this.componentStore.yAxis.calculateSpace({
1542
+ width: availableWidth,
1543
+ height: availableHeight
1544
+ });
1545
+ availableHeight -= spaceUsed.height;
1546
+ plotY = titleYEnd + spaceUsed.height;
1547
+ if (availableWidth > 0) {
1548
+ chartWidth += availableWidth;
1549
+ availableWidth = 0;
1550
+ }
1551
+ if (availableHeight > 0) {
1552
+ chartHeight += availableHeight;
1553
+ availableHeight = 0;
1554
+ }
1555
+ this.componentStore.plot.calculateSpace({
1556
+ width: chartWidth,
1557
+ height: chartHeight
1558
+ });
1559
+ this.componentStore.plot.setBoundingBoxXY({ x: plotX, y: plotY });
1560
+ this.componentStore.yAxis.setRange([plotX, plotX + chartWidth]);
1561
+ this.componentStore.yAxis.setBoundingBoxXY({ x: plotX, y: titleYEnd });
1562
+ this.componentStore.xAxis.setRange([plotY, plotY + chartHeight]);
1563
+ this.componentStore.xAxis.setBoundingBoxXY({ x: 0, y: plotY });
1564
+ if (this.chartData.plots.some((p) => isBarPlot(p))) {
1565
+ this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1566
+ }
1567
+ }
1568
+ calculateSpace() {
1569
+ if (this.chartConfig.chartOrientation === "horizontal") {
1570
+ this.calculateHorizontalSpace();
1571
+ } else {
1572
+ this.calculateVerticalSpace();
1573
+ }
1574
+ }
1575
+ getDrawableElement() {
1576
+ this.calculateSpace();
1577
+ const drawableElem = [];
1578
+ this.componentStore.plot.setAxes(this.componentStore.xAxis, this.componentStore.yAxis);
1579
+ for (const component of Object.values(this.componentStore)) {
1580
+ drawableElem.push(...component.getDrawableElements());
1581
+ }
1582
+ return drawableElem;
1583
+ }
1584
+ };
1585
+ var XYChartBuilder = class {
1586
+ static {
1587
+ __name(this, "XYChartBuilder");
1588
+ }
1589
+ static build(config, chartData, chartThemeConfig, tmpSVGGroup2) {
1590
+ const orchestrator = new Orchestrator(config, chartData, chartThemeConfig, tmpSVGGroup2);
1591
+ return orchestrator.getDrawableElement();
1592
+ }
1593
+ };
1594
+ var plotIndex = 0;
1595
+ var tmpSVGGroup;
1596
+ var xyChartConfig = getChartDefaultConfig();
1597
+ var xyChartThemeConfig = getChartDefaultThemeConfig();
1598
+ var xyChartData = getChartDefaultData();
1599
+ var plotColorPalette = xyChartThemeConfig.plotColorPalette.split(",").map((color) => color.trim());
1600
+ var hasSetXAxis = false;
1601
+ var hasSetYAxis = false;
1602
+ function getChartDefaultThemeConfig() {
1603
+ const defaultThemeVariables = getThemeVariables3();
1604
+ const config = getConfig();
1605
+ return cleanAndMerge(defaultThemeVariables.xyChart, config.themeVariables.xyChart);
1606
+ }
1607
+ __name(getChartDefaultThemeConfig, "getChartDefaultThemeConfig");
1608
+ function getChartDefaultConfig() {
1609
+ const config = getConfig();
1610
+ return cleanAndMerge(
1611
+ defaultConfig_default.xyChart,
1612
+ config.xyChart
1613
+ );
1614
+ }
1615
+ __name(getChartDefaultConfig, "getChartDefaultConfig");
1616
+ function getChartDefaultData() {
1617
+ return {
1618
+ yAxis: {
1619
+ type: "linear",
1620
+ title: "",
1621
+ min: Infinity,
1622
+ max: -Infinity
1623
+ },
1624
+ xAxis: {
1625
+ type: "band",
1626
+ title: "",
1627
+ categories: []
1628
+ },
1629
+ title: "",
1630
+ plots: []
1631
+ };
1632
+ }
1633
+ __name(getChartDefaultData, "getChartDefaultData");
1634
+ function textSanitizer(text) {
1635
+ const config = getConfig();
1636
+ return sanitizeText(text.trim(), config);
1637
+ }
1638
+ __name(textSanitizer, "textSanitizer");
1639
+ function setTmpSVGG(SVGG) {
1640
+ tmpSVGGroup = SVGG;
1641
+ }
1642
+ __name(setTmpSVGG, "setTmpSVGG");
1643
+ function setOrientation(orientation) {
1644
+ if (orientation === "horizontal") {
1645
+ xyChartConfig.chartOrientation = "horizontal";
1646
+ } else {
1647
+ xyChartConfig.chartOrientation = "vertical";
1648
+ }
1649
+ }
1650
+ __name(setOrientation, "setOrientation");
1651
+ function setXAxisTitle(title) {
1652
+ xyChartData.xAxis.title = textSanitizer(title.text);
1653
+ }
1654
+ __name(setXAxisTitle, "setXAxisTitle");
1655
+ function setXAxisRangeData(min, max) {
1656
+ xyChartData.xAxis = { type: "linear", title: xyChartData.xAxis.title, min, max };
1657
+ hasSetXAxis = true;
1658
+ }
1659
+ __name(setXAxisRangeData, "setXAxisRangeData");
1660
+ function setXAxisBand(categories) {
1661
+ xyChartData.xAxis = {
1662
+ type: "band",
1663
+ title: xyChartData.xAxis.title,
1664
+ categories: categories.map((c) => textSanitizer(c.text))
1665
+ };
1666
+ hasSetXAxis = true;
1667
+ }
1668
+ __name(setXAxisBand, "setXAxisBand");
1669
+ function setYAxisTitle(title) {
1670
+ xyChartData.yAxis.title = textSanitizer(title.text);
1671
+ }
1672
+ __name(setYAxisTitle, "setYAxisTitle");
1673
+ function setYAxisRangeData(min, max) {
1674
+ xyChartData.yAxis = { type: "linear", title: xyChartData.yAxis.title, min, max };
1675
+ hasSetYAxis = true;
1676
+ }
1677
+ __name(setYAxisRangeData, "setYAxisRangeData");
1678
+ function setYAxisRangeFromPlotData(data) {
1679
+ const minValue = Math.min(...data);
1680
+ const maxValue = Math.max(...data);
1681
+ const prevMinValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.min : Infinity;
1682
+ const prevMaxValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.max : -Infinity;
1683
+ xyChartData.yAxis = {
1684
+ type: "linear",
1685
+ title: xyChartData.yAxis.title,
1686
+ min: Math.min(prevMinValue, minValue),
1687
+ max: Math.max(prevMaxValue, maxValue)
1688
+ };
1689
+ }
1690
+ __name(setYAxisRangeFromPlotData, "setYAxisRangeFromPlotData");
1691
+ function transformDataWithoutCategory(data) {
1692
+ let retData = [];
1693
+ if (data.length === 0) {
1694
+ return retData;
1695
+ }
1696
+ if (!hasSetXAxis) {
1697
+ const prevMinValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.min : Infinity;
1698
+ const prevMaxValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.max : -Infinity;
1699
+ setXAxisRangeData(Math.min(prevMinValue, 1), Math.max(prevMaxValue, data.length));
1700
+ }
1701
+ if (!hasSetYAxis) {
1702
+ setYAxisRangeFromPlotData(data);
1703
+ }
1704
+ if (isBandAxisData(xyChartData.xAxis)) {
1705
+ retData = xyChartData.xAxis.categories.map((c, i) => [c, data[i]]);
1706
+ }
1707
+ if (isLinearAxisData(xyChartData.xAxis)) {
1708
+ const min = xyChartData.xAxis.min;
1709
+ const max = xyChartData.xAxis.max;
1710
+ const step = (max - min) / (data.length - 1);
1711
+ const categories = [];
1712
+ for (let i = min; i <= max; i += step) {
1713
+ categories.push(`${i}`);
1714
+ }
1715
+ retData = categories.map((c, i) => [c, data[i]]);
1716
+ }
1717
+ return retData;
1718
+ }
1719
+ __name(transformDataWithoutCategory, "transformDataWithoutCategory");
1720
+ function getPlotColorFromPalette(plotIndex2) {
1721
+ return plotColorPalette[plotIndex2 === 0 ? 0 : plotIndex2 % plotColorPalette.length];
1722
+ }
1723
+ __name(getPlotColorFromPalette, "getPlotColorFromPalette");
1724
+ function setLineData(title, data) {
1725
+ const plotData = transformDataWithoutCategory(data);
1726
+ xyChartData.plots.push({
1727
+ type: "line",
1728
+ strokeFill: getPlotColorFromPalette(plotIndex),
1729
+ strokeWidth: 2,
1730
+ data: plotData
1731
+ });
1732
+ plotIndex++;
1733
+ }
1734
+ __name(setLineData, "setLineData");
1735
+ function setBarData(title, data) {
1736
+ const plotData = transformDataWithoutCategory(data);
1737
+ xyChartData.plots.push({
1738
+ type: "bar",
1739
+ fill: getPlotColorFromPalette(plotIndex),
1740
+ data: plotData
1741
+ });
1742
+ plotIndex++;
1743
+ }
1744
+ __name(setBarData, "setBarData");
1745
+ function getDrawableElem() {
1746
+ if (xyChartData.plots.length === 0) {
1747
+ throw Error("No Plot to render, please provide a plot with some data");
1748
+ }
1749
+ xyChartData.title = getDiagramTitle();
1750
+ return XYChartBuilder.build(xyChartConfig, xyChartData, xyChartThemeConfig, tmpSVGGroup);
1751
+ }
1752
+ __name(getDrawableElem, "getDrawableElem");
1753
+ function getChartThemeConfig() {
1754
+ return xyChartThemeConfig;
1755
+ }
1756
+ __name(getChartThemeConfig, "getChartThemeConfig");
1757
+ function getChartConfig() {
1758
+ return xyChartConfig;
1759
+ }
1760
+ __name(getChartConfig, "getChartConfig");
1761
+ function getXYChartData() {
1762
+ return xyChartData;
1763
+ }
1764
+ __name(getXYChartData, "getXYChartData");
1765
+ var clear2 = /* @__PURE__ */ __name(function() {
1766
+ clear();
1767
+ plotIndex = 0;
1768
+ xyChartConfig = getChartDefaultConfig();
1769
+ xyChartData = getChartDefaultData();
1770
+ xyChartThemeConfig = getChartDefaultThemeConfig();
1771
+ plotColorPalette = xyChartThemeConfig.plotColorPalette.split(",").map((color) => color.trim());
1772
+ hasSetXAxis = false;
1773
+ hasSetYAxis = false;
1774
+ }, "clear");
1775
+ var xychartDb_default = {
1776
+ getDrawableElem,
1777
+ clear: clear2,
1778
+ setAccTitle,
1779
+ getAccTitle,
1780
+ setDiagramTitle,
1781
+ getDiagramTitle,
1782
+ getAccDescription,
1783
+ setAccDescription,
1784
+ setOrientation,
1785
+ setXAxisTitle,
1786
+ setXAxisRangeData,
1787
+ setXAxisBand,
1788
+ setYAxisTitle,
1789
+ setYAxisRangeData,
1790
+ setLineData,
1791
+ setBarData,
1792
+ setTmpSVGG,
1793
+ getChartThemeConfig,
1794
+ getChartConfig,
1795
+ getXYChartData
1796
+ };
1797
+ var draw = /* @__PURE__ */ __name((txt, id, _version, diagObj) => {
1798
+ const db = diagObj.db;
1799
+ const themeConfig = db.getChartThemeConfig();
1800
+ const chartConfig = db.getChartConfig();
1801
+ const labelData = db.getXYChartData().plots[0].data.map((data) => data[1]);
1802
+ function getDominantBaseLine(horizontalPos) {
1803
+ return horizontalPos === "top" ? "text-before-edge" : "middle";
1804
+ }
1805
+ __name(getDominantBaseLine, "getDominantBaseLine");
1806
+ function getTextAnchor(verticalPos) {
1807
+ return verticalPos === "left" ? "start" : verticalPos === "right" ? "end" : "middle";
1808
+ }
1809
+ __name(getTextAnchor, "getTextAnchor");
1810
+ function getTextTransformation(data) {
1811
+ return `translate(${data.x}, ${data.y}) rotate(${data.rotation || 0})`;
1812
+ }
1813
+ __name(getTextTransformation, "getTextTransformation");
1814
+ log.debug("Rendering xychart chart\n" + txt);
1815
+ const svg = selectSvgElement(id);
1816
+ const group = svg.append("g").attr("class", "main");
1817
+ const background = group.append("rect").attr("width", chartConfig.width).attr("height", chartConfig.height).attr("class", "background");
1818
+ configureSvgSize(svg, chartConfig.height, chartConfig.width, true);
1819
+ svg.attr("viewBox", `0 0 ${chartConfig.width} ${chartConfig.height}`);
1820
+ background.attr("fill", themeConfig.backgroundColor);
1821
+ db.setTmpSVGG(svg.append("g").attr("class", "mermaid-tmp-group"));
1822
+ const shapes = db.getDrawableElem();
1823
+ const groups = {};
1824
+ function getGroup(gList) {
1825
+ let elem = group;
1826
+ let prefix = "";
1827
+ for (const [i] of gList.entries()) {
1828
+ let parent = group;
1829
+ if (i > 0 && groups[prefix]) {
1830
+ parent = groups[prefix];
1831
+ }
1832
+ prefix += gList[i];
1833
+ elem = groups[prefix];
1834
+ if (!elem) {
1835
+ elem = groups[prefix] = parent.append("g").attr("class", gList[i]);
1836
+ }
1837
+ }
1838
+ return elem;
1839
+ }
1840
+ __name(getGroup, "getGroup");
1841
+ for (const shape of shapes) {
1842
+ if (shape.data.length === 0) {
1843
+ continue;
1844
+ }
1845
+ const shapeGroup = getGroup(shape.groupTexts);
1846
+ switch (shape.type) {
1847
+ case "rect":
1848
+ 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);
1849
+ if (chartConfig.showDataLabel) {
1850
+ const showDataLabelOutsideBar = chartConfig.showDataLabelOutsideBar;
1851
+ if (chartConfig.chartOrientation === "horizontal") {
1852
+ let fitsHorizontally2 = function(item, fontSize) {
1853
+ const { data, label } = item;
1854
+ const textWidth = fontSize * label.length * charWidthFactor;
1855
+ return textWidth <= data.width - rightMargin;
1856
+ };
1857
+ __name(fitsHorizontally2, "fitsHorizontally");
1858
+ const charWidthFactor = 0.7;
1859
+ const rightMargin = 10;
1860
+ const validItems = shape.data.map((d, i) => ({ data: d, label: labelData[i].toString() })).filter((item) => item.data.width > 0 && item.data.height > 0);
1861
+ const candidateFontSizes = validItems.map((item) => {
1862
+ const { data } = item;
1863
+ let fontSize = data.height * 0.7;
1864
+ while (!fitsHorizontally2(item, fontSize) && fontSize > 0) {
1865
+ fontSize -= 1;
1866
+ }
1867
+ return fontSize;
1868
+ });
1869
+ const uniformFontSize = Math.floor(Math.min(...candidateFontSizes));
1870
+ const determineLabelXPosition = /* @__PURE__ */ __name((item) => {
1871
+ if (showDataLabelOutsideBar) {
1872
+ return item.data.x + item.data.width + rightMargin;
1873
+ } else {
1874
+ return item.data.x + item.data.width - rightMargin;
1875
+ }
1876
+ }, "determineLabelXPosition");
1877
+ 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);
1878
+ } else {
1879
+ let fitsInBar2 = function(item, fontSize, yOffset2) {
1880
+ const { data, label } = item;
1881
+ const charWidthFactor = 0.7;
1882
+ const textWidth = fontSize * label.length * charWidthFactor;
1883
+ const centerX = data.x + data.width / 2;
1884
+ const leftEdge = centerX - textWidth / 2;
1885
+ const rightEdge = centerX + textWidth / 2;
1886
+ const horizontalFits = leftEdge >= data.x && rightEdge <= data.x + data.width;
1887
+ const verticalFits = data.y + yOffset2 + fontSize <= data.y + data.height;
1888
+ return horizontalFits && verticalFits;
1889
+ };
1890
+ __name(fitsInBar2, "fitsInBar");
1891
+ const yOffset = 10;
1892
+ const validItems = shape.data.map((d, i) => ({ data: d, label: labelData[i].toString() })).filter((item) => item.data.width > 0 && item.data.height > 0);
1893
+ const candidateFontSizes = validItems.map((item) => {
1894
+ const { data, label } = item;
1895
+ let fontSize = data.width / (label.length * 0.7);
1896
+ while (!fitsInBar2(item, fontSize, yOffset) && fontSize > 0) {
1897
+ fontSize -= 1;
1898
+ }
1899
+ return fontSize;
1900
+ });
1901
+ const uniformFontSize = Math.floor(Math.min(...candidateFontSizes));
1902
+ const determineLabelYPosition = /* @__PURE__ */ __name((item) => {
1903
+ if (showDataLabelOutsideBar) {
1904
+ return item.data.y - yOffset;
1905
+ } else {
1906
+ return item.data.y + yOffset;
1907
+ }
1908
+ }, "determineLabelYPosition");
1909
+ 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);
1910
+ }
1911
+ }
1912
+ break;
1913
+ case "text":
1914
+ 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);
1915
+ break;
1916
+ case "path":
1917
+ 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);
1918
+ break;
1919
+ }
1920
+ }
1921
+ }, "draw");
1922
+ var xychartRenderer_default = {
1923
+ draw
1924
+ };
1925
+ var diagram = {
1926
+ parser: xychart_default,
1927
+ db: xychartDb_default,
1928
+ renderer: xychartRenderer_default
1929
+ };
1930
+ export {
1931
+ diagram
1932
+ };