@vunk/plus 1.10.1 → 1.10.3

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