@bytechain.cn/colamd 1.5.1 → 2.7.7

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 (398) hide show
  1. package/LICENSE +22 -21
  2. package/README.md +160 -1012
  3. package/README_CN.md +210 -1070
  4. package/dist/main/chunks/docx-export.js +29695 -0
  5. package/dist/main/chunks/image-export.js +175 -0
  6. package/dist/main/index.js +17765 -452
  7. package/dist/preload/index.js +135 -23
  8. package/dist/renderer/assets/2DXBBFLN-BmaQ8lqV.js +667 -0
  9. package/dist/renderer/assets/46IJ22JX-Caywmaj-.js +854 -0
  10. package/dist/renderer/assets/4TTDE5I4-C82Tw8vO.js +502 -0
  11. package/dist/renderer/assets/4UF3HTLV-BD8W-BSm.js +30 -0
  12. package/dist/renderer/assets/5THPTBWS-2mBFupjU.js +21 -0
  13. package/dist/renderer/assets/7WLXJQOR-C8MM6Bra.js +23 -0
  14. package/dist/renderer/assets/AAXQQPKT-CCArPgA1.js +1131 -0
  15. package/dist/renderer/assets/AKE5O7KZ-DOAgUvEX.js +185 -0
  16. package/dist/renderer/assets/BNMLP6AG-igM96Ol7.js +805 -0
  17. package/dist/renderer/assets/DKTLEL5E-Dj3316cp.js +42 -0
  18. package/dist/renderer/assets/DR6PKOQU-C-e6zzyf.js +302 -0
  19. package/dist/renderer/assets/E4RJ7UJB-BMF4zoOQ.js +442 -0
  20. package/dist/renderer/assets/ELSXBIJH-BI2ySIoX.js +39 -0
  21. package/dist/renderer/assets/ERTIBQVS-CnvF3w9r.js +183 -0
  22. package/dist/renderer/assets/F653G4FO-CgzvjfOe.js +1498 -0
  23. package/dist/renderer/assets/FKCDD66M-BkVPFntx.js +205 -0
  24. package/dist/renderer/assets/FP7KDXVC-K0VCFuri.js +222 -0
  25. package/dist/renderer/assets/FT5I3RHX-zgsvTvBh.js +244 -0
  26. package/dist/renderer/assets/FTXIJQGB-BX14b7pN.js +13 -0
  27. package/dist/renderer/assets/G3MDBVQH-qZ3yfAIw.js +25 -0
  28. package/dist/renderer/assets/GY35JXOZ-Lo9DxsPK.js +169 -0
  29. package/dist/renderer/assets/H5EEJPP2-Bw2musel.js +354 -0
  30. package/dist/renderer/assets/HWDLEDTA-CCOSSl9K.js +982 -0
  31. package/dist/renderer/assets/JZWSX6AR-BBtw8K-1.js +67 -0
  32. package/dist/renderer/assets/KQOEJWJY-Brg31xSn.js +84 -0
  33. package/dist/renderer/assets/KS3BB3KE-2GQdjVNT.js +139 -0
  34. package/dist/renderer/assets/KXJRRZHI-B0Oj-tMS.js +503 -0
  35. package/dist/renderer/assets/MFVI5XKI-BpwEOECT.js +10 -0
  36. package/dist/renderer/assets/MWY2J62P-CSmi7lMQ.js +1103 -0
  37. package/dist/renderer/assets/MXGNCBL2-CSoCLfJw.js +217 -0
  38. package/dist/renderer/assets/N6DAJLIZ-DB-xlSjM.js +120 -0
  39. package/dist/renderer/assets/NU5M23IW-BhGgUeDk.js +117 -0
  40. package/dist/renderer/assets/NV4XNBIS-DMg8ibKU.js +1221 -0
  41. package/dist/renderer/assets/OGLU4SIR-DOU7cIL3.js +290 -0
  42. package/dist/renderer/assets/OUNS5N76-BO_k5M0O.js +1065 -0
  43. package/dist/renderer/assets/PU4ISKXV-Cw53csyu.js +516 -0
  44. package/dist/renderer/assets/PUZGS23X-_iUQg51-.js +21 -0
  45. package/dist/renderer/assets/Q3IYVLG5-ZFBZi3vs.js +501 -0
  46. package/dist/renderer/assets/QYHQDLKZ-BPb6lHi6.js +984 -0
  47. package/dist/renderer/assets/RVARI57O-DMrXgtoB.js +10 -0
  48. package/dist/renderer/assets/RZSVICHU-I7fvqLMQ.js +263 -0
  49. package/dist/renderer/assets/UEXXS2NB-AVpw2xTC.js +25 -0
  50. package/dist/renderer/assets/UHTQJXKL-6oSc4D2k.js +135 -0
  51. package/dist/renderer/assets/URA2L2QI-DkFUeeK0.js +201 -0
  52. package/dist/renderer/assets/UXCHDUKG-B54p4156.js +174 -0
  53. package/dist/renderer/assets/VKNV3BUX-Cc_4x0WI.js +278 -0
  54. package/dist/renderer/assets/VMV7XPHP-BjfrE66I.js +127 -0
  55. package/dist/renderer/assets/WEVWDWVA-Ca8eMbXN.js +57 -0
  56. package/dist/renderer/assets/XRRJ35LF-EWRU-xXu.js +120 -0
  57. package/dist/renderer/assets/YFKBLVVN-D2oaE2c2.js +991 -0
  58. package/dist/renderer/assets/YHRE5QGZ-ucJgE2vP.js +698 -0
  59. package/dist/renderer/assets/ZF3OVT4B-SN2E7Wbi.js +421 -0
  60. package/dist/renderer/assets/apl-fqmucPXA.js +140 -0
  61. package/dist/renderer/assets/asciiarmor-DucZyvP0.js +56 -0
  62. package/dist/renderer/assets/asn1-BnOEsgAm.js +144 -0
  63. package/dist/renderer/assets/asterisk-QAlztEwS.js +345 -0
  64. package/dist/renderer/assets/brainfuck-DZVCuF_t.js +53 -0
  65. package/dist/renderer/assets/clike-xqXYL6ge.js +805 -0
  66. package/dist/renderer/assets/clojure-BhXMqnxz.js +849 -0
  67. package/dist/renderer/assets/cmake-BGaNd9E7.js +71 -0
  68. package/dist/renderer/assets/cobol-4yqQntpt.js +120 -0
  69. package/dist/renderer/assets/coffeescript-D2dXvhEc.js +308 -0
  70. package/dist/renderer/assets/commonlisp-CF_VNHQR.js +130 -0
  71. package/dist/renderer/assets/crystal-DyuLTqLs.js +398 -0
  72. package/dist/renderer/assets/css-c-jst79C.js +1783 -0
  73. package/dist/renderer/assets/cypher-Dlu_3r4V.js +121 -0
  74. package/dist/renderer/assets/d-UURgV0Ux.js +179 -0
  75. package/dist/renderer/assets/diff-B_Bi2Crb.js +25 -0
  76. package/dist/renderer/assets/dockerfile-Bvk733Ga.js +201 -0
  77. package/dist/renderer/assets/dtd-Dy74G54E.js +114 -0
  78. package/dist/renderer/assets/dylan-TSb-Nfix.js +314 -0
  79. package/dist/renderer/assets/ebnf-4fKAGW3a.js +140 -0
  80. package/dist/renderer/assets/ecl-B59qGGVg.js +178 -0
  81. package/dist/renderer/assets/eiffel-Dze7nlu3.js +134 -0
  82. package/dist/renderer/assets/elm-DG7jkhNZ.js +176 -0
  83. package/dist/renderer/assets/erlang-BO6gOnGA.js +674 -0
  84. package/dist/renderer/assets/factor-CMxFHDqz.js +65 -0
  85. package/dist/renderer/assets/fcl-CDDUNjTj.js +141 -0
  86. package/dist/renderer/assets/forth-B9D2JCeE.js +116 -0
  87. package/dist/renderer/assets/fortran-CAG2BFbe.js +467 -0
  88. package/dist/renderer/assets/gas-d3KEcW3x.js +294 -0
  89. package/dist/renderer/assets/gherkin-DhZlEZiy.js +115 -0
  90. package/dist/renderer/assets/groovy-CpwJiBl7.js +223 -0
  91. package/dist/renderer/assets/haskell-ySd-OUo8.js +459 -0
  92. package/dist/renderer/assets/haxe-7MlzfeYV.js +514 -0
  93. package/dist/renderer/assets/http-BqypyemW.js +79 -0
  94. package/dist/renderer/assets/idl-4HIGJlDI.js +985 -0
  95. package/dist/renderer/assets/index-6G13Twgt.js +311 -0
  96. package/dist/renderer/assets/index-B2_pQa3G.js +384 -0
  97. package/dist/renderer/assets/index-B4keY9Xz.js +328 -0
  98. package/dist/renderer/assets/index-B5Jih3QA.js +47421 -0
  99. package/dist/renderer/assets/index-BH0PaTow.js +405 -0
  100. package/dist/renderer/assets/index-BWfIKsyn.js +8 -0
  101. package/dist/renderer/assets/index-B_BLxvag.js +156 -0
  102. package/dist/renderer/assets/index-BnXxA35e.js +325 -0
  103. package/dist/renderer/assets/index-Bu1PrnbA.js +81 -0
  104. package/dist/renderer/assets/index-BvXJHaQ4.js +60 -0
  105. package/dist/renderer/assets/index-BzHXcCGC.js +307 -0
  106. package/dist/renderer/assets/index-CXI9cRfo.js +287 -0
  107. package/dist/renderer/assets/index-Ccsf_83j.js +149 -0
  108. package/dist/renderer/assets/index-CkLQq2g4.js +688 -0
  109. package/dist/renderer/assets/index-DNL6Tijf.js +8 -0
  110. package/dist/renderer/assets/index-DRZsGkXi.js +78 -0
  111. package/dist/renderer/assets/index-Dfyz4Aee.js +181 -0
  112. package/dist/renderer/assets/index-HtqODURL.js +703 -0
  113. package/dist/renderer/assets/{index-DxOzbfR-.js → index-MJfkvBRx.js} +1 -1
  114. package/dist/renderer/assets/index-NsiBA9UX.js +113 -0
  115. package/dist/renderer/assets/index-aUzhL6sM.js +96 -0
  116. package/dist/renderer/assets/index-bx07CRyn.css +2503 -0
  117. package/dist/renderer/assets/{index-CBcVpA3d.js → index-k1ZFPJcr.js} +3 -4
  118. package/dist/renderer/assets/javascript-C_OHM9hj.js +994 -0
  119. package/dist/renderer/assets/julia-Bs6JJhYG.js +407 -0
  120. package/dist/renderer/assets/lazy-BY7ljzvO.js +1041 -0
  121. package/dist/renderer/assets/livescript-DmzgM3Yt.js +296 -0
  122. package/dist/renderer/assets/lua-Cvg8VrAA.js +256 -0
  123. package/dist/renderer/assets/mathematica-DNLOL9PQ.js +110 -0
  124. package/dist/renderer/assets/mbox-Ga7d4MMN.js +117 -0
  125. package/dist/renderer/assets/mirc-Dma3B8rS.js +107 -0
  126. package/dist/renderer/assets/mllike-DHn7xckP.js +334 -0
  127. package/dist/renderer/assets/modelica-0d55jYY0.js +147 -0
  128. package/dist/renderer/assets/mscgen-DdqZYINH.js +135 -0
  129. package/dist/renderer/assets/mumps-Btr8VblO.js +93 -0
  130. package/dist/renderer/assets/nginx-DTDtBDVN.js +141 -0
  131. package/dist/renderer/assets/nsis-CyKBdPWp.js +62 -0
  132. package/dist/renderer/assets/ntriples-CvgOYMpL.js +153 -0
  133. package/dist/renderer/assets/octave-DYBj3-tl.js +200 -0
  134. package/dist/renderer/assets/oz-R_e8WMIi.js +231 -0
  135. package/dist/renderer/assets/pascal-GD8iposT.js +105 -0
  136. package/dist/renderer/assets/perl-DL9mHpoi.js +1105 -0
  137. package/dist/renderer/assets/pig-C_4T4YIV.js +101 -0
  138. package/dist/renderer/assets/powershell-B0suO7Vd.js +328 -0
  139. package/dist/renderer/assets/properties-BR-vP1aU.js +58 -0
  140. package/dist/renderer/assets/protobuf-BxgpyhoW.js +77 -0
  141. package/dist/renderer/assets/pug-CTXt1f8z.js +405 -0
  142. package/dist/renderer/assets/puppet-Bdao66PW.js +137 -0
  143. package/dist/renderer/assets/python-CvWbmiX4.js +427 -0
  144. package/dist/renderer/assets/q-CrbCVq4a.js +131 -0
  145. package/dist/renderer/assets/r-V7nswm59.js +170 -0
  146. package/dist/renderer/assets/rpm-C-DLY-If.js +109 -0
  147. package/dist/renderer/assets/ruby-CQTpZw6f.js +331 -0
  148. package/dist/renderer/assets/sas-D2UG-yhZ.js +207 -0
  149. package/dist/renderer/assets/scheme-BKzrkGJD.js +222 -0
  150. package/dist/renderer/assets/shell-BlsXDxCn.js +222 -0
  151. package/dist/renderer/assets/sieve-CjwBwOY5.js +135 -0
  152. package/dist/renderer/assets/simple-mode-DMneyfDu.js +130 -0
  153. package/dist/renderer/assets/smalltalk-BOIGQuhN.js +121 -0
  154. package/dist/renderer/assets/solr-CwD7U71z.js +69 -0
  155. package/dist/renderer/assets/sparql-DYskk2vE.js +249 -0
  156. package/dist/renderer/assets/spreadsheet-Bgtt3oLP.js +87 -0
  157. package/dist/renderer/assets/sql-BSrOzCRI.js +354 -0
  158. package/dist/renderer/assets/stex-B6LNC55o.js +231 -0
  159. package/dist/renderer/assets/stylus-BkS-boTH.js +565 -0
  160. package/dist/renderer/assets/swift-FRZi1uvB.js +291 -0
  161. package/dist/renderer/assets/tcl-CUcaCdmq.js +114 -0
  162. package/dist/renderer/assets/textile-BnFpjsrl.js +414 -0
  163. package/dist/renderer/assets/tiddlywiki-CjprD-Qp.js +218 -0
  164. package/dist/renderer/assets/tiki-DK9DOeWn.js +268 -0
  165. package/dist/renderer/assets/toml-BOuWGMcf.js +76 -0
  166. package/dist/renderer/assets/troff-E1bJ0PPL.js +61 -0
  167. package/dist/renderer/assets/ttcn-cfg-Dc39-fIP.js +133 -0
  168. package/dist/renderer/assets/ttcn-tKd4HLu4.js +192 -0
  169. package/dist/renderer/assets/turtle-Dq7-1WAf.js +124 -0
  170. package/dist/renderer/assets/vb-Dp90gtsv.js +196 -0
  171. package/dist/renderer/assets/vbscript-CI6_mxxU.js +479 -0
  172. package/dist/renderer/assets/velocity-BwIZK1TH.js +149 -0
  173. package/dist/renderer/assets/verilog-DDCYnHN8.js +430 -0
  174. package/dist/renderer/assets/vhdl-DCkMIyT9.js +158 -0
  175. package/dist/renderer/assets/{web-BKE0SH0E.js → web-C4yaM4Cl.js} +1 -1
  176. package/dist/renderer/assets/{web-CBsFp24u.js → web-CF2Dtak3.js} +2 -3
  177. package/dist/renderer/assets/{web-Dc8YgoHP.js → web-DUy9unYf.js} +1 -1
  178. package/dist/renderer/assets/webidl-BTLTThCm.js +204 -0
  179. package/dist/renderer/assets/xquery-BrBUuxMR.js +525 -0
  180. package/dist/renderer/assets/yacas-b5lAVEIl.js +130 -0
  181. package/dist/renderer/assets/z80-BZV19vqv.js +93 -0
  182. package/dist/renderer/index.html +97 -77
  183. package/package.json +88 -60
  184. package/themes/README.md +99 -300
  185. package/themes/bear.css +38 -0
  186. package/themes/dark.css +20 -0
  187. package/themes/dracula.css +38 -0
  188. package/themes/elegant.css +53 -671
  189. package/themes/gruvbox.css +42 -0
  190. package/themes/light.css +20 -0
  191. package/themes/midnight.css +31 -0
  192. package/themes/nord.css +38 -0
  193. package/themes/notion.css +48 -0
  194. package/themes/sepia.css +48 -0
  195. package/themes/solarized-dark.css +35 -0
  196. package/themes/template.css +76 -498
  197. package/themes/writer.css +44 -0
  198. package/.github/workflows/release.yml +0 -66
  199. package/.trae/specs/optimize-theme-loading/checklist.md +0 -20
  200. package/.trae/specs/optimize-theme-loading/spec.md +0 -103
  201. package/.trae/specs/optimize-theme-loading/tasks.md +0 -40
  202. package/CHANGELOG.md +0 -320
  203. package/CLAUDE.md +0 -143
  204. package/android/app/build/.npmkeep +0 -0
  205. package/android/app/build.gradle +0 -76
  206. package/android/app/capacitor.build.gradle +0 -24
  207. package/android/app/proguard-rules.pro +0 -21
  208. package/android/app/release.keystore +0 -0
  209. package/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +0 -26
  210. package/android/app/src/main/AndroidManifest.xml +0 -64
  211. package/android/app/src/main/java/cn/bytechain/colamd/MainActivity.java +0 -180
  212. package/android/app/src/main/res/drawable/ic_launcher_background.xml +0 -170
  213. package/android/app/src/main/res/drawable/splash.png +0 -0
  214. package/android/app/src/main/res/drawable-land-hdpi/splash.png +0 -0
  215. package/android/app/src/main/res/drawable-land-mdpi/splash.png +0 -0
  216. package/android/app/src/main/res/drawable-land-xhdpi/splash.png +0 -0
  217. package/android/app/src/main/res/drawable-land-xxhdpi/splash.png +0 -0
  218. package/android/app/src/main/res/drawable-land-xxxhdpi/splash.png +0 -0
  219. package/android/app/src/main/res/drawable-port-hdpi/splash.png +0 -0
  220. package/android/app/src/main/res/drawable-port-mdpi/splash.png +0 -0
  221. package/android/app/src/main/res/drawable-port-xhdpi/splash.png +0 -0
  222. package/android/app/src/main/res/drawable-port-xxhdpi/splash.png +0 -0
  223. package/android/app/src/main/res/drawable-port-xxxhdpi/splash.png +0 -0
  224. package/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +0 -34
  225. package/android/app/src/main/res/layout/activity_main.xml +0 -12
  226. package/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -5
  227. package/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -5
  228. package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  229. package/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png +0 -0
  230. package/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  231. package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  232. package/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png +0 -0
  233. package/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  234. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  235. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
  236. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  237. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  238. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
  239. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  240. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  241. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
  242. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  243. package/android/app/src/main/res/values/ic_launcher_background.xml +0 -4
  244. package/android/app/src/main/res/values/strings.xml +0 -7
  245. package/android/app/src/main/res/values/styles.xml +0 -22
  246. package/android/app/src/main/res/xml/file_paths.xml +0 -5
  247. package/android/app/src/main/res/xml/network_security_config.xml +0 -8
  248. package/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +0 -18
  249. package/android/build.gradle +0 -29
  250. package/android/capacitor.settings.gradle +0 -21
  251. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  252. package/android/gradle/wrapper/gradle-wrapper.properties +0 -7
  253. package/android/gradle.properties +0 -22
  254. package/android/gradlew +0 -248
  255. package/android/gradlew.bat +0 -92
  256. package/android/settings.gradle +0 -5
  257. package/android/variables.gradle +0 -16
  258. package/capacitor.config.js +0 -29
  259. package/capacitor.config.ts +0 -30
  260. package/demo.md +0 -193
  261. package/dist/renderer/assets/arc-_lugyDzx.js +0 -131
  262. package/dist/renderer/assets/architectureDiagram-3BPJPVTR-DDfP-F9D.js +0 -8721
  263. package/dist/renderer/assets/blockDiagram-GPEHLZMM-DOETUKma.js +0 -3826
  264. package/dist/renderer/assets/c4Diagram-AAUBKEIU-kAmLfVtk.js +0 -2483
  265. package/dist/renderer/assets/channel-CD4vJFwr.js +0 -7
  266. package/dist/renderer/assets/chunk-2J33WTMH-DkVrgw4l.js +0 -24
  267. package/dist/renderer/assets/chunk-4BX2VUAB-JTZ-VKNX.js +0 -16
  268. package/dist/renderer/assets/chunk-55IACEB6-Di_O5box.js +0 -13
  269. package/dist/renderer/assets/chunk-727SXJPM-BgKvwR8w.js +0 -2016
  270. package/dist/renderer/assets/chunk-AQP2D5EJ-DonSXCCQ.js +0 -1953
  271. package/dist/renderer/assets/chunk-FMBD7UC4-CsV8Lmy6.js +0 -19
  272. package/dist/renderer/assets/chunk-ND2GUHAM-C_-_dlq7.js +0 -116
  273. package/dist/renderer/assets/chunk-QZHKN3VN-aCmcDsfu.js +0 -19
  274. package/dist/renderer/assets/classDiagram-4FO5ZUOK-nuHQLjzM.js +0 -24
  275. package/dist/renderer/assets/classDiagram-v2-Q7XG4LA2-nuHQLjzM.js +0 -24
  276. package/dist/renderer/assets/cose-bilkent-S5V4N54A-Di1_SXt9.js +0 -4943
  277. package/dist/renderer/assets/cytoscape.esm-CpHeHM5e.js +0 -30269
  278. package/dist/renderer/assets/dagre-BM42HDAG-CqOUIYsL.js +0 -706
  279. package/dist/renderer/assets/defaultLocale-B2RvLBDe.js +0 -206
  280. package/dist/renderer/assets/diagram-2AECGRRQ-F-fP19TC.js +0 -302
  281. package/dist/renderer/assets/diagram-5GNKFQAL-BD5XZc8G.js +0 -170
  282. package/dist/renderer/assets/diagram-KO2AKTUF-Qa3ZxA67.js +0 -633
  283. package/dist/renderer/assets/diagram-LMA3HP47-DqDnw2RA.js +0 -213
  284. package/dist/renderer/assets/diagram-OG6HWLK6-BH4Elzby.js +0 -852
  285. package/dist/renderer/assets/erDiagram-TEJ5UH35-CaKZCewa.js +0 -1228
  286. package/dist/renderer/assets/flowDiagram-I6XJVG4X-C8znUgyL.js +0 -2333
  287. package/dist/renderer/assets/ganttDiagram-6RSMTGT7-DnRvbMnU.js +0 -3721
  288. package/dist/renderer/assets/gitGraphDiagram-PVQCEYII-CZuRZzk4.js +0 -1374
  289. package/dist/renderer/assets/graph-CYiEKt0j.js +0 -1988
  290. package/dist/renderer/assets/index-B4uDgADr.js +0 -530
  291. package/dist/renderer/assets/index-BX6JHKv6.js +0 -73314
  292. package/dist/renderer/assets/index-CGj1spkU.js +0 -27
  293. package/dist/renderer/assets/index-CcwAgVRi.css +0 -2226
  294. package/dist/renderer/assets/index-D4CPFkph.js +0 -9
  295. package/dist/renderer/assets/index-Y89U1ptl.js +0 -9
  296. package/dist/renderer/assets/infoDiagram-5YYISTIA-BlBUdqMb.js +0 -32
  297. package/dist/renderer/assets/init-ZxktEp_H.js +0 -16
  298. package/dist/renderer/assets/ishikawaDiagram-YF4QCWOH-TeVytCrP.js +0 -968
  299. package/dist/renderer/assets/journeyDiagram-JHISSGLW-BLZa3jnX.js +0 -1256
  300. package/dist/renderer/assets/kanban-definition-UN3LZRKU-foVxWrJn.js +0 -1053
  301. package/dist/renderer/assets/layout-DOAlFUVb.js +0 -2610
  302. package/dist/renderer/assets/linear-BMBn6kVq.js +0 -340
  303. package/dist/renderer/assets/mindmap-definition-RKZ34NQL-5pGeNCcp.js +0 -1181
  304. package/dist/renderer/assets/ordinal-DSZU4PqD.js +0 -76
  305. package/dist/renderer/assets/pieDiagram-4H26LBE5-N9aAUxfr.js +0 -247
  306. package/dist/renderer/assets/preload-helper-tXtZnHb0.js +0 -88
  307. package/dist/renderer/assets/quadrantDiagram-W4KKPZXB-BPxbtjga.js +0 -1345
  308. package/dist/renderer/assets/requirementDiagram-4Y6WPE33-CK1LrJyG.js +0 -1205
  309. package/dist/renderer/assets/sankeyDiagram-5OEKKPKP-BNj7Sqii.js +0 -1275
  310. package/dist/renderer/assets/sequenceDiagram-3UESZ5HK-B-r7lNhI.js +0 -4515
  311. package/dist/renderer/assets/stateDiagram-AJRCARHV-wrWE0MRa.js +0 -451
  312. package/dist/renderer/assets/stateDiagram-v2-BHNVJYJU-CE-Lqo2d.js +0 -22
  313. package/dist/renderer/assets/timeline-definition-PNZ67QCA-BkeMGH4J.js +0 -1597
  314. package/dist/renderer/assets/vennDiagram-CIIHVFJN-BTxVzto3.js +0 -2487
  315. package/dist/renderer/assets/wardley-L42UT6IY-b-_GPpqL.js +0 -30699
  316. package/dist/renderer/assets/wardleyDiagram-YWT4CUSO-D2r5dVGW.js +0 -976
  317. package/dist/renderer/assets/web-TfDzToU7.js +0 -58
  318. package/dist/renderer/assets/xychartDiagram-2RQKCTM6-BHQdINVc.js +0 -1933
  319. package/docs/RELEASE_NOTES_v1.5.1.md +0 -382
  320. package/docs/academic-demo.md +0 -567
  321. package/docs/agent-diff-view.md +0 -48
  322. package/docs/demo.html +0 -748
  323. package/docs/demo.md +0 -546
  324. package/docs/demo.pdf +0 -0
  325. package/docs/theme-paradigm.md +0 -797
  326. package/electron-builder.yml +0 -64
  327. package/electron.vite.config.js +0 -31
  328. package/electron.vite.config.ts +0 -30
  329. package/ios/App/App/AppDelegate.swift +0 -49
  330. package/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
  331. package/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -14
  332. package/ios/App/App/Assets.xcassets/Contents.json +0 -6
  333. package/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +0 -23
  334. package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
  335. package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
  336. package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
  337. package/ios/App/App/Base.lproj/LaunchScreen.storyboard +0 -32
  338. package/ios/App/App/Base.lproj/Main.storyboard +0 -19
  339. package/ios/App/App/Info.plist +0 -49
  340. package/ios/App/App.xcodeproj/project.pbxproj +0 -408
  341. package/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  342. package/ios/App/Podfile +0 -28
  343. package/resources/entitlements.mac.plist +0 -12
  344. package/resources/icon.icns +0 -0
  345. package/resources/icon.png +0 -0
  346. package/resources/icon.svg +0 -23
  347. package/resources/templates/slides/icon.png +0 -0
  348. package/resources/templates/slides/slides-template.md +0 -74
  349. package/resources/templates/slides/template-forest-ink.html +0 -540
  350. package/resources/templates/slides/template.html +0 -535
  351. package/scripts/afterPack.js +0 -13
  352. package/scripts/generate-icons.js +0 -102
  353. package/src/main/index.ts +0 -919
  354. package/src/preload/index.d.ts +0 -51
  355. package/src/preload/index.js +0 -70
  356. package/src/preload/index.ts +0 -110
  357. package/src/renderer/capacitor-api.ts +0 -713
  358. package/src/renderer/editor/editor.ts +0 -287
  359. package/src/renderer/editor/html-view.ts +0 -15
  360. package/src/renderer/editor/plugins/index.ts +0 -86
  361. package/src/renderer/editor/plugins/math-plugin.ts +0 -305
  362. package/src/renderer/editor/plugins/mermaid-plugin-custom.css +0 -46
  363. package/src/renderer/editor/plugins/mermaid-plugin-dark.css +0 -428
  364. package/src/renderer/editor/plugins/mermaid-plugin-elegant.css +0 -443
  365. package/src/renderer/editor/plugins/mermaid-plugin-newsprint.css +0 -208
  366. package/src/renderer/editor/plugins/mermaid-plugin.css +0 -111
  367. package/src/renderer/editor/plugins/mermaid-plugin.ts +0 -680
  368. package/src/renderer/editor/plugins/themes/base/dark.css +0 -23
  369. package/src/renderer/editor/plugins/themes/base/elegant.css +0 -32
  370. package/src/renderer/editor/plugins/themes/base/light.css +0 -20
  371. package/src/renderer/editor/plugins/themes/base/newsprint.css +0 -27
  372. package/src/renderer/editor/plugins/themes/base.css +0 -509
  373. package/src/renderer/editor/plugins/themes/components/mermaid/academic.css +0 -43
  374. package/src/renderer/editor/plugins/themes/components/mermaid/dark.css +0 -20
  375. package/src/renderer/editor/plugins/themes/components/mermaid/elegant.css +0 -24
  376. package/src/renderer/editor/plugins/themes/components/mermaid/light.css +0 -21
  377. package/src/renderer/editor/plugins/themes/components/mermaid/newsprint.css +0 -26
  378. package/src/renderer/editor/plugins/themes/components/mermaid/variables.css +0 -592
  379. package/src/renderer/editor/plugins/themes/foundation.css +0 -143
  380. package/src/renderer/editor/plugins/themes/theme-manager.ts +0 -133
  381. package/src/renderer/env.d.ts +0 -10
  382. package/src/renderer/index.html +0 -76
  383. package/src/renderer/main.ts +0 -775
  384. package/src/renderer/mobile.css +0 -428
  385. package/themes/academic-paper-pt.css +0 -1321
  386. package/themes/academic-paper.css +0 -1416
  387. package/themes/forest-ink.css +0 -664
  388. package/themes/guizang.css +0 -732
  389. package/themes/pixso-design.css +0 -1261
  390. package/themes/swiss-design.css +0 -596
  391. package/tsconfig.json +0 -14
  392. package/tsconfig.main.json +0 -12
  393. package/tsconfig.main.tsbuildinfo +0 -1
  394. package/tsconfig.preload.json +0 -12
  395. package/tsconfig.preload.tsbuildinfo +0 -1
  396. package/tsconfig.renderer.json +0 -13
  397. package/tsconfig.renderer.tsbuildinfo +0 -1
  398. package/tsconfig.tsbuildinfo +0 -1
@@ -1,1933 +0,0 @@
1
- import { s as setAccDescription, g as getAccDescription, q as getDiagramTitle, p as setDiagramTitle, a as getAccTitle, b as setAccTitle, _ as __name, l as log, I as selectSvgElement, e as configureSvgSize, z as clear, D as getConfig, i as sanitizeText, F as cleanAndMerge, G as defaultConfig_default, K as getThemeVariables3, am as computeDimensionOfText, R as line } from "./index-BX6JHKv6.js";
2
- import { i as initRange } from "./init-ZxktEp_H.js";
3
- import { o as ordinal } from "./ordinal-DSZU4PqD.js";
4
- import { l as linear } from "./linear-BMBn6kVq.js";
5
- import "./preload-helper-tXtZnHb0.js";
6
- import "./defaultLocale-B2RvLBDe.js";
7
- function range(start, stop, step) {
8
- start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
9
- var i = -1, n = Math.max(0, Math.ceil((stop - start) / step)) | 0, range2 = new Array(n);
10
- while (++i < n) {
11
- range2[i] = start + i * step;
12
- }
13
- return range2;
14
- }
15
- function band() {
16
- 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;
17
- delete scale.unknown;
18
- function rescale() {
19
- var n = domain().length, reverse = r1 < r0, start = reverse ? r1 : r0, stop = reverse ? r0 : r1;
20
- step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);
21
- if (round) step = Math.floor(step);
22
- start += (stop - start - step * (n - paddingInner)) * align;
23
- bandwidth = step * (1 - paddingInner);
24
- if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);
25
- var values = range(n).map(function(i) {
26
- return start + step * i;
27
- });
28
- return ordinalRange(reverse ? values.reverse() : values);
29
- }
30
- scale.domain = function(_) {
31
- return arguments.length ? (domain(_), rescale()) : domain();
32
- };
33
- scale.range = function(_) {
34
- return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
35
- };
36
- scale.rangeRound = function(_) {
37
- return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();
38
- };
39
- scale.bandwidth = function() {
40
- return bandwidth;
41
- };
42
- scale.step = function() {
43
- return step;
44
- };
45
- scale.round = function(_) {
46
- return arguments.length ? (round = !!_, rescale()) : round;
47
- };
48
- scale.padding = function(_) {
49
- return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;
50
- };
51
- scale.paddingInner = function(_) {
52
- return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;
53
- };
54
- scale.paddingOuter = function(_) {
55
- return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;
56
- };
57
- scale.align = function(_) {
58
- return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
59
- };
60
- scale.copy = function() {
61
- return band(domain(), [r0, r1]).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);
62
- };
63
- return initRange.apply(rescale(), arguments);
64
- }
65
- var parser = (function() {
66
- var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
67
- for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
68
- return o2;
69
- }, "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];
70
- var parser2 = {
71
- trace: /* @__PURE__ */ __name(function trace() {
72
- }, "trace"),
73
- yy: {},
74
- 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 },
75
- 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" },
76
- 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]],
77
- performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
78
- var $0 = $$.length - 1;
79
- switch (yystate) {
80
- case 5:
81
- yy.setOrientation($$[$0]);
82
- break;
83
- case 9:
84
- yy.setDiagramTitle($$[$0].text.trim());
85
- break;
86
- case 12:
87
- yy.setLineData({ text: "", type: "text" }, $$[$0]);
88
- break;
89
- case 13:
90
- yy.setLineData($$[$0 - 1], $$[$0]);
91
- break;
92
- case 14:
93
- yy.setBarData({ text: "", type: "text" }, $$[$0]);
94
- break;
95
- case 15:
96
- yy.setBarData($$[$0 - 1], $$[$0]);
97
- break;
98
- case 16:
99
- this.$ = $$[$0].trim();
100
- yy.setAccTitle(this.$);
101
- break;
102
- case 17:
103
- case 18:
104
- this.$ = $$[$0].trim();
105
- yy.setAccDescription(this.$);
106
- break;
107
- case 19:
108
- this.$ = $$[$0 - 1];
109
- break;
110
- case 20:
111
- this.$ = [Number($$[$0 - 2]), ...$$[$0]];
112
- break;
113
- case 21:
114
- this.$ = [Number($$[$0])];
115
- break;
116
- case 22:
117
- yy.setXAxisTitle($$[$0]);
118
- break;
119
- case 23:
120
- yy.setXAxisTitle($$[$0 - 1]);
121
- break;
122
- case 24:
123
- yy.setXAxisTitle({ type: "text", text: "" });
124
- break;
125
- case 25:
126
- yy.setXAxisBand($$[$0]);
127
- break;
128
- case 26:
129
- yy.setXAxisRangeData(Number($$[$0 - 2]), Number($$[$0]));
130
- break;
131
- case 27:
132
- this.$ = $$[$0 - 1];
133
- break;
134
- case 28:
135
- this.$ = [$$[$0 - 2], ...$$[$0]];
136
- break;
137
- case 29:
138
- this.$ = [$$[$0]];
139
- break;
140
- case 30:
141
- yy.setYAxisTitle($$[$0]);
142
- break;
143
- case 31:
144
- yy.setYAxisTitle($$[$0 - 1]);
145
- break;
146
- case 32:
147
- yy.setYAxisTitle({ type: "text", text: "" });
148
- break;
149
- case 33:
150
- yy.setYAxisRangeData(Number($$[$0 - 2]), Number($$[$0]));
151
- break;
152
- case 37:
153
- this.$ = { text: $$[$0], type: "text" };
154
- break;
155
- case 38:
156
- this.$ = { text: $$[$0], type: "text" };
157
- break;
158
- case 39:
159
- this.$ = { text: $$[$0], type: "markdown" };
160
- break;
161
- case 40:
162
- this.$ = $$[$0];
163
- break;
164
- case 41:
165
- this.$ = $$[$0 - 1] + "" + $$[$0];
166
- break;
167
- }
168
- }, "anonymous"),
169
- 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] }],
170
- defaultActions: { 8: [2, 1], 10: [2, 3], 21: [2, 2], 72: [2, 28], 73: [2, 20] },
171
- parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
172
- if (hash.recoverable) {
173
- this.trace(str);
174
- } else {
175
- var error = new Error(str);
176
- error.hash = hash;
177
- throw error;
178
- }
179
- }, "parseError"),
180
- parse: /* @__PURE__ */ __name(function parse(input) {
181
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
182
- var args = lstack.slice.call(arguments, 1);
183
- var lexer2 = Object.create(this.lexer);
184
- var sharedState = { yy: {} };
185
- for (var k in this.yy) {
186
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
187
- sharedState.yy[k] = this.yy[k];
188
- }
189
- }
190
- lexer2.setInput(input, sharedState.yy);
191
- sharedState.yy.lexer = lexer2;
192
- sharedState.yy.parser = this;
193
- if (typeof lexer2.yylloc == "undefined") {
194
- lexer2.yylloc = {};
195
- }
196
- var yyloc = lexer2.yylloc;
197
- lstack.push(yyloc);
198
- var ranges = lexer2.options && lexer2.options.ranges;
199
- if (typeof sharedState.yy.parseError === "function") {
200
- this.parseError = sharedState.yy.parseError;
201
- } else {
202
- this.parseError = Object.getPrototypeOf(this).parseError;
203
- }
204
- function popStack(n) {
205
- stack.length = stack.length - 2 * n;
206
- vstack.length = vstack.length - n;
207
- lstack.length = lstack.length - n;
208
- }
209
- __name(popStack, "popStack");
210
- function lex() {
211
- var token;
212
- token = tstack.pop() || lexer2.lex() || EOF;
213
- if (typeof token !== "number") {
214
- if (token instanceof Array) {
215
- tstack = token;
216
- token = tstack.pop();
217
- }
218
- token = self.symbols_[token] || token;
219
- }
220
- return token;
221
- }
222
- __name(lex, "lex");
223
- var symbol, state, action, r, yyval = {}, p, len, newState, expected;
224
- while (true) {
225
- state = stack[stack.length - 1];
226
- if (this.defaultActions[state]) {
227
- action = this.defaultActions[state];
228
- } else {
229
- if (symbol === null || typeof symbol == "undefined") {
230
- symbol = lex();
231
- }
232
- action = table[state] && table[state][symbol];
233
- }
234
- if (typeof action === "undefined" || !action.length || !action[0]) {
235
- var errStr = "";
236
- expected = [];
237
- for (p in table[state]) {
238
- if (this.terminals_[p] && p > TERROR) {
239
- expected.push("'" + this.terminals_[p] + "'");
240
- }
241
- }
242
- if (lexer2.showPosition) {
243
- errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
244
- } else {
245
- errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
246
- }
247
- this.parseError(errStr, {
248
- text: lexer2.match,
249
- token: this.terminals_[symbol] || symbol,
250
- line: lexer2.yylineno,
251
- loc: yyloc,
252
- expected
253
- });
254
- }
255
- if (action[0] instanceof Array && action.length > 1) {
256
- throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
257
- }
258
- switch (action[0]) {
259
- case 1:
260
- stack.push(symbol);
261
- vstack.push(lexer2.yytext);
262
- lstack.push(lexer2.yylloc);
263
- stack.push(action[1]);
264
- symbol = null;
265
- {
266
- yyleng = lexer2.yyleng;
267
- yytext = lexer2.yytext;
268
- yylineno = lexer2.yylineno;
269
- yyloc = lexer2.yylloc;
270
- }
271
- break;
272
- case 2:
273
- len = this.productions_[action[1]][1];
274
- yyval.$ = vstack[vstack.length - len];
275
- yyval._$ = {
276
- first_line: lstack[lstack.length - (len || 1)].first_line,
277
- last_line: lstack[lstack.length - 1].last_line,
278
- first_column: lstack[lstack.length - (len || 1)].first_column,
279
- last_column: lstack[lstack.length - 1].last_column
280
- };
281
- if (ranges) {
282
- yyval._$.range = [
283
- lstack[lstack.length - (len || 1)].range[0],
284
- lstack[lstack.length - 1].range[1]
285
- ];
286
- }
287
- r = this.performAction.apply(yyval, [
288
- yytext,
289
- yyleng,
290
- yylineno,
291
- sharedState.yy,
292
- action[1],
293
- vstack,
294
- lstack
295
- ].concat(args));
296
- if (typeof r !== "undefined") {
297
- return r;
298
- }
299
- if (len) {
300
- stack = stack.slice(0, -1 * len * 2);
301
- vstack = vstack.slice(0, -1 * len);
302
- lstack = lstack.slice(0, -1 * len);
303
- }
304
- stack.push(this.productions_[action[1]][0]);
305
- vstack.push(yyval.$);
306
- lstack.push(yyval._$);
307
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
308
- stack.push(newState);
309
- break;
310
- case 3:
311
- return true;
312
- }
313
- }
314
- return true;
315
- }, "parse")
316
- };
317
- var lexer = /* @__PURE__ */ (function() {
318
- var lexer2 = {
319
- EOF: 1,
320
- parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
321
- if (this.yy.parser) {
322
- this.yy.parser.parseError(str, hash);
323
- } else {
324
- throw new Error(str);
325
- }
326
- }, "parseError"),
327
- // resets the lexer, sets new input
328
- setInput: /* @__PURE__ */ __name(function(input, yy) {
329
- this.yy = yy || this.yy || {};
330
- this._input = input;
331
- this._more = this._backtrack = this.done = false;
332
- this.yylineno = this.yyleng = 0;
333
- this.yytext = this.matched = this.match = "";
334
- this.conditionStack = ["INITIAL"];
335
- this.yylloc = {
336
- first_line: 1,
337
- first_column: 0,
338
- last_line: 1,
339
- last_column: 0
340
- };
341
- if (this.options.ranges) {
342
- this.yylloc.range = [0, 0];
343
- }
344
- this.offset = 0;
345
- return this;
346
- }, "setInput"),
347
- // consumes and returns one char from the input
348
- input: /* @__PURE__ */ __name(function() {
349
- var ch = this._input[0];
350
- this.yytext += ch;
351
- this.yyleng++;
352
- this.offset++;
353
- this.match += ch;
354
- this.matched += ch;
355
- var lines = ch.match(/(?:\r\n?|\n).*/g);
356
- if (lines) {
357
- this.yylineno++;
358
- this.yylloc.last_line++;
359
- } else {
360
- this.yylloc.last_column++;
361
- }
362
- if (this.options.ranges) {
363
- this.yylloc.range[1]++;
364
- }
365
- this._input = this._input.slice(1);
366
- return ch;
367
- }, "input"),
368
- // unshifts one char (or a string) into the input
369
- unput: /* @__PURE__ */ __name(function(ch) {
370
- var len = ch.length;
371
- var lines = ch.split(/(?:\r\n?|\n)/g);
372
- this._input = ch + this._input;
373
- this.yytext = this.yytext.substr(0, this.yytext.length - len);
374
- this.offset -= len;
375
- var oldLines = this.match.split(/(?:\r\n?|\n)/g);
376
- this.match = this.match.substr(0, this.match.length - 1);
377
- this.matched = this.matched.substr(0, this.matched.length - 1);
378
- if (lines.length - 1) {
379
- this.yylineno -= lines.length - 1;
380
- }
381
- var r = this.yylloc.range;
382
- this.yylloc = {
383
- first_line: this.yylloc.first_line,
384
- last_line: this.yylineno + 1,
385
- first_column: this.yylloc.first_column,
386
- 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
387
- };
388
- if (this.options.ranges) {
389
- this.yylloc.range = [r[0], r[0] + this.yyleng - len];
390
- }
391
- this.yyleng = this.yytext.length;
392
- return this;
393
- }, "unput"),
394
- // When called from action, caches matched text and appends it on next action
395
- more: /* @__PURE__ */ __name(function() {
396
- this._more = true;
397
- return this;
398
- }, "more"),
399
- // 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.
400
- reject: /* @__PURE__ */ __name(function() {
401
- if (this.options.backtrack_lexer) {
402
- this._backtrack = true;
403
- } else {
404
- 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(), {
405
- text: "",
406
- token: null,
407
- line: this.yylineno
408
- });
409
- }
410
- return this;
411
- }, "reject"),
412
- // retain first n characters of the match
413
- less: /* @__PURE__ */ __name(function(n) {
414
- this.unput(this.match.slice(n));
415
- }, "less"),
416
- // displays already matched input, i.e. for error messages
417
- pastInput: /* @__PURE__ */ __name(function() {
418
- var past = this.matched.substr(0, this.matched.length - this.match.length);
419
- return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
420
- }, "pastInput"),
421
- // displays upcoming input, i.e. for error messages
422
- upcomingInput: /* @__PURE__ */ __name(function() {
423
- var next = this.match;
424
- if (next.length < 20) {
425
- next += this._input.substr(0, 20 - next.length);
426
- }
427
- return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
428
- }, "upcomingInput"),
429
- // displays the character position where the lexing error occurred, i.e. for error messages
430
- showPosition: /* @__PURE__ */ __name(function() {
431
- var pre = this.pastInput();
432
- var c = new Array(pre.length + 1).join("-");
433
- return pre + this.upcomingInput() + "\n" + c + "^";
434
- }, "showPosition"),
435
- // test the lexed token: return FALSE when not a match, otherwise return token
436
- test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
437
- var token, lines, backup;
438
- if (this.options.backtrack_lexer) {
439
- backup = {
440
- yylineno: this.yylineno,
441
- yylloc: {
442
- first_line: this.yylloc.first_line,
443
- last_line: this.last_line,
444
- first_column: this.yylloc.first_column,
445
- last_column: this.yylloc.last_column
446
- },
447
- yytext: this.yytext,
448
- match: this.match,
449
- matches: this.matches,
450
- matched: this.matched,
451
- yyleng: this.yyleng,
452
- offset: this.offset,
453
- _more: this._more,
454
- _input: this._input,
455
- yy: this.yy,
456
- conditionStack: this.conditionStack.slice(0),
457
- done: this.done
458
- };
459
- if (this.options.ranges) {
460
- backup.yylloc.range = this.yylloc.range.slice(0);
461
- }
462
- }
463
- lines = match[0].match(/(?:\r\n?|\n).*/g);
464
- if (lines) {
465
- this.yylineno += lines.length;
466
- }
467
- this.yylloc = {
468
- first_line: this.yylloc.last_line,
469
- last_line: this.yylineno + 1,
470
- first_column: this.yylloc.last_column,
471
- last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
472
- };
473
- this.yytext += match[0];
474
- this.match += match[0];
475
- this.matches = match;
476
- this.yyleng = this.yytext.length;
477
- if (this.options.ranges) {
478
- this.yylloc.range = [this.offset, this.offset += this.yyleng];
479
- }
480
- this._more = false;
481
- this._backtrack = false;
482
- this._input = this._input.slice(match[0].length);
483
- this.matched += match[0];
484
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
485
- if (this.done && this._input) {
486
- this.done = false;
487
- }
488
- if (token) {
489
- return token;
490
- } else if (this._backtrack) {
491
- for (var k in backup) {
492
- this[k] = backup[k];
493
- }
494
- return false;
495
- }
496
- return false;
497
- }, "test_match"),
498
- // return next match in input
499
- next: /* @__PURE__ */ __name(function() {
500
- if (this.done) {
501
- return this.EOF;
502
- }
503
- if (!this._input) {
504
- this.done = true;
505
- }
506
- var token, match, tempMatch, index;
507
- if (!this._more) {
508
- this.yytext = "";
509
- this.match = "";
510
- }
511
- var rules = this._currentRules();
512
- for (var i = 0; i < rules.length; i++) {
513
- tempMatch = this._input.match(this.rules[rules[i]]);
514
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
515
- match = tempMatch;
516
- index = i;
517
- if (this.options.backtrack_lexer) {
518
- token = this.test_match(tempMatch, rules[i]);
519
- if (token !== false) {
520
- return token;
521
- } else if (this._backtrack) {
522
- match = false;
523
- continue;
524
- } else {
525
- return false;
526
- }
527
- } else if (!this.options.flex) {
528
- break;
529
- }
530
- }
531
- }
532
- if (match) {
533
- token = this.test_match(match, rules[index]);
534
- if (token !== false) {
535
- return token;
536
- }
537
- return false;
538
- }
539
- if (this._input === "") {
540
- return this.EOF;
541
- } else {
542
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
543
- text: "",
544
- token: null,
545
- line: this.yylineno
546
- });
547
- }
548
- }, "next"),
549
- // return next match that has a token
550
- lex: /* @__PURE__ */ __name(function lex() {
551
- var r = this.next();
552
- if (r) {
553
- return r;
554
- } else {
555
- return this.lex();
556
- }
557
- }, "lex"),
558
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
559
- begin: /* @__PURE__ */ __name(function begin(condition) {
560
- this.conditionStack.push(condition);
561
- }, "begin"),
562
- // pop the previously active lexer condition state off the condition stack
563
- popState: /* @__PURE__ */ __name(function popState() {
564
- var n = this.conditionStack.length - 1;
565
- if (n > 0) {
566
- return this.conditionStack.pop();
567
- } else {
568
- return this.conditionStack[0];
569
- }
570
- }, "popState"),
571
- // produce the lexer rule set which is active for the currently active lexer condition state
572
- _currentRules: /* @__PURE__ */ __name(function _currentRules() {
573
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
574
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
575
- } else {
576
- return this.conditions["INITIAL"].rules;
577
- }
578
- }, "_currentRules"),
579
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
580
- topState: /* @__PURE__ */ __name(function topState(n) {
581
- n = this.conditionStack.length - 1 - Math.abs(n || 0);
582
- if (n >= 0) {
583
- return this.conditionStack[n];
584
- } else {
585
- return "INITIAL";
586
- }
587
- }, "topState"),
588
- // alias for begin(condition)
589
- pushState: /* @__PURE__ */ __name(function pushState(condition) {
590
- this.begin(condition);
591
- }, "pushState"),
592
- // return the number of states currently on the stack
593
- stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
594
- return this.conditionStack.length;
595
- }, "stateStackSize"),
596
- options: { "case-insensitive": true },
597
- performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
598
- switch ($avoiding_name_collisions) {
599
- case 0:
600
- break;
601
- case 1:
602
- break;
603
- case 2:
604
- this.popState();
605
- return 34;
606
- case 3:
607
- this.popState();
608
- return 34;
609
- case 4:
610
- return 34;
611
- case 5:
612
- break;
613
- case 6:
614
- return 10;
615
- case 7:
616
- this.pushState("acc_title");
617
- return 19;
618
- case 8:
619
- this.popState();
620
- return "acc_title_value";
621
- case 9:
622
- this.pushState("acc_descr");
623
- return 21;
624
- case 10:
625
- this.popState();
626
- return "acc_descr_value";
627
- case 11:
628
- this.pushState("acc_descr_multiline");
629
- break;
630
- case 12:
631
- this.popState();
632
- break;
633
- case 13:
634
- return "acc_descr_multiline_value";
635
- case 14:
636
- return 5;
637
- case 15:
638
- return 5;
639
- case 16:
640
- return 8;
641
- case 17:
642
- this.pushState("axis_data");
643
- return "X_AXIS";
644
- case 18:
645
- this.pushState("axis_data");
646
- return "Y_AXIS";
647
- case 19:
648
- this.pushState("axis_band_data");
649
- return 24;
650
- case 20:
651
- return 31;
652
- case 21:
653
- this.pushState("data");
654
- return 16;
655
- case 22:
656
- this.pushState("data");
657
- return 18;
658
- case 23:
659
- this.pushState("data_inner");
660
- return 24;
661
- case 24:
662
- return 27;
663
- case 25:
664
- this.popState();
665
- return 26;
666
- case 26:
667
- this.popState();
668
- break;
669
- case 27:
670
- this.pushState("string");
671
- break;
672
- case 28:
673
- this.popState();
674
- break;
675
- case 29:
676
- return "STR";
677
- case 30:
678
- return 24;
679
- case 31:
680
- return 26;
681
- case 32:
682
- return 43;
683
- case 33:
684
- return "COLON";
685
- case 34:
686
- return 44;
687
- case 35:
688
- return 28;
689
- case 36:
690
- return 45;
691
- case 37:
692
- return 46;
693
- case 38:
694
- return 48;
695
- case 39:
696
- return 50;
697
- case 40:
698
- return 47;
699
- case 41:
700
- return 41;
701
- case 42:
702
- return 49;
703
- case 43:
704
- return 42;
705
- case 44:
706
- break;
707
- case 45:
708
- return 35;
709
- case 46:
710
- return 36;
711
- }
712
- }, "anonymous"),
713
- rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:(\r?\n))/i, /^(?:(\r?\n))/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:\})/i, /^(?:[^\}]*)/i, /^(?:xychart-beta\b)/i, /^(?:xychart\b)/i, /^(?:(?:vertical|horizontal))/i, /^(?:x-axis\b)/i, /^(?:y-axis\b)/i, /^(?:\[)/i, /^(?:-->)/i, /^(?:line\b)/i, /^(?:bar\b)/i, /^(?:\[)/i, /^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i, /^(?:\])/i, /^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s+)/i, /^(?:;)/i, /^(?:$)/i],
714
- conditions: { "data_inner": { "rules": [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 21, 22, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], "inclusive": true }, "data": { "rules": [0, 1, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 21, 22, 23, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], "inclusive": true }, "axis_band_data": { "rules": [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 21, 22, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], "inclusive": true }, "axis_data": { "rules": [0, 1, 2, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], "inclusive": true }, "acc_descr_multiline": { "rules": [12, 13], "inclusive": false }, "acc_descr": { "rules": [10], "inclusive": false }, "acc_title": { "rules": [8], "inclusive": false }, "title": { "rules": [], "inclusive": false }, "md_string": { "rules": [], "inclusive": false }, "string": { "rules": [28, 29], "inclusive": false }, "INITIAL": { "rules": [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 21, 22, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], "inclusive": true } }
715
- };
716
- return lexer2;
717
- })();
718
- parser2.lexer = lexer;
719
- function Parser() {
720
- this.yy = {};
721
- }
722
- __name(Parser, "Parser");
723
- Parser.prototype = parser2;
724
- parser2.Parser = Parser;
725
- return new Parser();
726
- })();
727
- parser.parser = parser;
728
- var xychart_default = parser;
729
- function isBarPlot(data) {
730
- return data.type === "bar";
731
- }
732
- __name(isBarPlot, "isBarPlot");
733
- function isBandAxisData(data) {
734
- return data.type === "band";
735
- }
736
- __name(isBandAxisData, "isBandAxisData");
737
- function isLinearAxisData(data) {
738
- return data.type === "linear";
739
- }
740
- __name(isLinearAxisData, "isLinearAxisData");
741
- var TextDimensionCalculatorWithFont = class {
742
- constructor(parentGroup) {
743
- this.parentGroup = parentGroup;
744
- }
745
- static {
746
- __name(this, "TextDimensionCalculatorWithFont");
747
- }
748
- getMaxDimension(texts, fontSize) {
749
- if (!this.parentGroup) {
750
- return {
751
- width: texts.reduce((acc, cur) => Math.max(cur.length, acc), 0) * fontSize,
752
- height: fontSize
753
- };
754
- }
755
- const dimension = {
756
- width: 0,
757
- height: 0
758
- };
759
- const elem = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", fontSize);
760
- for (const t of texts) {
761
- const bbox = computeDimensionOfText(elem, 1, t);
762
- const width = bbox ? bbox.width : t.length * fontSize;
763
- const height = bbox ? bbox.height : fontSize;
764
- dimension.width = Math.max(dimension.width, width);
765
- dimension.height = Math.max(dimension.height, height);
766
- }
767
- elem.remove();
768
- return dimension;
769
- }
770
- };
771
- var BAR_WIDTH_TO_TICK_WIDTH_RATIO = 0.7;
772
- var MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL = 0.2;
773
- var BaseAxis = class {
774
- constructor(axisConfig, title, textDimensionCalculator, axisThemeConfig) {
775
- this.axisConfig = axisConfig;
776
- this.title = title;
777
- this.textDimensionCalculator = textDimensionCalculator;
778
- this.axisThemeConfig = axisThemeConfig;
779
- this.boundingRect = { x: 0, y: 0, width: 0, height: 0 };
780
- this.axisPosition = "left";
781
- this.showTitle = false;
782
- this.showLabel = false;
783
- this.showTick = false;
784
- this.showAxisLine = false;
785
- this.outerPadding = 0;
786
- this.titleTextHeight = 0;
787
- this.labelTextHeight = 0;
788
- this.range = [0, 10];
789
- this.boundingRect = { x: 0, y: 0, width: 0, height: 0 };
790
- this.axisPosition = "left";
791
- }
792
- static {
793
- __name(this, "BaseAxis");
794
- }
795
- setRange(range2) {
796
- this.range = range2;
797
- if (this.axisPosition === "left" || this.axisPosition === "right") {
798
- this.boundingRect.height = range2[1] - range2[0];
799
- } else {
800
- this.boundingRect.width = range2[1] - range2[0];
801
- }
802
- this.recalculateScale();
803
- }
804
- getRange() {
805
- return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding];
806
- }
807
- setAxisPosition(axisPosition) {
808
- this.axisPosition = axisPosition;
809
- this.setRange(this.range);
810
- }
811
- getTickDistance() {
812
- const range2 = this.getRange();
813
- return Math.abs(range2[0] - range2[1]) / this.getTickValues().length;
814
- }
815
- getAxisOuterPadding() {
816
- return this.outerPadding;
817
- }
818
- getLabelDimension() {
819
- return this.textDimensionCalculator.getMaxDimension(
820
- this.getTickValues().map((tick) => tick.toString()),
821
- this.axisConfig.labelFontSize
822
- );
823
- }
824
- recalculateOuterPaddingToDrawBar() {
825
- if (BAR_WIDTH_TO_TICK_WIDTH_RATIO * this.getTickDistance() > this.outerPadding * 2) {
826
- this.outerPadding = Math.floor(BAR_WIDTH_TO_TICK_WIDTH_RATIO * this.getTickDistance() / 2);
827
- }
828
- this.recalculateScale();
829
- }
830
- calculateSpaceIfDrawnHorizontally(availableSpace) {
831
- let availableHeight = availableSpace.height;
832
- if (this.axisConfig.showAxisLine && availableHeight > this.axisConfig.axisLineWidth) {
833
- availableHeight -= this.axisConfig.axisLineWidth;
834
- this.showAxisLine = true;
835
- }
836
- if (this.axisConfig.showLabel) {
837
- const spaceRequired = this.getLabelDimension();
838
- const maxPadding = MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL * availableSpace.width;
839
- this.outerPadding = Math.min(spaceRequired.width / 2, maxPadding);
840
- const heightRequired = spaceRequired.height + this.axisConfig.labelPadding * 2;
841
- this.labelTextHeight = spaceRequired.height;
842
- if (heightRequired <= availableHeight) {
843
- availableHeight -= heightRequired;
844
- this.showLabel = true;
845
- }
846
- }
847
- if (this.axisConfig.showTick && availableHeight >= this.axisConfig.tickLength) {
848
- this.showTick = true;
849
- availableHeight -= this.axisConfig.tickLength;
850
- }
851
- if (this.axisConfig.showTitle && this.title) {
852
- const spaceRequired = this.textDimensionCalculator.getMaxDimension(
853
- [this.title],
854
- this.axisConfig.titleFontSize
855
- );
856
- const heightRequired = spaceRequired.height + this.axisConfig.titlePadding * 2;
857
- this.titleTextHeight = spaceRequired.height;
858
- if (heightRequired <= availableHeight) {
859
- availableHeight -= heightRequired;
860
- this.showTitle = true;
861
- }
862
- }
863
- this.boundingRect.width = availableSpace.width;
864
- this.boundingRect.height = availableSpace.height - availableHeight;
865
- }
866
- calculateSpaceIfDrawnVertical(availableSpace) {
867
- let availableWidth = availableSpace.width;
868
- if (this.axisConfig.showAxisLine && availableWidth > this.axisConfig.axisLineWidth) {
869
- availableWidth -= this.axisConfig.axisLineWidth;
870
- this.showAxisLine = true;
871
- }
872
- if (this.axisConfig.showLabel) {
873
- const spaceRequired = this.getLabelDimension();
874
- const maxPadding = MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL * availableSpace.height;
875
- this.outerPadding = Math.min(spaceRequired.height / 2, maxPadding);
876
- const widthRequired = spaceRequired.width + this.axisConfig.labelPadding * 2;
877
- if (widthRequired <= availableWidth) {
878
- availableWidth -= widthRequired;
879
- this.showLabel = true;
880
- }
881
- }
882
- if (this.axisConfig.showTick && availableWidth >= this.axisConfig.tickLength) {
883
- this.showTick = true;
884
- availableWidth -= this.axisConfig.tickLength;
885
- }
886
- if (this.axisConfig.showTitle && this.title) {
887
- const spaceRequired = this.textDimensionCalculator.getMaxDimension(
888
- [this.title],
889
- this.axisConfig.titleFontSize
890
- );
891
- const widthRequired = spaceRequired.height + this.axisConfig.titlePadding * 2;
892
- this.titleTextHeight = spaceRequired.height;
893
- if (widthRequired <= availableWidth) {
894
- availableWidth -= widthRequired;
895
- this.showTitle = true;
896
- }
897
- }
898
- this.boundingRect.width = availableSpace.width - availableWidth;
899
- this.boundingRect.height = availableSpace.height;
900
- }
901
- calculateSpace(availableSpace) {
902
- if (this.axisPosition === "left" || this.axisPosition === "right") {
903
- this.calculateSpaceIfDrawnVertical(availableSpace);
904
- } else {
905
- this.calculateSpaceIfDrawnHorizontally(availableSpace);
906
- }
907
- this.recalculateScale();
908
- return {
909
- width: this.boundingRect.width,
910
- height: this.boundingRect.height
911
- };
912
- }
913
- setBoundingBoxXY(point) {
914
- this.boundingRect.x = point.x;
915
- this.boundingRect.y = point.y;
916
- }
917
- getDrawableElementsForLeftAxis() {
918
- const drawableElement = [];
919
- if (this.showAxisLine) {
920
- const x = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2;
921
- drawableElement.push({
922
- type: "path",
923
- groupTexts: ["left-axis", "axisl-line"],
924
- data: [
925
- {
926
- path: `M ${x},${this.boundingRect.y} L ${x},${this.boundingRect.y + this.boundingRect.height} `,
927
- strokeFill: this.axisThemeConfig.axisLineColor,
928
- strokeWidth: this.axisConfig.axisLineWidth
929
- }
930
- ]
931
- });
932
- }
933
- if (this.showLabel) {
934
- drawableElement.push({
935
- type: "text",
936
- groupTexts: ["left-axis", "label"],
937
- data: this.getTickValues().map((tick) => ({
938
- text: tick.toString(),
939
- 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),
940
- y: this.getScaleValue(tick),
941
- fill: this.axisThemeConfig.labelColor,
942
- fontSize: this.axisConfig.labelFontSize,
943
- rotation: 0,
944
- verticalPos: "middle",
945
- horizontalPos: "right"
946
- }))
947
- });
948
- }
949
- if (this.showTick) {
950
- const x = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
951
- drawableElement.push({
952
- type: "path",
953
- groupTexts: ["left-axis", "ticks"],
954
- data: this.getTickValues().map((tick) => ({
955
- path: `M ${x},${this.getScaleValue(tick)} L ${x - this.axisConfig.tickLength},${this.getScaleValue(tick)}`,
956
- strokeFill: this.axisThemeConfig.tickColor,
957
- strokeWidth: this.axisConfig.tickWidth
958
- }))
959
- });
960
- }
961
- if (this.showTitle) {
962
- drawableElement.push({
963
- type: "text",
964
- groupTexts: ["left-axis", "title"],
965
- data: [
966
- {
967
- text: this.title,
968
- x: this.boundingRect.x + this.axisConfig.titlePadding,
969
- y: this.boundingRect.y + this.boundingRect.height / 2,
970
- fill: this.axisThemeConfig.titleColor,
971
- fontSize: this.axisConfig.titleFontSize,
972
- rotation: 270,
973
- verticalPos: "top",
974
- horizontalPos: "center"
975
- }
976
- ]
977
- });
978
- }
979
- return drawableElement;
980
- }
981
- getDrawableElementsForBottomAxis() {
982
- const drawableElement = [];
983
- if (this.showAxisLine) {
984
- const y = this.boundingRect.y + this.axisConfig.axisLineWidth / 2;
985
- drawableElement.push({
986
- type: "path",
987
- groupTexts: ["bottom-axis", "axis-line"],
988
- data: [
989
- {
990
- path: `M ${this.boundingRect.x},${y} L ${this.boundingRect.x + this.boundingRect.width},${y}`,
991
- strokeFill: this.axisThemeConfig.axisLineColor,
992
- strokeWidth: this.axisConfig.axisLineWidth
993
- }
994
- ]
995
- });
996
- }
997
- if (this.showLabel) {
998
- drawableElement.push({
999
- type: "text",
1000
- groupTexts: ["bottom-axis", "label"],
1001
- data: this.getTickValues().map((tick) => ({
1002
- text: tick.toString(),
1003
- x: this.getScaleValue(tick),
1004
- y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
1005
- fill: this.axisThemeConfig.labelColor,
1006
- fontSize: this.axisConfig.labelFontSize,
1007
- rotation: 0,
1008
- verticalPos: "top",
1009
- horizontalPos: "center"
1010
- }))
1011
- });
1012
- }
1013
- if (this.showTick) {
1014
- const y = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
1015
- drawableElement.push({
1016
- type: "path",
1017
- groupTexts: ["bottom-axis", "ticks"],
1018
- data: this.getTickValues().map((tick) => ({
1019
- path: `M ${this.getScaleValue(tick)},${y} L ${this.getScaleValue(tick)},${y + this.axisConfig.tickLength}`,
1020
- strokeFill: this.axisThemeConfig.tickColor,
1021
- strokeWidth: this.axisConfig.tickWidth
1022
- }))
1023
- });
1024
- }
1025
- if (this.showTitle) {
1026
- drawableElement.push({
1027
- type: "text",
1028
- groupTexts: ["bottom-axis", "title"],
1029
- data: [
1030
- {
1031
- text: this.title,
1032
- x: this.range[0] + (this.range[1] - this.range[0]) / 2,
1033
- y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight,
1034
- fill: this.axisThemeConfig.titleColor,
1035
- fontSize: this.axisConfig.titleFontSize,
1036
- rotation: 0,
1037
- verticalPos: "top",
1038
- horizontalPos: "center"
1039
- }
1040
- ]
1041
- });
1042
- }
1043
- return drawableElement;
1044
- }
1045
- getDrawableElementsForTopAxis() {
1046
- const drawableElement = [];
1047
- if (this.showAxisLine) {
1048
- const y = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2;
1049
- drawableElement.push({
1050
- type: "path",
1051
- groupTexts: ["top-axis", "axis-line"],
1052
- data: [
1053
- {
1054
- path: `M ${this.boundingRect.x},${y} L ${this.boundingRect.x + this.boundingRect.width},${y}`,
1055
- strokeFill: this.axisThemeConfig.axisLineColor,
1056
- strokeWidth: this.axisConfig.axisLineWidth
1057
- }
1058
- ]
1059
- });
1060
- }
1061
- if (this.showLabel) {
1062
- drawableElement.push({
1063
- type: "text",
1064
- groupTexts: ["top-axis", "label"],
1065
- data: this.getTickValues().map((tick) => ({
1066
- text: tick.toString(),
1067
- x: this.getScaleValue(tick),
1068
- y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding,
1069
- fill: this.axisThemeConfig.labelColor,
1070
- fontSize: this.axisConfig.labelFontSize,
1071
- rotation: 0,
1072
- verticalPos: "top",
1073
- horizontalPos: "center"
1074
- }))
1075
- });
1076
- }
1077
- if (this.showTick) {
1078
- const y = this.boundingRect.y;
1079
- drawableElement.push({
1080
- type: "path",
1081
- groupTexts: ["top-axis", "ticks"],
1082
- data: this.getTickValues().map((tick) => ({
1083
- 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)}`,
1084
- strokeFill: this.axisThemeConfig.tickColor,
1085
- strokeWidth: this.axisConfig.tickWidth
1086
- }))
1087
- });
1088
- }
1089
- if (this.showTitle) {
1090
- drawableElement.push({
1091
- type: "text",
1092
- groupTexts: ["top-axis", "title"],
1093
- data: [
1094
- {
1095
- text: this.title,
1096
- x: this.boundingRect.x + this.boundingRect.width / 2,
1097
- y: this.boundingRect.y + this.axisConfig.titlePadding,
1098
- fill: this.axisThemeConfig.titleColor,
1099
- fontSize: this.axisConfig.titleFontSize,
1100
- rotation: 0,
1101
- verticalPos: "top",
1102
- horizontalPos: "center"
1103
- }
1104
- ]
1105
- });
1106
- }
1107
- return drawableElement;
1108
- }
1109
- getDrawableElements() {
1110
- if (this.axisPosition === "left") {
1111
- return this.getDrawableElementsForLeftAxis();
1112
- }
1113
- if (this.axisPosition === "right") {
1114
- throw Error("Drawing of right axis is not implemented");
1115
- }
1116
- if (this.axisPosition === "bottom") {
1117
- return this.getDrawableElementsForBottomAxis();
1118
- }
1119
- if (this.axisPosition === "top") {
1120
- return this.getDrawableElementsForTopAxis();
1121
- }
1122
- return [];
1123
- }
1124
- };
1125
- var BandAxis = class extends BaseAxis {
1126
- static {
1127
- __name(this, "BandAxis");
1128
- }
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
- };
1148
- var LinearAxis = class extends BaseAxis {
1149
- static {
1150
- __name(this, "LinearAxis");
1151
- }
1152
- constructor(axisConfig, axisThemeConfig, domain, title, textDimensionCalculator) {
1153
- super(axisConfig, title, textDimensionCalculator, axisThemeConfig);
1154
- this.domain = domain;
1155
- this.scale = linear().domain(this.domain).range(this.getRange());
1156
- }
1157
- getTickValues() {
1158
- return this.scale.ticks();
1159
- }
1160
- recalculateScale() {
1161
- const domain = [...this.domain];
1162
- if (this.axisPosition === "left") {
1163
- domain.reverse();
1164
- }
1165
- this.scale = linear().domain(domain).range(this.getRange());
1166
- }
1167
- getScaleValue(value) {
1168
- return this.scale(value);
1169
- }
1170
- };
1171
- function getAxis(data, axisConfig, axisThemeConfig, tmpSVGGroup2) {
1172
- const textDimensionCalculator = new TextDimensionCalculatorWithFont(tmpSVGGroup2);
1173
- if (isBandAxisData(data)) {
1174
- return new BandAxis(
1175
- axisConfig,
1176
- axisThemeConfig,
1177
- data.categories,
1178
- data.title,
1179
- textDimensionCalculator
1180
- );
1181
- }
1182
- return new LinearAxis(
1183
- axisConfig,
1184
- axisThemeConfig,
1185
- [data.min, data.max],
1186
- data.title,
1187
- textDimensionCalculator
1188
- );
1189
- }
1190
- __name(getAxis, "getAxis");
1191
- var ChartTitle = class {
1192
- constructor(textDimensionCalculator, chartConfig, chartData, chartThemeConfig) {
1193
- this.textDimensionCalculator = textDimensionCalculator;
1194
- this.chartConfig = chartConfig;
1195
- this.chartData = chartData;
1196
- this.chartThemeConfig = chartThemeConfig;
1197
- this.boundingRect = {
1198
- x: 0,
1199
- y: 0,
1200
- width: 0,
1201
- height: 0
1202
- };
1203
- this.showChartTitle = false;
1204
- }
1205
- static {
1206
- __name(this, "ChartTitle");
1207
- }
1208
- setBoundingBoxXY(point) {
1209
- this.boundingRect.x = point.x;
1210
- this.boundingRect.y = point.y;
1211
- }
1212
- calculateSpace(availableSpace) {
1213
- const titleDimension = this.textDimensionCalculator.getMaxDimension(
1214
- [this.chartData.title],
1215
- this.chartConfig.titleFontSize
1216
- );
1217
- const widthRequired = Math.max(titleDimension.width, availableSpace.width);
1218
- const heightRequired = titleDimension.height + 2 * this.chartConfig.titlePadding;
1219
- if (titleDimension.width <= widthRequired && titleDimension.height <= heightRequired && this.chartConfig.showTitle && this.chartData.title) {
1220
- this.boundingRect.width = widthRequired;
1221
- this.boundingRect.height = heightRequired;
1222
- this.showChartTitle = true;
1223
- }
1224
- return {
1225
- width: this.boundingRect.width,
1226
- height: this.boundingRect.height
1227
- };
1228
- }
1229
- getDrawableElements() {
1230
- const drawableElem = [];
1231
- if (this.showChartTitle) {
1232
- drawableElem.push({
1233
- groupTexts: ["chart-title"],
1234
- type: "text",
1235
- data: [
1236
- {
1237
- fontSize: this.chartConfig.titleFontSize,
1238
- text: this.chartData.title,
1239
- verticalPos: "middle",
1240
- horizontalPos: "center",
1241
- x: this.boundingRect.x + this.boundingRect.width / 2,
1242
- y: this.boundingRect.y + this.boundingRect.height / 2,
1243
- fill: this.chartThemeConfig.titleColor,
1244
- rotation: 0
1245
- }
1246
- ]
1247
- });
1248
- }
1249
- return drawableElem;
1250
- }
1251
- };
1252
- function getChartTitleComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2) {
1253
- const textDimensionCalculator = new TextDimensionCalculatorWithFont(tmpSVGGroup2);
1254
- return new ChartTitle(textDimensionCalculator, chartConfig, chartData, chartThemeConfig);
1255
- }
1256
- __name(getChartTitleComponent, "getChartTitleComponent");
1257
- var LinePlot = class {
1258
- constructor(plotData, xAxis, yAxis, orientation, plotIndex2) {
1259
- this.plotData = plotData;
1260
- this.xAxis = xAxis;
1261
- this.yAxis = yAxis;
1262
- this.orientation = orientation;
1263
- this.plotIndex = plotIndex2;
1264
- }
1265
- static {
1266
- __name(this, "LinePlot");
1267
- }
1268
- getDrawableElement() {
1269
- const finalData = this.plotData.data.map((d) => [
1270
- this.xAxis.getScaleValue(d[0]),
1271
- this.yAxis.getScaleValue(d[1])
1272
- ]);
1273
- let path;
1274
- if (this.orientation === "horizontal") {
1275
- path = line().y((d) => d[0]).x((d) => d[1])(finalData);
1276
- } else {
1277
- path = line().x((d) => d[0]).y((d) => d[1])(finalData);
1278
- }
1279
- if (!path) {
1280
- return [];
1281
- }
1282
- return [
1283
- {
1284
- groupTexts: ["plot", `line-plot-${this.plotIndex}`],
1285
- type: "path",
1286
- data: [
1287
- {
1288
- path,
1289
- strokeFill: this.plotData.strokeFill,
1290
- strokeWidth: this.plotData.strokeWidth
1291
- }
1292
- ]
1293
- }
1294
- ];
1295
- }
1296
- };
1297
- var BarPlot = class {
1298
- constructor(barData, boundingRect, xAxis, yAxis, orientation, plotIndex2) {
1299
- this.barData = barData;
1300
- this.boundingRect = boundingRect;
1301
- this.xAxis = xAxis;
1302
- this.yAxis = yAxis;
1303
- this.orientation = orientation;
1304
- this.plotIndex = plotIndex2;
1305
- }
1306
- static {
1307
- __name(this, "BarPlot");
1308
- }
1309
- getDrawableElement() {
1310
- const finalData = this.barData.data.map((d) => [
1311
- this.xAxis.getScaleValue(d[0]),
1312
- this.yAxis.getScaleValue(d[1])
1313
- ]);
1314
- const barPaddingPercent = 0.05;
1315
- const barWidth = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * (1 - barPaddingPercent);
1316
- const barWidthHalf = barWidth / 2;
1317
- if (this.orientation === "horizontal") {
1318
- return [
1319
- {
1320
- groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
1321
- type: "rect",
1322
- data: finalData.map((data) => ({
1323
- x: this.boundingRect.x,
1324
- y: data[0] - barWidthHalf,
1325
- height: barWidth,
1326
- width: data[1] - this.boundingRect.x,
1327
- fill: this.barData.fill,
1328
- strokeWidth: 0,
1329
- strokeFill: this.barData.fill
1330
- }))
1331
- }
1332
- ];
1333
- }
1334
- return [
1335
- {
1336
- groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
1337
- type: "rect",
1338
- data: finalData.map((data) => ({
1339
- x: data[0] - barWidthHalf,
1340
- y: data[1],
1341
- width: barWidth,
1342
- height: this.boundingRect.y + this.boundingRect.height - data[1],
1343
- fill: this.barData.fill,
1344
- strokeWidth: 0,
1345
- strokeFill: this.barData.fill
1346
- }))
1347
- }
1348
- ];
1349
- }
1350
- };
1351
- var BasePlot = class {
1352
- constructor(chartConfig, chartData, chartThemeConfig) {
1353
- this.chartConfig = chartConfig;
1354
- this.chartData = chartData;
1355
- this.chartThemeConfig = chartThemeConfig;
1356
- this.boundingRect = {
1357
- x: 0,
1358
- y: 0,
1359
- width: 0,
1360
- height: 0
1361
- };
1362
- }
1363
- static {
1364
- __name(this, "BasePlot");
1365
- }
1366
- setAxes(xAxis, yAxis) {
1367
- this.xAxis = xAxis;
1368
- this.yAxis = yAxis;
1369
- }
1370
- setBoundingBoxXY(point) {
1371
- this.boundingRect.x = point.x;
1372
- this.boundingRect.y = point.y;
1373
- }
1374
- calculateSpace(availableSpace) {
1375
- this.boundingRect.width = availableSpace.width;
1376
- this.boundingRect.height = availableSpace.height;
1377
- return {
1378
- width: this.boundingRect.width,
1379
- height: this.boundingRect.height
1380
- };
1381
- }
1382
- getDrawableElements() {
1383
- if (!(this.xAxis && this.yAxis)) {
1384
- throw Error("Axes must be passed to render Plots");
1385
- }
1386
- const drawableElem = [];
1387
- for (const [i, plot] of this.chartData.plots.entries()) {
1388
- switch (plot.type) {
1389
- case "line":
1390
- {
1391
- const linePlot = new LinePlot(
1392
- plot,
1393
- this.xAxis,
1394
- this.yAxis,
1395
- this.chartConfig.chartOrientation,
1396
- i
1397
- );
1398
- drawableElem.push(...linePlot.getDrawableElement());
1399
- }
1400
- break;
1401
- case "bar":
1402
- {
1403
- const barPlot = new BarPlot(
1404
- plot,
1405
- this.boundingRect,
1406
- this.xAxis,
1407
- this.yAxis,
1408
- this.chartConfig.chartOrientation,
1409
- i
1410
- );
1411
- drawableElem.push(...barPlot.getDrawableElement());
1412
- }
1413
- break;
1414
- }
1415
- }
1416
- return drawableElem;
1417
- }
1418
- };
1419
- function getPlotComponent(chartConfig, chartData, chartThemeConfig) {
1420
- return new BasePlot(chartConfig, chartData, chartThemeConfig);
1421
- }
1422
- __name(getPlotComponent, "getPlotComponent");
1423
- var Orchestrator = class {
1424
- constructor(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2) {
1425
- this.chartConfig = chartConfig;
1426
- this.chartData = chartData;
1427
- this.componentStore = {
1428
- title: getChartTitleComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2),
1429
- plot: getPlotComponent(chartConfig, chartData, chartThemeConfig),
1430
- xAxis: getAxis(
1431
- chartData.xAxis,
1432
- chartConfig.xAxis,
1433
- {
1434
- titleColor: chartThemeConfig.xAxisTitleColor,
1435
- labelColor: chartThemeConfig.xAxisLabelColor,
1436
- tickColor: chartThemeConfig.xAxisTickColor,
1437
- axisLineColor: chartThemeConfig.xAxisLineColor
1438
- },
1439
- tmpSVGGroup2
1440
- ),
1441
- yAxis: getAxis(
1442
- chartData.yAxis,
1443
- chartConfig.yAxis,
1444
- {
1445
- titleColor: chartThemeConfig.yAxisTitleColor,
1446
- labelColor: chartThemeConfig.yAxisLabelColor,
1447
- tickColor: chartThemeConfig.yAxisTickColor,
1448
- axisLineColor: chartThemeConfig.yAxisLineColor
1449
- },
1450
- tmpSVGGroup2
1451
- )
1452
- };
1453
- }
1454
- static {
1455
- __name(this, "Orchestrator");
1456
- }
1457
- calculateVerticalSpace() {
1458
- let availableWidth = this.chartConfig.width;
1459
- let availableHeight = this.chartConfig.height;
1460
- let plotX = 0;
1461
- let plotY = 0;
1462
- let chartWidth = Math.floor(availableWidth * this.chartConfig.plotReservedSpacePercent / 100);
1463
- let chartHeight = Math.floor(
1464
- availableHeight * this.chartConfig.plotReservedSpacePercent / 100
1465
- );
1466
- let spaceUsed = this.componentStore.plot.calculateSpace({
1467
- width: chartWidth,
1468
- height: chartHeight
1469
- });
1470
- availableWidth -= spaceUsed.width;
1471
- availableHeight -= spaceUsed.height;
1472
- spaceUsed = this.componentStore.title.calculateSpace({
1473
- width: this.chartConfig.width,
1474
- height: availableHeight
1475
- });
1476
- plotY = spaceUsed.height;
1477
- availableHeight -= spaceUsed.height;
1478
- this.componentStore.xAxis.setAxisPosition("bottom");
1479
- spaceUsed = this.componentStore.xAxis.calculateSpace({
1480
- width: availableWidth,
1481
- height: availableHeight
1482
- });
1483
- availableHeight -= spaceUsed.height;
1484
- this.componentStore.yAxis.setAxisPosition("left");
1485
- spaceUsed = this.componentStore.yAxis.calculateSpace({
1486
- width: availableWidth,
1487
- height: availableHeight
1488
- });
1489
- plotX = spaceUsed.width;
1490
- availableWidth -= spaceUsed.width;
1491
- if (availableWidth > 0) {
1492
- chartWidth += availableWidth;
1493
- availableWidth = 0;
1494
- }
1495
- if (availableHeight > 0) {
1496
- chartHeight += availableHeight;
1497
- availableHeight = 0;
1498
- }
1499
- this.componentStore.plot.calculateSpace({
1500
- width: chartWidth,
1501
- height: chartHeight
1502
- });
1503
- this.componentStore.plot.setBoundingBoxXY({ x: plotX, y: plotY });
1504
- this.componentStore.xAxis.setRange([plotX, plotX + chartWidth]);
1505
- this.componentStore.xAxis.setBoundingBoxXY({ x: plotX, y: plotY + chartHeight });
1506
- this.componentStore.yAxis.setRange([plotY, plotY + chartHeight]);
1507
- this.componentStore.yAxis.setBoundingBoxXY({ x: 0, y: plotY });
1508
- if (this.chartData.plots.some((p) => isBarPlot(p))) {
1509
- this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1510
- }
1511
- }
1512
- calculateHorizontalSpace() {
1513
- let availableWidth = this.chartConfig.width;
1514
- let availableHeight = this.chartConfig.height;
1515
- let titleYEnd = 0;
1516
- let plotX = 0;
1517
- let plotY = 0;
1518
- let chartWidth = Math.floor(availableWidth * this.chartConfig.plotReservedSpacePercent / 100);
1519
- let chartHeight = Math.floor(
1520
- availableHeight * this.chartConfig.plotReservedSpacePercent / 100
1521
- );
1522
- let spaceUsed = this.componentStore.plot.calculateSpace({
1523
- width: chartWidth,
1524
- height: chartHeight
1525
- });
1526
- availableWidth -= spaceUsed.width;
1527
- availableHeight -= spaceUsed.height;
1528
- spaceUsed = this.componentStore.title.calculateSpace({
1529
- width: this.chartConfig.width,
1530
- height: availableHeight
1531
- });
1532
- titleYEnd = spaceUsed.height;
1533
- availableHeight -= spaceUsed.height;
1534
- this.componentStore.xAxis.setAxisPosition("left");
1535
- spaceUsed = this.componentStore.xAxis.calculateSpace({
1536
- width: availableWidth,
1537
- height: availableHeight
1538
- });
1539
- availableWidth -= spaceUsed.width;
1540
- plotX = spaceUsed.width;
1541
- this.componentStore.yAxis.setAxisPosition("top");
1542
- spaceUsed = this.componentStore.yAxis.calculateSpace({
1543
- width: availableWidth,
1544
- height: availableHeight
1545
- });
1546
- availableHeight -= spaceUsed.height;
1547
- plotY = titleYEnd + spaceUsed.height;
1548
- if (availableWidth > 0) {
1549
- chartWidth += availableWidth;
1550
- availableWidth = 0;
1551
- }
1552
- if (availableHeight > 0) {
1553
- chartHeight += availableHeight;
1554
- availableHeight = 0;
1555
- }
1556
- this.componentStore.plot.calculateSpace({
1557
- width: chartWidth,
1558
- height: chartHeight
1559
- });
1560
- this.componentStore.plot.setBoundingBoxXY({ x: plotX, y: plotY });
1561
- this.componentStore.yAxis.setRange([plotX, plotX + chartWidth]);
1562
- this.componentStore.yAxis.setBoundingBoxXY({ x: plotX, y: titleYEnd });
1563
- this.componentStore.xAxis.setRange([plotY, plotY + chartHeight]);
1564
- this.componentStore.xAxis.setBoundingBoxXY({ x: 0, y: plotY });
1565
- if (this.chartData.plots.some((p) => isBarPlot(p))) {
1566
- this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1567
- }
1568
- }
1569
- calculateSpace() {
1570
- if (this.chartConfig.chartOrientation === "horizontal") {
1571
- this.calculateHorizontalSpace();
1572
- } else {
1573
- this.calculateVerticalSpace();
1574
- }
1575
- }
1576
- getDrawableElement() {
1577
- this.calculateSpace();
1578
- const drawableElem = [];
1579
- this.componentStore.plot.setAxes(this.componentStore.xAxis, this.componentStore.yAxis);
1580
- for (const component of Object.values(this.componentStore)) {
1581
- drawableElem.push(...component.getDrawableElements());
1582
- }
1583
- return drawableElem;
1584
- }
1585
- };
1586
- var XYChartBuilder = class {
1587
- static {
1588
- __name(this, "XYChartBuilder");
1589
- }
1590
- static build(config, chartData, chartThemeConfig, tmpSVGGroup2) {
1591
- const orchestrator = new Orchestrator(config, chartData, chartThemeConfig, tmpSVGGroup2);
1592
- return orchestrator.getDrawableElement();
1593
- }
1594
- };
1595
- var plotIndex = 0;
1596
- var tmpSVGGroup;
1597
- var xyChartConfig = getChartDefaultConfig();
1598
- var xyChartThemeConfig = getChartDefaultThemeConfig();
1599
- var xyChartData = getChartDefaultData();
1600
- var plotColorPalette = xyChartThemeConfig.plotColorPalette.split(",").map((color) => color.trim());
1601
- var hasSetXAxis = false;
1602
- var hasSetYAxis = false;
1603
- function getChartDefaultThemeConfig() {
1604
- const defaultThemeVariables = getThemeVariables3();
1605
- const config = getConfig();
1606
- return cleanAndMerge(defaultThemeVariables.xyChart, config.themeVariables.xyChart);
1607
- }
1608
- __name(getChartDefaultThemeConfig, "getChartDefaultThemeConfig");
1609
- function getChartDefaultConfig() {
1610
- const config = getConfig();
1611
- return cleanAndMerge(
1612
- defaultConfig_default.xyChart,
1613
- config.xyChart
1614
- );
1615
- }
1616
- __name(getChartDefaultConfig, "getChartDefaultConfig");
1617
- function getChartDefaultData() {
1618
- return {
1619
- yAxis: {
1620
- type: "linear",
1621
- title: "",
1622
- min: Infinity,
1623
- max: -Infinity
1624
- },
1625
- xAxis: {
1626
- type: "band",
1627
- title: "",
1628
- categories: []
1629
- },
1630
- title: "",
1631
- plots: []
1632
- };
1633
- }
1634
- __name(getChartDefaultData, "getChartDefaultData");
1635
- function textSanitizer(text) {
1636
- const config = getConfig();
1637
- return sanitizeText(text.trim(), config);
1638
- }
1639
- __name(textSanitizer, "textSanitizer");
1640
- function setTmpSVGG(SVGG) {
1641
- tmpSVGGroup = SVGG;
1642
- }
1643
- __name(setTmpSVGG, "setTmpSVGG");
1644
- function setOrientation(orientation) {
1645
- if (orientation === "horizontal") {
1646
- xyChartConfig.chartOrientation = "horizontal";
1647
- } else {
1648
- xyChartConfig.chartOrientation = "vertical";
1649
- }
1650
- }
1651
- __name(setOrientation, "setOrientation");
1652
- function setXAxisTitle(title) {
1653
- xyChartData.xAxis.title = textSanitizer(title.text);
1654
- }
1655
- __name(setXAxisTitle, "setXAxisTitle");
1656
- function setXAxisRangeData(min, max) {
1657
- xyChartData.xAxis = { type: "linear", title: xyChartData.xAxis.title, min, max };
1658
- hasSetXAxis = true;
1659
- }
1660
- __name(setXAxisRangeData, "setXAxisRangeData");
1661
- function setXAxisBand(categories) {
1662
- xyChartData.xAxis = {
1663
- type: "band",
1664
- title: xyChartData.xAxis.title,
1665
- categories: categories.map((c) => textSanitizer(c.text))
1666
- };
1667
- hasSetXAxis = true;
1668
- }
1669
- __name(setXAxisBand, "setXAxisBand");
1670
- function setYAxisTitle(title) {
1671
- xyChartData.yAxis.title = textSanitizer(title.text);
1672
- }
1673
- __name(setYAxisTitle, "setYAxisTitle");
1674
- function setYAxisRangeData(min, max) {
1675
- xyChartData.yAxis = { type: "linear", title: xyChartData.yAxis.title, min, max };
1676
- hasSetYAxis = true;
1677
- }
1678
- __name(setYAxisRangeData, "setYAxisRangeData");
1679
- function setYAxisRangeFromPlotData(data) {
1680
- const minValue = Math.min(...data);
1681
- const maxValue = Math.max(...data);
1682
- const prevMinValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.min : Infinity;
1683
- const prevMaxValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.max : -Infinity;
1684
- xyChartData.yAxis = {
1685
- type: "linear",
1686
- title: xyChartData.yAxis.title,
1687
- min: Math.min(prevMinValue, minValue),
1688
- max: Math.max(prevMaxValue, maxValue)
1689
- };
1690
- }
1691
- __name(setYAxisRangeFromPlotData, "setYAxisRangeFromPlotData");
1692
- function transformDataWithoutCategory(data) {
1693
- let retData = [];
1694
- if (data.length === 0) {
1695
- return retData;
1696
- }
1697
- if (!hasSetXAxis) {
1698
- const prevMinValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.min : Infinity;
1699
- const prevMaxValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.max : -Infinity;
1700
- setXAxisRangeData(Math.min(prevMinValue, 1), Math.max(prevMaxValue, data.length));
1701
- }
1702
- if (!hasSetYAxis) {
1703
- setYAxisRangeFromPlotData(data);
1704
- }
1705
- if (isBandAxisData(xyChartData.xAxis)) {
1706
- retData = xyChartData.xAxis.categories.map((c, i) => [c, data[i]]);
1707
- }
1708
- if (isLinearAxisData(xyChartData.xAxis)) {
1709
- const min = xyChartData.xAxis.min;
1710
- const max = xyChartData.xAxis.max;
1711
- const step = (max - min) / (data.length - 1);
1712
- const categories = [];
1713
- for (let i = min; i <= max; i += step) {
1714
- categories.push(`${i}`);
1715
- }
1716
- retData = categories.map((c, i) => [c, data[i]]);
1717
- }
1718
- return retData;
1719
- }
1720
- __name(transformDataWithoutCategory, "transformDataWithoutCategory");
1721
- function getPlotColorFromPalette(plotIndex2) {
1722
- return plotColorPalette[plotIndex2 === 0 ? 0 : plotIndex2 % plotColorPalette.length];
1723
- }
1724
- __name(getPlotColorFromPalette, "getPlotColorFromPalette");
1725
- function setLineData(title, data) {
1726
- const plotData = transformDataWithoutCategory(data);
1727
- xyChartData.plots.push({
1728
- type: "line",
1729
- strokeFill: getPlotColorFromPalette(plotIndex),
1730
- strokeWidth: 2,
1731
- data: plotData
1732
- });
1733
- plotIndex++;
1734
- }
1735
- __name(setLineData, "setLineData");
1736
- function setBarData(title, data) {
1737
- const plotData = transformDataWithoutCategory(data);
1738
- xyChartData.plots.push({
1739
- type: "bar",
1740
- fill: getPlotColorFromPalette(plotIndex),
1741
- data: plotData
1742
- });
1743
- plotIndex++;
1744
- }
1745
- __name(setBarData, "setBarData");
1746
- function getDrawableElem() {
1747
- if (xyChartData.plots.length === 0) {
1748
- throw Error("No Plot to render, please provide a plot with some data");
1749
- }
1750
- xyChartData.title = getDiagramTitle();
1751
- return XYChartBuilder.build(xyChartConfig, xyChartData, xyChartThemeConfig, tmpSVGGroup);
1752
- }
1753
- __name(getDrawableElem, "getDrawableElem");
1754
- function getChartThemeConfig() {
1755
- return xyChartThemeConfig;
1756
- }
1757
- __name(getChartThemeConfig, "getChartThemeConfig");
1758
- function getChartConfig() {
1759
- return xyChartConfig;
1760
- }
1761
- __name(getChartConfig, "getChartConfig");
1762
- function getXYChartData() {
1763
- return xyChartData;
1764
- }
1765
- __name(getXYChartData, "getXYChartData");
1766
- var clear2 = /* @__PURE__ */ __name(function() {
1767
- clear();
1768
- plotIndex = 0;
1769
- xyChartConfig = getChartDefaultConfig();
1770
- xyChartData = getChartDefaultData();
1771
- xyChartThemeConfig = getChartDefaultThemeConfig();
1772
- plotColorPalette = xyChartThemeConfig.plotColorPalette.split(",").map((color) => color.trim());
1773
- hasSetXAxis = false;
1774
- hasSetYAxis = false;
1775
- }, "clear");
1776
- var xychartDb_default = {
1777
- getDrawableElem,
1778
- clear: clear2,
1779
- setAccTitle,
1780
- getAccTitle,
1781
- setDiagramTitle,
1782
- getDiagramTitle,
1783
- getAccDescription,
1784
- setAccDescription,
1785
- setOrientation,
1786
- setXAxisTitle,
1787
- setXAxisRangeData,
1788
- setXAxisBand,
1789
- setYAxisTitle,
1790
- setYAxisRangeData,
1791
- setLineData,
1792
- setBarData,
1793
- setTmpSVGG,
1794
- getChartThemeConfig,
1795
- getChartConfig,
1796
- getXYChartData
1797
- };
1798
- var draw = /* @__PURE__ */ __name((txt, id, _version, diagObj) => {
1799
- const db = diagObj.db;
1800
- const themeConfig = db.getChartThemeConfig();
1801
- const chartConfig = db.getChartConfig();
1802
- const labelData = db.getXYChartData().plots[0].data.map((data) => data[1]);
1803
- function getDominantBaseLine(horizontalPos) {
1804
- return horizontalPos === "top" ? "text-before-edge" : "middle";
1805
- }
1806
- __name(getDominantBaseLine, "getDominantBaseLine");
1807
- function getTextAnchor(verticalPos) {
1808
- return verticalPos === "left" ? "start" : verticalPos === "right" ? "end" : "middle";
1809
- }
1810
- __name(getTextAnchor, "getTextAnchor");
1811
- function getTextTransformation(data) {
1812
- return `translate(${data.x}, ${data.y}) rotate(${data.rotation || 0})`;
1813
- }
1814
- __name(getTextTransformation, "getTextTransformation");
1815
- log.debug("Rendering xychart chart\n" + txt);
1816
- const svg = selectSvgElement(id);
1817
- const group = svg.append("g").attr("class", "main");
1818
- const background = group.append("rect").attr("width", chartConfig.width).attr("height", chartConfig.height).attr("class", "background");
1819
- configureSvgSize(svg, chartConfig.height, chartConfig.width, true);
1820
- svg.attr("viewBox", `0 0 ${chartConfig.width} ${chartConfig.height}`);
1821
- background.attr("fill", themeConfig.backgroundColor);
1822
- db.setTmpSVGG(svg.append("g").attr("class", "mermaid-tmp-group"));
1823
- const shapes = db.getDrawableElem();
1824
- const groups = {};
1825
- function getGroup(gList) {
1826
- let elem = group;
1827
- let prefix = "";
1828
- for (const [i] of gList.entries()) {
1829
- let parent = group;
1830
- if (i > 0 && groups[prefix]) {
1831
- parent = groups[prefix];
1832
- }
1833
- prefix += gList[i];
1834
- elem = groups[prefix];
1835
- if (!elem) {
1836
- elem = groups[prefix] = parent.append("g").attr("class", gList[i]);
1837
- }
1838
- }
1839
- return elem;
1840
- }
1841
- __name(getGroup, "getGroup");
1842
- for (const shape of shapes) {
1843
- if (shape.data.length === 0) {
1844
- continue;
1845
- }
1846
- const shapeGroup = getGroup(shape.groupTexts);
1847
- switch (shape.type) {
1848
- case "rect":
1849
- 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);
1850
- if (chartConfig.showDataLabel) {
1851
- const showDataLabelOutsideBar = chartConfig.showDataLabelOutsideBar;
1852
- if (chartConfig.chartOrientation === "horizontal") {
1853
- let fitsHorizontally2 = function(item, fontSize) {
1854
- const { data, label } = item;
1855
- const textWidth = fontSize * label.length * charWidthFactor;
1856
- return textWidth <= data.width - rightMargin;
1857
- };
1858
- __name(fitsHorizontally2, "fitsHorizontally");
1859
- const charWidthFactor = 0.7;
1860
- const rightMargin = 10;
1861
- const validItems = shape.data.map((d, i) => ({ data: d, label: labelData[i].toString() })).filter((item) => item.data.width > 0 && item.data.height > 0);
1862
- const candidateFontSizes = validItems.map((item) => {
1863
- const { data } = item;
1864
- let fontSize = data.height * 0.7;
1865
- while (!fitsHorizontally2(item, fontSize) && fontSize > 0) {
1866
- fontSize -= 1;
1867
- }
1868
- return fontSize;
1869
- });
1870
- const uniformFontSize = Math.floor(Math.min(...candidateFontSizes));
1871
- const determineLabelXPosition = /* @__PURE__ */ __name((item) => {
1872
- if (showDataLabelOutsideBar) {
1873
- return item.data.x + item.data.width + rightMargin;
1874
- } else {
1875
- return item.data.x + item.data.width - rightMargin;
1876
- }
1877
- }, "determineLabelXPosition");
1878
- shapeGroup.selectAll("text").data(validItems).enter().append("text").attr("x", determineLabelXPosition).attr("y", (item) => item.data.y + item.data.height / 2).attr("text-anchor", showDataLabelOutsideBar ? "start" : "end").attr("dominant-baseline", "middle").attr("fill", themeConfig.dataLabelColor).attr("font-size", `${uniformFontSize}px`).text((item) => item.label);
1879
- } else {
1880
- let fitsInBar2 = function(item, fontSize, yOffset2) {
1881
- const { data, label } = item;
1882
- const charWidthFactor = 0.7;
1883
- const textWidth = fontSize * label.length * charWidthFactor;
1884
- const centerX = data.x + data.width / 2;
1885
- const leftEdge = centerX - textWidth / 2;
1886
- const rightEdge = centerX + textWidth / 2;
1887
- const horizontalFits = leftEdge >= data.x && rightEdge <= data.x + data.width;
1888
- const verticalFits = data.y + yOffset2 + fontSize <= data.y + data.height;
1889
- return horizontalFits && verticalFits;
1890
- };
1891
- __name(fitsInBar2, "fitsInBar");
1892
- const yOffset = 10;
1893
- const validItems = shape.data.map((d, i) => ({ data: d, label: labelData[i].toString() })).filter((item) => item.data.width > 0 && item.data.height > 0);
1894
- const candidateFontSizes = validItems.map((item) => {
1895
- const { data, label } = item;
1896
- let fontSize = data.width / (label.length * 0.7);
1897
- while (!fitsInBar2(item, fontSize, yOffset) && fontSize > 0) {
1898
- fontSize -= 1;
1899
- }
1900
- return fontSize;
1901
- });
1902
- const uniformFontSize = Math.floor(Math.min(...candidateFontSizes));
1903
- const determineLabelYPosition = /* @__PURE__ */ __name((item) => {
1904
- if (showDataLabelOutsideBar) {
1905
- return item.data.y - yOffset;
1906
- } else {
1907
- return item.data.y + yOffset;
1908
- }
1909
- }, "determineLabelYPosition");
1910
- shapeGroup.selectAll("text").data(validItems).enter().append("text").attr("x", (item) => item.data.x + item.data.width / 2).attr("y", determineLabelYPosition).attr("text-anchor", "middle").attr("dominant-baseline", showDataLabelOutsideBar ? "auto" : "hanging").attr("fill", themeConfig.dataLabelColor).attr("font-size", `${uniformFontSize}px`).text((item) => item.label);
1911
- }
1912
- }
1913
- break;
1914
- case "text":
1915
- 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);
1916
- break;
1917
- case "path":
1918
- 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);
1919
- break;
1920
- }
1921
- }
1922
- }, "draw");
1923
- var xychartRenderer_default = {
1924
- draw
1925
- };
1926
- var diagram = {
1927
- parser: xychart_default,
1928
- db: xychartDb_default,
1929
- renderer: xychartRenderer_default
1930
- };
1931
- export {
1932
- diagram
1933
- };