@chartts/core 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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-FEQKBVCZ.cjs → chunk-2EZ2TVYT.cjs} +14 -14
  57. package/dist/chunk-2EZ2TVYT.cjs.map +1 -0
  58. package/dist/{chunk-GI7PBJSK.js → chunk-2ITF366P.js} +4 -4
  59. package/dist/chunk-2ITF366P.js.map +1 -0
  60. package/dist/{chunk-YMJQUKKX.js → chunk-2MWA7H6J.js} +68 -42
  61. package/dist/chunk-2MWA7H6J.js.map +1 -0
  62. package/dist/{chunk-CJEMSKW3.js → chunk-3SOKHPAO.js} +217 -57
  63. package/dist/chunk-3SOKHPAO.js.map +1 -0
  64. package/dist/{chunk-3N447NTJ.cjs → chunk-3V64BDKG.cjs} +14 -14
  65. package/dist/chunk-3V64BDKG.cjs.map +1 -0
  66. package/dist/{chunk-DZW35WR2.js → chunk-46ZZTP5B.js} +5 -5
  67. package/dist/chunk-46ZZTP5B.js.map +1 -0
  68. package/dist/{chunk-PCTMS2PX.cjs → chunk-47EP245Y.cjs} +19 -9
  69. package/dist/chunk-47EP245Y.cjs.map +1 -0
  70. package/dist/{chunk-DZHP4UUE.cjs → chunk-4H2LGLGI.cjs} +16 -12
  71. package/dist/chunk-4H2LGLGI.cjs.map +1 -0
  72. package/dist/{chunk-7HOU6XMW.js → chunk-4L62MAZA.js} +25 -28
  73. package/dist/chunk-4L62MAZA.js.map +1 -0
  74. package/dist/{chunk-GQR7IHER.js → chunk-4ORSJM2I.js} +6 -6
  75. package/dist/chunk-4ORSJM2I.js.map +1 -0
  76. package/dist/{chunk-FQG4DRJS.cjs → chunk-4WQUX2B4.cjs} +71 -45
  77. package/dist/chunk-4WQUX2B4.cjs.map +1 -0
  78. package/dist/{chunk-3QXN7JBV.js → chunk-4XVJYNOT.js} +7 -5
  79. package/dist/chunk-4XVJYNOT.js.map +1 -0
  80. package/dist/{chunk-6WJJ26J5.js → chunk-5J26EN5I.js} +6 -6
  81. package/dist/chunk-5J26EN5I.js.map +1 -0
  82. package/dist/{chunk-K2EZ4SS4.js → chunk-5YNIOIKK.js} +5 -5
  83. package/dist/chunk-5YNIOIKK.js.map +1 -0
  84. package/dist/{chunk-5LQ26P4J.cjs → chunk-66BHM3UN.cjs} +11 -11
  85. package/dist/chunk-66BHM3UN.cjs.map +1 -0
  86. package/dist/{chunk-DAH76GIX.cjs → chunk-6E6ZDWZD.cjs} +11 -11
  87. package/dist/chunk-6E6ZDWZD.cjs.map +1 -0
  88. package/dist/{chunk-COPERSVL.cjs → chunk-6EGHZDZI.cjs} +15 -15
  89. package/dist/{chunk-COPERSVL.cjs.map → chunk-6EGHZDZI.cjs.map} +1 -1
  90. package/dist/{chunk-KHQRHTTN.js → chunk-6JNW43SE.js} +40 -30
  91. package/dist/chunk-6JNW43SE.js.map +1 -0
  92. package/dist/{chunk-3YFDZGHO.cjs → chunk-6UWYKNFN.cjs} +13 -13
  93. package/dist/{chunk-3YFDZGHO.cjs.map → chunk-6UWYKNFN.cjs.map} +1 -1
  94. package/dist/{chunk-CHERQT4B.js → chunk-7PNCJ4OQ.js} +4 -4
  95. package/dist/chunk-7PNCJ4OQ.js.map +1 -0
  96. package/dist/{chunk-2KMMVJEE.cjs → chunk-7ZPHLIFP.cjs} +7 -7
  97. package/dist/chunk-7ZPHLIFP.cjs.map +1 -0
  98. package/dist/{chunk-FIAKZSRR.cjs → chunk-AG7VY6MJ.cjs} +19 -12
  99. package/dist/chunk-AG7VY6MJ.cjs.map +1 -0
  100. package/dist/{chunk-7MXBXWVD.js → chunk-ASNAQ35U.js} +5 -5
  101. package/dist/chunk-ASNAQ35U.js.map +1 -0
  102. package/dist/{chunk-DKVRRL3F.js → chunk-BT5H3WMI.js} +6 -6
  103. package/dist/chunk-BT5H3WMI.js.map +1 -0
  104. package/dist/{chunk-S64PTNT7.cjs → chunk-BYB3LQAT.cjs} +27 -30
  105. package/dist/chunk-BYB3LQAT.cjs.map +1 -0
  106. package/dist/{chunk-NZWFBAFQ.js → chunk-CCMLOCTH.js} +30 -4
  107. package/dist/chunk-CCMLOCTH.js.map +1 -0
  108. package/dist/{chunk-HOPFELRP.cjs → chunk-CDS2NXGT.cjs} +4 -4
  109. package/dist/{chunk-HOPFELRP.cjs.map → chunk-CDS2NXGT.cjs.map} +1 -1
  110. package/dist/{chunk-7JN6GXML.cjs → chunk-DKXW2FQC.cjs} +13 -11
  111. package/dist/chunk-DKXW2FQC.cjs.map +1 -0
  112. package/dist/{chunk-QCR6L55R.js → chunk-DR5MQC3W.js} +8 -5
  113. package/dist/chunk-DR5MQC3W.js.map +1 -0
  114. package/dist/{chunk-GUVPVNPD.cjs → chunk-DRIJNFWP.cjs} +11 -11
  115. package/dist/chunk-DRIJNFWP.cjs.map +1 -0
  116. package/dist/{chunk-BMTVFAX2.js → chunk-DX4FBN3I.js} +230 -99
  117. package/dist/chunk-DX4FBN3I.js.map +1 -0
  118. package/dist/{chunk-IKUA7O73.cjs → chunk-E43H3A3G.cjs} +7 -7
  119. package/dist/{chunk-IKUA7O73.cjs.map → chunk-E43H3A3G.cjs.map} +1 -1
  120. package/dist/{chunk-K7UR7GYC.cjs → chunk-ECB3UPTC.cjs} +13 -13
  121. package/dist/chunk-ECB3UPTC.cjs.map +1 -0
  122. package/dist/{chunk-TVPS2NJH.cjs → chunk-EHKHXQ46.cjs} +11 -11
  123. package/dist/chunk-EHKHXQ46.cjs.map +1 -0
  124. package/dist/{chunk-SLJNRP7O.cjs → chunk-EHNX3MG3.cjs} +14 -24
  125. package/dist/chunk-EHNX3MG3.cjs.map +1 -0
  126. package/dist/{chunk-MQBKLKYF.js → chunk-F5AOBHQY.js} +4 -4
  127. package/dist/{chunk-MQBKLKYF.js.map → chunk-F5AOBHQY.js.map} +1 -1
  128. package/dist/{chunk-KUFDELQM.cjs → chunk-FDNJNVKA.cjs} +10 -10
  129. package/dist/chunk-FDNJNVKA.cjs.map +1 -0
  130. package/dist/{chunk-NML7F34A.js → chunk-FSDI3NJV.js} +4 -4
  131. package/dist/chunk-FSDI3NJV.js.map +1 -0
  132. package/dist/{chunk-CCHMQZIB.js → chunk-FV7R2LLD.js} +5 -5
  133. package/dist/chunk-FV7R2LLD.js.map +1 -0
  134. package/dist/{chunk-ID7GYRYL.cjs → chunk-FZIBM3G5.cjs} +11 -11
  135. package/dist/chunk-FZIBM3G5.cjs.map +1 -0
  136. package/dist/{chunk-43WDYYVH.cjs → chunk-G6R6MSRF.cjs} +10 -10
  137. package/dist/chunk-G6R6MSRF.cjs.map +1 -0
  138. package/dist/{chunk-VK72MICB.cjs → chunk-GAWIUMAK.cjs} +8 -8
  139. package/dist/{chunk-VK72MICB.cjs.map → chunk-GAWIUMAK.cjs.map} +1 -1
  140. package/dist/{chunk-3NWZJCWL.js → chunk-GPSNBZPX.js} +5 -5
  141. package/dist/chunk-GPSNBZPX.js.map +1 -0
  142. package/dist/{chunk-MGYBMQAX.cjs → chunk-HFWO37RY.cjs} +9 -9
  143. package/dist/chunk-HFWO37RY.cjs.map +1 -0
  144. package/dist/{chunk-U7GBOQXX.js → chunk-HMB2RIEE.js} +5 -5
  145. package/dist/chunk-HMB2RIEE.js.map +1 -0
  146. package/dist/{chunk-RLH3PS3Y.js → chunk-ILCWDAKD.js} +3 -3
  147. package/dist/{chunk-RLH3PS3Y.js.map → chunk-ILCWDAKD.js.map} +1 -1
  148. package/dist/{chunk-L37ZPX6D.js → chunk-IRUIWMH6.js} +5 -5
  149. package/dist/chunk-IRUIWMH6.js.map +1 -0
  150. package/dist/{chunk-B7IV2PB3.cjs → chunk-JNQ4NL3R.cjs} +9 -9
  151. package/dist/chunk-JNQ4NL3R.cjs.map +1 -0
  152. package/dist/{chunk-FSKUEB7P.js → chunk-K5TPJVOK.js} +3 -3
  153. package/dist/{chunk-FSKUEB7P.js.map → chunk-K5TPJVOK.js.map} +1 -1
  154. package/dist/{chunk-5M624BRW.js → chunk-KTCP23W6.js} +4 -4
  155. package/dist/chunk-KTCP23W6.js.map +1 -0
  156. package/dist/{chunk-2L46SAT7.js → chunk-LIY7MYRG.js} +30 -5
  157. package/dist/chunk-LIY7MYRG.js.map +1 -0
  158. package/dist/{chunk-AA45U5KV.js → chunk-LK2A3HBT.js} +5 -5
  159. package/dist/chunk-LK2A3HBT.js.map +1 -0
  160. package/dist/{chunk-GMLJDDHZ.js → chunk-MPQECPE3.js} +3 -3
  161. package/dist/{chunk-GMLJDDHZ.js.map → chunk-MPQECPE3.js.map} +1 -1
  162. package/dist/{chunk-T6LXFMBR.cjs → chunk-MY4KMVJ5.cjs} +9 -9
  163. package/dist/{chunk-T6LXFMBR.cjs.map → chunk-MY4KMVJ5.cjs.map} +1 -1
  164. package/dist/chunk-MYXLKVJE.js +889 -0
  165. package/dist/chunk-MYXLKVJE.js.map +1 -0
  166. package/dist/{chunk-N7NZQVIV.cjs → chunk-NG7DRWWT.cjs} +7 -7
  167. package/dist/chunk-NG7DRWWT.cjs.map +1 -0
  168. package/dist/{chunk-MZQY2FTP.cjs → chunk-NGKUI7XE.cjs} +13 -13
  169. package/dist/chunk-NGKUI7XE.cjs.map +1 -0
  170. package/dist/{chunk-D2IP3MWJ.cjs → chunk-OAIMES5S.cjs} +219 -59
  171. package/dist/chunk-OAIMES5S.cjs.map +1 -0
  172. package/dist/{chunk-XKDBNAHH.cjs → chunk-OAL5RS2X.cjs} +11 -11
  173. package/dist/chunk-OAL5RS2X.cjs.map +1 -0
  174. package/dist/{chunk-FTKL3UAN.cjs → chunk-OFEROCC5.cjs} +6 -6
  175. package/dist/{chunk-FTKL3UAN.cjs.map → chunk-OFEROCC5.cjs.map} +1 -1
  176. package/dist/{chunk-IAE4VRB7.cjs → chunk-OUN3MWRQ.cjs} +35 -10
  177. package/dist/chunk-OUN3MWRQ.cjs.map +1 -0
  178. package/dist/{chunk-TIHVTKXS.cjs → chunk-PQCHNZHM.cjs} +11 -11
  179. package/dist/chunk-PQCHNZHM.cjs.map +1 -0
  180. package/dist/{chunk-BMEMMYVF.js → chunk-PVPTFMJJ.js} +5 -5
  181. package/dist/{chunk-BMEMMYVF.js.map → chunk-PVPTFMJJ.js.map} +1 -1
  182. package/dist/{chunk-LCEMO7NI.js → chunk-QERWC7U6.js} +3 -3
  183. package/dist/{chunk-LCEMO7NI.js.map → chunk-QERWC7U6.js.map} +1 -1
  184. package/dist/{chunk-2PRCN5OJ.cjs → chunk-QKJUAMRK.cjs} +6 -6
  185. package/dist/{chunk-2PRCN5OJ.cjs.map → chunk-QKJUAMRK.cjs.map} +1 -1
  186. package/dist/{chunk-WS2AL7GY.cjs → chunk-R6ZDSXN7.cjs} +34 -8
  187. package/dist/chunk-R6ZDSXN7.cjs.map +1 -0
  188. package/dist/{chunk-FKVYS4RB.js → chunk-RFEKSP62.js} +15 -8
  189. package/dist/chunk-RFEKSP62.js.map +1 -0
  190. package/dist/{chunk-FKAA5FNG.cjs → chunk-RHTVKBRC.cjs} +10 -10
  191. package/dist/chunk-RHTVKBRC.cjs.map +1 -0
  192. package/dist/{chunk-QRTYX5KO.js → chunk-RJIPFWW7.js} +5 -5
  193. package/dist/chunk-RJIPFWW7.js.map +1 -0
  194. package/dist/{chunk-GL3M7MAM.js → chunk-RN7NNB6I.js} +4 -4
  195. package/dist/chunk-RN7NNB6I.js.map +1 -0
  196. package/dist/{chunk-VGGKMTO6.js → chunk-RQJRVKAH.js} +4 -4
  197. package/dist/chunk-RQJRVKAH.js.map +1 -0
  198. package/dist/{chunk-AAKS22M3.cjs → chunk-RWQH5EO5.cjs} +12 -12
  199. package/dist/{chunk-AAKS22M3.cjs.map → chunk-RWQH5EO5.cjs.map} +1 -1
  200. package/dist/{chunk-SKREYNRK.cjs → chunk-SXVMEC6N.cjs} +45 -35
  201. package/dist/chunk-SXVMEC6N.cjs.map +1 -0
  202. package/dist/{chunk-4ABM7UYD.js → chunk-TVDQNLGJ.js} +4 -4
  203. package/dist/chunk-TVDQNLGJ.js.map +1 -0
  204. package/dist/{chunk-QXQSJ3FZ.js → chunk-TWSWD4PU.js} +5 -5
  205. package/dist/chunk-TWSWD4PU.js.map +1 -0
  206. package/dist/chunk-UFMPALRH.js +126 -0
  207. package/dist/chunk-UFMPALRH.js.map +1 -0
  208. package/dist/{chunk-3TLJCGGQ.cjs → chunk-UMIJYYF3.cjs} +230 -99
  209. package/dist/chunk-UMIJYYF3.cjs.map +1 -0
  210. package/dist/{chunk-DZKYVTV3.js → chunk-UZH6PVHD.js} +5 -5
  211. package/dist/{chunk-DZKYVTV3.js.map → chunk-UZH6PVHD.js.map} +1 -1
  212. package/dist/{chunk-ARQLGTTV.js → chunk-V45C74EB.js} +5 -5
  213. package/dist/{chunk-ARQLGTTV.js.map → chunk-V45C74EB.js.map} +1 -1
  214. package/dist/{chunk-EAKXLFOR.cjs → chunk-VBEZS3Q4.cjs} +11 -11
  215. package/dist/chunk-VBEZS3Q4.cjs.map +1 -0
  216. package/dist/{chunk-IXFSJBJS.js → chunk-WJP6CRML.js} +4 -14
  217. package/dist/chunk-WJP6CRML.js.map +1 -0
  218. package/dist/{chunk-KEMT7F5H.cjs → chunk-WVQVGQJO.cjs} +9 -9
  219. package/dist/chunk-WVQVGQJO.cjs.map +1 -0
  220. package/dist/chunk-WYIIWTIR.cjs +128 -0
  221. package/dist/chunk-WYIIWTIR.cjs.map +1 -0
  222. package/dist/{chunk-EYN74SQ5.js → chunk-XE5ZYFGM.js} +5 -5
  223. package/dist/chunk-XE5ZYFGM.js.map +1 -0
  224. package/dist/{chunk-S6NGWPXC.js → chunk-XKERO5K2.js} +4 -4
  225. package/dist/chunk-XKERO5K2.js.map +1 -0
  226. package/dist/chunk-XN6YS55F.cjs +891 -0
  227. package/dist/chunk-XN6YS55F.cjs.map +1 -0
  228. package/dist/{chunk-JT6H7G52.js → chunk-XWCY67K5.js} +5 -5
  229. package/dist/chunk-XWCY67K5.js.map +1 -0
  230. package/dist/{chunk-SC5BGA2N.cjs → chunk-XWN43PZF.cjs} +8 -8
  231. package/dist/chunk-XWN43PZF.cjs.map +1 -0
  232. package/dist/{chunk-Y4HJCMB4.cjs → chunk-YDQDZWZ7.cjs} +7 -7
  233. package/dist/chunk-YDQDZWZ7.cjs.map +1 -0
  234. package/dist/{chunk-VJQCHBS6.js → chunk-YJHB2GHQ.js} +15 -5
  235. package/dist/chunk-YJHB2GHQ.js.map +1 -0
  236. package/dist/{chunk-IUYPKYOU.js → chunk-YOLF5DYU.js} +9 -5
  237. package/dist/chunk-YOLF5DYU.js.map +1 -0
  238. package/dist/{chunk-ALRCYQQX.cjs → chunk-YX6RW6ZW.cjs} +10 -7
  239. package/dist/chunk-YX6RW6ZW.cjs.map +1 -0
  240. package/dist/{chunk-27E6G2GT.js → chunk-YZQROIJY.js} +4 -4
  241. package/dist/chunk-YZQROIJY.js.map +1 -0
  242. package/dist/{chunk-M6JYSINX.cjs → chunk-ZFSFOD5W.cjs} +8 -8
  243. package/dist/chunk-ZFSFOD5W.cjs.map +1 -0
  244. package/dist/{chunk-EFRBTSUO.cjs → chunk-ZTUKOCJN.cjs} +4 -4
  245. package/dist/{chunk-EFRBTSUO.cjs.map → chunk-ZTUKOCJN.cjs.map} +1 -1
  246. package/dist/{chunk-MVJKRPX7.js → chunk-ZY7ETQD6.js} +3 -3
  247. package/dist/{chunk-MVJKRPX7.js.map → chunk-ZY7ETQD6.js.map} +1 -1
  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 +47 -47
  321. package/dist/index.d.ts +47 -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,891 @@
1
+ 'use strict';
2
+
3
+ var chunkCDS2NXGT_cjs = require('./chunk-CDS2NXGT.cjs');
4
+ var chunkUMIJYYF3_cjs = require('./chunk-UMIJYYF3.cjs');
5
+
6
+ // src/charts/graph/parse.ts
7
+ function parseGraphData(data, options) {
8
+ const opts = options;
9
+ const defaultShape = opts.nodeShape ?? "rect";
10
+ if (opts.nodes || opts.edges) {
11
+ return parseRichFormat(data, opts, defaultShape);
12
+ }
13
+ const hasArrow = data.series.some(
14
+ (s) => s.name.includes("\u2192") || s.name.includes("->")
15
+ );
16
+ if (hasArrow) {
17
+ return parseArrowNotation(data, defaultShape);
18
+ }
19
+ return parseAdjacencyMatrix(data, defaultShape);
20
+ }
21
+ function makeNode(id, label, index, value, shape, color, pin) {
22
+ return {
23
+ id,
24
+ label,
25
+ index,
26
+ value,
27
+ shape,
28
+ color,
29
+ pin,
30
+ x: 0,
31
+ y: 0,
32
+ vx: 0,
33
+ vy: 0,
34
+ width: 0,
35
+ height: 0
36
+ };
37
+ }
38
+ function makeEdge(source, target, weight, label, style, color) {
39
+ return { source, target, weight, label, style, color };
40
+ }
41
+ function parseRichFormat(_data, opts, defaultShape) {
42
+ const graphNodes = [];
43
+ const idToIndex = /* @__PURE__ */ new Map();
44
+ if (opts.nodes) {
45
+ for (const nodeDef of opts.nodes) {
46
+ const idx = graphNodes.length;
47
+ idToIndex.set(nodeDef.id, idx);
48
+ graphNodes.push(
49
+ makeNode(
50
+ nodeDef.id,
51
+ nodeDef.label ?? nodeDef.id,
52
+ idx,
53
+ 1,
54
+ nodeDef.shape ?? defaultShape,
55
+ nodeDef.color ?? null,
56
+ nodeDef.pin ?? null
57
+ )
58
+ );
59
+ }
60
+ }
61
+ const graphEdges = [];
62
+ if (opts.edges) {
63
+ for (const edgeDef of opts.edges) {
64
+ if (!idToIndex.has(edgeDef.source)) {
65
+ const idx = graphNodes.length;
66
+ idToIndex.set(edgeDef.source, idx);
67
+ graphNodes.push(
68
+ makeNode(edgeDef.source, edgeDef.source, idx, 1, defaultShape, null, null)
69
+ );
70
+ }
71
+ if (!idToIndex.has(edgeDef.target)) {
72
+ const idx = graphNodes.length;
73
+ idToIndex.set(edgeDef.target, idx);
74
+ graphNodes.push(
75
+ makeNode(edgeDef.target, edgeDef.target, idx, 1, defaultShape, null, null)
76
+ );
77
+ }
78
+ const srcIdx = idToIndex.get(edgeDef.source);
79
+ const tgtIdx = idToIndex.get(edgeDef.target);
80
+ graphEdges.push(
81
+ makeEdge(
82
+ srcIdx,
83
+ tgtIdx,
84
+ edgeDef.weight ?? 1,
85
+ edgeDef.label ?? null,
86
+ edgeDef.style ?? "solid",
87
+ edgeDef.color ?? null
88
+ )
89
+ );
90
+ }
91
+ }
92
+ return { graphNodes, graphEdges };
93
+ }
94
+ var ARROW_RE = /\s*(?:→|->)\s*/;
95
+ function parseArrowNotation(data, defaultShape) {
96
+ const graphNodes = [];
97
+ const nameToIndex = /* @__PURE__ */ new Map();
98
+ const graphEdges = [];
99
+ function getOrCreateNode(name) {
100
+ let idx = nameToIndex.get(name);
101
+ if (idx !== void 0) return idx;
102
+ idx = graphNodes.length;
103
+ nameToIndex.set(name, idx);
104
+ graphNodes.push(makeNode(name, name, idx, 0, defaultShape, null, null));
105
+ return idx;
106
+ }
107
+ for (const series of data.series) {
108
+ const parts = series.name.split(ARROW_RE);
109
+ if (parts.length < 2) continue;
110
+ const srcName = parts[0];
111
+ const tgtName = parts[1];
112
+ const weight = series.values[0] ?? 1;
113
+ const srcIdx = getOrCreateNode(srcName);
114
+ const tgtIdx = getOrCreateNode(tgtName);
115
+ graphNodes[srcIdx].value += weight;
116
+ graphNodes[tgtIdx].value += weight;
117
+ graphEdges.push(makeEdge(srcIdx, tgtIdx, weight, null, "solid", null));
118
+ }
119
+ return { graphNodes, graphEdges };
120
+ }
121
+ function parseAdjacencyMatrix(data, defaultShape) {
122
+ const graphNodes = [];
123
+ for (let i = 0; i < data.labels.length; i++) {
124
+ const name = String(data.labels[i]);
125
+ const value = Math.abs(data.series[0]?.values[i] ?? 1);
126
+ graphNodes.push(makeNode(name, name, i, value, defaultShape, null, null));
127
+ }
128
+ const graphEdges = [];
129
+ if (data.series.length > 1 && data.series.length === data.labels.length) {
130
+ for (let i = 0; i < data.series.length; i++) {
131
+ const row = data.series[i];
132
+ for (let j = 0; j < row.values.length; j++) {
133
+ const weight = row.values[j] ?? 0;
134
+ if (weight > 0) {
135
+ graphEdges.push(makeEdge(i, j, weight, null, "solid", null));
136
+ }
137
+ }
138
+ }
139
+ }
140
+ return { graphNodes, graphEdges };
141
+ }
142
+
143
+ // src/charts/graph/text-measure.ts
144
+ var CHAR_WIDTH_RATIO = 0.6;
145
+ var PADDING_H = 16;
146
+ var PADDING_V = 10;
147
+ function measureNodeSize(label, fontSize, shape) {
148
+ const charWidth = fontSize * CHAR_WIDTH_RATIO;
149
+ const textWidth = label.length * charWidth;
150
+ const textHeight = fontSize * 1.2;
151
+ let w = textWidth + PADDING_H * 2;
152
+ let h = textHeight + PADDING_V * 2;
153
+ w = Math.max(w, 40);
154
+ h = Math.max(h, 28);
155
+ switch (shape) {
156
+ case "circle": {
157
+ const d = Math.sqrt(w * w + h * h);
158
+ return { width: d, height: d };
159
+ }
160
+ case "diamond": {
161
+ return { width: w * 1.45, height: h * 1.45 };
162
+ }
163
+ case "hexagon": {
164
+ return { width: w * 1.25, height: h * 1.15 };
165
+ }
166
+ case "stadium":
167
+ case "rect":
168
+ default:
169
+ return { width: w, height: h };
170
+ }
171
+ }
172
+
173
+ // src/charts/graph/shapes.ts
174
+ function renderNodeShape(node, color, theme) {
175
+ const cx = node.x;
176
+ const cy = node.y;
177
+ const w = node.width;
178
+ const h = node.height;
179
+ const baseAttrs = {
180
+ class: "chartts-graph-node",
181
+ fill: color,
182
+ fillOpacity: 0.85,
183
+ stroke: color,
184
+ strokeWidth: 1.5,
185
+ "data-series": node.index,
186
+ "data-index": 0,
187
+ tabindex: 0,
188
+ role: "img",
189
+ ariaLabel: `${node.label}: ${node.value}`
190
+ };
191
+ let shapeNode;
192
+ switch (node.shape) {
193
+ case "circle": {
194
+ const r = Math.max(w, h) / 2;
195
+ shapeNode = chunkUMIJYYF3_cjs.circle(cx, cy, r, { ...baseAttrs });
196
+ break;
197
+ }
198
+ case "diamond": {
199
+ const pb = new chunkUMIJYYF3_cjs.PathBuilder();
200
+ pb.moveTo(cx, cy - h / 2).lineTo(cx + w / 2, cy).lineTo(cx, cy + h / 2).lineTo(cx - w / 2, cy).close();
201
+ shapeNode = chunkUMIJYYF3_cjs.path(pb.build(), { ...baseAttrs });
202
+ break;
203
+ }
204
+ case "hexagon": {
205
+ const rx = w / 2;
206
+ const ry = h / 2;
207
+ const pb = new chunkUMIJYYF3_cjs.PathBuilder();
208
+ for (let i = 0; i < 6; i++) {
209
+ const angle = Math.PI / 180 * (i * 60);
210
+ const px = cx + rx * Math.cos(angle);
211
+ const py = cy + ry * Math.sin(angle);
212
+ if (i === 0) pb.moveTo(px, py);
213
+ else pb.lineTo(px, py);
214
+ }
215
+ pb.close();
216
+ shapeNode = chunkUMIJYYF3_cjs.path(pb.build(), { ...baseAttrs });
217
+ break;
218
+ }
219
+ case "stadium": {
220
+ shapeNode = chunkUMIJYYF3_cjs.rect(cx - w / 2, cy - h / 2, w, h, {
221
+ ...baseAttrs,
222
+ rx: h / 2
223
+ });
224
+ break;
225
+ }
226
+ // 'rect' is the default
227
+ default: {
228
+ shapeNode = chunkUMIJYYF3_cjs.rect(cx - w / 2, cy - h / 2, w, h, {
229
+ ...baseAttrs,
230
+ rx: 8
231
+ });
232
+ break;
233
+ }
234
+ }
235
+ const labelNode = chunkUMIJYYF3_cjs.text(cx, cy, node.label, {
236
+ class: "chartts-graph-label",
237
+ fill: "#fff",
238
+ textAnchor: "middle",
239
+ dominantBaseline: "central",
240
+ fontSize: theme.fontSizeSmall,
241
+ fontFamily: theme.fontFamily,
242
+ fontWeight: 600
243
+ });
244
+ return [shapeNode, labelNode];
245
+ }
246
+ var PAD = 3;
247
+ function clipToNodeBoundary(node, angle) {
248
+ const cx = node.x;
249
+ const cy = node.y;
250
+ const w = node.width;
251
+ const h = node.height;
252
+ const cos = Math.cos(angle);
253
+ const sin = Math.sin(angle);
254
+ let bx;
255
+ let by;
256
+ switch (node.shape) {
257
+ case "circle": {
258
+ const r = Math.max(w, h) / 2;
259
+ bx = cx + r * cos;
260
+ by = cy + r * sin;
261
+ break;
262
+ }
263
+ case "diamond": {
264
+ const hw = w / 2;
265
+ const hh = h / 2;
266
+ const t = 1 / (Math.abs(cos) / hw + Math.abs(sin) / hh);
267
+ bx = cx + t * cos;
268
+ by = cy + t * sin;
269
+ break;
270
+ }
271
+ case "hexagon": {
272
+ const rx = w / 2;
273
+ const ry = h / 2;
274
+ const pt = hexBoundary(cx, cy, rx, ry, angle, cos, sin);
275
+ bx = pt.x;
276
+ by = pt.y;
277
+ break;
278
+ }
279
+ // rect and stadium share the same rectangular bounding box logic
280
+ default: {
281
+ const hw = w / 2;
282
+ const hh = h / 2;
283
+ const cornerAngle = Math.atan2(hh, hw);
284
+ let a = (angle % (2 * Math.PI) + 2 * Math.PI) % (2 * Math.PI);
285
+ if (a < cornerAngle || a >= 2 * Math.PI - cornerAngle) {
286
+ const t = hw / Math.abs(cos);
287
+ bx = cx + hw;
288
+ by = cy + t * sin;
289
+ } else if (a < Math.PI - cornerAngle) {
290
+ const t = hh / Math.abs(sin);
291
+ bx = cx + t * cos;
292
+ by = cy + hh;
293
+ } else if (a < Math.PI + cornerAngle) {
294
+ const t = hw / Math.abs(cos);
295
+ bx = cx - hw;
296
+ by = cy + t * sin;
297
+ } else {
298
+ const t = hh / Math.abs(sin);
299
+ bx = cx + t * cos;
300
+ by = cy - hh;
301
+ }
302
+ break;
303
+ }
304
+ }
305
+ bx += PAD * cos;
306
+ by += PAD * sin;
307
+ return { x: bx, y: by };
308
+ }
309
+ function hexBoundary(cx, cy, rx, ry, _angle, cos, sin) {
310
+ const verts = [];
311
+ for (let i = 0; i < 6; i++) {
312
+ const a = Math.PI / 180 * (i * 60);
313
+ verts.push({ x: cx + rx * Math.cos(a), y: cy + ry * Math.sin(a) });
314
+ }
315
+ let bestT = Infinity;
316
+ let bestPt = { x: cx + rx * cos, y: cy + ry * sin };
317
+ for (let i = 0; i < 6; i++) {
318
+ const v0 = verts[i];
319
+ const v1 = verts[(i + 1) % 6];
320
+ const dx = v1.x - v0.x;
321
+ const dy = v1.y - v0.y;
322
+ const denom = cos * dy - sin * dx;
323
+ if (Math.abs(denom) < 1e-12) continue;
324
+ const t = ((v0.x - cx) * dy - (v0.y - cy) * dx) / denom;
325
+ const s = cos !== 0 ? (cx + t * cos - v0.x) / dx : (cy + t * sin - v0.y) / dy;
326
+ if (t > 1e-6 && s >= -1e-6 && s <= 1 + 1e-6 && t < bestT) {
327
+ bestT = t;
328
+ bestPt = { x: cx + t * cos, y: cy + t * sin };
329
+ }
330
+ }
331
+ return bestPt;
332
+ }
333
+
334
+ // src/charts/graph/edges.ts
335
+ function renderArrowhead(tipX, tipY, angle, size, color) {
336
+ const cosA = Math.cos(angle);
337
+ const sinA = Math.sin(angle);
338
+ const baseX = tipX - cosA * size;
339
+ const baseY = tipY - sinA * size;
340
+ const perpX = -sinA * size * 0.4;
341
+ const perpY = cosA * size * 0.4;
342
+ const leftX = baseX + perpX;
343
+ const leftY = baseY + perpY;
344
+ const rightX = baseX - perpX;
345
+ const rightY = baseY - perpY;
346
+ const pb = new chunkUMIJYYF3_cjs.PathBuilder();
347
+ pb.moveTo(tipX, tipY).lineTo(leftX, leftY).lineTo(rightX, rightY).close();
348
+ return chunkUMIJYYF3_cjs.path(pb.build(), {
349
+ fill: color,
350
+ class: "chartts-graph-arrow"
351
+ });
352
+ }
353
+ function renderEdges(nodes, edges, options, theme) {
354
+ const result = [];
355
+ const pairIndex = /* @__PURE__ */ new Map();
356
+ for (const edge of edges) {
357
+ const src = nodes[edge.source];
358
+ const tgt = nodes[edge.target];
359
+ if (!src || !tgt) continue;
360
+ const angle = Math.atan2(tgt.y - src.y, tgt.x - src.x);
361
+ const start = clipToNodeBoundary(src, angle);
362
+ const end = clipToNodeBoundary(tgt, angle + Math.PI);
363
+ const edgeColor = edge.color ?? theme.gridColor;
364
+ const edgeAttrs = {
365
+ class: "chartts-graph-edge",
366
+ stroke: edgeColor,
367
+ strokeWidth: Math.max(1, Math.min(3, edge.weight * 0.5)),
368
+ strokeDasharray: edge.style === "dashed" ? "8,4" : edge.style === "dotted" ? "2,4" : void 0,
369
+ opacity: 0.6,
370
+ fill: "none"
371
+ };
372
+ let arrowAngle = angle;
373
+ let labelX = (start.x + end.x) / 2;
374
+ let labelY = (start.y + end.y) / 2;
375
+ if (options.edgeStyle === "straight" || options.edgeStyle === void 0) {
376
+ result.push(chunkUMIJYYF3_cjs.line(start.x, start.y, end.x, end.y, edgeAttrs));
377
+ } else {
378
+ const pairKey = Math.min(edge.source, edge.target) + ":" + Math.max(edge.source, edge.target);
379
+ const idx = pairIndex.get(pairKey) ?? 0;
380
+ pairIndex.set(pairKey, idx + 1);
381
+ const sign = idx % 2 === 0 ? 1 : -1;
382
+ const offset = Math.max(edge.weight * 8, 15);
383
+ const mx = (start.x + end.x) / 2;
384
+ const my = (start.y + end.y) / 2;
385
+ const perpAngle = angle + Math.PI / 2;
386
+ const cx = mx + Math.cos(perpAngle) * offset * sign;
387
+ const cy = my + Math.sin(perpAngle) * offset * sign;
388
+ const pb = new chunkUMIJYYF3_cjs.PathBuilder();
389
+ pb.moveTo(start.x, start.y).quadTo(cx, cy, end.x, end.y);
390
+ result.push(chunkUMIJYYF3_cjs.path(pb.build(), edgeAttrs));
391
+ arrowAngle = Math.atan2(end.y - cy, end.x - cx);
392
+ labelX = 0.25 * start.x + 0.5 * cx + 0.25 * end.x;
393
+ labelY = 0.25 * start.y + 0.5 * cy + 0.25 * end.y;
394
+ }
395
+ if (options.arrows !== false) {
396
+ const arrowSize = 8;
397
+ result.push(renderArrowhead(end.x, end.y, arrowAngle, arrowSize, edgeColor));
398
+ }
399
+ if (edge.label != null) {
400
+ const lx = labelX;
401
+ const ly = labelY;
402
+ const charWidth = (theme.fontSizeSmall - 1) * 0.6;
403
+ const pw = edge.label.length * charWidth + 8;
404
+ const ph = theme.fontSizeSmall - 1 + 6;
405
+ const bgFill = theme.background === "transparent" ? "#fff" : theme.background;
406
+ result.push(
407
+ chunkUMIJYYF3_cjs.rect(lx - pw / 2, ly - ph / 2, pw, ph, {
408
+ fill: bgFill,
409
+ rx: 3
410
+ })
411
+ );
412
+ result.push(
413
+ chunkUMIJYYF3_cjs.text(lx, ly, edge.label, {
414
+ fill: theme.textMuted,
415
+ textAnchor: "middle",
416
+ dominantBaseline: "central",
417
+ fontSize: theme.fontSizeSmall - 1,
418
+ fontFamily: theme.fontFamily
419
+ })
420
+ );
421
+ }
422
+ }
423
+ return result;
424
+ }
425
+
426
+ // src/charts/graph/layout-force.ts
427
+ var layoutCache = /* @__PURE__ */ new Map();
428
+ function cacheKey(nodes, edges) {
429
+ const nk = nodes.map((n) => n.id).join(",");
430
+ const ek = edges.map((e) => `${e.source}-${e.target}`).join(",");
431
+ return nk + "|" + ek;
432
+ }
433
+ function forceLayout(nodes, edges, opts) {
434
+ const { area, iterations } = opts;
435
+ const n = nodes.length;
436
+ if (n === 0) return;
437
+ const cx = area.x + area.width / 2;
438
+ const cy = area.y + area.height / 2;
439
+ const key = cacheKey(nodes, edges);
440
+ const cached = layoutCache.get(key);
441
+ if (cached && cached.length === n) {
442
+ for (let i = 0; i < n; i++) {
443
+ const node = nodes[i];
444
+ if (!node.pin) {
445
+ node.x = cached[i].x;
446
+ node.y = cached[i].y;
447
+ }
448
+ }
449
+ } else {
450
+ for (let i = 0; i < n; i++) {
451
+ const node = nodes[i];
452
+ if (node.pin) {
453
+ node.x = area.x + node.pin.x * area.width;
454
+ node.y = area.y + node.pin.y * area.height;
455
+ } else {
456
+ const angle = 2 * Math.PI * i / n;
457
+ const r = Math.min(area.width, area.height) * 0.3;
458
+ node.x = cx + r * Math.cos(angle);
459
+ node.y = cy + r * Math.sin(angle);
460
+ }
461
+ node.vx = 0;
462
+ node.vy = 0;
463
+ }
464
+ }
465
+ const k = Math.sqrt(area.width * area.height / Math.max(n, 1));
466
+ const repulsion = k * k;
467
+ for (let iter = 0; iter < iterations; iter++) {
468
+ const temp = 0.1 * (1 - iter / iterations) * Math.min(area.width, area.height) * 0.5;
469
+ for (const node of nodes) {
470
+ node.vx = 0;
471
+ node.vy = 0;
472
+ }
473
+ for (let i = 0; i < n; i++) {
474
+ for (let j = i + 1; j < n; j++) {
475
+ const ni = nodes[i];
476
+ const nj = nodes[j];
477
+ const dx = ni.x - nj.x;
478
+ const dy = ni.y - nj.y;
479
+ const dist = Math.max(Math.sqrt(dx * dx + dy * dy), 1);
480
+ const minDist = (Math.max(ni.width, ni.height) + Math.max(nj.width, nj.height)) / 2;
481
+ const effectiveDist = Math.max(dist - minDist * 0.6, 1);
482
+ const force = repulsion / (effectiveDist * effectiveDist);
483
+ const fx = dx / dist * force;
484
+ const fy = dy / dist * force;
485
+ ni.vx += fx;
486
+ ni.vy += fy;
487
+ nj.vx -= fx;
488
+ nj.vy -= fy;
489
+ }
490
+ }
491
+ for (const edge of edges) {
492
+ const src = nodes[edge.source];
493
+ const tgt = nodes[edge.target];
494
+ const dx = tgt.x - src.x;
495
+ const dy = tgt.y - src.y;
496
+ const dist = Math.max(Math.sqrt(dx * dx + dy * dy), 1);
497
+ const force = dist * dist / k;
498
+ const fx = dx / dist * force * 0.1;
499
+ const fy = dy / dist * force * 0.1;
500
+ src.vx += fx;
501
+ src.vy += fy;
502
+ tgt.vx -= fx;
503
+ tgt.vy -= fy;
504
+ }
505
+ for (const node of nodes) {
506
+ const dx = cx - node.x;
507
+ const dy = cy - node.y;
508
+ node.vx += dx * 0.01;
509
+ node.vy += dy * 0.01;
510
+ }
511
+ for (const node of nodes) {
512
+ if (node.pin) continue;
513
+ node.vx *= 0.8;
514
+ node.vy *= 0.8;
515
+ const speed = Math.sqrt(node.vx * node.vx + node.vy * node.vy);
516
+ if (speed > 0) {
517
+ const capped = Math.min(speed, temp);
518
+ node.x += node.vx / speed * capped;
519
+ node.y += node.vy / speed * capped;
520
+ }
521
+ const mx = Math.max(20, node.width / 2 + 5);
522
+ const my = Math.max(20, node.height / 2 + 5);
523
+ node.x = Math.max(area.x + mx, Math.min(area.x + area.width - mx, node.x));
524
+ node.y = Math.max(area.y + my, Math.min(area.y + area.height - my, node.y));
525
+ }
526
+ }
527
+ layoutCache.set(key, nodes.map((nd) => ({ x: nd.x, y: nd.y })));
528
+ }
529
+
530
+ // src/charts/graph/layout-hierarchy.ts
531
+ function hierarchyLayout(nodes, edges, opts) {
532
+ const n = nodes.length;
533
+ if (n === 0) return;
534
+ const { area, direction } = opts;
535
+ const outgoing = new Array(n);
536
+ const incoming = new Array(n);
537
+ for (let i = 0; i < n; i++) {
538
+ outgoing[i] = [];
539
+ incoming[i] = [];
540
+ }
541
+ const edgesCopy = edges.map((e) => ({ ...e }));
542
+ breakCycles(edgesCopy, n, outgoing, incoming);
543
+ const layers = assignLayers(n, outgoing, incoming);
544
+ const layerGroups = groupByLayer(layers, n);
545
+ orderLayers(layerGroups, outgoing, incoming, 3);
546
+ const isHorizontal = direction === "LR" || direction === "RL";
547
+ const maxLayer = Math.max(...layers, 0);
548
+ const availW = area.width;
549
+ const availH = area.height;
550
+ const layerCount = maxLayer + 1;
551
+ const layerGap = isHorizontal ? availW / (layerCount + 1) : availH / (layerCount + 1);
552
+ for (let layer = 0; layer <= maxLayer; layer++) {
553
+ const group2 = layerGroups[layer] ?? [];
554
+ if (group2.length === 0) continue;
555
+ const nodeGap = isHorizontal ? availH / (group2.length + 1) : availW / (group2.length + 1);
556
+ for (let pos = 0; pos < group2.length; pos++) {
557
+ const node = nodes[group2[pos]];
558
+ if (node.pin) {
559
+ node.x = area.x + node.pin.x * area.width;
560
+ node.y = area.y + node.pin.y * area.height;
561
+ continue;
562
+ }
563
+ let layerCoord = area.x + layerGap * (layer + 1);
564
+ let posCoord = area.y + nodeGap * (pos + 1);
565
+ if (isHorizontal) ; else {
566
+ const tmp = layerCoord;
567
+ layerCoord = posCoord;
568
+ posCoord = tmp;
569
+ }
570
+ switch (direction) {
571
+ case "TB":
572
+ node.x = layerCoord;
573
+ node.y = posCoord;
574
+ break;
575
+ case "BT":
576
+ node.x = layerCoord;
577
+ node.y = area.y + area.height - (posCoord - area.y);
578
+ break;
579
+ case "LR":
580
+ node.x = layerCoord;
581
+ node.y = posCoord;
582
+ break;
583
+ case "RL":
584
+ node.x = area.x + area.width - (layerCoord - area.x);
585
+ node.y = posCoord;
586
+ break;
587
+ }
588
+ }
589
+ }
590
+ }
591
+ function breakCycles(edges, n, outgoing, incoming) {
592
+ for (const e of edges) {
593
+ outgoing[e.source].push(e.target);
594
+ incoming[e.target].push(e.source);
595
+ }
596
+ const WHITE = 0, GRAY = 1, BLACK = 2;
597
+ const color = new Array(n).fill(WHITE);
598
+ function dfs(u) {
599
+ color[u] = GRAY;
600
+ const out = outgoing[u];
601
+ for (let i = 0; i < out.length; i++) {
602
+ const v = out[i];
603
+ if (color[v] === GRAY) {
604
+ for (const e of edges) {
605
+ if (e.source === u && e.target === v) {
606
+ e.source = v;
607
+ e.target = u;
608
+ break;
609
+ }
610
+ }
611
+ out.splice(i, 1);
612
+ i--;
613
+ outgoing[v].push(u);
614
+ incoming[u].push(v);
615
+ const idx = incoming[v].indexOf(u);
616
+ if (idx >= 0) incoming[v].splice(idx, 1);
617
+ } else if (color[v] === WHITE) {
618
+ dfs(v);
619
+ }
620
+ }
621
+ color[u] = BLACK;
622
+ }
623
+ for (let i = 0; i < n; i++) {
624
+ if (color[i] === WHITE) dfs(i);
625
+ }
626
+ }
627
+ function assignLayers(n, outgoing, incoming) {
628
+ const layers = new Array(n).fill(-1);
629
+ const roots = [];
630
+ for (let i = 0; i < n; i++) {
631
+ if (incoming[i].length === 0) roots.push(i);
632
+ }
633
+ if (roots.length === 0 && n > 0) roots.push(0);
634
+ const queue = [];
635
+ for (const r of roots) {
636
+ layers[r] = 0;
637
+ queue.push(r);
638
+ }
639
+ let qi = 0;
640
+ while (qi < queue.length) {
641
+ const u = queue[qi++];
642
+ for (const v of outgoing[u]) {
643
+ const newLayer = layers[u] + 1;
644
+ if (layers[v] < newLayer) {
645
+ layers[v] = newLayer;
646
+ queue.push(v);
647
+ }
648
+ }
649
+ }
650
+ for (let i = 0; i < n; i++) {
651
+ if (layers[i] < 0) layers[i] = 0;
652
+ }
653
+ return layers;
654
+ }
655
+ function groupByLayer(layers, n) {
656
+ const maxLayer = Math.max(...layers, 0);
657
+ const groups = new Array(maxLayer + 1);
658
+ for (let i = 0; i <= maxLayer; i++) groups[i] = [];
659
+ for (let i = 0; i < n; i++) {
660
+ groups[layers[i]].push(i);
661
+ }
662
+ return groups;
663
+ }
664
+ function orderLayers(layerGroups, outgoing, incoming, passes) {
665
+ for (let pass = 0; pass < passes; pass++) {
666
+ for (let l = 1; l < layerGroups.length; l++) {
667
+ const layer = layerGroups[l];
668
+ const posMap = /* @__PURE__ */ new Map();
669
+ const prevLayer = layerGroups[l - 1];
670
+ for (let i = 0; i < prevLayer.length; i++) posMap.set(prevLayer[i], i);
671
+ layer.sort((a, b) => {
672
+ const ba = barycenter(a, incoming, posMap);
673
+ const bb = barycenter(b, incoming, posMap);
674
+ return ba - bb;
675
+ });
676
+ }
677
+ for (let l = layerGroups.length - 2; l >= 0; l--) {
678
+ const layer = layerGroups[l];
679
+ const posMap = /* @__PURE__ */ new Map();
680
+ const nextLayer = layerGroups[l + 1];
681
+ for (let i = 0; i < nextLayer.length; i++) posMap.set(nextLayer[i], i);
682
+ layer.sort((a, b) => {
683
+ const ba = barycenter(a, outgoing, posMap);
684
+ const bb = barycenter(b, outgoing, posMap);
685
+ return ba - bb;
686
+ });
687
+ }
688
+ }
689
+ }
690
+ function barycenter(nodeIdx, adj, posMap) {
691
+ const neighbors = adj[nodeIdx];
692
+ if (neighbors.length === 0) return 0;
693
+ let sum = 0;
694
+ let count = 0;
695
+ for (const nb of neighbors) {
696
+ const pos = posMap.get(nb);
697
+ if (pos !== void 0) {
698
+ sum += pos;
699
+ count++;
700
+ }
701
+ }
702
+ return count > 0 ? sum / count : 0;
703
+ }
704
+
705
+ // src/charts/graph/layout-circular.ts
706
+ function circularLayout(nodes, edges, opts) {
707
+ const n = nodes.length;
708
+ if (n === 0) return;
709
+ const { area } = opts;
710
+ const cx = area.x + area.width / 2;
711
+ const cy = area.y + area.height / 2;
712
+ const maxNodeSize = Math.max(
713
+ ...nodes.map((nd) => Math.max(nd.width, nd.height)),
714
+ 40
715
+ );
716
+ const radius = Math.min(area.width, area.height) / 2 - maxNodeSize / 2 - 10;
717
+ const order = connectivityOrder(nodes, edges);
718
+ const unpinned = [];
719
+ for (const idx of order) {
720
+ if (!nodes[idx].pin) unpinned.push(idx);
721
+ }
722
+ const angleStep = 2 * Math.PI / Math.max(unpinned.length, 1);
723
+ const startAngle = -Math.PI / 2;
724
+ for (let i = 0; i < unpinned.length; i++) {
725
+ const node = nodes[unpinned[i]];
726
+ const angle = startAngle + angleStep * i;
727
+ node.x = cx + radius * Math.cos(angle);
728
+ node.y = cy + radius * Math.sin(angle);
729
+ }
730
+ for (const node of nodes) {
731
+ if (node.pin) {
732
+ node.x = area.x + node.pin.x * area.width;
733
+ node.y = area.y + node.pin.y * area.height;
734
+ }
735
+ }
736
+ }
737
+ function connectivityOrder(nodes, edges) {
738
+ const n = nodes.length;
739
+ if (n === 0) return [];
740
+ const adj = new Array(n);
741
+ for (let i = 0; i < n; i++) adj[i] = [];
742
+ for (const e of edges) {
743
+ adj[e.source].push(e.target);
744
+ adj[e.target].push(e.source);
745
+ }
746
+ let startNode = 0;
747
+ let maxDeg = 0;
748
+ for (let i = 0; i < n; i++) {
749
+ if (adj[i].length > maxDeg) {
750
+ maxDeg = adj[i].length;
751
+ startNode = i;
752
+ }
753
+ }
754
+ const visited = /* @__PURE__ */ new Set();
755
+ const order = [];
756
+ const queue = [startNode];
757
+ visited.add(startNode);
758
+ while (queue.length > 0) {
759
+ const u = queue.shift();
760
+ order.push(u);
761
+ const neighbors = adj[u].filter((v) => !visited.has(v));
762
+ neighbors.sort((a, b) => adj[b].length - adj[a].length);
763
+ for (const v of neighbors) {
764
+ if (!visited.has(v)) {
765
+ visited.add(v);
766
+ queue.push(v);
767
+ }
768
+ }
769
+ }
770
+ for (let i = 0; i < n; i++) {
771
+ if (!visited.has(i)) order.push(i);
772
+ }
773
+ return order;
774
+ }
775
+
776
+ // src/charts/graph/graph-type.ts
777
+ var graphChartType = {
778
+ type: "graph",
779
+ getScaleTypes() {
780
+ return { x: "categorical", y: "linear" };
781
+ },
782
+ prepareData(data, options) {
783
+ return chunkCDS2NXGT_cjs.prepareNoAxes(data, options);
784
+ },
785
+ render(ctx) {
786
+ const { data, area, theme, options } = ctx;
787
+ const graphOpts = options;
788
+ const result = [];
789
+ const { graphNodes, graphEdges } = parseGraphData(data, options);
790
+ if (graphNodes.length === 0) return result;
791
+ for (const node of graphNodes) {
792
+ const size = measureNodeSize(node.label, theme.fontSizeSmall, node.shape);
793
+ node.width = size.width;
794
+ node.height = size.height;
795
+ }
796
+ runLayout(graphNodes, graphEdges, graphOpts, area);
797
+ const edgeNodes = renderEdges(graphNodes, graphEdges, graphOpts, theme);
798
+ if (edgeNodes.length > 0) {
799
+ result.push(chunkUMIJYYF3_cjs.group(edgeNodes, { class: "chartts-graph-edges" }));
800
+ }
801
+ for (const node of graphNodes) {
802
+ const color = node.color ?? options.colors[node.index % options.colors.length];
803
+ const shapeNodes = renderNodeShape(node, color, theme);
804
+ result.push(chunkUMIJYYF3_cjs.group(shapeNodes, {
805
+ class: `chartts-series chartts-series-${node.index}`,
806
+ "data-series-name": node.label
807
+ }));
808
+ }
809
+ return result;
810
+ },
811
+ hitTest(ctx, mx, my) {
812
+ const { data, area, theme, options } = ctx;
813
+ const graphOpts = options;
814
+ const { graphNodes, graphEdges } = parseGraphData(data, options);
815
+ if (graphNodes.length === 0) return null;
816
+ for (const node of graphNodes) {
817
+ const size = measureNodeSize(node.label, theme.fontSizeSmall, node.shape);
818
+ node.width = size.width;
819
+ node.height = size.height;
820
+ }
821
+ runLayout(graphNodes, graphEdges, graphOpts, area);
822
+ let best = null;
823
+ let bestDist = Infinity;
824
+ for (const node of graphNodes) {
825
+ const dist = shapeDistance(node, mx, my);
826
+ if (dist < bestDist && dist < 8) {
827
+ bestDist = dist;
828
+ best = { seriesIndex: node.index, pointIndex: 0, distance: dist, x: node.x, y: node.y };
829
+ }
830
+ }
831
+ return best;
832
+ }
833
+ };
834
+ function runLayout(nodes, edges, opts, area) {
835
+ const layout = opts.layout ?? "force";
836
+ switch (layout) {
837
+ case "hierarchical":
838
+ hierarchyLayout(nodes, edges, {
839
+ area,
840
+ direction: opts.direction ?? "TB"
841
+ });
842
+ break;
843
+ case "circular":
844
+ circularLayout(nodes, edges, { area });
845
+ break;
846
+ case "force":
847
+ default:
848
+ forceLayout(nodes, edges, {
849
+ area,
850
+ iterations: opts.iterations ?? 120
851
+ });
852
+ break;
853
+ }
854
+ }
855
+ function shapeDistance(node, mx, my) {
856
+ const dx = mx - node.x;
857
+ const dy = my - node.y;
858
+ const absDx = Math.abs(dx);
859
+ const absDy = Math.abs(dy);
860
+ switch (node.shape) {
861
+ case "circle": {
862
+ const r = Math.max(node.width, node.height) / 2;
863
+ const dist = Math.sqrt(dx * dx + dy * dy);
864
+ return Math.max(0, dist - r);
865
+ }
866
+ case "diamond": {
867
+ const hw = node.width / 2;
868
+ const hh = node.height / 2;
869
+ const d = absDx / hw + absDy / hh;
870
+ return d <= 1 ? 0 : Math.sqrt(dx * dx + dy * dy) * (d - 1);
871
+ }
872
+ case "hexagon": {
873
+ const rx = node.width / 2;
874
+ const ry = node.height / 2;
875
+ const d = dx * dx / (rx * rx) + dy * dy / (ry * ry);
876
+ return d <= 1 ? 0 : Math.sqrt(dx * dx + dy * dy) * (Math.sqrt(d) - 1);
877
+ }
878
+ // rect, stadium
879
+ default: {
880
+ const hw = node.width / 2;
881
+ const hh = node.height / 2;
882
+ const ox = Math.max(0, absDx - hw);
883
+ const oy = Math.max(0, absDy - hh);
884
+ return Math.sqrt(ox * ox + oy * oy);
885
+ }
886
+ }
887
+ }
888
+
889
+ exports.graphChartType = graphChartType;
890
+ //# sourceMappingURL=chunk-XN6YS55F.cjs.map
891
+ //# sourceMappingURL=chunk-XN6YS55F.cjs.map