@chartts/core 0.1.2 → 0.1.4

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 (563) hide show
  1. package/LICENSE +21 -0
  2. package/dist/{area-type-B3CtuIIP.d.cts → area-type-BanqpQvK.d.cts} +1 -1
  3. package/dist/{area-type-DmB6fTVf.d.ts → area-type-Bzn6ur_t.d.ts} +1 -1
  4. package/dist/area.cjs +10 -10
  5. package/dist/area.d.cts +4 -4
  6. package/dist/area.d.ts +4 -4
  7. package/dist/area.js +5 -5
  8. package/dist/{bar-type-CkI-kkrC.d.cts → bar-type-BjYOtm2e.d.cts} +1 -1
  9. package/dist/{bar-type-Bne_khsO.d.ts → bar-type-D1gkUeQ2.d.ts} +1 -1
  10. package/dist/bar.cjs +9 -9
  11. package/dist/bar.d.cts +4 -4
  12. package/dist/bar.d.ts +4 -4
  13. package/dist/bar.js +4 -4
  14. package/dist/{baseline-type-B1O4XHT3.d.ts → baseline-type-DnAv8oax.d.ts} +1 -1
  15. package/dist/{baseline-type-BAPrZJ5W.d.cts → baseline-type-DskNy6iR.d.cts} +1 -1
  16. package/dist/baseline.cjs +9 -9
  17. package/dist/baseline.d.cts +4 -4
  18. package/dist/baseline.d.ts +4 -4
  19. package/dist/baseline.js +4 -4
  20. package/dist/{boxplot-type-CEWf7p5X.d.ts → boxplot-type-Bi46NGr5.d.ts} +1 -1
  21. package/dist/{boxplot-type-Da8_smoe.d.cts → boxplot-type-Df2L92GY.d.cts} +1 -1
  22. package/dist/boxplot.cjs +9 -9
  23. package/dist/boxplot.d.cts +4 -4
  24. package/dist/boxplot.d.ts +4 -4
  25. package/dist/boxplot.js +4 -4
  26. package/dist/{bubble-type-Dxb2JCKv.d.cts → bubble-type-D2_dA-tK.d.cts} +1 -1
  27. package/dist/{bubble-type-pru5MgB7.d.ts → bubble-type-XCkdPCxY.d.ts} +1 -1
  28. package/dist/bubble.cjs +9 -9
  29. package/dist/bubble.d.cts +4 -4
  30. package/dist/bubble.d.ts +4 -4
  31. package/dist/bubble.js +4 -4
  32. package/dist/{bullet-type-CPEYkEvt.d.ts → bullet-type-CluDVdqG.d.ts} +1 -1
  33. package/dist/{bullet-type-khCmwFqH.d.cts → bullet-type-yyHFEoBR.d.cts} +1 -1
  34. package/dist/bullet.cjs +10 -10
  35. package/dist/bullet.d.cts +4 -4
  36. package/dist/bullet.d.ts +4 -4
  37. package/dist/bullet.js +5 -5
  38. package/dist/{calendar-type-yJWPY6qT.d.ts → calendar-type-BXl4jP0I.d.ts} +1 -1
  39. package/dist/{calendar-type-Br5mpdea.d.cts → calendar-type-_hW3OLW-.d.cts} +1 -1
  40. package/dist/calendar.cjs +10 -10
  41. package/dist/calendar.d.cts +4 -4
  42. package/dist/calendar.d.ts +4 -4
  43. package/dist/calendar.js +5 -5
  44. package/dist/{candlestick-type-CtLZy_uC.d.ts → candlestick-type-CAfkfMPN.d.ts} +1 -1
  45. package/dist/{candlestick-type-CazXUb77.d.cts → candlestick-type-D-fhJzmV.d.cts} +1 -1
  46. package/dist/candlestick.cjs +9 -9
  47. package/dist/candlestick.d.cts +4 -4
  48. package/dist/candlestick.d.ts +4 -4
  49. package/dist/candlestick.js +4 -4
  50. package/dist/{chord-type-ruvHboZl.d.ts → chord-type-BLjyRxsx.d.ts} +1 -1
  51. package/dist/{chord-type-ChIZaOZd.d.cts → chord-type-Dvuvx5rp.d.cts} +1 -1
  52. package/dist/chord.cjs +10 -10
  53. package/dist/chord.d.cts +4 -4
  54. package/dist/chord.d.ts +4 -4
  55. package/dist/chord.js +5 -5
  56. package/dist/{chunk-S6NGWPXC.js → chunk-24557PYN.js} +4 -4
  57. package/dist/chunk-24557PYN.js.map +1 -0
  58. package/dist/{chunk-K2EZ4SS4.js → chunk-2BUIZDOB.js} +5 -5
  59. package/dist/chunk-2BUIZDOB.js.map +1 -0
  60. package/dist/{chunk-TVPS2NJH.cjs → chunk-2IMUTDTD.cjs} +11 -11
  61. package/dist/chunk-2IMUTDTD.cjs.map +1 -0
  62. package/dist/{chunk-2KMMVJEE.cjs → chunk-2IWLOBSF.cjs} +7 -7
  63. package/dist/chunk-2IWLOBSF.cjs.map +1 -0
  64. package/dist/{chunk-MQBKLKYF.js → chunk-2JYK52HV.js} +4 -4
  65. package/dist/{chunk-MQBKLKYF.js.map → chunk-2JYK52HV.js.map} +1 -1
  66. package/dist/{chunk-KEMT7F5H.cjs → chunk-2QRCHYTZ.cjs} +9 -9
  67. package/dist/chunk-2QRCHYTZ.cjs.map +1 -0
  68. package/dist/{chunk-JT6H7G52.js → chunk-34DQGCPP.js} +5 -5
  69. package/dist/chunk-34DQGCPP.js.map +1 -0
  70. package/dist/{chunk-6WJJ26J5.js → chunk-3JB4JBBK.js} +6 -6
  71. package/dist/chunk-3JB4JBBK.js.map +1 -0
  72. package/dist/{chunk-SLJNRP7O.cjs → chunk-3NHH6C4K.cjs} +14 -24
  73. package/dist/chunk-3NHH6C4K.cjs.map +1 -0
  74. package/dist/{chunk-K7UR7GYC.cjs → chunk-3SVNEKXE.cjs} +13 -13
  75. package/dist/chunk-3SVNEKXE.cjs.map +1 -0
  76. package/dist/{chunk-S64PTNT7.cjs → chunk-4D6PVH2C.cjs} +27 -30
  77. package/dist/chunk-4D6PVH2C.cjs.map +1 -0
  78. package/dist/{chunk-N7NZQVIV.cjs → chunk-4MNVJVK3.cjs} +7 -7
  79. package/dist/chunk-4MNVJVK3.cjs.map +1 -0
  80. package/dist/{chunk-VGGKMTO6.js → chunk-4QRND2V5.js} +4 -4
  81. package/dist/chunk-4QRND2V5.js.map +1 -0
  82. package/dist/{chunk-MZQY2FTP.cjs → chunk-55ZTXQQQ.cjs} +13 -13
  83. package/dist/chunk-55ZTXQQQ.cjs.map +1 -0
  84. package/dist/{chunk-YMJQUKKX.js → chunk-56BN43J4.js} +68 -42
  85. package/dist/chunk-56BN43J4.js.map +1 -0
  86. package/dist/{chunk-QRTYX5KO.js → chunk-5E7FXDBM.js} +5 -5
  87. package/dist/chunk-5E7FXDBM.js.map +1 -0
  88. package/dist/{chunk-RLH3PS3Y.js → chunk-5HZEDCJG.js} +3 -3
  89. package/dist/{chunk-RLH3PS3Y.js.map → chunk-5HZEDCJG.js.map} +1 -1
  90. package/dist/{chunk-7JN6GXML.cjs → chunk-5QT67VYJ.cjs} +13 -11
  91. package/dist/chunk-5QT67VYJ.cjs.map +1 -0
  92. package/dist/{chunk-EYN74SQ5.js → chunk-5QVUBGM7.js} +5 -5
  93. package/dist/chunk-5QVUBGM7.js.map +1 -0
  94. package/dist/{chunk-QCR6L55R.js → chunk-62DBXI4N.js} +8 -5
  95. package/dist/chunk-62DBXI4N.js.map +1 -0
  96. package/dist/{chunk-U7GBOQXX.js → chunk-6QMV75NT.js} +5 -5
  97. package/dist/chunk-6QMV75NT.js.map +1 -0
  98. package/dist/{chunk-IAE4VRB7.cjs → chunk-754Z4OR6.cjs} +35 -10
  99. package/dist/chunk-754Z4OR6.cjs.map +1 -0
  100. package/dist/{chunk-CJEMSKW3.js → chunk-7GLCJPV5.js} +217 -57
  101. package/dist/chunk-7GLCJPV5.js.map +1 -0
  102. package/dist/{chunk-TIHVTKXS.cjs → chunk-7PHOSSLJ.cjs} +11 -11
  103. package/dist/chunk-7PHOSSLJ.cjs.map +1 -0
  104. package/dist/{chunk-EAKXLFOR.cjs → chunk-A5G32G2R.cjs} +11 -11
  105. package/dist/chunk-A5G32G2R.cjs.map +1 -0
  106. package/dist/{chunk-BMTVFAX2.js → chunk-AEQXFDL7.js} +240 -104
  107. package/dist/chunk-AEQXFDL7.js.map +1 -0
  108. package/dist/{chunk-FKAA5FNG.cjs → chunk-ATMSGQCW.cjs} +10 -10
  109. package/dist/chunk-ATMSGQCW.cjs.map +1 -0
  110. package/dist/{chunk-GI7PBJSK.js → chunk-BFBVJ6MU.js} +4 -4
  111. package/dist/chunk-BFBVJ6MU.js.map +1 -0
  112. package/dist/{chunk-IKUA7O73.cjs → chunk-BGGESAAG.cjs} +7 -7
  113. package/dist/{chunk-IKUA7O73.cjs.map → chunk-BGGESAAG.cjs.map} +1 -1
  114. package/dist/{chunk-WS2AL7GY.cjs → chunk-CA42BCSM.cjs} +34 -8
  115. package/dist/chunk-CA42BCSM.cjs.map +1 -0
  116. package/dist/{chunk-CCHMQZIB.js → chunk-CU5ZXVZQ.js} +5 -5
  117. package/dist/chunk-CU5ZXVZQ.js.map +1 -0
  118. package/dist/{chunk-B7IV2PB3.cjs → chunk-CUIPBYMG.cjs} +9 -9
  119. package/dist/chunk-CUIPBYMG.cjs.map +1 -0
  120. package/dist/{chunk-NZWFBAFQ.js → chunk-CWZADOJ6.js} +30 -4
  121. package/dist/chunk-CWZADOJ6.js.map +1 -0
  122. package/dist/{chunk-ID7GYRYL.cjs → chunk-D5QUAWF3.cjs} +11 -11
  123. package/dist/chunk-D5QUAWF3.cjs.map +1 -0
  124. package/dist/{chunk-27E6G2GT.js → chunk-DAAU5H24.js} +4 -4
  125. package/dist/chunk-DAAU5H24.js.map +1 -0
  126. package/dist/{chunk-VK72MICB.cjs → chunk-DT4GG5BF.cjs} +8 -8
  127. package/dist/{chunk-VK72MICB.cjs.map → chunk-DT4GG5BF.cjs.map} +1 -1
  128. package/dist/{chunk-7HOU6XMW.js → chunk-DX77WSIB.js} +25 -28
  129. package/dist/chunk-DX77WSIB.js.map +1 -0
  130. package/dist/{chunk-GQR7IHER.js → chunk-EPUWA3ZW.js} +6 -6
  131. package/dist/chunk-EPUWA3ZW.js.map +1 -0
  132. package/dist/{chunk-EFRBTSUO.cjs → chunk-ESJMEDLY.cjs} +4 -4
  133. package/dist/{chunk-EFRBTSUO.cjs.map → chunk-ESJMEDLY.cjs.map} +1 -1
  134. package/dist/{chunk-KHQRHTTN.js → chunk-EWVXMQRW.js} +40 -30
  135. package/dist/chunk-EWVXMQRW.js.map +1 -0
  136. package/dist/{chunk-2L46SAT7.js → chunk-FGBIJ6PL.js} +30 -5
  137. package/dist/chunk-FGBIJ6PL.js.map +1 -0
  138. package/dist/{chunk-FTKL3UAN.cjs → chunk-FGHSUT6X.cjs} +6 -6
  139. package/dist/{chunk-FTKL3UAN.cjs.map → chunk-FGHSUT6X.cjs.map} +1 -1
  140. package/dist/{chunk-2PRCN5OJ.cjs → chunk-FVLVTY5D.cjs} +6 -6
  141. package/dist/{chunk-2PRCN5OJ.cjs.map → chunk-FVLVTY5D.cjs.map} +1 -1
  142. package/dist/{chunk-ALRCYQQX.cjs → chunk-GBL4R3GH.cjs} +10 -7
  143. package/dist/chunk-GBL4R3GH.cjs.map +1 -0
  144. package/dist/{chunk-SKREYNRK.cjs → chunk-GRXHW5S3.cjs} +45 -35
  145. package/dist/chunk-GRXHW5S3.cjs.map +1 -0
  146. package/dist/{chunk-FSKUEB7P.js → chunk-HCIBBUV5.js} +3 -3
  147. package/dist/{chunk-FSKUEB7P.js.map → chunk-HCIBBUV5.js.map} +1 -1
  148. package/dist/{chunk-MGYBMQAX.cjs → chunk-HCK2VUWD.cjs} +9 -9
  149. package/dist/chunk-HCK2VUWD.cjs.map +1 -0
  150. package/dist/{chunk-NML7F34A.js → chunk-IDZTDJLH.js} +4 -4
  151. package/dist/chunk-IDZTDJLH.js.map +1 -0
  152. package/dist/{chunk-KUFDELQM.cjs → chunk-IF6RQ53Q.cjs} +10 -10
  153. package/dist/chunk-IF6RQ53Q.cjs.map +1 -0
  154. package/dist/{chunk-BMEMMYVF.js → chunk-IOV77VHP.js} +5 -5
  155. package/dist/{chunk-BMEMMYVF.js.map → chunk-IOV77VHP.js.map} +1 -1
  156. package/dist/{chunk-3TLJCGGQ.cjs → chunk-JVVGQLJQ.cjs} +240 -104
  157. package/dist/chunk-JVVGQLJQ.cjs.map +1 -0
  158. package/dist/{chunk-T6LXFMBR.cjs → chunk-JYVRX3BX.cjs} +9 -9
  159. package/dist/{chunk-T6LXFMBR.cjs.map → chunk-JYVRX3BX.cjs.map} +1 -1
  160. package/dist/{chunk-MVJKRPX7.js → chunk-KHG3G2ZX.js} +3 -3
  161. package/dist/{chunk-MVJKRPX7.js.map → chunk-KHG3G2ZX.js.map} +1 -1
  162. package/dist/{chunk-7MXBXWVD.js → chunk-KNMEXOKJ.js} +5 -5
  163. package/dist/chunk-KNMEXOKJ.js.map +1 -0
  164. package/dist/chunk-KWSVJRXX.cjs +128 -0
  165. package/dist/chunk-KWSVJRXX.cjs.map +1 -0
  166. package/dist/{chunk-XKDBNAHH.cjs → chunk-LARNENXE.cjs} +11 -11
  167. package/dist/chunk-LARNENXE.cjs.map +1 -0
  168. package/dist/chunk-LRHMLNPW.js +897 -0
  169. package/dist/chunk-LRHMLNPW.js.map +1 -0
  170. package/dist/{chunk-5LQ26P4J.cjs → chunk-LXYNL7BI.cjs} +11 -11
  171. package/dist/chunk-LXYNL7BI.cjs.map +1 -0
  172. package/dist/{chunk-ARQLGTTV.js → chunk-MEERXUZS.js} +5 -5
  173. package/dist/{chunk-ARQLGTTV.js.map → chunk-MEERXUZS.js.map} +1 -1
  174. package/dist/{chunk-VJQCHBS6.js → chunk-MJY25P44.js} +15 -5
  175. package/dist/chunk-MJY25P44.js.map +1 -0
  176. package/dist/{chunk-3YFDZGHO.cjs → chunk-MSCRIA2U.cjs} +13 -13
  177. package/dist/{chunk-3YFDZGHO.cjs.map → chunk-MSCRIA2U.cjs.map} +1 -1
  178. package/dist/{chunk-DZKYVTV3.js → chunk-N35UAFEU.js} +5 -5
  179. package/dist/{chunk-DZKYVTV3.js.map → chunk-N35UAFEU.js.map} +1 -1
  180. package/dist/{chunk-DAH76GIX.cjs → chunk-NE2W2MF3.cjs} +11 -11
  181. package/dist/chunk-NE2W2MF3.cjs.map +1 -0
  182. package/dist/{chunk-CHERQT4B.js → chunk-NQ7Y6ZKH.js} +4 -4
  183. package/dist/chunk-NQ7Y6ZKH.js.map +1 -0
  184. package/dist/{chunk-AA45U5KV.js → chunk-NRULNA5F.js} +5 -5
  185. package/dist/chunk-NRULNA5F.js.map +1 -0
  186. package/dist/{chunk-PCTMS2PX.cjs → chunk-OEGSDOJ2.cjs} +19 -9
  187. package/dist/chunk-OEGSDOJ2.cjs.map +1 -0
  188. package/dist/{chunk-M6JYSINX.cjs → chunk-OMAW52LY.cjs} +8 -8
  189. package/dist/chunk-OMAW52LY.cjs.map +1 -0
  190. package/dist/{chunk-IUYPKYOU.js → chunk-OMSHGBV3.js} +9 -5
  191. package/dist/chunk-OMSHGBV3.js.map +1 -0
  192. package/dist/{chunk-DZHP4UUE.cjs → chunk-OTXHJHXU.cjs} +16 -12
  193. package/dist/chunk-OTXHJHXU.cjs.map +1 -0
  194. package/dist/{chunk-GUVPVNPD.cjs → chunk-PCAYYCLY.cjs} +11 -11
  195. package/dist/chunk-PCAYYCLY.cjs.map +1 -0
  196. package/dist/{chunk-LCEMO7NI.js → chunk-PKXW45G4.js} +3 -3
  197. package/dist/{chunk-LCEMO7NI.js.map → chunk-PKXW45G4.js.map} +1 -1
  198. package/dist/{chunk-Y4HJCMB4.cjs → chunk-QEPMEEZC.cjs} +7 -7
  199. package/dist/chunk-QEPMEEZC.cjs.map +1 -0
  200. package/dist/{chunk-43WDYYVH.cjs → chunk-QPHUAF3R.cjs} +10 -10
  201. package/dist/chunk-QPHUAF3R.cjs.map +1 -0
  202. package/dist/{chunk-FKVYS4RB.js → chunk-QPHWRD25.js} +15 -8
  203. package/dist/chunk-QPHWRD25.js.map +1 -0
  204. package/dist/chunk-QYI7ZV3B.cjs +899 -0
  205. package/dist/chunk-QYI7ZV3B.cjs.map +1 -0
  206. package/dist/{chunk-3N447NTJ.cjs → chunk-R2W3RJFW.cjs} +14 -14
  207. package/dist/chunk-R2W3RJFW.cjs.map +1 -0
  208. package/dist/{chunk-DZW35WR2.js → chunk-SGZUUUXU.js} +5 -5
  209. package/dist/chunk-SGZUUUXU.js.map +1 -0
  210. package/dist/{chunk-GMLJDDHZ.js → chunk-T7SCCACB.js} +3 -3
  211. package/dist/{chunk-GMLJDDHZ.js.map → chunk-T7SCCACB.js.map} +1 -1
  212. package/dist/{chunk-3NWZJCWL.js → chunk-TC3H6ZED.js} +5 -5
  213. package/dist/chunk-TC3H6ZED.js.map +1 -0
  214. package/dist/{chunk-FIAKZSRR.cjs → chunk-TEZNWW3R.cjs} +19 -12
  215. package/dist/chunk-TEZNWW3R.cjs.map +1 -0
  216. package/dist/{chunk-5M624BRW.js → chunk-THHZMRFU.js} +4 -4
  217. package/dist/chunk-THHZMRFU.js.map +1 -0
  218. package/dist/{chunk-AAKS22M3.cjs → chunk-TLHQ6JCK.cjs} +12 -12
  219. package/dist/{chunk-AAKS22M3.cjs.map → chunk-TLHQ6JCK.cjs.map} +1 -1
  220. package/dist/{chunk-HOPFELRP.cjs → chunk-V5Q6UNUK.cjs} +4 -4
  221. package/dist/{chunk-HOPFELRP.cjs.map → chunk-V5Q6UNUK.cjs.map} +1 -1
  222. package/dist/{chunk-DKVRRL3F.js → chunk-VBMLJUBE.js} +6 -6
  223. package/dist/chunk-VBMLJUBE.js.map +1 -0
  224. package/dist/chunk-VGJD4F4H.js +126 -0
  225. package/dist/chunk-VGJD4F4H.js.map +1 -0
  226. package/dist/{chunk-GL3M7MAM.js → chunk-VJXUBN7J.js} +4 -4
  227. package/dist/chunk-VJXUBN7J.js.map +1 -0
  228. package/dist/{chunk-4ABM7UYD.js → chunk-VUHNBLFA.js} +4 -4
  229. package/dist/chunk-VUHNBLFA.js.map +1 -0
  230. package/dist/{chunk-D2IP3MWJ.cjs → chunk-W476ER4X.cjs} +219 -59
  231. package/dist/chunk-W476ER4X.cjs.map +1 -0
  232. package/dist/{chunk-3QXN7JBV.js → chunk-WZCES5M6.js} +7 -5
  233. package/dist/chunk-WZCES5M6.js.map +1 -0
  234. package/dist/{chunk-FEQKBVCZ.cjs → chunk-Y6CVUI6A.cjs} +14 -14
  235. package/dist/chunk-Y6CVUI6A.cjs.map +1 -0
  236. package/dist/{chunk-FQG4DRJS.cjs → chunk-YCL43UQM.cjs} +71 -45
  237. package/dist/chunk-YCL43UQM.cjs.map +1 -0
  238. package/dist/{chunk-SC5BGA2N.cjs → chunk-YZXRD6K6.cjs} +8 -8
  239. package/dist/chunk-YZXRD6K6.cjs.map +1 -0
  240. package/dist/{chunk-L37ZPX6D.js → chunk-ZFGLBJYC.js} +5 -5
  241. package/dist/chunk-ZFGLBJYC.js.map +1 -0
  242. package/dist/{chunk-COPERSVL.cjs → chunk-ZNKVOTPB.cjs} +15 -15
  243. package/dist/{chunk-COPERSVL.cjs.map → chunk-ZNKVOTPB.cjs.map} +1 -1
  244. package/dist/{chunk-IXFSJBJS.js → chunk-ZOEN3ARN.js} +4 -14
  245. package/dist/chunk-ZOEN3ARN.js.map +1 -0
  246. package/dist/{chunk-QXQSJ3FZ.js → chunk-ZYXRRVR6.js} +5 -5
  247. package/dist/chunk-ZYXRRVR6.js.map +1 -0
  248. package/dist/{combo-type-wodyLq1f.d.cts → combo-type-CCrfKcTc.d.cts} +1 -1
  249. package/dist/{combo-type-BdSohVyy.d.ts → combo-type-Drb7xHSH.d.ts} +1 -1
  250. package/dist/combo.cjs +9 -9
  251. package/dist/combo.d.cts +4 -4
  252. package/dist/combo.d.ts +4 -4
  253. package/dist/combo.js +4 -4
  254. package/dist/{custom-type-B6w1n5Ua.d.cts → custom-type-CUdaJtsU.d.cts} +1 -1
  255. package/dist/{custom-type-XFjuPwCr.d.ts → custom-type-DeCdYBIK.d.ts} +1 -1
  256. package/dist/custom.cjs +10 -10
  257. package/dist/custom.d.cts +4 -4
  258. package/dist/custom.d.ts +4 -4
  259. package/dist/custom.js +5 -5
  260. package/dist/donut.cjs +11 -10
  261. package/dist/donut.cjs.map +1 -1
  262. package/dist/donut.d.cts +4 -4
  263. package/dist/donut.d.ts +4 -4
  264. package/dist/donut.js +6 -5
  265. package/dist/donut.js.map +1 -1
  266. package/dist/{dumbbell-type-w424KzI2.d.cts → dumbbell-type--8jqwUbP.d.cts} +1 -1
  267. package/dist/{dumbbell-type-DPSE0OTg.d.ts → dumbbell-type-FrAcyybz.d.ts} +1 -1
  268. package/dist/dumbbell.cjs +10 -10
  269. package/dist/dumbbell.d.cts +4 -4
  270. package/dist/dumbbell.d.ts +4 -4
  271. package/dist/dumbbell.js +5 -5
  272. package/dist/{engine-CNukbv7k.d.ts → engine-7vdmtmTm.d.cts} +20 -0
  273. package/dist/{engine-CNukbv7k.d.cts → engine-7vdmtmTm.d.ts} +20 -0
  274. package/dist/{factory-dbngWV4d.d.cts → factory-DVmPQ-5P.d.cts} +1 -1
  275. package/dist/{factory-jRzNNxwj.d.ts → factory-DXvw-FCZ.d.ts} +1 -1
  276. package/dist/{funnel-type-CMXGQq4T.d.ts → funnel-type-BhtkYPBR.d.ts} +1 -1
  277. package/dist/{funnel-type-BeVl3ohX.d.cts → funnel-type-BqLhbGkI.d.cts} +1 -1
  278. package/dist/funnel.cjs +10 -10
  279. package/dist/funnel.d.cts +4 -4
  280. package/dist/funnel.d.ts +4 -4
  281. package/dist/funnel.js +5 -5
  282. package/dist/{gauge-type-DmjDdfsY.d.cts → gauge-type-NeAO1otO.d.cts} +1 -1
  283. package/dist/{gauge-type-BpDBwCeD.d.ts → gauge-type-h6z_4lnL.d.ts} +1 -1
  284. package/dist/gauge.cjs +10 -10
  285. package/dist/gauge.d.cts +4 -4
  286. package/dist/gauge.d.ts +4 -4
  287. package/dist/gauge.js +5 -5
  288. package/dist/geo.cjs +12 -12
  289. package/dist/geo.d.cts +4 -4
  290. package/dist/geo.d.ts +4 -4
  291. package/dist/geo.js +5 -5
  292. package/dist/graph-type-Bg04GFeS.d.ts +15 -0
  293. package/dist/graph-type-DF-vww8T.d.cts +15 -0
  294. package/dist/graph.cjs +63 -10
  295. package/dist/graph.cjs.map +1 -1
  296. package/dist/graph.d.cts +65 -5
  297. package/dist/graph.d.ts +65 -5
  298. package/dist/graph.js +58 -6
  299. package/dist/graph.js.map +1 -1
  300. package/dist/{heatmap-type-q6nNhVTr.d.ts → heatmap-type-BAxcLZ1S.d.ts} +1 -1
  301. package/dist/{heatmap-type-D0shkxK7.d.cts → heatmap-type-CkmoO1Vi.d.cts} +1 -1
  302. package/dist/heatmap.cjs +10 -10
  303. package/dist/heatmap.d.cts +4 -4
  304. package/dist/heatmap.d.ts +4 -4
  305. package/dist/heatmap.js +5 -5
  306. package/dist/{histogram-type-BWil-Rb7.d.cts → histogram-type-BMxwKNZD.d.cts} +1 -1
  307. package/dist/{histogram-type-CF593WSp.d.ts → histogram-type-Bz1r_8dr.d.ts} +1 -1
  308. package/dist/histogram.cjs +9 -9
  309. package/dist/histogram.d.cts +4 -4
  310. package/dist/histogram.d.ts +4 -4
  311. package/dist/histogram.js +4 -4
  312. package/dist/{horizontal-bar-type-0mqnyMUR.d.cts → horizontal-bar-type-CPMqObyF.d.cts} +1 -1
  313. package/dist/{horizontal-bar-type-DAlrxY0h.d.ts → horizontal-bar-type-oNPstB_X.d.ts} +1 -1
  314. package/dist/horizontal-bar.cjs +9 -9
  315. package/dist/horizontal-bar.d.cts +4 -4
  316. package/dist/horizontal-bar.d.ts +4 -4
  317. package/dist/horizontal-bar.js +4 -4
  318. package/dist/index.cjs +180 -179
  319. package/dist/index.cjs.map +1 -1
  320. package/dist/index.d.cts +51 -47
  321. package/dist/index.d.ts +51 -47
  322. package/dist/index.js +92 -91
  323. package/dist/index.js.map +1 -1
  324. package/dist/{kagi-type-Y5XUVm3h.d.ts → kagi-type-DLvdmNEs.d.ts} +1 -1
  325. package/dist/{kagi-type-aG-Q1bWk.d.cts → kagi-type-DolumABK.d.cts} +1 -1
  326. package/dist/kagi.cjs +10 -10
  327. package/dist/kagi.d.cts +4 -4
  328. package/dist/kagi.d.ts +4 -4
  329. package/dist/kagi.js +5 -5
  330. package/dist/{line-type-Diw0nXj7.d.ts → line-type-CQ_Sbwde.d.ts} +1 -1
  331. package/dist/{line-type-B8lgTFjb.d.cts → line-type-DU-iLYyU.d.cts} +1 -1
  332. package/dist/line.cjs +9 -9
  333. package/dist/line.d.cts +4 -4
  334. package/dist/line.d.ts +4 -4
  335. package/dist/line.js +4 -4
  336. package/dist/{lines-type-CGrg_mDi.d.cts → lines-type-BZF5YnFG.d.cts} +1 -1
  337. package/dist/{lines-type-V-seVNZ4.d.ts → lines-type-CkKW7kQN.d.ts} +1 -1
  338. package/dist/lines.cjs +10 -10
  339. package/dist/lines.d.cts +4 -4
  340. package/dist/lines.d.ts +4 -4
  341. package/dist/lines.js +5 -5
  342. package/dist/{lollipop-type-CoTzKLSu.d.cts → lollipop-type-BUeY0pGU.d.cts} +1 -1
  343. package/dist/{lollipop-type-Ygc4rRql.d.ts → lollipop-type-DY7z1meu.d.ts} +1 -1
  344. package/dist/lollipop.cjs +9 -9
  345. package/dist/lollipop.d.cts +4 -4
  346. package/dist/lollipop.d.ts +4 -4
  347. package/dist/lollipop.js +4 -4
  348. package/dist/{matrix-type-Crb_NwUJ.d.cts → matrix-type-DZBt3yku.d.cts} +1 -1
  349. package/dist/{matrix-type-Dag1VLCY.d.ts → matrix-type-DkaWmxKb.d.ts} +1 -1
  350. package/dist/matrix.cjs +10 -10
  351. package/dist/matrix.d.cts +4 -4
  352. package/dist/matrix.d.ts +4 -4
  353. package/dist/matrix.js +5 -5
  354. package/dist/{ohlc-type-BQBHvVJO.d.cts → ohlc-type-C6NE-Bb3.d.cts} +1 -1
  355. package/dist/{ohlc-type-CGR-vRGL.d.ts → ohlc-type-eQd0E8lm.d.ts} +1 -1
  356. package/dist/ohlc.cjs +9 -9
  357. package/dist/ohlc.d.cts +4 -4
  358. package/dist/ohlc.d.ts +4 -4
  359. package/dist/ohlc.js +4 -4
  360. package/dist/{parallel-type-D-S-EqeC.d.cts → parallel-type-Cn2B_2-r.d.cts} +1 -1
  361. package/dist/{parallel-type-6t6xyHMg.d.ts → parallel-type-D4B96-R-.d.ts} +1 -1
  362. package/dist/parallel.cjs +10 -10
  363. package/dist/parallel.d.cts +4 -4
  364. package/dist/parallel.d.ts +4 -4
  365. package/dist/parallel.js +5 -5
  366. package/dist/{pictorialbar-type-A-8mTX1N.d.ts → pictorialbar-type-CoClaroO.d.ts} +1 -1
  367. package/dist/{pictorialbar-type-CnJEH9GZ.d.cts → pictorialbar-type-jiWGSHOU.d.cts} +1 -1
  368. package/dist/pictorialbar.cjs +10 -10
  369. package/dist/pictorialbar.d.cts +4 -4
  370. package/dist/pictorialbar.d.ts +4 -4
  371. package/dist/pictorialbar.js +5 -5
  372. package/dist/{pie-type-S7kUKGRS.d.ts → pie-type-0inQl-lu.d.ts} +1 -1
  373. package/dist/{pie-type-duX5xkfQ.d.cts → pie-type-9iaid0XE.d.cts} +1 -1
  374. package/dist/pie.cjs +11 -10
  375. package/dist/pie.cjs.map +1 -1
  376. package/dist/pie.d.cts +4 -4
  377. package/dist/pie.d.ts +4 -4
  378. package/dist/pie.js +6 -5
  379. package/dist/pie.js.map +1 -1
  380. package/dist/{polar-type-CI6-I8Yg.d.cts → polar-type-BraqKI4A.d.ts} +2 -1
  381. package/dist/{polar-type-Dj21GIc9.d.ts → polar-type-DsB9FOAO.d.cts} +2 -1
  382. package/dist/polar.cjs +11 -10
  383. package/dist/polar.cjs.map +1 -1
  384. package/dist/polar.d.cts +4 -4
  385. package/dist/polar.d.ts +4 -4
  386. package/dist/polar.js +6 -5
  387. package/dist/polar.js.map +1 -1
  388. package/dist/{radar-type-CYjZHuKm.d.ts → radar-type-C0JiXn53.d.ts} +1 -1
  389. package/dist/{radar-type-Dgyr13Zd.d.cts → radar-type-DaLjHpgO.d.cts} +1 -1
  390. package/dist/radar.cjs +10 -10
  391. package/dist/radar.d.cts +4 -4
  392. package/dist/radar.d.ts +4 -4
  393. package/dist/radar.js +5 -5
  394. package/dist/{radialbar-type-CLZ8XgST.d.ts → radialbar-type-DMzib3wW.d.ts} +1 -1
  395. package/dist/{radialbar-type-C_SBXoaa.d.cts → radialbar-type-YtZDe2x4.d.cts} +1 -1
  396. package/dist/radialbar.cjs +10 -10
  397. package/dist/radialbar.d.cts +4 -4
  398. package/dist/radialbar.d.ts +4 -4
  399. package/dist/radialbar.js +5 -5
  400. package/dist/{range-type-_LbMV4tl.d.ts → range-type-RlwPvBxs.d.ts} +1 -1
  401. package/dist/{range-type-CkriEnLm.d.cts → range-type-imi4626F.d.cts} +1 -1
  402. package/dist/range.cjs +9 -9
  403. package/dist/range.d.cts +4 -4
  404. package/dist/range.d.ts +4 -4
  405. package/dist/range.js +4 -4
  406. package/dist/{renko-type-ejoXt2ro.d.ts → renko-type-Bv23hPuk.d.ts} +1 -1
  407. package/dist/{renko-type-43OXCtZ3.d.cts → renko-type-DEe4vBKT.d.cts} +1 -1
  408. package/dist/renko.cjs +10 -10
  409. package/dist/renko.d.cts +4 -4
  410. package/dist/renko.d.ts +4 -4
  411. package/dist/renko.js +5 -5
  412. package/dist/{sankey-type-DfkTUnXB.d.cts → sankey-type-B0LCLees.d.cts} +1 -1
  413. package/dist/{sankey-type-CN7PL5MQ.d.ts → sankey-type-Gr2owHtQ.d.ts} +1 -1
  414. package/dist/sankey.cjs +10 -10
  415. package/dist/sankey.d.cts +4 -4
  416. package/dist/sankey.d.ts +4 -4
  417. package/dist/sankey.js +5 -5
  418. package/dist/{scatter-type-CD7X1pZb.d.cts → scatter-type-C0vMtH11.d.cts} +1 -1
  419. package/dist/{scatter-type-D3HdPkZ6.d.ts → scatter-type-DPCIXt3X.d.ts} +1 -1
  420. package/dist/scatter.cjs +9 -9
  421. package/dist/scatter.d.cts +4 -4
  422. package/dist/scatter.d.ts +4 -4
  423. package/dist/scatter.js +4 -4
  424. package/dist/{sparkline-type-qt3yoLs7.d.cts → sparkline-type-BDDpw4DS.d.cts} +1 -1
  425. package/dist/{sparkline-type-COW3izgF.d.ts → sparkline-type-BtSsuoh4.d.ts} +1 -1
  426. package/dist/sparkline.cjs +9 -9
  427. package/dist/sparkline.d.cts +4 -4
  428. package/dist/sparkline.d.ts +4 -4
  429. package/dist/sparkline.js +4 -4
  430. package/dist/{stacked-bar-type-C-5pmb-D.d.ts → stacked-bar-type-5_GXIxLN.d.ts} +1 -1
  431. package/dist/{stacked-bar-type-Ct6HK2A0.d.cts → stacked-bar-type-BF4R1zEK.d.cts} +1 -1
  432. package/dist/stacked-bar.cjs +9 -9
  433. package/dist/stacked-bar.d.cts +4 -4
  434. package/dist/stacked-bar.d.ts +4 -4
  435. package/dist/stacked-bar.js +4 -4
  436. package/dist/{step-type-BSL-CUny.d.cts → step-type-CZJO5PE4.d.cts} +1 -1
  437. package/dist/{step-type-Cleoshov.d.ts → step-type-CoBGeRRR.d.ts} +1 -1
  438. package/dist/step.cjs +10 -10
  439. package/dist/step.d.cts +4 -4
  440. package/dist/step.d.ts +4 -4
  441. package/dist/step.js +5 -5
  442. package/dist/{sunburst-type-ZFw2w6m8.d.ts → sunburst-type-CAcFLV8s.d.ts} +1 -1
  443. package/dist/{sunburst-type-BOztb_Px.d.cts → sunburst-type-DgP1x1nn.d.cts} +1 -1
  444. package/dist/sunburst.cjs +11 -10
  445. package/dist/sunburst.cjs.map +1 -1
  446. package/dist/sunburst.d.cts +4 -4
  447. package/dist/sunburst.d.ts +4 -4
  448. package/dist/sunburst.js +6 -5
  449. package/dist/sunburst.js.map +1 -1
  450. package/dist/{themeriver-type-B5PYChcC.d.ts → themeriver-type-BxLJux1v.d.ts} +1 -1
  451. package/dist/{themeriver-type-BnRSsyal.d.cts → themeriver-type-CGn5zE2F.d.cts} +1 -1
  452. package/dist/themeriver.cjs +10 -10
  453. package/dist/themeriver.d.cts +4 -4
  454. package/dist/themeriver.d.ts +4 -4
  455. package/dist/themeriver.js +5 -5
  456. package/dist/{tree-type-B-bOSg0l.d.ts → tree-type-Dyw9F7oq.d.ts} +1 -1
  457. package/dist/{tree-type-Cz84wHnR.d.cts → tree-type-xf-pj4pG.d.cts} +1 -1
  458. package/dist/tree.cjs +10 -10
  459. package/dist/tree.d.cts +4 -4
  460. package/dist/tree.d.ts +4 -4
  461. package/dist/tree.js +5 -5
  462. package/dist/{treemap-type-DYDj-rWv.d.ts → treemap-type-B4ty-Vge.d.ts} +1 -1
  463. package/dist/{treemap-type-OBCGexiK.d.cts → treemap-type-CeLgbJFQ.d.cts} +1 -1
  464. package/dist/treemap.cjs +10 -10
  465. package/dist/treemap.d.cts +4 -4
  466. package/dist/treemap.d.ts +4 -4
  467. package/dist/treemap.js +5 -5
  468. package/dist/{volume-type-C9wRmKR6.d.ts → volume-type-2ZgLIkPV.d.ts} +1 -1
  469. package/dist/{volume-type-CfERBN5g.d.cts → volume-type-Dvnr4sC9.d.cts} +1 -1
  470. package/dist/volume.cjs +9 -9
  471. package/dist/volume.d.cts +4 -4
  472. package/dist/volume.d.ts +4 -4
  473. package/dist/volume.js +4 -4
  474. package/dist/{waterfall-type-hm5ylGgW.d.cts → waterfall-type-D_6Db7Zy.d.cts} +1 -1
  475. package/dist/{waterfall-type-CpdVtBi_.d.ts → waterfall-type-DsC5vlAP.d.ts} +1 -1
  476. package/dist/waterfall.cjs +9 -9
  477. package/dist/waterfall.d.cts +4 -4
  478. package/dist/waterfall.d.ts +4 -4
  479. package/dist/waterfall.js +4 -4
  480. package/dist/world-regions-C0JUJCGT.d.ts +25 -0
  481. package/dist/world-regions-gUFRPji8.d.cts +25 -0
  482. package/package.json +11 -7
  483. package/dist/chunk-27E6G2GT.js.map +0 -1
  484. package/dist/chunk-2KMMVJEE.cjs.map +0 -1
  485. package/dist/chunk-2L46SAT7.js.map +0 -1
  486. package/dist/chunk-3N447NTJ.cjs.map +0 -1
  487. package/dist/chunk-3NWZJCWL.js.map +0 -1
  488. package/dist/chunk-3QXN7JBV.js.map +0 -1
  489. package/dist/chunk-3TLJCGGQ.cjs.map +0 -1
  490. package/dist/chunk-43WDYYVH.cjs.map +0 -1
  491. package/dist/chunk-4ABM7UYD.js.map +0 -1
  492. package/dist/chunk-5LQ26P4J.cjs.map +0 -1
  493. package/dist/chunk-5M624BRW.js.map +0 -1
  494. package/dist/chunk-6WJJ26J5.js.map +0 -1
  495. package/dist/chunk-7HOU6XMW.js.map +0 -1
  496. package/dist/chunk-7JN6GXML.cjs.map +0 -1
  497. package/dist/chunk-7MXBXWVD.js.map +0 -1
  498. package/dist/chunk-AA45U5KV.js.map +0 -1
  499. package/dist/chunk-ALRCYQQX.cjs.map +0 -1
  500. package/dist/chunk-B7IV2PB3.cjs.map +0 -1
  501. package/dist/chunk-BMTVFAX2.js.map +0 -1
  502. package/dist/chunk-CCHMQZIB.js.map +0 -1
  503. package/dist/chunk-CHERQT4B.js.map +0 -1
  504. package/dist/chunk-CJEMSKW3.js.map +0 -1
  505. package/dist/chunk-D2IP3MWJ.cjs.map +0 -1
  506. package/dist/chunk-DAH76GIX.cjs.map +0 -1
  507. package/dist/chunk-DKVRRL3F.js.map +0 -1
  508. package/dist/chunk-DZHP4UUE.cjs.map +0 -1
  509. package/dist/chunk-DZW35WR2.js.map +0 -1
  510. package/dist/chunk-EAKXLFOR.cjs.map +0 -1
  511. package/dist/chunk-EYN74SQ5.js.map +0 -1
  512. package/dist/chunk-FEQKBVCZ.cjs.map +0 -1
  513. package/dist/chunk-FIAKZSRR.cjs.map +0 -1
  514. package/dist/chunk-FKAA5FNG.cjs.map +0 -1
  515. package/dist/chunk-FKVYS4RB.js.map +0 -1
  516. package/dist/chunk-FQG4DRJS.cjs.map +0 -1
  517. package/dist/chunk-GI7PBJSK.js.map +0 -1
  518. package/dist/chunk-GL3M7MAM.js.map +0 -1
  519. package/dist/chunk-GQR7IHER.js.map +0 -1
  520. package/dist/chunk-GUVPVNPD.cjs.map +0 -1
  521. package/dist/chunk-IAE4VRB7.cjs.map +0 -1
  522. package/dist/chunk-ID7GYRYL.cjs.map +0 -1
  523. package/dist/chunk-IUYPKYOU.js.map +0 -1
  524. package/dist/chunk-IXFSJBJS.js.map +0 -1
  525. package/dist/chunk-JT6H7G52.js.map +0 -1
  526. package/dist/chunk-K2EZ4SS4.js.map +0 -1
  527. package/dist/chunk-K7UR7GYC.cjs.map +0 -1
  528. package/dist/chunk-KEMT7F5H.cjs.map +0 -1
  529. package/dist/chunk-KHQRHTTN.js.map +0 -1
  530. package/dist/chunk-KUFDELQM.cjs.map +0 -1
  531. package/dist/chunk-L37ZPX6D.js.map +0 -1
  532. package/dist/chunk-M6JYSINX.cjs.map +0 -1
  533. package/dist/chunk-MGYBMQAX.cjs.map +0 -1
  534. package/dist/chunk-MZCKMTQE.cjs +0 -210
  535. package/dist/chunk-MZCKMTQE.cjs.map +0 -1
  536. package/dist/chunk-MZQY2FTP.cjs.map +0 -1
  537. package/dist/chunk-N7NZQVIV.cjs.map +0 -1
  538. package/dist/chunk-NML7F34A.js.map +0 -1
  539. package/dist/chunk-NQGZMWNT.js +0 -208
  540. package/dist/chunk-NQGZMWNT.js.map +0 -1
  541. package/dist/chunk-NZWFBAFQ.js.map +0 -1
  542. package/dist/chunk-PCTMS2PX.cjs.map +0 -1
  543. package/dist/chunk-QCR6L55R.js.map +0 -1
  544. package/dist/chunk-QRTYX5KO.js.map +0 -1
  545. package/dist/chunk-QXQSJ3FZ.js.map +0 -1
  546. package/dist/chunk-S64PTNT7.cjs.map +0 -1
  547. package/dist/chunk-S6NGWPXC.js.map +0 -1
  548. package/dist/chunk-SC5BGA2N.cjs.map +0 -1
  549. package/dist/chunk-SKREYNRK.cjs.map +0 -1
  550. package/dist/chunk-SLJNRP7O.cjs.map +0 -1
  551. package/dist/chunk-TIHVTKXS.cjs.map +0 -1
  552. package/dist/chunk-TVPS2NJH.cjs.map +0 -1
  553. package/dist/chunk-U7GBOQXX.js.map +0 -1
  554. package/dist/chunk-VGGKMTO6.js.map +0 -1
  555. package/dist/chunk-VJQCHBS6.js.map +0 -1
  556. package/dist/chunk-WS2AL7GY.cjs.map +0 -1
  557. package/dist/chunk-XKDBNAHH.cjs.map +0 -1
  558. package/dist/chunk-Y4HJCMB4.cjs.map +0 -1
  559. package/dist/chunk-YMJQUKKX.js.map +0 -1
  560. package/dist/graph-type-DkdAB6Vc.d.cts +0 -5
  561. package/dist/graph-type-ul9xwdf5.d.ts +0 -5
  562. package/dist/world-regions-D-TCHPZP.d.cts +0 -38
  563. package/dist/world-regions-DjMvYgFu.d.ts +0 -38
@@ -0,0 +1,897 @@
1
+ import { prepareNoAxes } from './chunk-T7SCCACB.js';
2
+ import { group, line, PathBuilder, path, rect, text, circle } from './chunk-AEQXFDL7.js';
3
+
4
+ // src/charts/graph/parse.ts
5
+ function parseGraphData(data, options) {
6
+ const opts = options;
7
+ const defaultShape = opts.nodeShape ?? "rect";
8
+ if (opts.nodes || opts.edges) {
9
+ return parseRichFormat(data, opts, defaultShape);
10
+ }
11
+ const hasArrow = data.series.some(
12
+ (s) => s.name.includes("\u2192") || s.name.includes("->")
13
+ );
14
+ if (hasArrow) {
15
+ return parseArrowNotation(data, defaultShape);
16
+ }
17
+ return parseAdjacencyMatrix(data, defaultShape);
18
+ }
19
+ function makeNode(id, label, index, value, shape, color, pin) {
20
+ return {
21
+ id,
22
+ label,
23
+ index,
24
+ value,
25
+ shape,
26
+ color,
27
+ pin,
28
+ x: 0,
29
+ y: 0,
30
+ vx: 0,
31
+ vy: 0,
32
+ width: 0,
33
+ height: 0
34
+ };
35
+ }
36
+ function makeEdge(source, target, weight, label, style, color) {
37
+ return { source, target, weight, label, style, color };
38
+ }
39
+ function parseRichFormat(_data, opts, defaultShape) {
40
+ const graphNodes = [];
41
+ const idToIndex = /* @__PURE__ */ new Map();
42
+ if (opts.nodes) {
43
+ for (const nodeDef of opts.nodes) {
44
+ const idx = graphNodes.length;
45
+ idToIndex.set(nodeDef.id, idx);
46
+ graphNodes.push(
47
+ makeNode(
48
+ nodeDef.id,
49
+ nodeDef.label ?? nodeDef.id,
50
+ idx,
51
+ 1,
52
+ nodeDef.shape ?? defaultShape,
53
+ nodeDef.color ?? null,
54
+ nodeDef.pin ?? null
55
+ )
56
+ );
57
+ }
58
+ }
59
+ const graphEdges = [];
60
+ if (opts.edges) {
61
+ for (const edgeDef of opts.edges) {
62
+ if (!idToIndex.has(edgeDef.source)) {
63
+ const idx = graphNodes.length;
64
+ idToIndex.set(edgeDef.source, idx);
65
+ graphNodes.push(
66
+ makeNode(edgeDef.source, edgeDef.source, idx, 1, defaultShape, null, null)
67
+ );
68
+ }
69
+ if (!idToIndex.has(edgeDef.target)) {
70
+ const idx = graphNodes.length;
71
+ idToIndex.set(edgeDef.target, idx);
72
+ graphNodes.push(
73
+ makeNode(edgeDef.target, edgeDef.target, idx, 1, defaultShape, null, null)
74
+ );
75
+ }
76
+ const srcIdx = idToIndex.get(edgeDef.source);
77
+ const tgtIdx = idToIndex.get(edgeDef.target);
78
+ graphEdges.push(
79
+ makeEdge(
80
+ srcIdx,
81
+ tgtIdx,
82
+ edgeDef.weight ?? 1,
83
+ edgeDef.label ?? null,
84
+ edgeDef.style ?? "solid",
85
+ edgeDef.color ?? null
86
+ )
87
+ );
88
+ }
89
+ }
90
+ return { graphNodes, graphEdges };
91
+ }
92
+ var ARROW_RE = /\s*(?:→|->)\s*/;
93
+ function parseArrowNotation(data, defaultShape) {
94
+ const graphNodes = [];
95
+ const nameToIndex = /* @__PURE__ */ new Map();
96
+ const graphEdges = [];
97
+ function getOrCreateNode(name) {
98
+ let idx = nameToIndex.get(name);
99
+ if (idx !== void 0) return idx;
100
+ idx = graphNodes.length;
101
+ nameToIndex.set(name, idx);
102
+ graphNodes.push(makeNode(name, name, idx, 0, defaultShape, null, null));
103
+ return idx;
104
+ }
105
+ for (const series of data.series) {
106
+ const parts = series.name.split(ARROW_RE);
107
+ if (parts.length < 2) continue;
108
+ const srcName = parts[0];
109
+ const tgtName = parts[1];
110
+ const weight = series.values[0] ?? 1;
111
+ const srcIdx = getOrCreateNode(srcName);
112
+ const tgtIdx = getOrCreateNode(tgtName);
113
+ graphNodes[srcIdx].value += weight;
114
+ graphNodes[tgtIdx].value += weight;
115
+ graphEdges.push(makeEdge(srcIdx, tgtIdx, weight, null, "solid", null));
116
+ }
117
+ return { graphNodes, graphEdges };
118
+ }
119
+ function parseAdjacencyMatrix(data, defaultShape) {
120
+ const graphNodes = [];
121
+ for (let i = 0; i < data.labels.length; i++) {
122
+ const name = String(data.labels[i]);
123
+ const value = Math.abs(data.series[0]?.values[i] ?? 1);
124
+ graphNodes.push(makeNode(name, name, i, value, defaultShape, null, null));
125
+ }
126
+ const graphEdges = [];
127
+ if (data.series.length > 1 && data.series.length === data.labels.length) {
128
+ for (let i = 0; i < data.series.length; i++) {
129
+ const row = data.series[i];
130
+ for (let j = 0; j < row.values.length; j++) {
131
+ const weight = row.values[j] ?? 0;
132
+ if (weight > 0) {
133
+ graphEdges.push(makeEdge(i, j, weight, null, "solid", null));
134
+ }
135
+ }
136
+ }
137
+ }
138
+ return { graphNodes, graphEdges };
139
+ }
140
+
141
+ // src/charts/graph/text-measure.ts
142
+ var CHAR_WIDTH_RATIO = 0.6;
143
+ var PADDING_H = 16;
144
+ var PADDING_V = 10;
145
+ function measureNodeSize(label, fontSize, shape) {
146
+ const charWidth = fontSize * CHAR_WIDTH_RATIO;
147
+ const textWidth = label.length * charWidth;
148
+ const textHeight = fontSize * 1.2;
149
+ let w = textWidth + PADDING_H * 2;
150
+ let h = textHeight + PADDING_V * 2;
151
+ w = Math.max(w, 40);
152
+ h = Math.max(h, 28);
153
+ switch (shape) {
154
+ case "circle": {
155
+ const d = Math.sqrt(w * w + h * h);
156
+ return { width: d, height: d };
157
+ }
158
+ case "diamond": {
159
+ return { width: w * 1.45, height: h * 1.45 };
160
+ }
161
+ case "hexagon": {
162
+ return { width: w * 1.25, height: h * 1.15 };
163
+ }
164
+ case "stadium":
165
+ case "rect":
166
+ default:
167
+ return { width: w, height: h };
168
+ }
169
+ }
170
+
171
+ // src/charts/graph/shapes.ts
172
+ function renderNodeShape(node, color, theme) {
173
+ const cx = node.x;
174
+ const cy = node.y;
175
+ const w = node.width;
176
+ const h = node.height;
177
+ const baseAttrs = {
178
+ class: "chartts-graph-node",
179
+ fill: color,
180
+ fillOpacity: 0.85,
181
+ stroke: color,
182
+ strokeWidth: 1.5,
183
+ "data-series": node.index,
184
+ "data-index": 0,
185
+ tabindex: 0,
186
+ role: "img",
187
+ ariaLabel: `${node.label}: ${node.value}`
188
+ };
189
+ let shapeNode;
190
+ switch (node.shape) {
191
+ case "circle": {
192
+ const r = Math.max(w, h) / 2;
193
+ shapeNode = circle(cx, cy, r, { ...baseAttrs });
194
+ break;
195
+ }
196
+ case "diamond": {
197
+ const pb = new PathBuilder();
198
+ pb.moveTo(cx, cy - h / 2).lineTo(cx + w / 2, cy).lineTo(cx, cy + h / 2).lineTo(cx - w / 2, cy).close();
199
+ shapeNode = path(pb.build(), { ...baseAttrs });
200
+ break;
201
+ }
202
+ case "hexagon": {
203
+ const rx = w / 2;
204
+ const ry = h / 2;
205
+ const pb = new PathBuilder();
206
+ for (let i = 0; i < 6; i++) {
207
+ const angle = Math.PI / 180 * (i * 60);
208
+ const px = cx + rx * Math.cos(angle);
209
+ const py = cy + ry * Math.sin(angle);
210
+ if (i === 0) pb.moveTo(px, py);
211
+ else pb.lineTo(px, py);
212
+ }
213
+ pb.close();
214
+ shapeNode = path(pb.build(), { ...baseAttrs });
215
+ break;
216
+ }
217
+ case "stadium": {
218
+ shapeNode = rect(cx - w / 2, cy - h / 2, w, h, {
219
+ ...baseAttrs,
220
+ rx: h / 2
221
+ });
222
+ break;
223
+ }
224
+ // 'rect' is the default
225
+ default: {
226
+ shapeNode = rect(cx - w / 2, cy - h / 2, w, h, {
227
+ ...baseAttrs,
228
+ rx: 8
229
+ });
230
+ break;
231
+ }
232
+ }
233
+ const labelNode = text(cx, cy, node.label, {
234
+ class: "chartts-graph-label",
235
+ fill: "#fff",
236
+ textAnchor: "middle",
237
+ dominantBaseline: "central",
238
+ fontSize: theme.fontSizeSmall,
239
+ fontFamily: theme.fontFamily,
240
+ fontWeight: 600
241
+ });
242
+ return [shapeNode, labelNode];
243
+ }
244
+ var PAD = 3;
245
+ function clipToNodeBoundary(node, angle) {
246
+ const cx = node.x;
247
+ const cy = node.y;
248
+ const w = node.width;
249
+ const h = node.height;
250
+ const cos = Math.cos(angle);
251
+ const sin = Math.sin(angle);
252
+ let bx;
253
+ let by;
254
+ switch (node.shape) {
255
+ case "circle": {
256
+ const r = Math.max(w, h) / 2;
257
+ bx = cx + r * cos;
258
+ by = cy + r * sin;
259
+ break;
260
+ }
261
+ case "diamond": {
262
+ const hw = w / 2;
263
+ const hh = h / 2;
264
+ const t = 1 / (Math.abs(cos) / hw + Math.abs(sin) / hh);
265
+ bx = cx + t * cos;
266
+ by = cy + t * sin;
267
+ break;
268
+ }
269
+ case "hexagon": {
270
+ const rx = w / 2;
271
+ const ry = h / 2;
272
+ const pt = hexBoundary(cx, cy, rx, ry, angle, cos, sin);
273
+ bx = pt.x;
274
+ by = pt.y;
275
+ break;
276
+ }
277
+ // rect and stadium share the same rectangular bounding box logic
278
+ default: {
279
+ const hw = w / 2;
280
+ const hh = h / 2;
281
+ const cornerAngle = Math.atan2(hh, hw);
282
+ let a = (angle % (2 * Math.PI) + 2 * Math.PI) % (2 * Math.PI);
283
+ if (a < cornerAngle || a >= 2 * Math.PI - cornerAngle) {
284
+ const t = hw / Math.abs(cos);
285
+ bx = cx + hw;
286
+ by = cy + t * sin;
287
+ } else if (a < Math.PI - cornerAngle) {
288
+ const t = hh / Math.abs(sin);
289
+ bx = cx + t * cos;
290
+ by = cy + hh;
291
+ } else if (a < Math.PI + cornerAngle) {
292
+ const t = hw / Math.abs(cos);
293
+ bx = cx - hw;
294
+ by = cy + t * sin;
295
+ } else {
296
+ const t = hh / Math.abs(sin);
297
+ bx = cx + t * cos;
298
+ by = cy - hh;
299
+ }
300
+ break;
301
+ }
302
+ }
303
+ bx += PAD * cos;
304
+ by += PAD * sin;
305
+ return { x: bx, y: by };
306
+ }
307
+ function hexBoundary(cx, cy, rx, ry, _angle, cos, sin) {
308
+ const verts = [];
309
+ for (let i = 0; i < 6; i++) {
310
+ const a = Math.PI / 180 * (i * 60);
311
+ verts.push({ x: cx + rx * Math.cos(a), y: cy + ry * Math.sin(a) });
312
+ }
313
+ let bestT = Infinity;
314
+ let bestPt = { x: cx + rx * cos, y: cy + ry * sin };
315
+ for (let i = 0; i < 6; i++) {
316
+ const v0 = verts[i];
317
+ const v1 = verts[(i + 1) % 6];
318
+ const dx = v1.x - v0.x;
319
+ const dy = v1.y - v0.y;
320
+ const denom = cos * dy - sin * dx;
321
+ if (Math.abs(denom) < 1e-12) continue;
322
+ const t = ((v0.x - cx) * dy - (v0.y - cy) * dx) / denom;
323
+ const s = cos !== 0 ? (cx + t * cos - v0.x) / dx : (cy + t * sin - v0.y) / dy;
324
+ if (t > 1e-6 && s >= -1e-6 && s <= 1 + 1e-6 && t < bestT) {
325
+ bestT = t;
326
+ bestPt = { x: cx + t * cos, y: cy + t * sin };
327
+ }
328
+ }
329
+ return bestPt;
330
+ }
331
+
332
+ // src/charts/graph/edges.ts
333
+ function renderArrowhead(tipX, tipY, angle, size, color) {
334
+ const cosA = Math.cos(angle);
335
+ const sinA = Math.sin(angle);
336
+ const baseX = tipX - cosA * size;
337
+ const baseY = tipY - sinA * size;
338
+ const perpX = -sinA * size * 0.4;
339
+ const perpY = cosA * size * 0.4;
340
+ const leftX = baseX + perpX;
341
+ const leftY = baseY + perpY;
342
+ const rightX = baseX - perpX;
343
+ const rightY = baseY - perpY;
344
+ const pb = new PathBuilder();
345
+ pb.moveTo(tipX, tipY).lineTo(leftX, leftY).lineTo(rightX, rightY).close();
346
+ return path(pb.build(), {
347
+ fill: color,
348
+ class: "chartts-graph-arrow"
349
+ });
350
+ }
351
+ function renderEdges(nodes, edges, options, theme) {
352
+ const result = [];
353
+ const pairIndex = /* @__PURE__ */ new Map();
354
+ for (const edge of edges) {
355
+ const src = nodes[edge.source];
356
+ const tgt = nodes[edge.target];
357
+ if (!src || !tgt) continue;
358
+ const angle = Math.atan2(tgt.y - src.y, tgt.x - src.x);
359
+ const start = clipToNodeBoundary(src, angle);
360
+ const end = clipToNodeBoundary(tgt, angle + Math.PI);
361
+ const edgeColor = edge.color ?? theme.gridColor;
362
+ const edgeAttrs = {
363
+ class: "chartts-graph-edge",
364
+ stroke: edgeColor,
365
+ strokeWidth: Math.max(1, Math.min(3, edge.weight * 0.5)),
366
+ strokeDasharray: edge.style === "dashed" ? "8,4" : edge.style === "dotted" ? "2,4" : void 0,
367
+ opacity: 0.6,
368
+ fill: "none"
369
+ };
370
+ let arrowAngle = angle;
371
+ let labelX = (start.x + end.x) / 2;
372
+ let labelY = (start.y + end.y) / 2;
373
+ if (options.edgeStyle === "straight" || options.edgeStyle === void 0) {
374
+ result.push(line(start.x, start.y, end.x, end.y, edgeAttrs));
375
+ } else {
376
+ const pairKey = Math.min(edge.source, edge.target) + ":" + Math.max(edge.source, edge.target);
377
+ const idx = pairIndex.get(pairKey) ?? 0;
378
+ pairIndex.set(pairKey, idx + 1);
379
+ const sign = idx % 2 === 0 ? 1 : -1;
380
+ const offset = Math.max(edge.weight * 8, 15);
381
+ const mx = (start.x + end.x) / 2;
382
+ const my = (start.y + end.y) / 2;
383
+ const perpAngle = angle + Math.PI / 2;
384
+ const cx = mx + Math.cos(perpAngle) * offset * sign;
385
+ const cy = my + Math.sin(perpAngle) * offset * sign;
386
+ const pb = new PathBuilder();
387
+ pb.moveTo(start.x, start.y).quadTo(cx, cy, end.x, end.y);
388
+ result.push(path(pb.build(), edgeAttrs));
389
+ arrowAngle = Math.atan2(end.y - cy, end.x - cx);
390
+ labelX = 0.25 * start.x + 0.5 * cx + 0.25 * end.x;
391
+ labelY = 0.25 * start.y + 0.5 * cy + 0.25 * end.y;
392
+ }
393
+ if (options.arrows !== false) {
394
+ const arrowSize = 8;
395
+ result.push(renderArrowhead(end.x, end.y, arrowAngle, arrowSize, edgeColor));
396
+ }
397
+ if (edge.label != null) {
398
+ const lx = labelX;
399
+ const ly = labelY;
400
+ const charWidth = (theme.fontSizeSmall - 1) * 0.6;
401
+ const pw = edge.label.length * charWidth + 8;
402
+ const ph = theme.fontSizeSmall - 1 + 6;
403
+ const bgFill = theme.background === "transparent" ? "#fff" : theme.background;
404
+ result.push(
405
+ rect(lx - pw / 2, ly - ph / 2, pw, ph, {
406
+ fill: bgFill,
407
+ rx: 3
408
+ })
409
+ );
410
+ result.push(
411
+ text(lx, ly, edge.label, {
412
+ fill: theme.textMuted,
413
+ textAnchor: "middle",
414
+ dominantBaseline: "central",
415
+ fontSize: theme.fontSizeSmall - 1,
416
+ fontFamily: theme.fontFamily
417
+ })
418
+ );
419
+ }
420
+ }
421
+ return result;
422
+ }
423
+
424
+ // src/charts/graph/layout-force.ts
425
+ var layoutCache = /* @__PURE__ */ new Map();
426
+ function cacheKey(nodes, edges) {
427
+ const nk = nodes.map((n) => n.id).join(",");
428
+ const ek = edges.map((e) => `${e.source}-${e.target}`).join(",");
429
+ return nk + "|" + ek;
430
+ }
431
+ function forceLayout(nodes, edges, opts) {
432
+ const { area, iterations } = opts;
433
+ const n = nodes.length;
434
+ if (n === 0) return;
435
+ const cx = area.x + area.width / 2;
436
+ const cy = area.y + area.height / 2;
437
+ const key = cacheKey(nodes, edges);
438
+ const cached = layoutCache.get(key);
439
+ if (cached && cached.length === n) {
440
+ for (let i = 0; i < n; i++) {
441
+ const node = nodes[i];
442
+ if (!node.pin) {
443
+ node.x = cached[i].x;
444
+ node.y = cached[i].y;
445
+ }
446
+ }
447
+ } else {
448
+ for (let i = 0; i < n; i++) {
449
+ const node = nodes[i];
450
+ if (node.pin) {
451
+ node.x = area.x + node.pin.x * area.width;
452
+ node.y = area.y + node.pin.y * area.height;
453
+ } else {
454
+ const angle = 2 * Math.PI * i / n;
455
+ const r = Math.min(area.width, area.height) * 0.3;
456
+ node.x = cx + r * Math.cos(angle);
457
+ node.y = cy + r * Math.sin(angle);
458
+ }
459
+ node.vx = 0;
460
+ node.vy = 0;
461
+ }
462
+ }
463
+ const k = Math.sqrt(area.width * area.height / Math.max(n, 1));
464
+ const repulsion = k * k;
465
+ for (let iter = 0; iter < iterations; iter++) {
466
+ const temp = 0.1 * (1 - iter / iterations) * Math.min(area.width, area.height) * 0.5;
467
+ for (const node of nodes) {
468
+ node.vx = 0;
469
+ node.vy = 0;
470
+ }
471
+ for (let i = 0; i < n; i++) {
472
+ for (let j = i + 1; j < n; j++) {
473
+ const ni = nodes[i];
474
+ const nj = nodes[j];
475
+ const dx = ni.x - nj.x;
476
+ const dy = ni.y - nj.y;
477
+ const dist = Math.max(Math.sqrt(dx * dx + dy * dy), 1);
478
+ const minDist = (Math.max(ni.width, ni.height) + Math.max(nj.width, nj.height)) / 2;
479
+ const effectiveDist = Math.max(dist - minDist * 0.6, 1);
480
+ const force = repulsion / (effectiveDist * effectiveDist);
481
+ const fx = dx / dist * force;
482
+ const fy = dy / dist * force;
483
+ ni.vx += fx;
484
+ ni.vy += fy;
485
+ nj.vx -= fx;
486
+ nj.vy -= fy;
487
+ }
488
+ }
489
+ for (const edge of edges) {
490
+ const src = nodes[edge.source];
491
+ const tgt = nodes[edge.target];
492
+ const dx = tgt.x - src.x;
493
+ const dy = tgt.y - src.y;
494
+ const dist = Math.max(Math.sqrt(dx * dx + dy * dy), 1);
495
+ const force = dist * dist / k;
496
+ const fx = dx / dist * force * 0.1;
497
+ const fy = dy / dist * force * 0.1;
498
+ src.vx += fx;
499
+ src.vy += fy;
500
+ tgt.vx -= fx;
501
+ tgt.vy -= fy;
502
+ }
503
+ for (const node of nodes) {
504
+ const dx = cx - node.x;
505
+ const dy = cy - node.y;
506
+ node.vx += dx * 0.01;
507
+ node.vy += dy * 0.01;
508
+ }
509
+ for (const node of nodes) {
510
+ if (node.pin) continue;
511
+ node.vx *= 0.8;
512
+ node.vy *= 0.8;
513
+ const speed = Math.sqrt(node.vx * node.vx + node.vy * node.vy);
514
+ if (speed > 0) {
515
+ const capped = Math.min(speed, temp);
516
+ node.x += node.vx / speed * capped;
517
+ node.y += node.vy / speed * capped;
518
+ }
519
+ const mx = Math.max(20, node.width / 2 + 5);
520
+ const my = Math.max(20, node.height / 2 + 5);
521
+ node.x = Math.max(area.x + mx, Math.min(area.x + area.width - mx, node.x));
522
+ node.y = Math.max(area.y + my, Math.min(area.y + area.height - my, node.y));
523
+ }
524
+ }
525
+ layoutCache.set(key, nodes.map((nd) => ({ x: nd.x, y: nd.y })));
526
+ }
527
+
528
+ // src/charts/graph/layout-hierarchy.ts
529
+ function hierarchyLayout(nodes, edges, opts) {
530
+ const n = nodes.length;
531
+ if (n === 0) return;
532
+ const { area, direction } = opts;
533
+ const outgoing = new Array(n);
534
+ const incoming = new Array(n);
535
+ for (let i = 0; i < n; i++) {
536
+ outgoing[i] = [];
537
+ incoming[i] = [];
538
+ }
539
+ const edgesCopy = edges.map((e) => ({ ...e }));
540
+ breakCycles(edgesCopy, n, outgoing, incoming);
541
+ const layers = assignLayers(n, outgoing, incoming);
542
+ const layerGroups = groupByLayer(layers, n);
543
+ orderLayers(layerGroups, outgoing, incoming, 3);
544
+ const isHorizontal = direction === "LR" || direction === "RL";
545
+ const maxLayer = Math.max(...layers, 0);
546
+ const availW = area.width;
547
+ const availH = area.height;
548
+ const layerCount = maxLayer + 1;
549
+ const layerGap = isHorizontal ? availW / (layerCount + 1) : availH / (layerCount + 1);
550
+ for (let layer = 0; layer <= maxLayer; layer++) {
551
+ const group2 = layerGroups[layer] ?? [];
552
+ if (group2.length === 0) continue;
553
+ const nodeGap = isHorizontal ? availH / (group2.length + 1) : availW / (group2.length + 1);
554
+ for (let pos = 0; pos < group2.length; pos++) {
555
+ const node = nodes[group2[pos]];
556
+ if (node.pin) {
557
+ node.x = area.x + node.pin.x * area.width;
558
+ node.y = area.y + node.pin.y * area.height;
559
+ continue;
560
+ }
561
+ let layerCoord = area.x + layerGap * (layer + 1);
562
+ let posCoord = area.y + nodeGap * (pos + 1);
563
+ if (isHorizontal) ; else {
564
+ const tmp = layerCoord;
565
+ layerCoord = posCoord;
566
+ posCoord = tmp;
567
+ }
568
+ switch (direction) {
569
+ case "TB":
570
+ node.x = layerCoord;
571
+ node.y = posCoord;
572
+ break;
573
+ case "BT":
574
+ node.x = layerCoord;
575
+ node.y = area.y + area.height - (posCoord - area.y);
576
+ break;
577
+ case "LR":
578
+ node.x = layerCoord;
579
+ node.y = posCoord;
580
+ break;
581
+ case "RL":
582
+ node.x = area.x + area.width - (layerCoord - area.x);
583
+ node.y = posCoord;
584
+ break;
585
+ }
586
+ }
587
+ }
588
+ }
589
+ function breakCycles(edges, n, outgoing, incoming) {
590
+ for (const e of edges) {
591
+ outgoing[e.source].push(e.target);
592
+ incoming[e.target].push(e.source);
593
+ }
594
+ const WHITE = 0, GRAY = 1, BLACK = 2;
595
+ const color = new Array(n).fill(WHITE);
596
+ function dfs(u) {
597
+ color[u] = GRAY;
598
+ const out = outgoing[u];
599
+ for (let i = 0; i < out.length; i++) {
600
+ const v = out[i];
601
+ if (color[v] === GRAY) {
602
+ for (const e of edges) {
603
+ if (e.source === u && e.target === v) {
604
+ e.source = v;
605
+ e.target = u;
606
+ break;
607
+ }
608
+ }
609
+ out.splice(i, 1);
610
+ i--;
611
+ outgoing[v].push(u);
612
+ incoming[u].push(v);
613
+ const idx = incoming[v].indexOf(u);
614
+ if (idx >= 0) incoming[v].splice(idx, 1);
615
+ } else if (color[v] === WHITE) {
616
+ dfs(v);
617
+ }
618
+ }
619
+ color[u] = BLACK;
620
+ }
621
+ for (let i = 0; i < n; i++) {
622
+ if (color[i] === WHITE) dfs(i);
623
+ }
624
+ }
625
+ function assignLayers(n, outgoing, incoming) {
626
+ const layers = new Array(n).fill(-1);
627
+ const roots = [];
628
+ for (let i = 0; i < n; i++) {
629
+ if (incoming[i].length === 0) roots.push(i);
630
+ }
631
+ if (roots.length === 0 && n > 0) roots.push(0);
632
+ const queue = [];
633
+ for (const r of roots) {
634
+ layers[r] = 0;
635
+ queue.push(r);
636
+ }
637
+ let qi = 0;
638
+ while (qi < queue.length) {
639
+ const u = queue[qi++];
640
+ for (const v of outgoing[u]) {
641
+ const newLayer = layers[u] + 1;
642
+ if (layers[v] < newLayer) {
643
+ layers[v] = newLayer;
644
+ queue.push(v);
645
+ }
646
+ }
647
+ }
648
+ for (let i = 0; i < n; i++) {
649
+ if (layers[i] < 0) layers[i] = 0;
650
+ }
651
+ return layers;
652
+ }
653
+ function groupByLayer(layers, n) {
654
+ const maxLayer = Math.max(...layers, 0);
655
+ const groups = new Array(maxLayer + 1);
656
+ for (let i = 0; i <= maxLayer; i++) groups[i] = [];
657
+ for (let i = 0; i < n; i++) {
658
+ groups[layers[i]].push(i);
659
+ }
660
+ return groups;
661
+ }
662
+ function orderLayers(layerGroups, outgoing, incoming, passes) {
663
+ for (let pass = 0; pass < passes; pass++) {
664
+ for (let l = 1; l < layerGroups.length; l++) {
665
+ const layer = layerGroups[l];
666
+ const posMap = /* @__PURE__ */ new Map();
667
+ const prevLayer = layerGroups[l - 1];
668
+ for (let i = 0; i < prevLayer.length; i++) posMap.set(prevLayer[i], i);
669
+ layer.sort((a, b) => {
670
+ const ba = barycenter(a, incoming, posMap);
671
+ const bb = barycenter(b, incoming, posMap);
672
+ return ba - bb;
673
+ });
674
+ }
675
+ for (let l = layerGroups.length - 2; l >= 0; l--) {
676
+ const layer = layerGroups[l];
677
+ const posMap = /* @__PURE__ */ new Map();
678
+ const nextLayer = layerGroups[l + 1];
679
+ for (let i = 0; i < nextLayer.length; i++) posMap.set(nextLayer[i], i);
680
+ layer.sort((a, b) => {
681
+ const ba = barycenter(a, outgoing, posMap);
682
+ const bb = barycenter(b, outgoing, posMap);
683
+ return ba - bb;
684
+ });
685
+ }
686
+ }
687
+ }
688
+ function barycenter(nodeIdx, adj, posMap) {
689
+ const neighbors = adj[nodeIdx];
690
+ if (neighbors.length === 0) return 0;
691
+ let sum = 0;
692
+ let count = 0;
693
+ for (const nb of neighbors) {
694
+ const pos = posMap.get(nb);
695
+ if (pos !== void 0) {
696
+ sum += pos;
697
+ count++;
698
+ }
699
+ }
700
+ return count > 0 ? sum / count : 0;
701
+ }
702
+
703
+ // src/charts/graph/layout-circular.ts
704
+ function circularLayout(nodes, edges, opts) {
705
+ const n = nodes.length;
706
+ if (n === 0) return;
707
+ const { area } = opts;
708
+ const cx = area.x + area.width / 2;
709
+ const cy = area.y + area.height / 2;
710
+ const maxNodeSize = Math.max(
711
+ ...nodes.map((nd) => Math.max(nd.width, nd.height)),
712
+ 40
713
+ );
714
+ const radius = Math.min(area.width, area.height) / 2 - maxNodeSize / 2 - 10;
715
+ const order = connectivityOrder(nodes, edges);
716
+ const unpinned = [];
717
+ for (const idx of order) {
718
+ if (!nodes[idx].pin) unpinned.push(idx);
719
+ }
720
+ const angleStep = 2 * Math.PI / Math.max(unpinned.length, 1);
721
+ const startAngle = -Math.PI / 2;
722
+ for (let i = 0; i < unpinned.length; i++) {
723
+ const node = nodes[unpinned[i]];
724
+ const angle = startAngle + angleStep * i;
725
+ node.x = cx + radius * Math.cos(angle);
726
+ node.y = cy + radius * Math.sin(angle);
727
+ }
728
+ for (const node of nodes) {
729
+ if (node.pin) {
730
+ node.x = area.x + node.pin.x * area.width;
731
+ node.y = area.y + node.pin.y * area.height;
732
+ }
733
+ }
734
+ }
735
+ function connectivityOrder(nodes, edges) {
736
+ const n = nodes.length;
737
+ if (n === 0) return [];
738
+ const adj = new Array(n);
739
+ for (let i = 0; i < n; i++) adj[i] = [];
740
+ for (const e of edges) {
741
+ adj[e.source].push(e.target);
742
+ adj[e.target].push(e.source);
743
+ }
744
+ let startNode = 0;
745
+ let maxDeg = 0;
746
+ for (let i = 0; i < n; i++) {
747
+ if (adj[i].length > maxDeg) {
748
+ maxDeg = adj[i].length;
749
+ startNode = i;
750
+ }
751
+ }
752
+ const visited = /* @__PURE__ */ new Set();
753
+ const order = [];
754
+ const queue = [startNode];
755
+ visited.add(startNode);
756
+ while (queue.length > 0) {
757
+ const u = queue.shift();
758
+ order.push(u);
759
+ const neighbors = adj[u].filter((v) => !visited.has(v));
760
+ neighbors.sort((a, b) => adj[b].length - adj[a].length);
761
+ for (const v of neighbors) {
762
+ if (!visited.has(v)) {
763
+ visited.add(v);
764
+ queue.push(v);
765
+ }
766
+ }
767
+ }
768
+ for (let i = 0; i < n; i++) {
769
+ if (!visited.has(i)) order.push(i);
770
+ }
771
+ return order;
772
+ }
773
+
774
+ // src/charts/graph/graph-type.ts
775
+ var graphChartType = {
776
+ type: "graph",
777
+ getScaleTypes() {
778
+ return { x: "categorical", y: "linear" };
779
+ },
780
+ prepareData(data, options) {
781
+ const opts = options;
782
+ if ((opts.nodes || opts.edges) && (!data.series.length || data.series.every((s) => s.values.length === 0))) {
783
+ return {
784
+ series: [],
785
+ labels: [],
786
+ bounds: { xMin: 0, xMax: 1, yMin: 0, yMax: 1 }
787
+ };
788
+ }
789
+ return prepareNoAxes(data, options);
790
+ },
791
+ render(ctx) {
792
+ const { data, area, theme, options } = ctx;
793
+ const graphOpts = options;
794
+ const result = [];
795
+ const { graphNodes, graphEdges } = parseGraphData(data, options);
796
+ if (graphNodes.length === 0) return result;
797
+ for (const node of graphNodes) {
798
+ const size = measureNodeSize(node.label, theme.fontSizeSmall, node.shape);
799
+ node.width = size.width;
800
+ node.height = size.height;
801
+ }
802
+ runLayout(graphNodes, graphEdges, graphOpts, area);
803
+ const edgeNodes = renderEdges(graphNodes, graphEdges, graphOpts, theme);
804
+ if (edgeNodes.length > 0) {
805
+ result.push(group(edgeNodes, { class: "chartts-graph-edges" }));
806
+ }
807
+ for (const node of graphNodes) {
808
+ const color = node.color ?? options.colors[node.index % options.colors.length];
809
+ const shapeNodes = renderNodeShape(node, color, theme);
810
+ result.push(group(shapeNodes, {
811
+ class: `chartts-series chartts-series-${node.index}`,
812
+ "data-series-name": node.label
813
+ }));
814
+ }
815
+ return result;
816
+ },
817
+ hitTest(ctx, mx, my) {
818
+ const { data, area, theme, options } = ctx;
819
+ const graphOpts = options;
820
+ const { graphNodes, graphEdges } = parseGraphData(data, options);
821
+ if (graphNodes.length === 0) return null;
822
+ for (const node of graphNodes) {
823
+ const size = measureNodeSize(node.label, theme.fontSizeSmall, node.shape);
824
+ node.width = size.width;
825
+ node.height = size.height;
826
+ }
827
+ runLayout(graphNodes, graphEdges, graphOpts, area);
828
+ let best = null;
829
+ let bestDist = Infinity;
830
+ for (const node of graphNodes) {
831
+ const dist = shapeDistance(node, mx, my);
832
+ if (dist < bestDist && dist < 8) {
833
+ bestDist = dist;
834
+ best = { seriesIndex: node.index, pointIndex: 0, distance: dist, x: node.x, y: node.y };
835
+ }
836
+ }
837
+ return best;
838
+ }
839
+ };
840
+ function runLayout(nodes, edges, opts, area) {
841
+ const layout = opts.layout ?? "force";
842
+ switch (layout) {
843
+ case "hierarchical":
844
+ hierarchyLayout(nodes, edges, {
845
+ area,
846
+ direction: opts.direction ?? "TB"
847
+ });
848
+ break;
849
+ case "circular":
850
+ circularLayout(nodes, edges, { area });
851
+ break;
852
+ case "force":
853
+ default:
854
+ forceLayout(nodes, edges, {
855
+ area,
856
+ iterations: opts.iterations ?? 120
857
+ });
858
+ break;
859
+ }
860
+ }
861
+ function shapeDistance(node, mx, my) {
862
+ const dx = mx - node.x;
863
+ const dy = my - node.y;
864
+ const absDx = Math.abs(dx);
865
+ const absDy = Math.abs(dy);
866
+ switch (node.shape) {
867
+ case "circle": {
868
+ const r = Math.max(node.width, node.height) / 2;
869
+ const dist = Math.sqrt(dx * dx + dy * dy);
870
+ return Math.max(0, dist - r);
871
+ }
872
+ case "diamond": {
873
+ const hw = node.width / 2;
874
+ const hh = node.height / 2;
875
+ const d = absDx / hw + absDy / hh;
876
+ return d <= 1 ? 0 : Math.sqrt(dx * dx + dy * dy) * (d - 1);
877
+ }
878
+ case "hexagon": {
879
+ const rx = node.width / 2;
880
+ const ry = node.height / 2;
881
+ const d = dx * dx / (rx * rx) + dy * dy / (ry * ry);
882
+ return d <= 1 ? 0 : Math.sqrt(dx * dx + dy * dy) * (Math.sqrt(d) - 1);
883
+ }
884
+ // rect, stadium
885
+ default: {
886
+ const hw = node.width / 2;
887
+ const hh = node.height / 2;
888
+ const ox = Math.max(0, absDx - hw);
889
+ const oy = Math.max(0, absDy - hh);
890
+ return Math.sqrt(ox * ox + oy * oy);
891
+ }
892
+ }
893
+ }
894
+
895
+ export { graphChartType };
896
+ //# sourceMappingURL=chunk-LRHMLNPW.js.map
897
+ //# sourceMappingURL=chunk-LRHMLNPW.js.map