@vunk/plus 1.6.11 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (411) hide show
  1. package/components/_baseUniq-BXtq6_NW.mjs +239 -0
  2. package/components/abap-B7h4dtBh.mjs +6 -0
  3. package/components/actionscript-3-Bmm7RA3Y.mjs +6 -0
  4. package/components/ada-BZS802Se.mjs +6 -0
  5. package/components/agent-chat-provider/index.mjs +74 -39
  6. package/components/andromeeda-CrngpmZk.mjs +3 -0
  7. package/components/apache-D4roVlsU.mjs +6 -0
  8. package/components/apex-D6mfw0H5.mjs +6 -0
  9. package/components/apl-DDK-VObo.mjs +18 -0
  10. package/components/applescript-C43Knf0G.mjs +6 -0
  11. package/components/ara-DRBH84ND.mjs +6 -0
  12. package/components/arc-Js_tyW10.mjs +131 -0
  13. package/components/architecture-O4VJ6CD3-ZoZ2IAk2.mjs +13 -0
  14. package/components/architectureDiagram-SUXI7LT5-kyYGGrHN.mjs +8676 -0
  15. package/components/asm-3tg4MVib.mjs +6 -0
  16. package/components/astro-v4FYbRud.mjs +19 -0
  17. package/components/aurora-x-wJ4-eM2h.mjs +3 -0
  18. package/components/awk-ChreaG-G.mjs +6 -0
  19. package/components/ayu-dark-BEKp3oqs.mjs +3 -0
  20. package/components/ballerina-B0yt0TYU.mjs +6 -0
  21. package/components/batch-Ce_EX3Sx.mjs +14 -0
  22. package/components/beancount-BRIsdQEB.mjs +6 -0
  23. package/components/berry-Brv4WWdL.mjs +14 -0
  24. package/components/bibtex-BLeFwAes.mjs +6 -0
  25. package/components/bicep-BVrgfErX.mjs +6 -0
  26. package/components/blade-By3Sw_Ex.mjs +22 -0
  27. package/components/blockDiagram-6J76NXCF-IAr4zDV3.mjs +3608 -0
  28. package/components/bubble-list/index.css +22 -0
  29. package/components/bubble-list/index.mjs +7 -134
  30. package/components/bubble-templates/index.mjs +11438 -101
  31. package/components/c-C4VtT7JA.mjs +6 -0
  32. package/components/c4Diagram-6F6E4RAY-Dv27rXcJ.mjs +2490 -0
  33. package/components/catppuccin-frappe-zLMNRRUx.mjs +3 -0
  34. package/components/catppuccin-latte-CdF5jC3c.mjs +3 -0
  35. package/components/catppuccin-macchiato-DyjXeyRt.mjs +3 -0
  36. package/components/catppuccin-mocha-66IdYxR8.mjs +3 -0
  37. package/components/cdc-30ktANo3.mjs +14 -0
  38. package/components/channel-BBZy6zOT.mjs +7 -0
  39. package/components/chat-independent/index.mjs +4 -4
  40. package/components/chunk-353BL4L5-Dn_Y_Yna.mjs +17 -0
  41. package/components/chunk-67H74DCK-Br5U8bfD.mjs +102 -0
  42. package/components/chunk-AACKK3MU-DH_MKxca.mjs +17 -0
  43. package/components/chunk-BFAMUDN2-DHLCoYMN.mjs +13 -0
  44. package/components/chunk-E2GYISFI-DQPHyyga.mjs +19 -0
  45. package/components/chunk-OW32GOEJ-CQOSE6Bn.mjs +1924 -0
  46. package/components/chunk-SKB7J2MH-BlwHRDiW.mjs +25 -0
  47. package/components/chunk-SZ463SBG-DEp8buKJ.mjs +1823 -0
  48. package/components/clarity-6uBl6Vpb.mjs +6 -0
  49. package/components/classDiagram-M3E45YP4-D0ySDe-v.mjs +30 -0
  50. package/components/classDiagram-v2-YAWTLIQI-D0ySDe-v.mjs +30 -0
  51. package/components/clojure-COBRmwo8.mjs +14 -0
  52. package/components/clone-CEJtuQzg.mjs +8 -0
  53. package/components/cmake-CDfQILeU.mjs +6 -0
  54. package/components/cobol-BOOIiISO.mjs +13 -0
  55. package/components/coffee-DO_RGoZp.mjs +9 -0
  56. package/components/cpp-DAK8ktHO.mjs +25 -0
  57. package/components/crystal-CBGbbyVp.mjs +19 -0
  58. package/components/cs-h3ksD6-P.mjs +14 -0
  59. package/components/css-BtVcDqlU.mjs +6 -0
  60. package/components/cue-BFSVLV6N.mjs +6 -0
  61. package/components/cypher-Dl2CXoXF.mjs +14 -0
  62. package/components/cytoscape.esm-BojS1z60.mjs +30216 -0
  63. package/components/d-9qSZPw74.mjs +6 -0
  64. package/components/dagre-JOIXM2OF-5zx0JY2T.mjs +705 -0
  65. package/components/dark-plus-DmZ1Dzd4.mjs +3 -0
  66. package/components/dart-CCSsOg9l.mjs +6 -0
  67. package/components/dax-CvsmLV-B.mjs +6 -0
  68. package/components/defaultLocale-DVr69WTU.mjs +202 -0
  69. package/components/diagram-5UYTHUR4-C19nyAKc.mjs +213 -0
  70. package/components/diagram-VMROVX33-DkGwo-hj.mjs +859 -0
  71. package/components/diagram-ZTM2IBQH-CBgHCu9L.mjs +315 -0
  72. package/components/diff-BEdzuHlE.mjs +6 -0
  73. package/components/dockerfile-B3DP334t.mjs +14 -0
  74. package/components/dracula-B8-AVrwI.mjs +3 -0
  75. package/components/dracula-soft-BHeefow7.mjs +3 -0
  76. package/components/dream-maker-CNLQpoF-.mjs +6 -0
  77. package/components/elixir-0rTCSSfp.mjs +11 -0
  78. package/components/elm-BhwiZPvf.mjs +10 -0
  79. package/components/erDiagram-3M52JZNH-cttdAJXW.mjs +1167 -0
  80. package/components/erb-Lra8TlYM.mjs +27 -0
  81. package/components/erlang-D2NNgvtR.mjs +17 -0
  82. package/components/everforest-dark-Cg1xdODP.mjs +3 -0
  83. package/components/everforest-light-BmTD3bxe.mjs +3 -0
  84. package/components/fish-BU5HSdZy.mjs +6 -0
  85. package/components/flowDiagram-KYDEHFYC-9HpsqDdB.mjs +2343 -0
  86. package/components/fs-CdBSddpF.mjs +17 -0
  87. package/components/ganttDiagram-EK5VF46D-8QB3ofs6.mjs +3495 -0
  88. package/components/gdresource-CAbkn6H_.mjs +11 -0
  89. package/components/gdscript-Be_cubqt.mjs +6 -0
  90. package/components/gdshader-BEzE4j_3.mjs +6 -0
  91. package/components/gherkin-xCNF9gh8.mjs +6 -0
  92. package/components/git-commit-PP9xCApN.mjs +9 -0
  93. package/components/git-rebase-DqdGofLo.mjs +9 -0
  94. package/components/gitGraph-ZV4HHKMB-BSmtVGRu.mjs +13 -0
  95. package/components/gitGraphDiagram-GW3U2K7C-DNzc0Vx_.mjs +1225 -0
  96. package/components/github-dark-O22yVQaY.mjs +3 -0
  97. package/components/github-dark-default-DB2Hkvqn.mjs +3 -0
  98. package/components/github-dark-dimmed-CMZ_OfqC.mjs +3 -0
  99. package/components/github-dark-high-contrast-DmxWVmCU.mjs +3 -0
  100. package/components/github-light-BTbR9xVK.mjs +3 -0
  101. package/components/github-light-default-DWEonwFe.mjs +3 -0
  102. package/components/github-light-high-contrast-WJ_cPDts.mjs +3 -0
  103. package/components/glimmer-js-BkPYTyD4.mjs +23 -0
  104. package/components/glsl-CGsiYPcu.mjs +9 -0
  105. package/components/gnuplot-tV8vezdE.mjs +6 -0
  106. package/components/go-CBmVHZBz.mjs +6 -0
  107. package/components/graph-3zJxsO-i.mjs +425 -0
  108. package/components/graphql-D4pgneW3.mjs +15 -0
  109. package/components/groovy-Bn4MhXgW.mjs +6 -0
  110. package/components/gruvbox-dark-hard-C89wZ4s3.mjs +3 -0
  111. package/components/gruvbox-dark-medium-swz85q_b.mjs +3 -0
  112. package/components/gruvbox-dark-soft-BYHBHQJW.mjs +3 -0
  113. package/components/gruvbox-light-hard-DEF_ZxYZ.mjs +3 -0
  114. package/components/gruvbox-light-medium-ziUMnHJx.mjs +3 -0
  115. package/components/gruvbox-light-soft-Cuwp0tsB.mjs +3 -0
  116. package/components/gts-d3WsqAZM.mjs +23 -0
  117. package/components/hack-CwaBuF5l.mjs +13 -0
  118. package/components/haml-gLijj4rW.mjs +11 -0
  119. package/components/hbs-CFi5SpI3.mjs +23 -0
  120. package/components/hcl-axoq0Ycu.mjs +6 -0
  121. package/components/hjson-I7LcauIB.mjs +6 -0
  122. package/components/hlsl-TRzjajlb.mjs +6 -0
  123. package/components/houston-CF_ws8Cq.mjs +3 -0
  124. package/components/hs-DXSGqUFF.mjs +14 -0
  125. package/components/html-CLq-n30c.mjs +11 -0
  126. package/components/html-derivative-C8POX8SL.mjs +9 -0
  127. package/components/http-BYUKZ6kX.mjs +20 -0
  128. package/components/imba-C4923lSV.mjs +6 -0
  129. package/components/index3.mjs +79528 -0
  130. package/components/info-63CPKGFF-C8sYWczU.mjs +13 -0
  131. package/components/infoDiagram-LHK5PUON-C-vFFPTf.mjs +42 -0
  132. package/components/init-ZxktEp_H.mjs +15 -0
  133. package/components/java-BfXh-0uJ.mjs +6 -0
  134. package/components/jinja-html-BmW4v_vu.mjs +11 -0
  135. package/components/jison-C9kAT_Oj.mjs +9 -0
  136. package/components/journeyDiagram-EWQZEKCU-BJrw4-AG.mjs +1262 -0
  137. package/components/js-CN_xSsjU.mjs +14 -0
  138. package/components/json-TjWBGEk1.mjs +6 -0
  139. package/components/json5-DCGCKrmX.mjs +6 -0
  140. package/components/jsonc-DLVLp8id.mjs +6 -0
  141. package/components/jsonl-B-R_pDGg.mjs +6 -0
  142. package/components/jsonnet-Cs8BnnC6.mjs +6 -0
  143. package/components/jssm-D_YBQ_cM.mjs +14 -0
  144. package/components/jsx-BPmvoin2.mjs +6 -0
  145. package/components/julia-C-JjBobP.mjs +19 -0
  146. package/components/kanagawa-dragon-DU8n2NNT.mjs +3 -0
  147. package/components/kanagawa-lotus-Byd0CDet.mjs +3 -0
  148. package/components/kanagawa-wave-DExoagcR.mjs +3 -0
  149. package/components/kanban-definition-ZSS6B67P-BptAnqU-.mjs +1057 -0
  150. package/components/kotlin-BM2ZNTMh.mjs +6 -0
  151. package/components/kusto-D9MF7CZf.mjs +14 -0
  152. package/components/laserwave-DF03wMlf.mjs +3 -0
  153. package/components/latex-BsqkLZB_.mjs +10 -0
  154. package/components/layout-sGZIJplX.mjs +2043 -0
  155. package/components/less-BAzLMJNR.mjs +6 -0
  156. package/components/light-plus-DS08Xg5J.mjs +3 -0
  157. package/components/linear-DqgVh5FN.mjs +336 -0
  158. package/components/liquid-f2VHt0dg.mjs +15 -0
  159. package/components/lisp-DAq1kaby.mjs +6 -0
  160. package/components/logo-D9l7oEJ8.mjs +6 -0
  161. package/components/lua-CH3ttzl_.mjs +9 -0
  162. package/components/makefile-D2qLe7q0.mjs +14 -0
  163. package/components/marko-DwRyI_--.mjs +15 -0
  164. package/components/material-theme-B8B2U48Q.mjs +3 -0
  165. package/components/material-theme-darker-BV0iY_T3.mjs +3 -0
  166. package/components/material-theme-lighter-DrzybSTF.mjs +3 -0
  167. package/components/material-theme-ocean-BRPLVReX.mjs +3 -0
  168. package/components/material-theme-palenight-DSJwsR_D.mjs +3 -0
  169. package/components/matlab-7XHduepk.mjs +6 -0
  170. package/components/md-BIvDPr-W.mjs +14 -0
  171. package/components/mdc-Rx6hWSHn.mjs +16 -0
  172. package/components/mdx-D5wExp-O.mjs +6 -0
  173. package/components/mermaid-CUjtoYEe.mjs +6 -0
  174. package/components/mermaid-parser.core-CH9ryA1K.mjs +16987 -0
  175. package/components/mermaid.core-CAqkCmS1.mjs +20975 -0
  176. package/components/min-BngCxx8g.mjs +109 -0
  177. package/components/min-dark-BNaN9fWk.mjs +3 -0
  178. package/components/min-light-CMrjentn.mjs +3 -0
  179. package/components/mindmap-definition-6CBA2TL7-Cp_EeEsh.mjs +5854 -0
  180. package/components/mojo-CrbF881p.mjs +6 -0
  181. package/components/monokai-DelygWXa.mjs +3 -0
  182. package/components/narrat-DOwkIbBe.mjs +14 -0
  183. package/components/nf-DHfvJ2gH.mjs +14 -0
  184. package/components/nginx-B_jWsywZ.mjs +10 -0
  185. package/components/night-owl-DSS199ra.mjs +3 -0
  186. package/components/nim-yzbnZKJd.mjs +22 -0
  187. package/components/nix--3K2gyjg.mjs +6 -0
  188. package/components/nord-CvDbBq5M.mjs +3 -0
  189. package/components/objective-c-DkOBZg1J.mjs +14 -0
  190. package/components/objective-cpp-DEoN9Fe5.mjs +6 -0
  191. package/components/ocaml-B1kfGk9Y.mjs +6 -0
  192. package/components/one-dark-pro-CsMf0BoJ.mjs +3 -0
  193. package/components/one-light-BwwAsfsj.mjs +3 -0
  194. package/components/ordinal-DSZU4PqD.mjs +76 -0
  195. package/components/packet-HUATNLJX-bfFWFja0.mjs +13 -0
  196. package/components/pascal-CU8Kjkr_.mjs +6 -0
  197. package/components/perl-FH6su6vZ.mjs +18 -0
  198. package/components/php-Dnl1TfYH.mjs +20 -0
  199. package/components/pie-WTHONI2E-QPrWs3SR.mjs +13 -0
  200. package/components/pieDiagram-NIOCPIFQ-C46Y_4C6.mjs +248 -0
  201. package/components/plastic-BjwMpBc0.mjs +3 -0
  202. package/components/plsql-B3Na24V4.mjs +6 -0
  203. package/components/poimandres-ChWyhPrn.mjs +3 -0
  204. package/components/postcss-kj1IbjVd.mjs +6 -0
  205. package/components/powerquery-B-e1fO-k.mjs +6 -0
  206. package/components/prisma-bmxcSDxq.mjs +6 -0
  207. package/components/prolog-BT9GCzqD.mjs +6 -0
  208. package/components/properties-D6yKO1eW.mjs +14 -0
  209. package/components/proto-BIXM0k1a.mjs +6 -0
  210. package/components/ps1-aFyNx8UH.mjs +18 -0
  211. package/components/pug-BrOx0bSt.mjs +21 -0
  212. package/components/puppet-N15G4Usj.mjs +6 -0
  213. package/components/purescript-DrwsEYNH.mjs +6 -0
  214. package/components/python-D2s92fRP.mjs +14 -0
  215. package/components/ql-DTm-NCRo.mjs +14 -0
  216. package/components/quadrantDiagram-2OG54O6I-Dgf6d6F_.mjs +1347 -0
  217. package/components/r-oprfD2-9.mjs +6 -0
  218. package/components/radar-NJJJXTRR-BnUCJhQL.mjs +13 -0
  219. package/components/raku-xArQd_rF.mjs +14 -0
  220. package/components/razor-BoXCAbWQ.mjs +13 -0
  221. package/components/red-DByOl5N0.mjs +3 -0
  222. package/components/reg-CULnG2WX.mjs +6 -0
  223. package/components/rel-CHRwzjd4.mjs +6 -0
  224. package/components/requirementDiagram-QOLK2EJ7-CSF6N7HA.mjs +1171 -0
  225. package/components/riscv-BNQ9cVpw.mjs +6 -0
  226. package/components/rose-pine-LL9gXmP2.mjs +3 -0
  227. package/components/rose-pine-dawn-CH9zdisO.mjs +3 -0
  228. package/components/rose-pine-moon-B1oKSfEJ.mjs +3 -0
  229. package/components/rst-bEtD1v7N.mjs +36 -0
  230. package/components/ruby-BmfBy6EV.mjs +44 -0
  231. package/components/rust-Bf_fdNdL.mjs +14 -0
  232. package/components/sankeyDiagram-4UZDY2LN-BAHB7dMS.mjs +1199 -0
  233. package/components/sas-BLBgC3TA.mjs +9 -0
  234. package/components/sass-BheygBdF.mjs +6 -0
  235. package/components/scala-B-_7vFVn.mjs +6 -0
  236. package/components/scheme-BSHdPinv.mjs +6 -0
  237. package/components/scss-Dq-LbI_c.mjs +9 -0
  238. package/components/sequenceDiagram-SKLFT4DO-10gLJ50N.mjs +3422 -0
  239. package/components/shaderlab-BOQRTiQi.mjs +17 -0
  240. package/components/shellsession-Cu3c0QAc.mjs +17 -0
  241. package/components/slack-dark-BEe10hxO.mjs +3 -0
  242. package/components/slack-ochin-BKmu9pBc.mjs +3 -0
  243. package/components/smalltalk-qxcGy4fT.mjs +6 -0
  244. package/components/snazzy-light-Dcvd-ZyI.mjs +3 -0
  245. package/components/solarized-dark-BBl5y5sR.mjs +3 -0
  246. package/components/solarized-light-DW9b_AY8.mjs +3 -0
  247. package/components/solidity-CewKZgp-.mjs +6 -0
  248. package/components/sparql-DswowMAp.mjs +9 -0
  249. package/components/splunk-gK6Iw_P9.mjs +14 -0
  250. package/components/sql-DzUuSofg.mjs +6 -0
  251. package/components/ssh-config-Bk_I5wDR.mjs +6 -0
  252. package/components/stata-Dl7wDdBE.mjs +9 -0
  253. package/components/stateDiagram-MI5ZYTHO-D6p6nCaj.mjs +459 -0
  254. package/components/stateDiagram-v2-5AN5P6BG-DaN5hC-t.mjs +29 -0
  255. package/components/stylus-qRNkxrFU.mjs +14 -0
  256. package/components/svelte-B9qv3vkS.mjs +15 -0
  257. package/components/swift-BRQRsam8.mjs +6 -0
  258. package/components/synthwave-84-CoUef9sh.mjs +3 -0
  259. package/components/system-verilog-BcESSvRn.mjs +6 -0
  260. package/components/tasl-DfOr2qHi.mjs +6 -0
  261. package/components/tcl-CTsc4-t7.mjs +6 -0
  262. package/components/tex-CumJx1zu.mjs +9 -0
  263. package/components/timeline-definition-MYPXXCX6-gLqnWxDu.mjs +1234 -0
  264. package/components/tokyo-night-DjtLpAEY.mjs +3 -0
  265. package/components/toml-vHPzWDj6.mjs +6 -0
  266. package/components/treemap-75Q7IDZK-B2atdfMH.mjs +13 -0
  267. package/components/tsx-CmGGo4Hm.mjs +6 -0
  268. package/components/turtle-BnC7StHY.mjs +6 -0
  269. package/components/twig-0XKNpXN1.mjs +35 -0
  270. package/components/typescript-CgxwwAuC.mjs +14 -0
  271. package/components/v-Bmdjo9cy.mjs +6 -0
  272. package/components/vb-DuF6ZenW.mjs +14 -0
  273. package/components/verilog-CCb_iTfF.mjs +6 -0
  274. package/components/vesper-4Q1cEwPL.mjs +3 -0
  275. package/components/vhdl-DMqk4T2s.mjs +6 -0
  276. package/components/vimscript-aKp9YbYm.mjs +18 -0
  277. package/components/vitesse-black-BqNLki8b.mjs +3 -0
  278. package/components/vitesse-dark-jJ32WhwH.mjs +3 -0
  279. package/components/vitesse-light-476zM4e6.mjs +3 -0
  280. package/components/vue-DVNNTw2l.mjs +40 -0
  281. package/components/vue-html-Cr5wciIP.mjs +16 -0
  282. package/components/vyper-DYedWgAE.mjs +14 -0
  283. package/components/wasm-BBh6f151.mjs +6 -0
  284. package/components/wasm-DDgzZJey.mjs +7 -0
  285. package/components/wenyan-BdqozpMZ.mjs +6 -0
  286. package/components/wgsl-Vo-hHVWH.mjs +6 -0
  287. package/components/wolfram-CRmjUoI4.mjs +6 -0
  288. package/components/xml-BMzZeaqs.mjs +9 -0
  289. package/components/xsl-CAhvzxWv.mjs +10 -0
  290. package/components/xychartDiagram-H2YORKM3-Whqa4ezL.mjs +1893 -0
  291. package/components/yml-BhSrWWMS.mjs +14 -0
  292. package/components/zenscript-DFINJL6j.mjs +6 -0
  293. package/components/zig-CS4FMAZp.mjs +6 -0
  294. package/components/zsh-hcK4TBd7.mjs +26 -0
  295. package/index.css +23 -0
  296. package/package.json +4 -1
  297. package/components/agent-chat-provider/index.d.ts +0 -7
  298. package/components/agent-chat-provider/src/api.d.ts +0 -3
  299. package/components/agent-chat-provider/src/const-roles.d.ts +0 -8
  300. package/components/agent-chat-provider/src/const.d.ts +0 -1
  301. package/components/agent-chat-provider/src/index.vue.d.ts +0 -22
  302. package/components/agent-chat-provider/src/types.d.ts +0 -50
  303. package/components/agent-chat-provider/src/use.d.ts +0 -5
  304. package/components/avatar/index.d.ts +0 -4
  305. package/components/avatar/src/ctx.d.ts +0 -6
  306. package/components/avatar/src/index.vue.d.ts +0 -180
  307. package/components/avatar/src/types.d.ts +0 -1
  308. package/components/broadcasting-markdown/index.d.ts +0 -7
  309. package/components/broadcasting-markdown/src/const.d.ts +0 -13
  310. package/components/broadcasting-markdown/src/ctx.d.ts +0 -129
  311. package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +0 -104
  312. package/components/broadcasting-markdown/src/index.vue.d.ts +0 -439
  313. package/components/broadcasting-markdown/src/paragraph.vue.d.ts +0 -79
  314. package/components/broadcasting-markdown/src/speech-error.vue.d.ts +0 -67
  315. package/components/broadcasting-markdown/src/types.d.ts +0 -26
  316. package/components/broadcasting-markdown/src/use.d.ts +0 -21
  317. package/components/bubble-list/index.d.ts +0 -5
  318. package/components/bubble-list/src/ctx.d.ts +0 -32
  319. package/components/bubble-list/src/index.vue.d.ts +0 -810
  320. package/components/bubble-list/src/types.d.ts +0 -4
  321. package/components/bubble-templates/index.d.ts +0 -4
  322. package/components/bubble-templates/src/index.vue.d.ts +0 -595
  323. package/components/bubble-templates/src/types.d.ts +0 -40
  324. package/components/chat-independent/index.d.ts +0 -4
  325. package/components/chat-independent/src/const.d.ts +0 -13
  326. package/components/chat-independent/src/ctx.d.ts +0 -21
  327. package/components/chat-independent/src/index.vue.d.ts +0 -2429
  328. package/components/chat-independent/src/types.d.ts +0 -13
  329. package/components/index.d.ts +0 -0
  330. package/components/lottie-animation/index.d.ts +0 -4
  331. package/components/lottie-animation/src/ctx.d.ts +0 -10
  332. package/components/lottie-animation/src/index.vue.d.ts +0 -21
  333. package/components/lottie-animation/src/types.d.ts +0 -4
  334. package/components/metahuman-broadcasting/index.d.ts +0 -5
  335. package/components/metahuman-broadcasting/src/ctx.d.ts +0 -57
  336. package/components/metahuman-broadcasting/src/index.vue.d.ts +0 -885
  337. package/components/metahuman-broadcasting/src/types.d.ts +0 -1
  338. package/components/monaco-editor/index.d.ts +0 -5
  339. package/components/monaco-editor/src/ctx.d.ts +0 -23
  340. package/components/monaco-editor/src/index.vue.d.ts +0 -40
  341. package/components/monaco-editor/src/types.d.ts +0 -1
  342. package/components/monaco-environment/index.d.ts +0 -4
  343. package/components/monaco-environment/src/ctx.d.ts +0 -8
  344. package/components/monaco-environment/src/index.vue.d.ts +0 -2
  345. package/components/monaco-environment/src/types.d.ts +0 -1
  346. package/components/pixi-frame/index.d.ts +0 -11
  347. package/components/pixi-frame/src/apng.vue.d.ts +0 -161
  348. package/components/pixi-frame/src/bitmap.vue.d.ts +0 -158
  349. package/components/pixi-frame/src/core.vue.d.ts +0 -173
  350. package/components/pixi-frame/src/ctx.d.ts +0 -55
  351. package/components/pixi-frame/src/index.vue.d.ts +0 -591
  352. package/components/pixi-frame/src/provider.vue.d.ts +0 -2
  353. package/components/pixi-frame/src/types.d.ts +0 -17
  354. package/components/pixi-frame/src/use.d.ts +0 -16
  355. package/components/pixi-frame/src/useSprite.d.ts +0 -12
  356. package/components/pixi-frame/src/video.vue.d.ts +0 -159
  357. package/components/pixi-frame/src/view.vue.d.ts +0 -29
  358. package/components/recorder-button/index.d.ts +0 -4
  359. package/components/recorder-button/src/ctx.d.ts +0 -41
  360. package/components/recorder-button/src/index.vue.d.ts +0 -333
  361. package/components/recorder-button/src/speech-to-text.d.ts +0 -1
  362. package/components/recorder-button/src/types.d.ts +0 -7
  363. package/components/routes-menu-content/index.d.ts +0 -4
  364. package/components/routes-menu-content/src/ctx.d.ts +0 -17
  365. package/components/routes-menu-content/src/index.vue.d.ts +0 -350
  366. package/components/routes-menu-content/src/item/core/ctx.d.ts +0 -18
  367. package/components/routes-menu-content/src/item/core/index.vue.d.ts +0 -185
  368. package/components/routes-menu-content/src/item/ctx.d.ts +0 -14
  369. package/components/routes-menu-content/src/item/index.vue.d.ts +0 -316
  370. package/components/routes-menu-content/src/types.d.ts +0 -1
  371. package/components/sender/index.d.ts +0 -4
  372. package/components/sender/src/SenderHeader.vue.d.ts +0 -270
  373. package/components/sender/src/ctx.d.ts +0 -64
  374. package/components/sender/src/index.vue.d.ts +0 -779
  375. package/components/sender/src/types.d.ts +0 -1
  376. package/components/speech-button/index.d.ts +0 -4
  377. package/components/speech-button/src/LoadingIcon.vue.d.ts +0 -2
  378. package/components/speech-button/src/RecordingIcon.vue.d.ts +0 -2
  379. package/components/speech-button/src/ctx.d.ts +0 -10
  380. package/components/speech-button/src/index.vue.d.ts +0 -22
  381. package/components/speech-button/src/types.d.ts +0 -1
  382. package/components/table-columns/index.d.ts +0 -5
  383. package/components/table-columns/src/ctx.d.ts +0 -59
  384. package/components/table-columns/src/el-ctx.d.ts +0 -57
  385. package/components/table-columns/src/index.vue.d.ts +0 -266
  386. package/components/table-columns/src/types.d.ts +0 -21
  387. package/components/tables-v1/index.d.ts +0 -5
  388. package/components/tables-v1/src/ctx.d.ts +0 -280
  389. package/components/tables-v1/src/el-ctx.d.ts +0 -262
  390. package/components/tables-v1/src/index.vue.d.ts +0 -3054
  391. package/components/tables-v1/src/types.d.ts +0 -3
  392. package/components/tables-v1-checkbox/index.d.ts +0 -5
  393. package/components/tables-v1-checkbox/src/ctx.d.ts +0 -313
  394. package/components/tables-v1-checkbox/src/index.vue.d.ts +0 -3831
  395. package/components/tables-v1-checkbox/src/types.d.ts +0 -1
  396. package/components/text/index.d.ts +0 -4
  397. package/components/text/src/ctx.d.ts +0 -341
  398. package/components/text/src/index.vue.d.ts +0 -4593
  399. package/components/text/src/types.d.ts +0 -1
  400. package/components/typing-markdown/index.d.ts +0 -4
  401. package/components/typing-markdown/src/core.d.ts +0 -2
  402. package/components/typing-markdown/src/ctx.d.ts +0 -41
  403. package/components/typing-markdown/src/index.vue.d.ts +0 -75
  404. package/components/typing-markdown/src/types.d.ts +0 -1
  405. package/components/vditor/index.d.ts +0 -5
  406. package/components/vditor/src/ctx.d.ts +0 -38
  407. package/components/vditor/src/handle-fullscreen.vue.d.ts +0 -18
  408. package/components/vditor/src/handle-value.vue.d.ts +0 -18
  409. package/components/vditor/src/index.vue.d.ts +0 -143
  410. package/components/vditor/src/types.d.ts +0 -9
  411. package/components/vditor/src/use.d.ts +0 -4
@@ -0,0 +1,1893 @@
1
+ import { _ as __name, a1 as getThemeVariables3, G as getConfig, F as cleanAndMerge, H as defaultConfig_default, aD as computeDimensionOfText, l as log, a9 as line$1, i as sanitizeText, t as getDiagramTitle, b as setAccTitle, a as getAccTitle, q as setDiagramTitle, g as getAccDescription, s as setAccDescription, z as clear$2, K as selectSvgElement, e as configureSvgSize } from './mermaid.core-CAqkCmS1.mjs';
2
+ import { i as initRange } from './init-ZxktEp_H.mjs';
3
+ import { o as ordinal } from './ordinal-DSZU4PqD.mjs';
4
+ import { l as linear } from './linear-DqgVh5FN.mjs';
5
+ import './index3.mjs';
6
+ import 'vue';
7
+ import '@vunk/plus/components/bubble-templates';
8
+ import '@vunk/core/components/spread-to';
9
+ import 'element-plus';
10
+ import '@vunk/shared/function';
11
+ import './_plugin-vue_export-helper.mjs';
12
+ import '@vunk/plus/components/agent-chat-provider';
13
+ import './defaultLocale-DVr69WTU.mjs';
14
+
15
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
16
+ function range(start, stop, step) {
17
+ start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
18
+ var i = -1, n = Math.max(0, Math.ceil((stop - start) / step)) | 0, range2 = new Array(n);
19
+ while (++i < n) {
20
+ range2[i] = start + i * step;
21
+ }
22
+ return range2;
23
+ }
24
+ function band() {
25
+ 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;
26
+ delete scale.unknown;
27
+ function rescale() {
28
+ var n = domain().length, reverse = r1 < r0, start = reverse ? r1 : r0, stop = reverse ? r0 : r1;
29
+ step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);
30
+ if (round) step = Math.floor(step);
31
+ start += (stop - start - step * (n - paddingInner)) * align;
32
+ bandwidth = step * (1 - paddingInner);
33
+ if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);
34
+ var values = range(n).map(function(i) {
35
+ return start + step * i;
36
+ });
37
+ return ordinalRange(reverse ? values.reverse() : values);
38
+ }
39
+ scale.domain = function(_) {
40
+ return arguments.length ? (domain(_), rescale()) : domain();
41
+ };
42
+ scale.range = function(_) {
43
+ return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
44
+ };
45
+ scale.rangeRound = function(_) {
46
+ return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();
47
+ };
48
+ scale.bandwidth = function() {
49
+ return bandwidth;
50
+ };
51
+ scale.step = function() {
52
+ return step;
53
+ };
54
+ scale.round = function(_) {
55
+ return arguments.length ? (round = !!_, rescale()) : round;
56
+ };
57
+ scale.padding = function(_) {
58
+ return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;
59
+ };
60
+ scale.paddingInner = function(_) {
61
+ return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;
62
+ };
63
+ scale.paddingOuter = function(_) {
64
+ return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;
65
+ };
66
+ scale.align = function(_) {
67
+ return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
68
+ };
69
+ scale.copy = function() {
70
+ return band(domain(), [r0, r1]).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);
71
+ };
72
+ return initRange.apply(rescale(), arguments);
73
+ }
74
+ var parser = function() {
75
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
76
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
77
+ return o2;
78
+ }, "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];
79
+ var parser2 = {
80
+ trace: /* @__PURE__ */ __name(function trace() {
81
+ }, "trace"),
82
+ yy: {},
83
+ 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 },
84
+ 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" },
85
+ 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]],
86
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
87
+ var $0 = $$.length - 1;
88
+ switch (yystate) {
89
+ case 5:
90
+ yy.setOrientation($$[$0]);
91
+ break;
92
+ case 9:
93
+ yy.setDiagramTitle($$[$0].text.trim());
94
+ break;
95
+ case 12:
96
+ yy.setLineData({ text: "", type: "text" }, $$[$0]);
97
+ break;
98
+ case 13:
99
+ yy.setLineData($$[$0 - 1], $$[$0]);
100
+ break;
101
+ case 14:
102
+ yy.setBarData({ text: "", type: "text" }, $$[$0]);
103
+ break;
104
+ case 15:
105
+ yy.setBarData($$[$0 - 1], $$[$0]);
106
+ break;
107
+ case 16:
108
+ this.$ = $$[$0].trim();
109
+ yy.setAccTitle(this.$);
110
+ break;
111
+ case 17:
112
+ case 18:
113
+ this.$ = $$[$0].trim();
114
+ yy.setAccDescription(this.$);
115
+ break;
116
+ case 19:
117
+ this.$ = $$[$0 - 1];
118
+ break;
119
+ case 20:
120
+ this.$ = [Number($$[$0 - 2]), ...$$[$0]];
121
+ break;
122
+ case 21:
123
+ this.$ = [Number($$[$0])];
124
+ break;
125
+ case 22:
126
+ yy.setXAxisTitle($$[$0]);
127
+ break;
128
+ case 23:
129
+ yy.setXAxisTitle($$[$0 - 1]);
130
+ break;
131
+ case 24:
132
+ yy.setXAxisTitle({ type: "text", text: "" });
133
+ break;
134
+ case 25:
135
+ yy.setXAxisBand($$[$0]);
136
+ break;
137
+ case 26:
138
+ yy.setXAxisRangeData(Number($$[$0 - 2]), Number($$[$0]));
139
+ break;
140
+ case 27:
141
+ this.$ = $$[$0 - 1];
142
+ break;
143
+ case 28:
144
+ this.$ = [$$[$0 - 2], ...$$[$0]];
145
+ break;
146
+ case 29:
147
+ this.$ = [$$[$0]];
148
+ break;
149
+ case 30:
150
+ yy.setYAxisTitle($$[$0]);
151
+ break;
152
+ case 31:
153
+ yy.setYAxisTitle($$[$0 - 1]);
154
+ break;
155
+ case 32:
156
+ yy.setYAxisTitle({ type: "text", text: "" });
157
+ break;
158
+ case 33:
159
+ yy.setYAxisRangeData(Number($$[$0 - 2]), Number($$[$0]));
160
+ break;
161
+ case 37:
162
+ this.$ = { text: $$[$0], type: "text" };
163
+ break;
164
+ case 38:
165
+ this.$ = { text: $$[$0], type: "text" };
166
+ break;
167
+ case 39:
168
+ this.$ = { text: $$[$0], type: "markdown" };
169
+ break;
170
+ case 40:
171
+ this.$ = $$[$0];
172
+ break;
173
+ case 41:
174
+ this.$ = $$[$0 - 1] + "" + $$[$0];
175
+ break;
176
+ }
177
+ }, "anonymous"),
178
+ 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] }],
179
+ defaultActions: { 8: [2, 1], 10: [2, 3], 21: [2, 2], 72: [2, 28], 73: [2, 20] },
180
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
181
+ if (hash.recoverable) {
182
+ this.trace(str);
183
+ } else {
184
+ var error = new Error(str);
185
+ error.hash = hash;
186
+ throw error;
187
+ }
188
+ }, "parseError"),
189
+ parse: /* @__PURE__ */ __name(function parse(input) {
190
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
191
+ var args = lstack.slice.call(arguments, 1);
192
+ var lexer2 = Object.create(this.lexer);
193
+ var sharedState = { yy: {} };
194
+ for (var k in this.yy) {
195
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
196
+ sharedState.yy[k] = this.yy[k];
197
+ }
198
+ }
199
+ lexer2.setInput(input, sharedState.yy);
200
+ sharedState.yy.lexer = lexer2;
201
+ sharedState.yy.parser = this;
202
+ if (typeof lexer2.yylloc == "undefined") {
203
+ lexer2.yylloc = {};
204
+ }
205
+ var yyloc = lexer2.yylloc;
206
+ lstack.push(yyloc);
207
+ var ranges = lexer2.options && lexer2.options.ranges;
208
+ if (typeof sharedState.yy.parseError === "function") {
209
+ this.parseError = sharedState.yy.parseError;
210
+ } else {
211
+ this.parseError = Object.getPrototypeOf(this).parseError;
212
+ }
213
+ function popStack(n) {
214
+ stack.length = stack.length - 2 * n;
215
+ vstack.length = vstack.length - n;
216
+ lstack.length = lstack.length - n;
217
+ }
218
+ __name(popStack, "popStack");
219
+ function lex() {
220
+ var token;
221
+ token = tstack.pop() || lexer2.lex() || EOF;
222
+ if (typeof token !== "number") {
223
+ if (token instanceof Array) {
224
+ tstack = token;
225
+ token = tstack.pop();
226
+ }
227
+ token = self.symbols_[token] || token;
228
+ }
229
+ return token;
230
+ }
231
+ __name(lex, "lex");
232
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
233
+ while (true) {
234
+ state = stack[stack.length - 1];
235
+ if (this.defaultActions[state]) {
236
+ action = this.defaultActions[state];
237
+ } else {
238
+ if (symbol === null || typeof symbol == "undefined") {
239
+ symbol = lex();
240
+ }
241
+ action = table[state] && table[state][symbol];
242
+ }
243
+ if (typeof action === "undefined" || !action.length || !action[0]) {
244
+ var errStr = "";
245
+ expected = [];
246
+ for (p in table[state]) {
247
+ if (this.terminals_[p] && p > TERROR) {
248
+ expected.push("'" + this.terminals_[p] + "'");
249
+ }
250
+ }
251
+ if (lexer2.showPosition) {
252
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
253
+ } else {
254
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
255
+ }
256
+ this.parseError(errStr, {
257
+ text: lexer2.match,
258
+ token: this.terminals_[symbol] || symbol,
259
+ line: lexer2.yylineno,
260
+ loc: yyloc,
261
+ expected
262
+ });
263
+ }
264
+ if (action[0] instanceof Array && action.length > 1) {
265
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
266
+ }
267
+ switch (action[0]) {
268
+ case 1:
269
+ stack.push(symbol);
270
+ vstack.push(lexer2.yytext);
271
+ lstack.push(lexer2.yylloc);
272
+ stack.push(action[1]);
273
+ symbol = null;
274
+ {
275
+ yyleng = lexer2.yyleng;
276
+ yytext = lexer2.yytext;
277
+ yylineno = lexer2.yylineno;
278
+ yyloc = lexer2.yylloc;
279
+ }
280
+ break;
281
+ case 2:
282
+ len = this.productions_[action[1]][1];
283
+ yyval.$ = vstack[vstack.length - len];
284
+ yyval._$ = {
285
+ first_line: lstack[lstack.length - (len || 1)].first_line,
286
+ last_line: lstack[lstack.length - 1].last_line,
287
+ first_column: lstack[lstack.length - (len || 1)].first_column,
288
+ last_column: lstack[lstack.length - 1].last_column
289
+ };
290
+ if (ranges) {
291
+ yyval._$.range = [
292
+ lstack[lstack.length - (len || 1)].range[0],
293
+ lstack[lstack.length - 1].range[1]
294
+ ];
295
+ }
296
+ r = this.performAction.apply(yyval, [
297
+ yytext,
298
+ yyleng,
299
+ yylineno,
300
+ sharedState.yy,
301
+ action[1],
302
+ vstack,
303
+ lstack
304
+ ].concat(args));
305
+ if (typeof r !== "undefined") {
306
+ return r;
307
+ }
308
+ if (len) {
309
+ stack = stack.slice(0, -1 * len * 2);
310
+ vstack = vstack.slice(0, -1 * len);
311
+ lstack = lstack.slice(0, -1 * len);
312
+ }
313
+ stack.push(this.productions_[action[1]][0]);
314
+ vstack.push(yyval.$);
315
+ lstack.push(yyval._$);
316
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
317
+ stack.push(newState);
318
+ break;
319
+ case 3:
320
+ return true;
321
+ }
322
+ }
323
+ return true;
324
+ }, "parse")
325
+ };
326
+ var lexer = /* @__PURE__ */ function() {
327
+ var lexer2 = {
328
+ EOF: 1,
329
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
330
+ if (this.yy.parser) {
331
+ this.yy.parser.parseError(str, hash);
332
+ } else {
333
+ throw new Error(str);
334
+ }
335
+ }, "parseError"),
336
+ // resets the lexer, sets new input
337
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
338
+ this.yy = yy || this.yy || {};
339
+ this._input = input;
340
+ this._more = this._backtrack = this.done = false;
341
+ this.yylineno = this.yyleng = 0;
342
+ this.yytext = this.matched = this.match = "";
343
+ this.conditionStack = ["INITIAL"];
344
+ this.yylloc = {
345
+ first_line: 1,
346
+ first_column: 0,
347
+ last_line: 1,
348
+ last_column: 0
349
+ };
350
+ if (this.options.ranges) {
351
+ this.yylloc.range = [0, 0];
352
+ }
353
+ this.offset = 0;
354
+ return this;
355
+ }, "setInput"),
356
+ // consumes and returns one char from the input
357
+ input: /* @__PURE__ */ __name(function() {
358
+ var ch = this._input[0];
359
+ this.yytext += ch;
360
+ this.yyleng++;
361
+ this.offset++;
362
+ this.match += ch;
363
+ this.matched += ch;
364
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
365
+ if (lines) {
366
+ this.yylineno++;
367
+ this.yylloc.last_line++;
368
+ } else {
369
+ this.yylloc.last_column++;
370
+ }
371
+ if (this.options.ranges) {
372
+ this.yylloc.range[1]++;
373
+ }
374
+ this._input = this._input.slice(1);
375
+ return ch;
376
+ }, "input"),
377
+ // unshifts one char (or a string) into the input
378
+ unput: /* @__PURE__ */ __name(function(ch) {
379
+ var len = ch.length;
380
+ var lines = ch.split(/(?:\r\n?|\n)/g);
381
+ this._input = ch + this._input;
382
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
383
+ this.offset -= len;
384
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
385
+ this.match = this.match.substr(0, this.match.length - 1);
386
+ this.matched = this.matched.substr(0, this.matched.length - 1);
387
+ if (lines.length - 1) {
388
+ this.yylineno -= lines.length - 1;
389
+ }
390
+ var r = this.yylloc.range;
391
+ this.yylloc = {
392
+ first_line: this.yylloc.first_line,
393
+ last_line: this.yylineno + 1,
394
+ first_column: this.yylloc.first_column,
395
+ 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
396
+ };
397
+ if (this.options.ranges) {
398
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
399
+ }
400
+ this.yyleng = this.yytext.length;
401
+ return this;
402
+ }, "unput"),
403
+ // When called from action, caches matched text and appends it on next action
404
+ more: /* @__PURE__ */ __name(function() {
405
+ this._more = true;
406
+ return this;
407
+ }, "more"),
408
+ // 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.
409
+ reject: /* @__PURE__ */ __name(function() {
410
+ if (this.options.backtrack_lexer) {
411
+ this._backtrack = true;
412
+ } else {
413
+ 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(), {
414
+ text: "",
415
+ token: null,
416
+ line: this.yylineno
417
+ });
418
+ }
419
+ return this;
420
+ }, "reject"),
421
+ // retain first n characters of the match
422
+ less: /* @__PURE__ */ __name(function(n) {
423
+ this.unput(this.match.slice(n));
424
+ }, "less"),
425
+ // displays already matched input, i.e. for error messages
426
+ pastInput: /* @__PURE__ */ __name(function() {
427
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
428
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
429
+ }, "pastInput"),
430
+ // displays upcoming input, i.e. for error messages
431
+ upcomingInput: /* @__PURE__ */ __name(function() {
432
+ var next = this.match;
433
+ if (next.length < 20) {
434
+ next += this._input.substr(0, 20 - next.length);
435
+ }
436
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
437
+ }, "upcomingInput"),
438
+ // displays the character position where the lexing error occurred, i.e. for error messages
439
+ showPosition: /* @__PURE__ */ __name(function() {
440
+ var pre = this.pastInput();
441
+ var c = new Array(pre.length + 1).join("-");
442
+ return pre + this.upcomingInput() + "\n" + c + "^";
443
+ }, "showPosition"),
444
+ // test the lexed token: return FALSE when not a match, otherwise return token
445
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
446
+ var token, lines, backup;
447
+ if (this.options.backtrack_lexer) {
448
+ backup = {
449
+ yylineno: this.yylineno,
450
+ yylloc: {
451
+ first_line: this.yylloc.first_line,
452
+ last_line: this.last_line,
453
+ first_column: this.yylloc.first_column,
454
+ last_column: this.yylloc.last_column
455
+ },
456
+ yytext: this.yytext,
457
+ match: this.match,
458
+ matches: this.matches,
459
+ matched: this.matched,
460
+ yyleng: this.yyleng,
461
+ offset: this.offset,
462
+ _more: this._more,
463
+ _input: this._input,
464
+ yy: this.yy,
465
+ conditionStack: this.conditionStack.slice(0),
466
+ done: this.done
467
+ };
468
+ if (this.options.ranges) {
469
+ backup.yylloc.range = this.yylloc.range.slice(0);
470
+ }
471
+ }
472
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
473
+ if (lines) {
474
+ this.yylineno += lines.length;
475
+ }
476
+ this.yylloc = {
477
+ first_line: this.yylloc.last_line,
478
+ last_line: this.yylineno + 1,
479
+ first_column: this.yylloc.last_column,
480
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
481
+ };
482
+ this.yytext += match[0];
483
+ this.match += match[0];
484
+ this.matches = match;
485
+ this.yyleng = this.yytext.length;
486
+ if (this.options.ranges) {
487
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
488
+ }
489
+ this._more = false;
490
+ this._backtrack = false;
491
+ this._input = this._input.slice(match[0].length);
492
+ this.matched += match[0];
493
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
494
+ if (this.done && this._input) {
495
+ this.done = false;
496
+ }
497
+ if (token) {
498
+ return token;
499
+ } else if (this._backtrack) {
500
+ for (var k in backup) {
501
+ this[k] = backup[k];
502
+ }
503
+ return false;
504
+ }
505
+ return false;
506
+ }, "test_match"),
507
+ // return next match in input
508
+ next: /* @__PURE__ */ __name(function() {
509
+ if (this.done) {
510
+ return this.EOF;
511
+ }
512
+ if (!this._input) {
513
+ this.done = true;
514
+ }
515
+ var token, match, tempMatch, index;
516
+ if (!this._more) {
517
+ this.yytext = "";
518
+ this.match = "";
519
+ }
520
+ var rules = this._currentRules();
521
+ for (var i = 0; i < rules.length; i++) {
522
+ tempMatch = this._input.match(this.rules[rules[i]]);
523
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
524
+ match = tempMatch;
525
+ index = i;
526
+ if (this.options.backtrack_lexer) {
527
+ token = this.test_match(tempMatch, rules[i]);
528
+ if (token !== false) {
529
+ return token;
530
+ } else if (this._backtrack) {
531
+ match = false;
532
+ continue;
533
+ } else {
534
+ return false;
535
+ }
536
+ } else if (!this.options.flex) {
537
+ break;
538
+ }
539
+ }
540
+ }
541
+ if (match) {
542
+ token = this.test_match(match, rules[index]);
543
+ if (token !== false) {
544
+ return token;
545
+ }
546
+ return false;
547
+ }
548
+ if (this._input === "") {
549
+ return this.EOF;
550
+ } else {
551
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
552
+ text: "",
553
+ token: null,
554
+ line: this.yylineno
555
+ });
556
+ }
557
+ }, "next"),
558
+ // return next match that has a token
559
+ lex: /* @__PURE__ */ __name(function lex() {
560
+ var r = this.next();
561
+ if (r) {
562
+ return r;
563
+ } else {
564
+ return this.lex();
565
+ }
566
+ }, "lex"),
567
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
568
+ begin: /* @__PURE__ */ __name(function begin(condition) {
569
+ this.conditionStack.push(condition);
570
+ }, "begin"),
571
+ // pop the previously active lexer condition state off the condition stack
572
+ popState: /* @__PURE__ */ __name(function popState() {
573
+ var n = this.conditionStack.length - 1;
574
+ if (n > 0) {
575
+ return this.conditionStack.pop();
576
+ } else {
577
+ return this.conditionStack[0];
578
+ }
579
+ }, "popState"),
580
+ // produce the lexer rule set which is active for the currently active lexer condition state
581
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
582
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
583
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
584
+ } else {
585
+ return this.conditions["INITIAL"].rules;
586
+ }
587
+ }, "_currentRules"),
588
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
589
+ topState: /* @__PURE__ */ __name(function topState(n) {
590
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
591
+ if (n >= 0) {
592
+ return this.conditionStack[n];
593
+ } else {
594
+ return "INITIAL";
595
+ }
596
+ }, "topState"),
597
+ // alias for begin(condition)
598
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
599
+ this.begin(condition);
600
+ }, "pushState"),
601
+ // return the number of states currently on the stack
602
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
603
+ return this.conditionStack.length;
604
+ }, "stateStackSize"),
605
+ options: { "case-insensitive": true },
606
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
607
+ switch ($avoiding_name_collisions) {
608
+ case 0:
609
+ break;
610
+ case 1:
611
+ break;
612
+ case 2:
613
+ this.popState();
614
+ return 34;
615
+ case 3:
616
+ this.popState();
617
+ return 34;
618
+ case 4:
619
+ return 34;
620
+ case 5:
621
+ break;
622
+ case 6:
623
+ return 10;
624
+ case 7:
625
+ this.pushState("acc_title");
626
+ return 19;
627
+ case 8:
628
+ this.popState();
629
+ return "acc_title_value";
630
+ case 9:
631
+ this.pushState("acc_descr");
632
+ return 21;
633
+ case 10:
634
+ this.popState();
635
+ return "acc_descr_value";
636
+ case 11:
637
+ this.pushState("acc_descr_multiline");
638
+ break;
639
+ case 12:
640
+ this.popState();
641
+ break;
642
+ case 13:
643
+ return "acc_descr_multiline_value";
644
+ case 14:
645
+ return 5;
646
+ case 15:
647
+ return 8;
648
+ case 16:
649
+ this.pushState("axis_data");
650
+ return "X_AXIS";
651
+ case 17:
652
+ this.pushState("axis_data");
653
+ return "Y_AXIS";
654
+ case 18:
655
+ this.pushState("axis_band_data");
656
+ return 24;
657
+ case 19:
658
+ return 31;
659
+ case 20:
660
+ this.pushState("data");
661
+ return 16;
662
+ case 21:
663
+ this.pushState("data");
664
+ return 18;
665
+ case 22:
666
+ this.pushState("data_inner");
667
+ return 24;
668
+ case 23:
669
+ return 27;
670
+ case 24:
671
+ this.popState();
672
+ return 26;
673
+ case 25:
674
+ this.popState();
675
+ break;
676
+ case 26:
677
+ this.pushState("string");
678
+ break;
679
+ case 27:
680
+ this.popState();
681
+ break;
682
+ case 28:
683
+ return "STR";
684
+ case 29:
685
+ return 24;
686
+ case 30:
687
+ return 26;
688
+ case 31:
689
+ return 43;
690
+ case 32:
691
+ return "COLON";
692
+ case 33:
693
+ return 44;
694
+ case 34:
695
+ return 28;
696
+ case 35:
697
+ return 45;
698
+ case 36:
699
+ return 46;
700
+ case 37:
701
+ return 48;
702
+ case 38:
703
+ return 50;
704
+ case 39:
705
+ return 47;
706
+ case 40:
707
+ return 41;
708
+ case 41:
709
+ return 49;
710
+ case 42:
711
+ return 42;
712
+ case 43:
713
+ break;
714
+ case 44:
715
+ return 35;
716
+ case 45:
717
+ return 36;
718
+ }
719
+ }, "anonymous"),
720
+ rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:(\r?\n))/i, /^(?:(\r?\n))/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:\{)/i, /^(?:[^\}]*)/i, /^(?:xychart-beta\b)/i, /^(?:(?:vertical|horizontal))/i, /^(?:x-axis\b)/i, /^(?:y-axis\b)/i, /^(?:\[)/i, /^(?:-->)/i, /^(?:line\b)/i, /^(?:bar\b)/i, /^(?:\[)/i, /^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i, /^(?:\])/i, /^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s+)/i, /^(?:;)/i, /^(?:$)/i],
721
+ conditions: { "data_inner": { "rules": [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "data": { "rules": [0, 1, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 22, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "axis_band_data": { "rules": [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "axis_data": { "rules": [0, 1, 2, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19, 20, 21, 23, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true }, "acc_descr_multiline": { "rules": [12, 13], "inclusive": false }, "acc_descr": { "rules": [10], "inclusive": false }, "acc_title": { "rules": [8], "inclusive": false }, "title": { "rules": [], "inclusive": false }, "md_string": { "rules": [], "inclusive": false }, "string": { "rules": [27, 28], "inclusive": false }, "INITIAL": { "rules": [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "inclusive": true } }
722
+ };
723
+ return lexer2;
724
+ }();
725
+ parser2.lexer = lexer;
726
+ function Parser() {
727
+ this.yy = {};
728
+ }
729
+ __name(Parser, "Parser");
730
+ Parser.prototype = parser2;
731
+ parser2.Parser = Parser;
732
+ return new Parser();
733
+ }();
734
+ parser.parser = parser;
735
+ var xychart_default = parser;
736
+ function isBarPlot(data) {
737
+ return data.type === "bar";
738
+ }
739
+ __name(isBarPlot, "isBarPlot");
740
+ function isBandAxisData(data) {
741
+ return data.type === "band";
742
+ }
743
+ __name(isBandAxisData, "isBandAxisData");
744
+ function isLinearAxisData(data) {
745
+ return data.type === "linear";
746
+ }
747
+ __name(isLinearAxisData, "isLinearAxisData");
748
+ var TextDimensionCalculatorWithFont = (_a = class {
749
+ constructor(parentGroup) {
750
+ this.parentGroup = parentGroup;
751
+ }
752
+ getMaxDimension(texts, fontSize) {
753
+ if (!this.parentGroup) {
754
+ return {
755
+ width: texts.reduce((acc, cur) => Math.max(cur.length, acc), 0) * fontSize,
756
+ height: fontSize
757
+ };
758
+ }
759
+ const dimension = {
760
+ width: 0,
761
+ height: 0
762
+ };
763
+ const elem = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", fontSize);
764
+ for (const t of texts) {
765
+ const bbox = computeDimensionOfText(elem, 1, t);
766
+ const width = bbox ? bbox.width : t.length * fontSize;
767
+ const height = bbox ? bbox.height : fontSize;
768
+ dimension.width = Math.max(dimension.width, width);
769
+ dimension.height = Math.max(dimension.height, height);
770
+ }
771
+ elem.remove();
772
+ return dimension;
773
+ }
774
+ }, __name(_a, "TextDimensionCalculatorWithFont"), _a);
775
+ var BAR_WIDTH_TO_TICK_WIDTH_RATIO = 0.7;
776
+ var MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL = 0.2;
777
+ var BaseAxis = (_b = class {
778
+ constructor(axisConfig, title, textDimensionCalculator, axisThemeConfig) {
779
+ this.axisConfig = axisConfig;
780
+ this.title = title;
781
+ this.textDimensionCalculator = textDimensionCalculator;
782
+ this.axisThemeConfig = axisThemeConfig;
783
+ this.boundingRect = { x: 0, y: 0, width: 0, height: 0 };
784
+ this.axisPosition = "left";
785
+ this.showTitle = false;
786
+ this.showLabel = false;
787
+ this.showTick = false;
788
+ this.showAxisLine = false;
789
+ this.outerPadding = 0;
790
+ this.titleTextHeight = 0;
791
+ this.labelTextHeight = 0;
792
+ this.range = [0, 10];
793
+ this.boundingRect = { x: 0, y: 0, width: 0, height: 0 };
794
+ this.axisPosition = "left";
795
+ }
796
+ setRange(range2) {
797
+ this.range = range2;
798
+ if (this.axisPosition === "left" || this.axisPosition === "right") {
799
+ this.boundingRect.height = range2[1] - range2[0];
800
+ } else {
801
+ this.boundingRect.width = range2[1] - range2[0];
802
+ }
803
+ this.recalculateScale();
804
+ }
805
+ getRange() {
806
+ return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding];
807
+ }
808
+ setAxisPosition(axisPosition) {
809
+ this.axisPosition = axisPosition;
810
+ this.setRange(this.range);
811
+ }
812
+ getTickDistance() {
813
+ const range2 = this.getRange();
814
+ return Math.abs(range2[0] - range2[1]) / this.getTickValues().length;
815
+ }
816
+ getAxisOuterPadding() {
817
+ return this.outerPadding;
818
+ }
819
+ getLabelDimension() {
820
+ return this.textDimensionCalculator.getMaxDimension(
821
+ this.getTickValues().map((tick) => tick.toString()),
822
+ this.axisConfig.labelFontSize
823
+ );
824
+ }
825
+ recalculateOuterPaddingToDrawBar() {
826
+ if (BAR_WIDTH_TO_TICK_WIDTH_RATIO * this.getTickDistance() > this.outerPadding * 2) {
827
+ this.outerPadding = Math.floor(BAR_WIDTH_TO_TICK_WIDTH_RATIO * this.getTickDistance() / 2);
828
+ }
829
+ this.recalculateScale();
830
+ }
831
+ calculateSpaceIfDrawnHorizontally(availableSpace) {
832
+ let availableHeight = availableSpace.height;
833
+ if (this.axisConfig.showAxisLine && availableHeight > this.axisConfig.axisLineWidth) {
834
+ availableHeight -= this.axisConfig.axisLineWidth;
835
+ this.showAxisLine = true;
836
+ }
837
+ if (this.axisConfig.showLabel) {
838
+ const spaceRequired = this.getLabelDimension();
839
+ const maxPadding = MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL * availableSpace.width;
840
+ this.outerPadding = Math.min(spaceRequired.width / 2, maxPadding);
841
+ const heightRequired = spaceRequired.height + this.axisConfig.labelPadding * 2;
842
+ this.labelTextHeight = spaceRequired.height;
843
+ if (heightRequired <= availableHeight) {
844
+ availableHeight -= heightRequired;
845
+ this.showLabel = true;
846
+ }
847
+ }
848
+ if (this.axisConfig.showTick && availableHeight >= this.axisConfig.tickLength) {
849
+ this.showTick = true;
850
+ availableHeight -= this.axisConfig.tickLength;
851
+ }
852
+ if (this.axisConfig.showTitle && this.title) {
853
+ const spaceRequired = this.textDimensionCalculator.getMaxDimension(
854
+ [this.title],
855
+ this.axisConfig.titleFontSize
856
+ );
857
+ const heightRequired = spaceRequired.height + this.axisConfig.titlePadding * 2;
858
+ this.titleTextHeight = spaceRequired.height;
859
+ if (heightRequired <= availableHeight) {
860
+ availableHeight -= heightRequired;
861
+ this.showTitle = true;
862
+ }
863
+ }
864
+ this.boundingRect.width = availableSpace.width;
865
+ this.boundingRect.height = availableSpace.height - availableHeight;
866
+ }
867
+ calculateSpaceIfDrawnVertical(availableSpace) {
868
+ let availableWidth = availableSpace.width;
869
+ if (this.axisConfig.showAxisLine && availableWidth > this.axisConfig.axisLineWidth) {
870
+ availableWidth -= this.axisConfig.axisLineWidth;
871
+ this.showAxisLine = true;
872
+ }
873
+ if (this.axisConfig.showLabel) {
874
+ const spaceRequired = this.getLabelDimension();
875
+ const maxPadding = MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL * availableSpace.height;
876
+ this.outerPadding = Math.min(spaceRequired.height / 2, maxPadding);
877
+ const widthRequired = spaceRequired.width + this.axisConfig.labelPadding * 2;
878
+ if (widthRequired <= availableWidth) {
879
+ availableWidth -= widthRequired;
880
+ this.showLabel = true;
881
+ }
882
+ }
883
+ if (this.axisConfig.showTick && availableWidth >= this.axisConfig.tickLength) {
884
+ this.showTick = true;
885
+ availableWidth -= this.axisConfig.tickLength;
886
+ }
887
+ if (this.axisConfig.showTitle && this.title) {
888
+ const spaceRequired = this.textDimensionCalculator.getMaxDimension(
889
+ [this.title],
890
+ this.axisConfig.titleFontSize
891
+ );
892
+ const widthRequired = spaceRequired.height + this.axisConfig.titlePadding * 2;
893
+ this.titleTextHeight = spaceRequired.height;
894
+ if (widthRequired <= availableWidth) {
895
+ availableWidth -= widthRequired;
896
+ this.showTitle = true;
897
+ }
898
+ }
899
+ this.boundingRect.width = availableSpace.width - availableWidth;
900
+ this.boundingRect.height = availableSpace.height;
901
+ }
902
+ calculateSpace(availableSpace) {
903
+ if (this.axisPosition === "left" || this.axisPosition === "right") {
904
+ this.calculateSpaceIfDrawnVertical(availableSpace);
905
+ } else {
906
+ this.calculateSpaceIfDrawnHorizontally(availableSpace);
907
+ }
908
+ this.recalculateScale();
909
+ return {
910
+ width: this.boundingRect.width,
911
+ height: this.boundingRect.height
912
+ };
913
+ }
914
+ setBoundingBoxXY(point) {
915
+ this.boundingRect.x = point.x;
916
+ this.boundingRect.y = point.y;
917
+ }
918
+ getDrawableElementsForLeftAxis() {
919
+ const drawableElement = [];
920
+ if (this.showAxisLine) {
921
+ const x = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2;
922
+ drawableElement.push({
923
+ type: "path",
924
+ groupTexts: ["left-axis", "axisl-line"],
925
+ data: [
926
+ {
927
+ path: `M ${x},${this.boundingRect.y} L ${x},${this.boundingRect.y + this.boundingRect.height} `,
928
+ strokeFill: this.axisThemeConfig.axisLineColor,
929
+ strokeWidth: this.axisConfig.axisLineWidth
930
+ }
931
+ ]
932
+ });
933
+ }
934
+ if (this.showLabel) {
935
+ drawableElement.push({
936
+ type: "text",
937
+ groupTexts: ["left-axis", "label"],
938
+ data: this.getTickValues().map((tick) => ({
939
+ text: tick.toString(),
940
+ 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),
941
+ y: this.getScaleValue(tick),
942
+ fill: this.axisThemeConfig.labelColor,
943
+ fontSize: this.axisConfig.labelFontSize,
944
+ rotation: 0,
945
+ verticalPos: "middle",
946
+ horizontalPos: "right"
947
+ }))
948
+ });
949
+ }
950
+ if (this.showTick) {
951
+ const x = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
952
+ drawableElement.push({
953
+ type: "path",
954
+ groupTexts: ["left-axis", "ticks"],
955
+ data: this.getTickValues().map((tick) => ({
956
+ path: `M ${x},${this.getScaleValue(tick)} L ${x - this.axisConfig.tickLength},${this.getScaleValue(tick)}`,
957
+ strokeFill: this.axisThemeConfig.tickColor,
958
+ strokeWidth: this.axisConfig.tickWidth
959
+ }))
960
+ });
961
+ }
962
+ if (this.showTitle) {
963
+ drawableElement.push({
964
+ type: "text",
965
+ groupTexts: ["left-axis", "title"],
966
+ data: [
967
+ {
968
+ text: this.title,
969
+ x: this.boundingRect.x + this.axisConfig.titlePadding,
970
+ y: this.boundingRect.y + this.boundingRect.height / 2,
971
+ fill: this.axisThemeConfig.titleColor,
972
+ fontSize: this.axisConfig.titleFontSize,
973
+ rotation: 270,
974
+ verticalPos: "top",
975
+ horizontalPos: "center"
976
+ }
977
+ ]
978
+ });
979
+ }
980
+ return drawableElement;
981
+ }
982
+ getDrawableElementsForBottomAxis() {
983
+ const drawableElement = [];
984
+ if (this.showAxisLine) {
985
+ const y = this.boundingRect.y + this.axisConfig.axisLineWidth / 2;
986
+ drawableElement.push({
987
+ type: "path",
988
+ groupTexts: ["bottom-axis", "axis-line"],
989
+ data: [
990
+ {
991
+ path: `M ${this.boundingRect.x},${y} L ${this.boundingRect.x + this.boundingRect.width},${y}`,
992
+ strokeFill: this.axisThemeConfig.axisLineColor,
993
+ strokeWidth: this.axisConfig.axisLineWidth
994
+ }
995
+ ]
996
+ });
997
+ }
998
+ if (this.showLabel) {
999
+ drawableElement.push({
1000
+ type: "text",
1001
+ groupTexts: ["bottom-axis", "label"],
1002
+ data: this.getTickValues().map((tick) => ({
1003
+ text: tick.toString(),
1004
+ x: this.getScaleValue(tick),
1005
+ y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
1006
+ fill: this.axisThemeConfig.labelColor,
1007
+ fontSize: this.axisConfig.labelFontSize,
1008
+ rotation: 0,
1009
+ verticalPos: "top",
1010
+ horizontalPos: "center"
1011
+ }))
1012
+ });
1013
+ }
1014
+ if (this.showTick) {
1015
+ const y = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
1016
+ drawableElement.push({
1017
+ type: "path",
1018
+ groupTexts: ["bottom-axis", "ticks"],
1019
+ data: this.getTickValues().map((tick) => ({
1020
+ path: `M ${this.getScaleValue(tick)},${y} L ${this.getScaleValue(tick)},${y + this.axisConfig.tickLength}`,
1021
+ strokeFill: this.axisThemeConfig.tickColor,
1022
+ strokeWidth: this.axisConfig.tickWidth
1023
+ }))
1024
+ });
1025
+ }
1026
+ if (this.showTitle) {
1027
+ drawableElement.push({
1028
+ type: "text",
1029
+ groupTexts: ["bottom-axis", "title"],
1030
+ data: [
1031
+ {
1032
+ text: this.title,
1033
+ x: this.range[0] + (this.range[1] - this.range[0]) / 2,
1034
+ y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight,
1035
+ fill: this.axisThemeConfig.titleColor,
1036
+ fontSize: this.axisConfig.titleFontSize,
1037
+ rotation: 0,
1038
+ verticalPos: "top",
1039
+ horizontalPos: "center"
1040
+ }
1041
+ ]
1042
+ });
1043
+ }
1044
+ return drawableElement;
1045
+ }
1046
+ getDrawableElementsForTopAxis() {
1047
+ const drawableElement = [];
1048
+ if (this.showAxisLine) {
1049
+ const y = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2;
1050
+ drawableElement.push({
1051
+ type: "path",
1052
+ groupTexts: ["top-axis", "axis-line"],
1053
+ data: [
1054
+ {
1055
+ path: `M ${this.boundingRect.x},${y} L ${this.boundingRect.x + this.boundingRect.width},${y}`,
1056
+ strokeFill: this.axisThemeConfig.axisLineColor,
1057
+ strokeWidth: this.axisConfig.axisLineWidth
1058
+ }
1059
+ ]
1060
+ });
1061
+ }
1062
+ if (this.showLabel) {
1063
+ drawableElement.push({
1064
+ type: "text",
1065
+ groupTexts: ["top-axis", "label"],
1066
+ data: this.getTickValues().map((tick) => ({
1067
+ text: tick.toString(),
1068
+ x: this.getScaleValue(tick),
1069
+ y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding,
1070
+ fill: this.axisThemeConfig.labelColor,
1071
+ fontSize: this.axisConfig.labelFontSize,
1072
+ rotation: 0,
1073
+ verticalPos: "top",
1074
+ horizontalPos: "center"
1075
+ }))
1076
+ });
1077
+ }
1078
+ if (this.showTick) {
1079
+ const y = this.boundingRect.y;
1080
+ drawableElement.push({
1081
+ type: "path",
1082
+ groupTexts: ["top-axis", "ticks"],
1083
+ data: this.getTickValues().map((tick) => ({
1084
+ 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)}`,
1085
+ strokeFill: this.axisThemeConfig.tickColor,
1086
+ strokeWidth: this.axisConfig.tickWidth
1087
+ }))
1088
+ });
1089
+ }
1090
+ if (this.showTitle) {
1091
+ drawableElement.push({
1092
+ type: "text",
1093
+ groupTexts: ["top-axis", "title"],
1094
+ data: [
1095
+ {
1096
+ text: this.title,
1097
+ x: this.boundingRect.x + this.boundingRect.width / 2,
1098
+ y: this.boundingRect.y + this.axisConfig.titlePadding,
1099
+ fill: this.axisThemeConfig.titleColor,
1100
+ fontSize: this.axisConfig.titleFontSize,
1101
+ rotation: 0,
1102
+ verticalPos: "top",
1103
+ horizontalPos: "center"
1104
+ }
1105
+ ]
1106
+ });
1107
+ }
1108
+ return drawableElement;
1109
+ }
1110
+ getDrawableElements() {
1111
+ if (this.axisPosition === "left") {
1112
+ return this.getDrawableElementsForLeftAxis();
1113
+ }
1114
+ if (this.axisPosition === "right") {
1115
+ throw Error("Drawing of right axis is not implemented");
1116
+ }
1117
+ if (this.axisPosition === "bottom") {
1118
+ return this.getDrawableElementsForBottomAxis();
1119
+ }
1120
+ if (this.axisPosition === "top") {
1121
+ return this.getDrawableElementsForTopAxis();
1122
+ }
1123
+ return [];
1124
+ }
1125
+ }, __name(_b, "BaseAxis"), _b);
1126
+ var BandAxis = (_c = class extends BaseAxis {
1127
+ constructor(axisConfig, axisThemeConfig, categories, title, textDimensionCalculator) {
1128
+ super(axisConfig, title, textDimensionCalculator, axisThemeConfig);
1129
+ this.categories = categories;
1130
+ this.scale = band().domain(this.categories).range(this.getRange());
1131
+ }
1132
+ setRange(range2) {
1133
+ super.setRange(range2);
1134
+ }
1135
+ recalculateScale() {
1136
+ this.scale = band().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5);
1137
+ log.trace("BandAxis axis final categories, range: ", this.categories, this.getRange());
1138
+ }
1139
+ getTickValues() {
1140
+ return this.categories;
1141
+ }
1142
+ getScaleValue(value) {
1143
+ return this.scale(value) ?? this.getRange()[0];
1144
+ }
1145
+ }, __name(_c, "BandAxis"), _c);
1146
+ var LinearAxis = (_d = class extends BaseAxis {
1147
+ constructor(axisConfig, axisThemeConfig, domain, title, textDimensionCalculator) {
1148
+ super(axisConfig, title, textDimensionCalculator, axisThemeConfig);
1149
+ this.domain = domain;
1150
+ this.scale = linear().domain(this.domain).range(this.getRange());
1151
+ }
1152
+ getTickValues() {
1153
+ return this.scale.ticks();
1154
+ }
1155
+ recalculateScale() {
1156
+ const domain = [...this.domain];
1157
+ if (this.axisPosition === "left") {
1158
+ domain.reverse();
1159
+ }
1160
+ this.scale = linear().domain(domain).range(this.getRange());
1161
+ }
1162
+ getScaleValue(value) {
1163
+ return this.scale(value);
1164
+ }
1165
+ }, __name(_d, "LinearAxis"), _d);
1166
+ function getAxis(data, axisConfig, axisThemeConfig, tmpSVGGroup2) {
1167
+ const textDimensionCalculator = new TextDimensionCalculatorWithFont(tmpSVGGroup2);
1168
+ if (isBandAxisData(data)) {
1169
+ return new BandAxis(
1170
+ axisConfig,
1171
+ axisThemeConfig,
1172
+ data.categories,
1173
+ data.title,
1174
+ textDimensionCalculator
1175
+ );
1176
+ }
1177
+ return new LinearAxis(
1178
+ axisConfig,
1179
+ axisThemeConfig,
1180
+ [data.min, data.max],
1181
+ data.title,
1182
+ textDimensionCalculator
1183
+ );
1184
+ }
1185
+ __name(getAxis, "getAxis");
1186
+ var ChartTitle = (_e = class {
1187
+ constructor(textDimensionCalculator, chartConfig, chartData, chartThemeConfig) {
1188
+ this.textDimensionCalculator = textDimensionCalculator;
1189
+ this.chartConfig = chartConfig;
1190
+ this.chartData = chartData;
1191
+ this.chartThemeConfig = chartThemeConfig;
1192
+ this.boundingRect = {
1193
+ x: 0,
1194
+ y: 0,
1195
+ width: 0,
1196
+ height: 0
1197
+ };
1198
+ this.showChartTitle = false;
1199
+ }
1200
+ setBoundingBoxXY(point) {
1201
+ this.boundingRect.x = point.x;
1202
+ this.boundingRect.y = point.y;
1203
+ }
1204
+ calculateSpace(availableSpace) {
1205
+ const titleDimension = this.textDimensionCalculator.getMaxDimension(
1206
+ [this.chartData.title],
1207
+ this.chartConfig.titleFontSize
1208
+ );
1209
+ const widthRequired = Math.max(titleDimension.width, availableSpace.width);
1210
+ const heightRequired = titleDimension.height + 2 * this.chartConfig.titlePadding;
1211
+ if (titleDimension.width <= widthRequired && titleDimension.height <= heightRequired && this.chartConfig.showTitle && this.chartData.title) {
1212
+ this.boundingRect.width = widthRequired;
1213
+ this.boundingRect.height = heightRequired;
1214
+ this.showChartTitle = true;
1215
+ }
1216
+ return {
1217
+ width: this.boundingRect.width,
1218
+ height: this.boundingRect.height
1219
+ };
1220
+ }
1221
+ getDrawableElements() {
1222
+ const drawableElem = [];
1223
+ if (this.showChartTitle) {
1224
+ drawableElem.push({
1225
+ groupTexts: ["chart-title"],
1226
+ type: "text",
1227
+ data: [
1228
+ {
1229
+ fontSize: this.chartConfig.titleFontSize,
1230
+ text: this.chartData.title,
1231
+ verticalPos: "middle",
1232
+ horizontalPos: "center",
1233
+ x: this.boundingRect.x + this.boundingRect.width / 2,
1234
+ y: this.boundingRect.y + this.boundingRect.height / 2,
1235
+ fill: this.chartThemeConfig.titleColor,
1236
+ rotation: 0
1237
+ }
1238
+ ]
1239
+ });
1240
+ }
1241
+ return drawableElem;
1242
+ }
1243
+ }, __name(_e, "ChartTitle"), _e);
1244
+ function getChartTitleComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2) {
1245
+ const textDimensionCalculator = new TextDimensionCalculatorWithFont(tmpSVGGroup2);
1246
+ return new ChartTitle(textDimensionCalculator, chartConfig, chartData, chartThemeConfig);
1247
+ }
1248
+ __name(getChartTitleComponent, "getChartTitleComponent");
1249
+ var LinePlot = (_f = class {
1250
+ constructor(plotData, xAxis, yAxis, orientation, plotIndex2) {
1251
+ this.plotData = plotData;
1252
+ this.xAxis = xAxis;
1253
+ this.yAxis = yAxis;
1254
+ this.orientation = orientation;
1255
+ this.plotIndex = plotIndex2;
1256
+ }
1257
+ getDrawableElement() {
1258
+ const finalData = this.plotData.data.map((d) => [
1259
+ this.xAxis.getScaleValue(d[0]),
1260
+ this.yAxis.getScaleValue(d[1])
1261
+ ]);
1262
+ let path;
1263
+ if (this.orientation === "horizontal") {
1264
+ path = line$1().y((d) => d[0]).x((d) => d[1])(finalData);
1265
+ } else {
1266
+ path = line$1().x((d) => d[0]).y((d) => d[1])(finalData);
1267
+ }
1268
+ if (!path) {
1269
+ return [];
1270
+ }
1271
+ return [
1272
+ {
1273
+ groupTexts: ["plot", `line-plot-${this.plotIndex}`],
1274
+ type: "path",
1275
+ data: [
1276
+ {
1277
+ path,
1278
+ strokeFill: this.plotData.strokeFill,
1279
+ strokeWidth: this.plotData.strokeWidth
1280
+ }
1281
+ ]
1282
+ }
1283
+ ];
1284
+ }
1285
+ }, __name(_f, "LinePlot"), _f);
1286
+ var BarPlot = (_g = class {
1287
+ constructor(barData, boundingRect, xAxis, yAxis, orientation, plotIndex2) {
1288
+ this.barData = barData;
1289
+ this.boundingRect = boundingRect;
1290
+ this.xAxis = xAxis;
1291
+ this.yAxis = yAxis;
1292
+ this.orientation = orientation;
1293
+ this.plotIndex = plotIndex2;
1294
+ }
1295
+ getDrawableElement() {
1296
+ const finalData = this.barData.data.map((d) => [
1297
+ this.xAxis.getScaleValue(d[0]),
1298
+ this.yAxis.getScaleValue(d[1])
1299
+ ]);
1300
+ const barPaddingPercent = 0.05;
1301
+ const barWidth = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * (1 - barPaddingPercent);
1302
+ const barWidthHalf = barWidth / 2;
1303
+ if (this.orientation === "horizontal") {
1304
+ return [
1305
+ {
1306
+ groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
1307
+ type: "rect",
1308
+ data: finalData.map((data) => ({
1309
+ x: this.boundingRect.x,
1310
+ y: data[0] - barWidthHalf,
1311
+ height: barWidth,
1312
+ width: data[1] - this.boundingRect.x,
1313
+ fill: this.barData.fill,
1314
+ strokeWidth: 0,
1315
+ strokeFill: this.barData.fill
1316
+ }))
1317
+ }
1318
+ ];
1319
+ }
1320
+ return [
1321
+ {
1322
+ groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
1323
+ type: "rect",
1324
+ data: finalData.map((data) => ({
1325
+ x: data[0] - barWidthHalf,
1326
+ y: data[1],
1327
+ width: barWidth,
1328
+ height: this.boundingRect.y + this.boundingRect.height - data[1],
1329
+ fill: this.barData.fill,
1330
+ strokeWidth: 0,
1331
+ strokeFill: this.barData.fill
1332
+ }))
1333
+ }
1334
+ ];
1335
+ }
1336
+ }, __name(_g, "BarPlot"), _g);
1337
+ var BasePlot = (_h = class {
1338
+ constructor(chartConfig, chartData, chartThemeConfig) {
1339
+ this.chartConfig = chartConfig;
1340
+ this.chartData = chartData;
1341
+ this.chartThemeConfig = chartThemeConfig;
1342
+ this.boundingRect = {
1343
+ x: 0,
1344
+ y: 0,
1345
+ width: 0,
1346
+ height: 0
1347
+ };
1348
+ }
1349
+ setAxes(xAxis, yAxis) {
1350
+ this.xAxis = xAxis;
1351
+ this.yAxis = yAxis;
1352
+ }
1353
+ setBoundingBoxXY(point) {
1354
+ this.boundingRect.x = point.x;
1355
+ this.boundingRect.y = point.y;
1356
+ }
1357
+ calculateSpace(availableSpace) {
1358
+ this.boundingRect.width = availableSpace.width;
1359
+ this.boundingRect.height = availableSpace.height;
1360
+ return {
1361
+ width: this.boundingRect.width,
1362
+ height: this.boundingRect.height
1363
+ };
1364
+ }
1365
+ getDrawableElements() {
1366
+ if (!(this.xAxis && this.yAxis)) {
1367
+ throw Error("Axes must be passed to render Plots");
1368
+ }
1369
+ const drawableElem = [];
1370
+ for (const [i, plot] of this.chartData.plots.entries()) {
1371
+ switch (plot.type) {
1372
+ case "line":
1373
+ {
1374
+ const linePlot = new LinePlot(
1375
+ plot,
1376
+ this.xAxis,
1377
+ this.yAxis,
1378
+ this.chartConfig.chartOrientation,
1379
+ i
1380
+ );
1381
+ drawableElem.push(...linePlot.getDrawableElement());
1382
+ }
1383
+ break;
1384
+ case "bar":
1385
+ {
1386
+ const barPlot = new BarPlot(
1387
+ plot,
1388
+ this.boundingRect,
1389
+ this.xAxis,
1390
+ this.yAxis,
1391
+ this.chartConfig.chartOrientation,
1392
+ i
1393
+ );
1394
+ drawableElem.push(...barPlot.getDrawableElement());
1395
+ }
1396
+ break;
1397
+ }
1398
+ }
1399
+ return drawableElem;
1400
+ }
1401
+ }, __name(_h, "BasePlot"), _h);
1402
+ function getPlotComponent(chartConfig, chartData, chartThemeConfig) {
1403
+ return new BasePlot(chartConfig, chartData, chartThemeConfig);
1404
+ }
1405
+ __name(getPlotComponent, "getPlotComponent");
1406
+ var Orchestrator = (_i = class {
1407
+ constructor(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2) {
1408
+ this.chartConfig = chartConfig;
1409
+ this.chartData = chartData;
1410
+ this.componentStore = {
1411
+ title: getChartTitleComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2),
1412
+ plot: getPlotComponent(chartConfig, chartData, chartThemeConfig),
1413
+ xAxis: getAxis(
1414
+ chartData.xAxis,
1415
+ chartConfig.xAxis,
1416
+ {
1417
+ titleColor: chartThemeConfig.xAxisTitleColor,
1418
+ labelColor: chartThemeConfig.xAxisLabelColor,
1419
+ tickColor: chartThemeConfig.xAxisTickColor,
1420
+ axisLineColor: chartThemeConfig.xAxisLineColor
1421
+ },
1422
+ tmpSVGGroup2
1423
+ ),
1424
+ yAxis: getAxis(
1425
+ chartData.yAxis,
1426
+ chartConfig.yAxis,
1427
+ {
1428
+ titleColor: chartThemeConfig.yAxisTitleColor,
1429
+ labelColor: chartThemeConfig.yAxisLabelColor,
1430
+ tickColor: chartThemeConfig.yAxisTickColor,
1431
+ axisLineColor: chartThemeConfig.yAxisLineColor
1432
+ },
1433
+ tmpSVGGroup2
1434
+ )
1435
+ };
1436
+ }
1437
+ calculateVerticalSpace() {
1438
+ let availableWidth = this.chartConfig.width;
1439
+ let availableHeight = this.chartConfig.height;
1440
+ let plotX = 0;
1441
+ let plotY = 0;
1442
+ let chartWidth = Math.floor(availableWidth * this.chartConfig.plotReservedSpacePercent / 100);
1443
+ let chartHeight = Math.floor(
1444
+ availableHeight * this.chartConfig.plotReservedSpacePercent / 100
1445
+ );
1446
+ let spaceUsed = this.componentStore.plot.calculateSpace({
1447
+ width: chartWidth,
1448
+ height: chartHeight
1449
+ });
1450
+ availableWidth -= spaceUsed.width;
1451
+ availableHeight -= spaceUsed.height;
1452
+ spaceUsed = this.componentStore.title.calculateSpace({
1453
+ width: this.chartConfig.width,
1454
+ height: availableHeight
1455
+ });
1456
+ plotY = spaceUsed.height;
1457
+ availableHeight -= spaceUsed.height;
1458
+ this.componentStore.xAxis.setAxisPosition("bottom");
1459
+ spaceUsed = this.componentStore.xAxis.calculateSpace({
1460
+ width: availableWidth,
1461
+ height: availableHeight
1462
+ });
1463
+ availableHeight -= spaceUsed.height;
1464
+ this.componentStore.yAxis.setAxisPosition("left");
1465
+ spaceUsed = this.componentStore.yAxis.calculateSpace({
1466
+ width: availableWidth,
1467
+ height: availableHeight
1468
+ });
1469
+ plotX = spaceUsed.width;
1470
+ availableWidth -= spaceUsed.width;
1471
+ if (availableWidth > 0) {
1472
+ chartWidth += availableWidth;
1473
+ availableWidth = 0;
1474
+ }
1475
+ if (availableHeight > 0) {
1476
+ chartHeight += availableHeight;
1477
+ availableHeight = 0;
1478
+ }
1479
+ this.componentStore.plot.calculateSpace({
1480
+ width: chartWidth,
1481
+ height: chartHeight
1482
+ });
1483
+ this.componentStore.plot.setBoundingBoxXY({ x: plotX, y: plotY });
1484
+ this.componentStore.xAxis.setRange([plotX, plotX + chartWidth]);
1485
+ this.componentStore.xAxis.setBoundingBoxXY({ x: plotX, y: plotY + chartHeight });
1486
+ this.componentStore.yAxis.setRange([plotY, plotY + chartHeight]);
1487
+ this.componentStore.yAxis.setBoundingBoxXY({ x: 0, y: plotY });
1488
+ if (this.chartData.plots.some((p) => isBarPlot(p))) {
1489
+ this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1490
+ }
1491
+ }
1492
+ calculateHorizontalSpace() {
1493
+ let availableWidth = this.chartConfig.width;
1494
+ let availableHeight = this.chartConfig.height;
1495
+ let titleYEnd = 0;
1496
+ let plotX = 0;
1497
+ let plotY = 0;
1498
+ let chartWidth = Math.floor(availableWidth * this.chartConfig.plotReservedSpacePercent / 100);
1499
+ let chartHeight = Math.floor(
1500
+ availableHeight * this.chartConfig.plotReservedSpacePercent / 100
1501
+ );
1502
+ let spaceUsed = this.componentStore.plot.calculateSpace({
1503
+ width: chartWidth,
1504
+ height: chartHeight
1505
+ });
1506
+ availableWidth -= spaceUsed.width;
1507
+ availableHeight -= spaceUsed.height;
1508
+ spaceUsed = this.componentStore.title.calculateSpace({
1509
+ width: this.chartConfig.width,
1510
+ height: availableHeight
1511
+ });
1512
+ titleYEnd = spaceUsed.height;
1513
+ availableHeight -= spaceUsed.height;
1514
+ this.componentStore.xAxis.setAxisPosition("left");
1515
+ spaceUsed = this.componentStore.xAxis.calculateSpace({
1516
+ width: availableWidth,
1517
+ height: availableHeight
1518
+ });
1519
+ availableWidth -= spaceUsed.width;
1520
+ plotX = spaceUsed.width;
1521
+ this.componentStore.yAxis.setAxisPosition("top");
1522
+ spaceUsed = this.componentStore.yAxis.calculateSpace({
1523
+ width: availableWidth,
1524
+ height: availableHeight
1525
+ });
1526
+ availableHeight -= spaceUsed.height;
1527
+ plotY = titleYEnd + spaceUsed.height;
1528
+ if (availableWidth > 0) {
1529
+ chartWidth += availableWidth;
1530
+ availableWidth = 0;
1531
+ }
1532
+ if (availableHeight > 0) {
1533
+ chartHeight += availableHeight;
1534
+ availableHeight = 0;
1535
+ }
1536
+ this.componentStore.plot.calculateSpace({
1537
+ width: chartWidth,
1538
+ height: chartHeight
1539
+ });
1540
+ this.componentStore.plot.setBoundingBoxXY({ x: plotX, y: plotY });
1541
+ this.componentStore.yAxis.setRange([plotX, plotX + chartWidth]);
1542
+ this.componentStore.yAxis.setBoundingBoxXY({ x: plotX, y: titleYEnd });
1543
+ this.componentStore.xAxis.setRange([plotY, plotY + chartHeight]);
1544
+ this.componentStore.xAxis.setBoundingBoxXY({ x: 0, y: plotY });
1545
+ if (this.chartData.plots.some((p) => isBarPlot(p))) {
1546
+ this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1547
+ }
1548
+ }
1549
+ calculateSpace() {
1550
+ if (this.chartConfig.chartOrientation === "horizontal") {
1551
+ this.calculateHorizontalSpace();
1552
+ } else {
1553
+ this.calculateVerticalSpace();
1554
+ }
1555
+ }
1556
+ getDrawableElement() {
1557
+ this.calculateSpace();
1558
+ const drawableElem = [];
1559
+ this.componentStore.plot.setAxes(this.componentStore.xAxis, this.componentStore.yAxis);
1560
+ for (const component of Object.values(this.componentStore)) {
1561
+ drawableElem.push(...component.getDrawableElements());
1562
+ }
1563
+ return drawableElem;
1564
+ }
1565
+ }, __name(_i, "Orchestrator"), _i);
1566
+ var XYChartBuilder = (_j = class {
1567
+ static build(config, chartData, chartThemeConfig, tmpSVGGroup2) {
1568
+ const orchestrator = new Orchestrator(config, chartData, chartThemeConfig, tmpSVGGroup2);
1569
+ return orchestrator.getDrawableElement();
1570
+ }
1571
+ }, __name(_j, "XYChartBuilder"), _j);
1572
+ var plotIndex = 0;
1573
+ var tmpSVGGroup;
1574
+ var xyChartConfig = getChartDefaultConfig();
1575
+ var xyChartThemeConfig = getChartDefaultThemeConfig();
1576
+ var xyChartData = getChartDefaultData();
1577
+ var plotColorPalette = xyChartThemeConfig.plotColorPalette.split(",").map((color) => color.trim());
1578
+ var hasSetXAxis = false;
1579
+ var hasSetYAxis = false;
1580
+ function getChartDefaultThemeConfig() {
1581
+ const defaultThemeVariables = getThemeVariables3();
1582
+ const config = getConfig();
1583
+ return cleanAndMerge(defaultThemeVariables.xyChart, config.themeVariables.xyChart);
1584
+ }
1585
+ __name(getChartDefaultThemeConfig, "getChartDefaultThemeConfig");
1586
+ function getChartDefaultConfig() {
1587
+ const config = getConfig();
1588
+ return cleanAndMerge(
1589
+ defaultConfig_default.xyChart,
1590
+ config.xyChart
1591
+ );
1592
+ }
1593
+ __name(getChartDefaultConfig, "getChartDefaultConfig");
1594
+ function getChartDefaultData() {
1595
+ return {
1596
+ yAxis: {
1597
+ type: "linear",
1598
+ title: "",
1599
+ min: Infinity,
1600
+ max: -Infinity
1601
+ },
1602
+ xAxis: {
1603
+ type: "band",
1604
+ title: "",
1605
+ categories: []
1606
+ },
1607
+ title: "",
1608
+ plots: []
1609
+ };
1610
+ }
1611
+ __name(getChartDefaultData, "getChartDefaultData");
1612
+ function textSanitizer(text) {
1613
+ const config = getConfig();
1614
+ return sanitizeText(text.trim(), config);
1615
+ }
1616
+ __name(textSanitizer, "textSanitizer");
1617
+ function setTmpSVGG(SVGG) {
1618
+ tmpSVGGroup = SVGG;
1619
+ }
1620
+ __name(setTmpSVGG, "setTmpSVGG");
1621
+ function setOrientation(orientation) {
1622
+ if (orientation === "horizontal") {
1623
+ xyChartConfig.chartOrientation = "horizontal";
1624
+ } else {
1625
+ xyChartConfig.chartOrientation = "vertical";
1626
+ }
1627
+ }
1628
+ __name(setOrientation, "setOrientation");
1629
+ function setXAxisTitle(title) {
1630
+ xyChartData.xAxis.title = textSanitizer(title.text);
1631
+ }
1632
+ __name(setXAxisTitle, "setXAxisTitle");
1633
+ function setXAxisRangeData(min, max) {
1634
+ xyChartData.xAxis = { type: "linear", title: xyChartData.xAxis.title, min, max };
1635
+ hasSetXAxis = true;
1636
+ }
1637
+ __name(setXAxisRangeData, "setXAxisRangeData");
1638
+ function setXAxisBand(categories) {
1639
+ xyChartData.xAxis = {
1640
+ type: "band",
1641
+ title: xyChartData.xAxis.title,
1642
+ categories: categories.map((c) => textSanitizer(c.text))
1643
+ };
1644
+ hasSetXAxis = true;
1645
+ }
1646
+ __name(setXAxisBand, "setXAxisBand");
1647
+ function setYAxisTitle(title) {
1648
+ xyChartData.yAxis.title = textSanitizer(title.text);
1649
+ }
1650
+ __name(setYAxisTitle, "setYAxisTitle");
1651
+ function setYAxisRangeData(min, max) {
1652
+ xyChartData.yAxis = { type: "linear", title: xyChartData.yAxis.title, min, max };
1653
+ hasSetYAxis = true;
1654
+ }
1655
+ __name(setYAxisRangeData, "setYAxisRangeData");
1656
+ function setYAxisRangeFromPlotData(data) {
1657
+ const minValue = Math.min(...data);
1658
+ const maxValue = Math.max(...data);
1659
+ const prevMinValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.min : Infinity;
1660
+ const prevMaxValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.max : -Infinity;
1661
+ xyChartData.yAxis = {
1662
+ type: "linear",
1663
+ title: xyChartData.yAxis.title,
1664
+ min: Math.min(prevMinValue, minValue),
1665
+ max: Math.max(prevMaxValue, maxValue)
1666
+ };
1667
+ }
1668
+ __name(setYAxisRangeFromPlotData, "setYAxisRangeFromPlotData");
1669
+ function transformDataWithoutCategory(data) {
1670
+ let retData = [];
1671
+ if (data.length === 0) {
1672
+ return retData;
1673
+ }
1674
+ if (!hasSetXAxis) {
1675
+ const prevMinValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.min : Infinity;
1676
+ const prevMaxValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.max : -Infinity;
1677
+ setXAxisRangeData(Math.min(prevMinValue, 1), Math.max(prevMaxValue, data.length));
1678
+ }
1679
+ if (!hasSetYAxis) {
1680
+ setYAxisRangeFromPlotData(data);
1681
+ }
1682
+ if (isBandAxisData(xyChartData.xAxis)) {
1683
+ retData = xyChartData.xAxis.categories.map((c, i) => [c, data[i]]);
1684
+ }
1685
+ if (isLinearAxisData(xyChartData.xAxis)) {
1686
+ const min = xyChartData.xAxis.min;
1687
+ const max = xyChartData.xAxis.max;
1688
+ const step = (max - min) / (data.length - 1);
1689
+ const categories = [];
1690
+ for (let i = min; i <= max; i += step) {
1691
+ categories.push(`${i}`);
1692
+ }
1693
+ retData = categories.map((c, i) => [c, data[i]]);
1694
+ }
1695
+ return retData;
1696
+ }
1697
+ __name(transformDataWithoutCategory, "transformDataWithoutCategory");
1698
+ function getPlotColorFromPalette(plotIndex2) {
1699
+ return plotColorPalette[plotIndex2 === 0 ? 0 : plotIndex2 % plotColorPalette.length];
1700
+ }
1701
+ __name(getPlotColorFromPalette, "getPlotColorFromPalette");
1702
+ function setLineData(title, data) {
1703
+ const plotData = transformDataWithoutCategory(data);
1704
+ xyChartData.plots.push({
1705
+ type: "line",
1706
+ strokeFill: getPlotColorFromPalette(plotIndex),
1707
+ strokeWidth: 2,
1708
+ data: plotData
1709
+ });
1710
+ plotIndex++;
1711
+ }
1712
+ __name(setLineData, "setLineData");
1713
+ function setBarData(title, data) {
1714
+ const plotData = transformDataWithoutCategory(data);
1715
+ xyChartData.plots.push({
1716
+ type: "bar",
1717
+ fill: getPlotColorFromPalette(plotIndex),
1718
+ data: plotData
1719
+ });
1720
+ plotIndex++;
1721
+ }
1722
+ __name(setBarData, "setBarData");
1723
+ function getDrawableElem() {
1724
+ if (xyChartData.plots.length === 0) {
1725
+ throw Error("No Plot to render, please provide a plot with some data");
1726
+ }
1727
+ xyChartData.title = getDiagramTitle();
1728
+ return XYChartBuilder.build(xyChartConfig, xyChartData, xyChartThemeConfig, tmpSVGGroup);
1729
+ }
1730
+ __name(getDrawableElem, "getDrawableElem");
1731
+ function getChartThemeConfig() {
1732
+ return xyChartThemeConfig;
1733
+ }
1734
+ __name(getChartThemeConfig, "getChartThemeConfig");
1735
+ function getChartConfig() {
1736
+ return xyChartConfig;
1737
+ }
1738
+ __name(getChartConfig, "getChartConfig");
1739
+ function getXYChartData() {
1740
+ return xyChartData;
1741
+ }
1742
+ __name(getXYChartData, "getXYChartData");
1743
+ var clear2 = /* @__PURE__ */ __name(function() {
1744
+ clear$2();
1745
+ plotIndex = 0;
1746
+ xyChartConfig = getChartDefaultConfig();
1747
+ xyChartData = getChartDefaultData();
1748
+ xyChartThemeConfig = getChartDefaultThemeConfig();
1749
+ plotColorPalette = xyChartThemeConfig.plotColorPalette.split(",").map((color) => color.trim());
1750
+ hasSetXAxis = false;
1751
+ hasSetYAxis = false;
1752
+ }, "clear");
1753
+ var xychartDb_default = {
1754
+ getDrawableElem,
1755
+ clear: clear2,
1756
+ setAccTitle,
1757
+ getAccTitle,
1758
+ setDiagramTitle,
1759
+ getDiagramTitle,
1760
+ getAccDescription,
1761
+ setAccDescription,
1762
+ setOrientation,
1763
+ setXAxisTitle,
1764
+ setXAxisRangeData,
1765
+ setXAxisBand,
1766
+ setYAxisTitle,
1767
+ setYAxisRangeData,
1768
+ setLineData,
1769
+ setBarData,
1770
+ setTmpSVGG,
1771
+ getChartThemeConfig,
1772
+ getChartConfig,
1773
+ getXYChartData
1774
+ };
1775
+ var draw = /* @__PURE__ */ __name((txt, id, _version, diagObj) => {
1776
+ const db = diagObj.db;
1777
+ const themeConfig = db.getChartThemeConfig();
1778
+ const chartConfig = db.getChartConfig();
1779
+ const labelData = db.getXYChartData().plots[0].data.map((data) => data[1]);
1780
+ function getDominantBaseLine(horizontalPos) {
1781
+ return horizontalPos === "top" ? "text-before-edge" : "middle";
1782
+ }
1783
+ __name(getDominantBaseLine, "getDominantBaseLine");
1784
+ function getTextAnchor(verticalPos) {
1785
+ return verticalPos === "left" ? "start" : verticalPos === "right" ? "end" : "middle";
1786
+ }
1787
+ __name(getTextAnchor, "getTextAnchor");
1788
+ function getTextTransformation(data) {
1789
+ return `translate(${data.x}, ${data.y}) rotate(${data.rotation || 0})`;
1790
+ }
1791
+ __name(getTextTransformation, "getTextTransformation");
1792
+ log.debug("Rendering xychart chart\n" + txt);
1793
+ const svg = selectSvgElement(id);
1794
+ const group = svg.append("g").attr("class", "main");
1795
+ const background = group.append("rect").attr("width", chartConfig.width).attr("height", chartConfig.height).attr("class", "background");
1796
+ configureSvgSize(svg, chartConfig.height, chartConfig.width, true);
1797
+ svg.attr("viewBox", `0 0 ${chartConfig.width} ${chartConfig.height}`);
1798
+ background.attr("fill", themeConfig.backgroundColor);
1799
+ db.setTmpSVGG(svg.append("g").attr("class", "mermaid-tmp-group"));
1800
+ const shapes = db.getDrawableElem();
1801
+ const groups = {};
1802
+ function getGroup(gList) {
1803
+ let elem = group;
1804
+ let prefix = "";
1805
+ for (const [i] of gList.entries()) {
1806
+ let parent = group;
1807
+ if (i > 0 && groups[prefix]) {
1808
+ parent = groups[prefix];
1809
+ }
1810
+ prefix += gList[i];
1811
+ elem = groups[prefix];
1812
+ if (!elem) {
1813
+ elem = groups[prefix] = parent.append("g").attr("class", gList[i]);
1814
+ }
1815
+ }
1816
+ return elem;
1817
+ }
1818
+ __name(getGroup, "getGroup");
1819
+ for (const shape of shapes) {
1820
+ if (shape.data.length === 0) {
1821
+ continue;
1822
+ }
1823
+ const shapeGroup = getGroup(shape.groupTexts);
1824
+ switch (shape.type) {
1825
+ case "rect":
1826
+ 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);
1827
+ if (chartConfig.showDataLabel) {
1828
+ if (chartConfig.chartOrientation === "horizontal") {
1829
+ let fitsHorizontally2 = function(item, fontSize) {
1830
+ const { data, label } = item;
1831
+ const textWidth = fontSize * label.length * charWidthFactor;
1832
+ return textWidth <= data.width - 10;
1833
+ };
1834
+ __name(fitsHorizontally2, "fitsHorizontally");
1835
+ const charWidthFactor = 0.7;
1836
+ const validItems = shape.data.map((d, i) => ({ data: d, label: labelData[i].toString() })).filter((item) => item.data.width > 0 && item.data.height > 0);
1837
+ const candidateFontSizes = validItems.map((item) => {
1838
+ const { data } = item;
1839
+ let fontSize = data.height * 0.7;
1840
+ while (!fitsHorizontally2(item, fontSize) && fontSize > 0) {
1841
+ fontSize -= 1;
1842
+ }
1843
+ return fontSize;
1844
+ });
1845
+ const uniformFontSize = Math.floor(Math.min(...candidateFontSizes));
1846
+ shapeGroup.selectAll("text").data(validItems).enter().append("text").attr("x", (item) => item.data.x + item.data.width - 10).attr("y", (item) => item.data.y + item.data.height / 2).attr("text-anchor", "end").attr("dominant-baseline", "middle").attr("fill", "black").attr("font-size", `${uniformFontSize}px`).text((item) => item.label);
1847
+ } else {
1848
+ let fitsInBar2 = function(item, fontSize, yOffset2) {
1849
+ const { data, label } = item;
1850
+ const charWidthFactor = 0.7;
1851
+ const textWidth = fontSize * label.length * charWidthFactor;
1852
+ const centerX = data.x + data.width / 2;
1853
+ const leftEdge = centerX - textWidth / 2;
1854
+ const rightEdge = centerX + textWidth / 2;
1855
+ const horizontalFits = leftEdge >= data.x && rightEdge <= data.x + data.width;
1856
+ const verticalFits = data.y + yOffset2 + fontSize <= data.y + data.height;
1857
+ return horizontalFits && verticalFits;
1858
+ };
1859
+ __name(fitsInBar2, "fitsInBar");
1860
+ const yOffset = 10;
1861
+ const validItems = shape.data.map((d, i) => ({ data: d, label: labelData[i].toString() })).filter((item) => item.data.width > 0 && item.data.height > 0);
1862
+ const candidateFontSizes = validItems.map((item) => {
1863
+ const { data, label } = item;
1864
+ let fontSize = data.width / (label.length * 0.7);
1865
+ while (!fitsInBar2(item, fontSize, yOffset) && fontSize > 0) {
1866
+ fontSize -= 1;
1867
+ }
1868
+ return fontSize;
1869
+ });
1870
+ const uniformFontSize = Math.floor(Math.min(...candidateFontSizes));
1871
+ shapeGroup.selectAll("text").data(validItems).enter().append("text").attr("x", (item) => item.data.x + item.data.width / 2).attr("y", (item) => item.data.y + yOffset).attr("text-anchor", "middle").attr("dominant-baseline", "hanging").attr("fill", "black").attr("font-size", `${uniformFontSize}px`).text((item) => item.label);
1872
+ }
1873
+ }
1874
+ break;
1875
+ case "text":
1876
+ 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);
1877
+ break;
1878
+ case "path":
1879
+ 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);
1880
+ break;
1881
+ }
1882
+ }
1883
+ }, "draw");
1884
+ var xychartRenderer_default = {
1885
+ draw
1886
+ };
1887
+ var diagram = {
1888
+ parser: xychart_default,
1889
+ db: xychartDb_default,
1890
+ renderer: xychartRenderer_default
1891
+ };
1892
+
1893
+ export { diagram };