@tabler/charts 0.2.0 → 0.4.0

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 (420) hide show
  1. package/README.md +165 -17
  2. package/dist/{annotations-DdRdeBUB.cjs → annotations--m-HzMBM.cjs} +87 -11
  3. package/dist/annotations--m-HzMBM.cjs.map +1 -0
  4. package/dist/{annotations-B02GR_KU.d.ts → annotations-CCDUC1lW.d.ts} +16 -30
  5. package/dist/{annotations-CHafaGd4.d.cts → annotations-CqZM1z9R.d.cts} +16 -30
  6. package/dist/{annotations-D0YQ0IoA.js → annotations-DGITy6th.js} +87 -11
  7. package/dist/annotations-DGITy6th.js.map +1 -0
  8. package/dist/annotations.cjs +2 -2
  9. package/dist/annotations.d.cts +1 -1
  10. package/dist/annotations.d.ts +1 -1
  11. package/dist/annotations.js +2 -2
  12. package/dist/{area-0-L1bG9B.js → area-BN0uE9R0.js} +4 -3
  13. package/dist/area-BN0uE9R0.js.map +1 -0
  14. package/dist/{area-CJX9219z.d.cts → area-D6LNLk3r.d.cts} +2 -2
  15. package/dist/{area-d11XePuw.d.ts → area-DEFL-Yun.d.ts} +2 -2
  16. package/dist/{area-4eRs3c0K.cjs → area-D_N8b4Ng.cjs} +4 -3
  17. package/dist/area-D_N8b4Ng.cjs.map +1 -0
  18. package/dist/area.cjs +1 -1
  19. package/dist/area.d.cts +1 -1
  20. package/dist/area.d.ts +1 -1
  21. package/dist/area.js +1 -1
  22. package/dist/axis-BzBkkC5X.cjs +305 -0
  23. package/dist/axis-BzBkkC5X.cjs.map +1 -0
  24. package/dist/axis-C5obgdJt.js +240 -0
  25. package/dist/axis-C5obgdJt.js.map +1 -0
  26. package/dist/{bar-Da6dE_nI.cjs → bar-BrmfXugT.cjs} +77 -58
  27. package/dist/bar-BrmfXugT.cjs.map +1 -0
  28. package/dist/{bar-XwzM6Pb0.d.ts → bar-Bs_rPqgR.d.ts} +1 -1
  29. package/dist/{bar-BDLR4p9c.d.cts → bar-CEt8YRxf.d.cts} +2 -2
  30. package/dist/{bar-B5n2oq9-.js → bar-CgpC2EpX.js} +2 -2
  31. package/dist/{bar-B5n2oq9-.js.map → bar-CgpC2EpX.js.map} +1 -1
  32. package/dist/{bar-BNZ3GhIw.js → bar-D_KKd2fL.js} +75 -56
  33. package/dist/bar-D_KKd2fL.js.map +1 -0
  34. package/dist/{bar-LYIF8MEz.cjs → bar-wVykm1us.cjs} +2 -2
  35. package/dist/{bar-LYIF8MEz.cjs.map → bar-wVykm1us.cjs.map} +1 -1
  36. package/dist/bar.cjs +1 -1
  37. package/dist/bar.d.cts +1 -1
  38. package/dist/bar.d.ts +1 -1
  39. package/dist/bar.js +1 -1
  40. package/dist/calendar-B7843sQu.d.cts +106 -0
  41. package/dist/calendar-BG_q_NC_.cjs +507 -0
  42. package/dist/calendar-BG_q_NC_.cjs.map +1 -0
  43. package/dist/calendar-CF3gfDQk.js +502 -0
  44. package/dist/calendar-CF3gfDQk.js.map +1 -0
  45. package/dist/calendar-D10_ki1S.d.ts +106 -0
  46. package/dist/calendar.cjs +3 -0
  47. package/dist/calendar.d.cts +3 -0
  48. package/dist/calendar.d.ts +3 -0
  49. package/dist/calendar.js +1 -0
  50. package/dist/{candlestick-BHQkQfxH.js → candlestick-B1onjo1o.js} +17 -14
  51. package/dist/candlestick-B1onjo1o.js.map +1 -0
  52. package/dist/{candlestick-Dq7qp-F0.d.cts → candlestick-B7YXUVVh.d.cts} +4 -3
  53. package/dist/{candlestick-CYCQXgky.cjs → candlestick-BwrFKak_.cjs} +17 -14
  54. package/dist/candlestick-BwrFKak_.cjs.map +1 -0
  55. package/dist/{candlestick-D0xKkdqd.d.ts → candlestick-XpqJvarq.d.ts} +4 -3
  56. package/dist/candlestick.cjs +3 -3
  57. package/dist/candlestick.d.cts +1 -1
  58. package/dist/candlestick.d.ts +1 -1
  59. package/dist/candlestick.js +3 -3
  60. package/dist/{cartesian-DV02PsBe.cjs → cartesian-B9CrasFJ.cjs} +190 -310
  61. package/dist/cartesian-B9CrasFJ.cjs.map +1 -0
  62. package/dist/{cartesian-CI2x6N7N.js → cartesian-COglz544.js} +161 -251
  63. package/dist/cartesian-COglz544.js.map +1 -0
  64. package/dist/{chart-DWn9v6qw.js → chart-B97FBRCd.js} +114 -72
  65. package/dist/chart-B97FBRCd.js.map +1 -0
  66. package/dist/{chart-QilhWP8Z.d.ts → chart-CE9EVbfV.d.ts} +427 -112
  67. package/dist/{chart-kqFMEwDo.d.cts → chart-Dz4geQZy.d.cts} +427 -112
  68. package/dist/{chart-e2VqomCI.cjs → chart-GUmmjJ7S.cjs} +132 -78
  69. package/dist/chart-GUmmjJ7S.cjs.map +1 -0
  70. package/dist/{core-BKRQvPAT.js → core-7fgM3su0.js} +188 -73
  71. package/dist/core-7fgM3su0.js.map +1 -0
  72. package/dist/{core-DRUCk67j.d.ts → core-BUQzLsRJ.d.ts} +26 -10
  73. package/dist/{core-DIOC61up.cjs → core-BZTrsPxc.cjs} +200 -73
  74. package/dist/core-BZTrsPxc.cjs.map +1 -0
  75. package/dist/{core-PAX5ogLk.d.cts → core-Ck5uHcW8.d.cts} +45 -24
  76. package/dist/core.cjs +45 -31
  77. package/dist/core.d.cts +23 -18
  78. package/dist/core.d.ts +23 -18
  79. package/dist/core.js +28 -23
  80. package/dist/{dates-DurEr9WT.cjs → dates-0YNY49KQ.cjs} +2 -2
  81. package/dist/{dates-DurEr9WT.cjs.map → dates-0YNY49KQ.cjs.map} +1 -1
  82. package/dist/{dates-C2RzY3rE.js → dates-CKDRgpin.js} +2 -2
  83. package/dist/{dates-C2RzY3rE.js.map → dates-CKDRgpin.js.map} +1 -1
  84. package/dist/decimate.cjs +1 -1
  85. package/dist/decimate.js +1 -1
  86. package/dist/{dom-D_g13XWY.cjs → dom-C33zvtPo.cjs} +3 -7
  87. package/dist/dom-C33zvtPo.cjs.map +1 -0
  88. package/dist/{dom-CuceR8gt.js → dom-CTse6Rvd.js} +3 -7
  89. package/dist/dom-CTse6Rvd.js.map +1 -0
  90. package/dist/end-labels-B3oRvjxw.js +114 -0
  91. package/dist/end-labels-B3oRvjxw.js.map +1 -0
  92. package/dist/end-labels-CS-fnpp-.cjs +119 -0
  93. package/dist/end-labels-CS-fnpp-.cjs.map +1 -0
  94. package/dist/end-labels.cjs +11 -0
  95. package/dist/end-labels.cjs.map +1 -0
  96. package/dist/end-labels.d.cts +6 -0
  97. package/dist/end-labels.d.ts +6 -0
  98. package/dist/end-labels.js +11 -0
  99. package/dist/end-labels.js.map +1 -0
  100. package/dist/{export-chart-83UYH48t.js → export-chart-BOH_nfcH.js} +92 -15
  101. package/dist/export-chart-BOH_nfcH.js.map +1 -0
  102. package/dist/{export-chart-mYgEfK-L.cjs → export-chart-Be4T9J3m.cjs} +97 -14
  103. package/dist/export-chart-Be4T9J3m.cjs.map +1 -0
  104. package/dist/export.cjs +5 -3
  105. package/dist/export.cjs.map +1 -1
  106. package/dist/export.d.cts +4 -3
  107. package/dist/export.d.ts +4 -3
  108. package/dist/export.js +5 -4
  109. package/dist/export.js.map +1 -1
  110. package/dist/{fade-GGxcBdss.js → fade-CDrQjnDz.js} +56 -78
  111. package/dist/fade-CDrQjnDz.js.map +1 -0
  112. package/dist/{fade-DVTkhrFU.cjs → fade-CRqcKMWY.cjs} +56 -78
  113. package/dist/fade-CRqcKMWY.cjs.map +1 -0
  114. package/dist/{features-BMxkqCyS.js → features-B55rwpQC.js} +4 -2
  115. package/dist/features-B55rwpQC.js.map +1 -0
  116. package/dist/{features-DCXEvoya.cjs → features-DEDP5CEQ.cjs} +9 -1
  117. package/dist/features-DEDP5CEQ.cjs.map +1 -0
  118. package/dist/fit-BPyPRnsK.js +16 -0
  119. package/dist/fit-BPyPRnsK.js.map +1 -0
  120. package/dist/fit-D4MIIQQz.cjs +21 -0
  121. package/dist/fit-D4MIIQQz.cjs.map +1 -0
  122. package/dist/funnel-B9ridzNx.d.cts +50 -0
  123. package/dist/funnel-CFEEulw_.cjs +244 -0
  124. package/dist/funnel-CFEEulw_.cjs.map +1 -0
  125. package/dist/funnel-CYCv8cq2.js +239 -0
  126. package/dist/funnel-CYCv8cq2.js.map +1 -0
  127. package/dist/funnel-FogM8flk.d.ts +50 -0
  128. package/dist/funnel.cjs +3 -0
  129. package/dist/funnel.d.cts +3 -0
  130. package/dist/funnel.d.ts +3 -0
  131. package/dist/funnel.js +1 -0
  132. package/dist/{gauge-DXkjXNCD.cjs → gauge-6HfDcLMJ.cjs} +28 -28
  133. package/dist/gauge-6HfDcLMJ.cjs.map +1 -0
  134. package/dist/{gauge-BSist7My.d.cts → gauge-BScJ7U6O.d.cts} +2 -2
  135. package/dist/{gauge-0VJuAHWF.d.ts → gauge-D78oq1Lx.d.ts} +2 -2
  136. package/dist/{gauge-ts0kqN1-.js → gauge-DiTk5aWO.js} +28 -28
  137. package/dist/gauge-DiTk5aWO.js.map +1 -0
  138. package/dist/gauge.cjs +1 -1
  139. package/dist/gauge.d.cts +1 -1
  140. package/dist/gauge.d.ts +1 -1
  141. package/dist/gauge.js +1 -1
  142. package/dist/heat-Bsqq4zw9.js +38 -0
  143. package/dist/heat-Bsqq4zw9.js.map +1 -0
  144. package/dist/heat-DYsivvDq.cjs +49 -0
  145. package/dist/heat-DYsivvDq.cjs.map +1 -0
  146. package/dist/{heatmap-CXhlrLTl.cjs → heatmap-Dyzrd4Fd.cjs} +39 -37
  147. package/dist/heatmap-Dyzrd4Fd.cjs.map +1 -0
  148. package/dist/{heatmap-19BGJTKF.js → heatmap-J7fxG7MM.js} +35 -33
  149. package/dist/heatmap-J7fxG7MM.js.map +1 -0
  150. package/dist/{heatmap-Dp_oyEe0.d.cts → heatmap-Jvwo7iFW.d.cts} +2 -2
  151. package/dist/{heatmap-59lmClj9.d.ts → heatmap-mFCnP6aB.d.ts} +2 -2
  152. package/dist/heatmap.cjs +1 -1
  153. package/dist/heatmap.d.cts +1 -1
  154. package/dist/heatmap.d.ts +1 -1
  155. package/dist/heatmap.js +1 -1
  156. package/dist/{hydrate-OA6R2_Pn.js → hydrate-BB3MlR36.js} +2 -2
  157. package/dist/{hydrate-OA6R2_Pn.js.map → hydrate-BB3MlR36.js.map} +1 -1
  158. package/dist/{hydrate-CmN1k8Mo.cjs → hydrate-m0I5m6ue.cjs} +2 -2
  159. package/dist/{hydrate-CmN1k8Mo.cjs.map → hydrate-m0I5m6ue.cjs.map} +1 -1
  160. package/dist/hydrate.cjs +2 -2
  161. package/dist/hydrate.js +2 -2
  162. package/dist/index.cjs +69 -45
  163. package/dist/index.cjs.map +1 -1
  164. package/dist/index.d.cts +24 -19
  165. package/dist/index.d.ts +24 -19
  166. package/dist/index.js +51 -37
  167. package/dist/index.js.map +1 -1
  168. package/dist/interaction-DXYSjgnP.cjs +32 -0
  169. package/dist/interaction-DXYSjgnP.cjs.map +1 -0
  170. package/dist/interaction-En1KlwFO.js +21 -0
  171. package/dist/interaction-En1KlwFO.js.map +1 -0
  172. package/dist/layout-CYerDebD.d.cts +29 -0
  173. package/dist/layout-CYerDebD.d.ts +29 -0
  174. package/dist/{layout-JY2aR-yE.cjs → layout-Cfg9x1k2.cjs} +32 -1
  175. package/dist/layout-Cfg9x1k2.cjs.map +1 -0
  176. package/dist/{layout-DmrrLjwN.js → layout-DqAte3H8.js} +27 -2
  177. package/dist/layout-DqAte3H8.js.map +1 -0
  178. package/dist/{line-DO66LtwH.js → line-CXH0L10d.js} +84 -37
  179. package/dist/line-CXH0L10d.js.map +1 -0
  180. package/dist/{line-_rNdeKmS.d.cts → line-Cu9ctpbv.d.cts} +9 -3
  181. package/dist/{line-Dbt6KFRK.cjs → line-DHbYCQy4.cjs} +84 -37
  182. package/dist/line-DHbYCQy4.cjs.map +1 -0
  183. package/dist/{line-DtSh7HQU.d.ts → line-TkzA7wMK.d.ts} +8 -1
  184. package/dist/line.cjs +3 -3
  185. package/dist/line.d.cts +1 -1
  186. package/dist/line.d.ts +1 -1
  187. package/dist/line.js +3 -3
  188. package/dist/log.cjs +1 -1
  189. package/dist/log.js +1 -1
  190. package/dist/map-BirylCmT.d.cts +156 -0
  191. package/dist/map-CYp6x-uS.js +784 -0
  192. package/dist/map-CYp6x-uS.js.map +1 -0
  193. package/dist/map-ChwSgooH.cjs +795 -0
  194. package/dist/map-ChwSgooH.cjs.map +1 -0
  195. package/dist/map-DNqog2Xs.d.ts +156 -0
  196. package/dist/map.cjs +4 -0
  197. package/dist/map.d.cts +3 -0
  198. package/dist/map.d.ts +3 -0
  199. package/dist/map.js +1 -0
  200. package/dist/maps/world.cjs +875 -0
  201. package/dist/maps/world.cjs.map +1 -0
  202. package/dist/maps/world.d.cts +2 -0
  203. package/dist/maps/world.d.ts +2 -0
  204. package/dist/maps/world.js +874 -0
  205. package/dist/maps/world.js.map +1 -0
  206. package/dist/{morph-9_LJL0ra.cjs → morph-3I1Nf_tR.cjs} +2 -2
  207. package/dist/{morph-9_LJL0ra.cjs.map → morph-3I1Nf_tR.cjs.map} +1 -1
  208. package/dist/{morph-DnRxuwR-.js → morph-GfBab-b3.js} +2 -2
  209. package/dist/{morph-DnRxuwR-.js.map → morph-GfBab-b3.js.map} +1 -1
  210. package/dist/morph.cjs +2 -2
  211. package/dist/morph.js +2 -2
  212. package/dist/others-CuNdpvjd.d.cts +31 -0
  213. package/dist/{others-J7NCAMA0.js → others-DBIGE6jr.js} +11 -3
  214. package/dist/others-DBIGE6jr.js.map +1 -0
  215. package/dist/others-DBO4Kjwl.d.ts +29 -0
  216. package/dist/{others-DWdK7vKp.cjs → others-WfjCsjqT.cjs} +14 -6
  217. package/dist/others-WfjCsjqT.cjs.map +1 -0
  218. package/dist/{parliament-Cru4IcuM.js → parliament-BKN6ikBJ.js} +30 -29
  219. package/dist/parliament-BKN6ikBJ.js.map +1 -0
  220. package/dist/{parliament-CLCI7tUO.d.ts → parliament-CHdf13XU.d.ts} +2 -2
  221. package/dist/{parliament-CgsVnWEe.d.cts → parliament-CsYgh4N2.d.cts} +2 -2
  222. package/dist/{parliament-x5hcFaQ3.cjs → parliament-DhxAaIZ3.cjs} +30 -29
  223. package/dist/parliament-DhxAaIZ3.cjs.map +1 -0
  224. package/dist/parliament.cjs +1 -1
  225. package/dist/parliament.d.cts +1 -1
  226. package/dist/parliament.d.ts +1 -1
  227. package/dist/parliament.js +1 -1
  228. package/dist/{patterns-D3-wQagb.cjs → patterns-BPN1c9qe.cjs} +2 -2
  229. package/dist/{patterns-D3-wQagb.cjs.map → patterns-BPN1c9qe.cjs.map} +1 -1
  230. package/dist/{patterns-CufKZYhm.js → patterns-CVrLrJXg.js} +2 -2
  231. package/dist/{patterns-CufKZYhm.js.map → patterns-CVrLrJXg.js.map} +1 -1
  232. package/dist/patterns.cjs +2 -2
  233. package/dist/patterns.d.cts +1 -1
  234. package/dist/patterns.d.ts +1 -1
  235. package/dist/patterns.js +2 -2
  236. package/dist/{percentage-bar-ybNS3goo.cjs → percentage-bar-BChkTRoz.cjs} +37 -35
  237. package/dist/percentage-bar-BChkTRoz.cjs.map +1 -0
  238. package/dist/{percentage-bar-nhTeakD_.d.ts → percentage-bar-CSAbzDOn.d.ts} +11 -15
  239. package/dist/{percentage-bar-B6tNOqNn.js → percentage-bar-CaInxrL8.js} +37 -35
  240. package/dist/percentage-bar-CaInxrL8.js.map +1 -0
  241. package/dist/{percentage-bar-tepMr7Hd.d.cts → percentage-bar-UZHCRvlK.d.cts} +11 -15
  242. package/dist/percentage-bar.cjs +1 -1
  243. package/dist/percentage-bar.d.cts +1 -1
  244. package/dist/percentage-bar.d.ts +1 -1
  245. package/dist/percentage-bar.js +1 -1
  246. package/dist/{pie-BXg2gNpb.d.cts → pie-AFedsDcF.d.cts} +17 -14
  247. package/dist/{pie-CVsc-6qD.js → pie-Ch6Bx0ih.js} +68 -52
  248. package/dist/pie-Ch6Bx0ih.js.map +1 -0
  249. package/dist/{pie-BpjvSPnz.cjs → pie-Cll1OrVZ.cjs} +68 -52
  250. package/dist/pie-Cll1OrVZ.cjs.map +1 -0
  251. package/dist/{pie-CFptILSm.d.ts → pie-Cn2H3pz8.d.ts} +17 -14
  252. package/dist/pie.cjs +1 -1
  253. package/dist/pie.d.cts +1 -1
  254. package/dist/pie.d.ts +1 -1
  255. package/dist/pie.js +1 -1
  256. package/dist/{point-shapes--_gmdTyK.cjs → point-shapes-BRawRM78.cjs} +23 -22
  257. package/dist/point-shapes-BRawRM78.cjs.map +1 -0
  258. package/dist/{point-shapes-DD2Ektzm.js → point-shapes-DI6GhcI7.js} +18 -23
  259. package/dist/point-shapes-DI6GhcI7.js.map +1 -0
  260. package/dist/point-shapes.cjs +6 -4
  261. package/dist/point-shapes.cjs.map +1 -1
  262. package/dist/point-shapes.d.cts +2 -2
  263. package/dist/point-shapes.d.ts +2 -2
  264. package/dist/point-shapes.js +7 -5
  265. package/dist/point-shapes.js.map +1 -1
  266. package/dist/{radar-BR-mumDd.js → radar-Bg-IiIWB.js} +21 -22
  267. package/dist/radar-Bg-IiIWB.js.map +1 -0
  268. package/dist/{radar-BC9Skgpj.d.ts → radar-DEer2jjd.d.ts} +2 -2
  269. package/dist/{radar-D1-lItDy.d.cts → radar-DxmjXhMc.d.cts} +2 -2
  270. package/dist/{radar-HPDrIdzc.cjs → radar-wDyX17S3.cjs} +22 -23
  271. package/dist/radar-wDyX17S3.cjs.map +1 -0
  272. package/dist/radar.cjs +1 -1
  273. package/dist/radar.d.cts +1 -1
  274. package/dist/radar.d.ts +1 -1
  275. package/dist/radar.js +1 -1
  276. package/dist/range-bar-BnKjJP89.cjs +348 -0
  277. package/dist/range-bar-BnKjJP89.cjs.map +1 -0
  278. package/dist/range-bar-C4cRaaQE.d.ts +123 -0
  279. package/dist/range-bar-D32dIQOY.d.cts +123 -0
  280. package/dist/range-bar-Dx6ce0J1.js +343 -0
  281. package/dist/range-bar-Dx6ce0J1.js.map +1 -0
  282. package/dist/range-bar.cjs +3 -0
  283. package/dist/range-bar.d.cts +3 -0
  284. package/dist/range-bar.d.ts +3 -0
  285. package/dist/range-bar.js +1 -0
  286. package/dist/{rect-DSVmUZrD.js → rect-CZTNvMlf.js} +2 -2
  287. package/dist/{rect-DSVmUZrD.js.map → rect-CZTNvMlf.js.map} +1 -1
  288. package/dist/{rect-D6VhynBM.cjs → rect-DPr9QRxl.cjs} +2 -2
  289. package/dist/{rect-D6VhynBM.cjs.map → rect-DPr9QRxl.cjs.map} +1 -1
  290. package/dist/{sankey-fCoo1cpz.cjs → sankey-0CSp_Er9.cjs} +72 -71
  291. package/dist/sankey-0CSp_Er9.cjs.map +1 -0
  292. package/dist/{sankey-Dk7jUt8x.d.cts → sankey-D-8ATwBT.d.cts} +2 -2
  293. package/dist/{sankey-D6JeZfK5.js → sankey-Dp4CuLVe.js} +72 -71
  294. package/dist/sankey-Dp4CuLVe.js.map +1 -0
  295. package/dist/{sankey-D_v7KxnJ.d.ts → sankey-DpYJsOI4.d.ts} +2 -2
  296. package/dist/sankey.cjs +1 -1
  297. package/dist/sankey.d.cts +1 -1
  298. package/dist/sankey.d.ts +1 -1
  299. package/dist/sankey.js +1 -1
  300. package/dist/{scatter-C0TWjFpW.js → scatter-0Z7K_YUz.js} +94 -46
  301. package/dist/scatter-0Z7K_YUz.js.map +1 -0
  302. package/dist/{scatter-CXEsioOJ.d.ts → scatter-BAL5K9_4.d.ts} +28 -9
  303. package/dist/{scatter-DZeEIfyo.d.cts → scatter-BUGbnRzM.d.cts} +28 -9
  304. package/dist/{scatter-DVqB_fP9.cjs → scatter-CZ8do3Up.cjs} +95 -47
  305. package/dist/scatter-CZ8do3Up.cjs.map +1 -0
  306. package/dist/scatter.cjs +1 -1
  307. package/dist/scatter.d.cts +2 -2
  308. package/dist/scatter.d.ts +2 -2
  309. package/dist/scatter.js +1 -1
  310. package/dist/slice-labels-1TBq7p3q.d.cts +28 -0
  311. package/dist/slice-labels-C9ucsBVW.js +88 -0
  312. package/dist/slice-labels-C9ucsBVW.js.map +1 -0
  313. package/dist/slice-labels-CbFiy46l.cjs +93 -0
  314. package/dist/slice-labels-CbFiy46l.cjs.map +1 -0
  315. package/dist/slice-labels-Cm5CyV7B.d.ts +28 -0
  316. package/dist/slice-labels.cjs +11 -0
  317. package/dist/slice-labels.cjs.map +1 -0
  318. package/dist/slice-labels.d.cts +6 -0
  319. package/dist/slice-labels.d.ts +6 -0
  320. package/dist/slice-labels.js +11 -0
  321. package/dist/slice-labels.js.map +1 -0
  322. package/dist/{sparkline-cbvRkWqS.d.ts → sparkline-CtoBJe-a.d.ts} +2 -2
  323. package/dist/{sparkline-B39NA0Mi.cjs → sparkline-DjR-V6BI.cjs} +13 -15
  324. package/dist/sparkline-DjR-V6BI.cjs.map +1 -0
  325. package/dist/{sparkline-DAP6jtzw.d.cts → sparkline-DwHJfeZz.d.cts} +2 -2
  326. package/dist/{sparkline-XO_TqCNP.js → sparkline-_dxwtdli.js} +13 -15
  327. package/dist/sparkline-_dxwtdli.js.map +1 -0
  328. package/dist/sparkline.cjs +1 -1
  329. package/dist/sparkline.d.cts +1 -1
  330. package/dist/sparkline.d.ts +1 -1
  331. package/dist/sparkline.js +1 -1
  332. package/dist/{stack-Dagxq7l2.d.cts → stack-CcmyALx0.d.cts} +1 -1
  333. package/dist/{stack-2H2Gfs1Q.js → stack-CyVlS7Fr.js} +2 -2
  334. package/dist/{stack-2H2Gfs1Q.js.map → stack-CyVlS7Fr.js.map} +1 -1
  335. package/dist/{stack-BgPzoQmv.cjs → stack-DBhmYNat.cjs} +2 -2
  336. package/dist/{stack-BgPzoQmv.cjs.map → stack-DBhmYNat.cjs.map} +1 -1
  337. package/dist/style.css +1 -1
  338. package/dist/{time-axis-BjZ1bYTK.cjs → time-axis-CVKjQKSS.cjs} +4 -3
  339. package/dist/{time-axis-BjZ1bYTK.cjs.map → time-axis-CVKjQKSS.cjs.map} +1 -1
  340. package/dist/{time-axis-FLONo54E.js → time-axis-CkmbAw4Z.js} +3 -2
  341. package/dist/{time-axis-FLONo54E.js.map → time-axis-CkmbAw4Z.js.map} +1 -1
  342. package/dist/time.cjs +3 -3
  343. package/dist/time.js +3 -3
  344. package/dist/{treemap-BAkhmVQc.d.cts → treemap-C2maqerU.d.cts} +37 -5
  345. package/dist/{treemap-BNpxFBao.d.ts → treemap-D_zbubo3.d.ts} +37 -5
  346. package/dist/{treemap-BWpEUlDh.cjs → treemap-PulGXZv0.cjs} +58 -33
  347. package/dist/treemap-PulGXZv0.cjs.map +1 -0
  348. package/dist/{treemap-CQdavQ9u.js → treemap-lbYxb-7h.js} +57 -32
  349. package/dist/treemap-lbYxb-7h.js.map +1 -0
  350. package/dist/treemap.cjs +1 -1
  351. package/dist/treemap.d.cts +1 -1
  352. package/dist/treemap.d.ts +1 -1
  353. package/dist/treemap.js +1 -1
  354. package/dist/{value-labels-BBuSi4i0.js → value-labels-B0VeheyE.js} +29 -8
  355. package/dist/value-labels-B0VeheyE.js.map +1 -0
  356. package/dist/{value-labels-BV9keAuL.cjs → value-labels-Dcyk3GIY.cjs} +29 -8
  357. package/dist/value-labels-Dcyk3GIY.cjs.map +1 -0
  358. package/dist/value-labels.cjs +2 -2
  359. package/dist/value-labels.d.cts +1 -1
  360. package/dist/value-labels.d.ts +1 -1
  361. package/dist/value-labels.js +2 -2
  362. package/dist/zoom.cjs +810 -0
  363. package/dist/zoom.cjs.map +1 -0
  364. package/dist/zoom.d.cts +34 -0
  365. package/dist/zoom.d.ts +34 -0
  366. package/dist/zoom.js +806 -0
  367. package/dist/zoom.js.map +1 -0
  368. package/package.json +120 -235
  369. package/dist/annotations-D0YQ0IoA.js.map +0 -1
  370. package/dist/annotations-DdRdeBUB.cjs.map +0 -1
  371. package/dist/area-0-L1bG9B.js.map +0 -1
  372. package/dist/area-4eRs3c0K.cjs.map +0 -1
  373. package/dist/bar-BNZ3GhIw.js.map +0 -1
  374. package/dist/bar-Da6dE_nI.cjs.map +0 -1
  375. package/dist/candlestick-BHQkQfxH.js.map +0 -1
  376. package/dist/candlestick-CYCQXgky.cjs.map +0 -1
  377. package/dist/cartesian-CI2x6N7N.js.map +0 -1
  378. package/dist/cartesian-DV02PsBe.cjs.map +0 -1
  379. package/dist/chart-DWn9v6qw.js.map +0 -1
  380. package/dist/chart-e2VqomCI.cjs.map +0 -1
  381. package/dist/core-BKRQvPAT.js.map +0 -1
  382. package/dist/core-DIOC61up.cjs.map +0 -1
  383. package/dist/dom-CuceR8gt.js.map +0 -1
  384. package/dist/dom-D_g13XWY.cjs.map +0 -1
  385. package/dist/export-chart-83UYH48t.js.map +0 -1
  386. package/dist/export-chart-mYgEfK-L.cjs.map +0 -1
  387. package/dist/fade-DVTkhrFU.cjs.map +0 -1
  388. package/dist/fade-GGxcBdss.js.map +0 -1
  389. package/dist/features-BMxkqCyS.js.map +0 -1
  390. package/dist/features-DCXEvoya.cjs.map +0 -1
  391. package/dist/gauge-DXkjXNCD.cjs.map +0 -1
  392. package/dist/gauge-ts0kqN1-.js.map +0 -1
  393. package/dist/heatmap-19BGJTKF.js.map +0 -1
  394. package/dist/heatmap-CXhlrLTl.cjs.map +0 -1
  395. package/dist/layout-DmrrLjwN.js.map +0 -1
  396. package/dist/layout-JY2aR-yE.cjs.map +0 -1
  397. package/dist/line-DO66LtwH.js.map +0 -1
  398. package/dist/line-Dbt6KFRK.cjs.map +0 -1
  399. package/dist/others-DWdK7vKp.cjs.map +0 -1
  400. package/dist/others-J7NCAMA0.js.map +0 -1
  401. package/dist/parliament-Cru4IcuM.js.map +0 -1
  402. package/dist/parliament-x5hcFaQ3.cjs.map +0 -1
  403. package/dist/percentage-bar-B6tNOqNn.js.map +0 -1
  404. package/dist/percentage-bar-ybNS3goo.cjs.map +0 -1
  405. package/dist/pie-BpjvSPnz.cjs.map +0 -1
  406. package/dist/pie-CVsc-6qD.js.map +0 -1
  407. package/dist/point-shapes--_gmdTyK.cjs.map +0 -1
  408. package/dist/point-shapes-DD2Ektzm.js.map +0 -1
  409. package/dist/radar-BR-mumDd.js.map +0 -1
  410. package/dist/radar-HPDrIdzc.cjs.map +0 -1
  411. package/dist/sankey-D6JeZfK5.js.map +0 -1
  412. package/dist/sankey-fCoo1cpz.cjs.map +0 -1
  413. package/dist/scatter-C0TWjFpW.js.map +0 -1
  414. package/dist/scatter-DVqB_fP9.cjs.map +0 -1
  415. package/dist/sparkline-B39NA0Mi.cjs.map +0 -1
  416. package/dist/sparkline-XO_TqCNP.js.map +0 -1
  417. package/dist/treemap-BWpEUlDh.cjs.map +0 -1
  418. package/dist/treemap-CQdavQ9u.js.map +0 -1
  419. package/dist/value-labels-BBuSi4i0.js.map +0 -1
  420. package/dist/value-labels-BV9keAuL.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radar-Bg-IiIWB.js","names":[],"sources":["../src/charts/radar.ts"],"sourcesContent":["import type { ChartType, RenderContext, RenderResult } from '../chart.ts'\nimport { linearTicks } from '../components/axis.ts'\nimport { formatDetail, type NumberFormat } from '../format.ts'\nimport type { Hit, HitItem, Interaction } from '../interaction.ts'\nimport {\n estimateTextWidth,\n type InsetsInput,\n innerRect,\n insets,\n LINE_HEIGHT,\n round,\n} from '../layout.ts'\nimport { linear } from '../scales/linear.ts'\nimport { h } from '../vnode.ts'\nimport {\n type CartesianData,\n domainOf,\n type Label,\n labelKey,\n markerShape,\n pointMark,\n resolveLabels,\n seriesAttrs,\n seriesKey,\n seriesLegend,\n seriesTable,\n tickCount,\n} from './cartesian.ts'\nimport { cleanData, cleanSeries } from './clean.ts'\n\n/** Options for the radial value axis. */\nexport interface RadialAxisOptions {\n /** Render the value labels along the first spoke. Defaults to `true`. */\n show?: boolean\n /** Value at the center. Defaults to `0` (or the data minimum when it is negative). */\n min?: number\n /** Value at the outer ring. Defaults to the niced data maximum. */\n max?: number\n /** Extend the domain to round values. Defaults to `true`. */\n nice?: boolean\n /** Approximate number of rings. Defaults to one per ~40px of radius. */\n ticks?: number\n format?: NumberFormat\n}\n\nexport interface RadarOptions {\n /** One spoke per label, one polygon per series. */\n data: CartesianData\n /** The radial value axis. */\n r?: RadialAxisOptions\n /** Format of the spoke labels (axis, tooltips and the table). */\n format?: (label: Label, index: number) => string\n /** Shape of the rings. Defaults to `'polygon'`. */\n grid?: 'polygon' | 'circle'\n /** Fill each polygon. Defaults to `true`. */\n fill?: boolean\n /** Draw a dot on every value. Defaults to `false`. */\n points?: boolean\n /** Dot radius in pixels. Defaults to `4`. */\n pointRadius?: number\n /**\n * Widest spoke label, in pixels: a longer one wraps at its spaces onto up\n * to three lines. Defaults to a quarter of the chart's width.\n */\n labelWidth?: number\n /** Extra space around the chart, in pixels. */\n padding?: InsetsInput\n}\n\n/** Space between the outer ring and the spoke labels. */\nconst LABEL_GAP = 8\n/** Pixels around the outer ring that still count as hovering it. */\nconst HOVER_SLOP = 8\n\n/** Smallest radius, as a share of the space, however long the labels. */\nconst MIN_RADIUS = 0.5\n/** Most lines a wrapped spoke label takes. */\nconst MAX_LINES = 3\n\n/** `text`, cut short with an ellipsis to fit `width` pixels. */\nfunction truncate(text: string, width: number, fontSize: number): string {\n if (estimateTextWidth(text, fontSize) <= width) return text\n let end = text.length\n while (end > 0 && estimateTextWidth(`${text.slice(0, end)}…`, fontSize) > width) end--\n return end > 0 ? `${text.slice(0, end).trimEnd()}…` : ''\n}\n\n/**\n * `text` split at its spaces into lines no wider than `width` pixels (a word\n * wider than that gets a line of its own), at most `MAX_LINES` of them: what\n * is left joins the last line.\n */\nfunction wrap(text: string, width: number, fontSize: number): string[] {\n const lines: string[] = []\n let line = ''\n for (const word of text.split(' ')) {\n const next = line ? `${line} ${word}` : word\n if (!line || estimateTextWidth(next, fontSize) <= width) line = next\n else {\n lines.push(line)\n line = word\n }\n }\n lines.push(line)\n if (lines.length > MAX_LINES)\n lines.splice(MAX_LINES - 1, lines.length, lines.slice(MAX_LINES - 1).join(' '))\n return lines\n}\n\n/** Text anchor of a spoke label on the side its spoke points to. */\nconst side = (sin: number): -1 | 0 | 1 => (sin > 0.1 ? 1 : sin < -0.1 ? -1 : 0)\n\n/**\n * The largest radius at which every spoke label still fits in `area`:\n * labels sit beyond the outer ring, on the side their spoke points to.\n */\nfunction fitRadius(\n area: { width: number; height: number },\n angles: readonly number[],\n labels: readonly (readonly string[])[],\n fontSize: number,\n): number {\n let radius = Math.min(area.width, area.height) / 2\n angles.forEach((angle, i) => {\n const sin = Math.sin(angle)\n const cos = Math.cos(angle)\n const lines = labels[i] ?? []\n const w = Math.max(0, ...lines.map((line) => estimateTextWidth(line, fontSize)))\n const height = blockHeight(lines.length, fontSize)\n const s = side(sin)\n // Horizontal: the label runs outwards from the spoke end (or is centered on it).\n const across = s === 0 ? w / 2 : w + LABEL_GAP\n if (Math.abs(sin) > 1e-6) radius = Math.min(radius, (area.width / 2 - across) / Math.abs(sin))\n // Vertical: the lines of text above the top spokes, below the bottom ones,\n // centered on the ones at the sides.\n if (Math.abs(cos) > 1e-6) {\n const along = (s === 0 ? height + LABEL_GAP : height / 2) / Math.abs(cos)\n radius = Math.min(radius, area.height / 2 / Math.abs(cos) - along)\n }\n })\n return Math.max(0, radius)\n}\n\n/** Height of `lines` lines of text, in pixels. */\nconst blockHeight = (lines: number, fontSize: number) =>\n fontSize * (1 + Math.max(0, lines - 1) * LINE_HEIGHT)\n\nfunction renderRadar(options: RadarOptions, ctx: RenderContext): RenderResult {\n const { width, height, fontSize, locale } = ctx\n const axis = options.r ?? {}\n const { fill = true, points = false, pointRadius = 4 } = options\n const series = options.data.series\n const labels = resolveLabels(options.data)\n const n = labels.length\n const visible = series.filter((s) => !ctx.hidden.has(seriesKey(s)))\n const formatLabel = options.format ?? ((label: Label) => String(label))\n const formatValue = formatDetail(axis.format, locale)\n\n const pad = insets(options.padding)\n const area = innerRect(width, height, {\n top: pad.top + LABEL_GAP,\n right: pad.right + LABEL_GAP,\n bottom: pad.bottom + LABEL_GAP,\n left: pad.left + LABEL_GAP,\n })\n const cx = area.x + area.width / 2\n const cy = area.y + area.height / 2\n const angles = labels.map((_, i) => (i / Math.max(1, n)) * Math.PI * 2)\n const texts = labels.map((label, i) => formatLabel(label, i))\n // Long labels wrap onto a few lines, then the radius fits them, but never\n // shrinks below a share of the space: lines that still do not fit are cut\n // short (the tooltip and the table keep the labels whole).\n const labelWidth = options.labelWidth ?? area.width / 4\n const wrapped = texts.map((text) => wrap(text, labelWidth, fontSize))\n const radius = Math.max(\n fitRadius(area, angles, wrapped, fontSize),\n (Math.min(area.width, area.height) / 2) * MIN_RADIUS,\n )\n const shown = wrapped.map((lines, i) => {\n const sin = Math.sin(angles[i] as number)\n const room = side(sin) === 0 ? area.width : area.width / 2 - radius * Math.abs(sin) - LABEL_GAP\n return lines.map((line) => truncate(line, room, fontSize))\n })\n\n const count = tickCount(axis, Math.max(2, Math.round(radius / 40)))\n const values = visible.flatMap((s) => s.values)\n const domain = domainOf(values, axis, true, count)\n const scale = linear(domain, [0, radius], { clamp: true })\n const ticks = linearTicks(scale, { count, format: axis.format, locale })\n\n /** Point at `r` pixels from the center along spoke `i`. */\n const at = (i: number, r: number): [number, number] => [\n cx + r * Math.sin(angles[i] as number),\n cy - r * Math.cos(angles[i] as number),\n ]\n /** A closed path through one radius per spoke (the same commands for any values). */\n const polygon = (radii: readonly number[]) =>\n `${radii.map((r, i) => `${i ? 'L' : 'M'}${at(i, r).map(round).join(',')}`).join('')}Z`\n const ring = (r: number) =>\n options.grid === 'circle'\n ? `M${round(cx)},${round(cy - r)}A${round(r)},${round(r)},0,1,1,${round(cx)},${round(cy + r)}A${round(r)},${round(r)},0,1,1,${round(cx)},${round(cy - r)}Z`\n : polygon(labels.map(() => r))\n /** Pixel radius of a value; missing values sit at the center. */\n const radiusOf = (v: number | null | undefined) =>\n v != null && Number.isFinite(v) ? scale(v) : 0\n\n const hitAt = (index: number): Hit => {\n const items: HitItem[] = []\n series.forEach((s, seriesIndex) => {\n if (ctx.hidden.has(seriesKey(s))) return\n const raw = s.values[index]\n const value = raw != null && Number.isFinite(raw) ? raw : null\n const [x, y] = at(index, radiusOf(value))\n const item: HitItem = {\n name: s.name,\n seriesIndex,\n value,\n text: value === null ? '–' : formatValue(value),\n x,\n y: value === null ? null : y,\n }\n if (s.color) item.color = s.color\n items.push(item)\n })\n const [x2, y2] = at(index, radius)\n return {\n index,\n label: labelKey(labels[index] as Label),\n title: texts[index] as string,\n x: x2,\n area: { x: cx - radius, y: cy - radius, width: radius * 2, height: radius * 2 },\n items,\n highlight: { kind: 'spoke', x1: cx, y1: cy, x2, y2 },\n }\n }\n\n const interaction: Interaction = {\n count: n,\n hitTest(px, py) {\n if (n === 0 || Math.hypot(px - cx, py - cy) > radius + HOVER_SLOP) return null\n // The nearest spoke by angle, clockwise from 12 o'clock.\n const angle = Math.atan2(px - cx, cy - py)\n const turn = (angle < 0 ? angle + Math.PI * 2 : angle) / (Math.PI * 2)\n return hitAt(Math.round(turn * n) % n)\n },\n hitIndex(index, seriesIndex) {\n if (index < 0 || index >= n) return null\n const hit = hitAt(index)\n if (seriesIndex !== undefined && hit.items.some((item) => item.seriesIndex === seriesIndex)) {\n hit.seriesIndex = seriesIndex\n }\n return hit\n },\n }\n\n const grid = h(\n 'g',\n { key: 'grid', class: 'tc-radar-grid', 'aria-hidden': 'true' },\n ticks\n .filter((tick) => tick.position > 0)\n .map((tick) =>\n h('path', { key: tick.value, class: 'tc-radar-ring', d: ring(tick.position) }),\n ),\n labels.map((label, i) => {\n const [x2, y2] = at(i, radius)\n return h('line', {\n key: labelKey(label),\n class: 'tc-radar-spoke',\n x1: round(cx),\n y1: round(cy),\n x2: round(x2),\n y2: round(y2),\n })\n }),\n )\n\n const shape = markerShape(options)\n const groups = series.map((s, index) => {\n if (ctx.hidden.has(seriesKey(s))) return null\n const d = polygon(labels.map((_, i) => radiusOf(s.values[i])))\n return h(\n 'g',\n seriesAttrs(s, index),\n fill && h('path', { class: 'tc-area', d }),\n h('path', { class: 'tc-line', d }),\n points &&\n h(\n 'g',\n { class: 'tc-points' },\n labels.map((label, i) => {\n const v = s.values[i]\n if (v == null || !Number.isFinite(v)) return null\n const [x, y] = at(i, scale(v))\n return pointMark(\n shape,\n index,\n labelKey(label),\n 'tc-point',\n round(x),\n round(y),\n pointRadius,\n )\n }),\n ),\n )\n })\n\n const spokeLabels = h(\n 'g',\n { key: 'labels', class: 'tc-radar-labels', 'aria-hidden': 'true' },\n labels.map((label, i) => {\n const angle = angles[i] as number\n const s = side(Math.sin(angle))\n const cos = Math.cos(angle)\n const [x, y] = at(i, radius + LABEL_GAP)\n const [first = '', ...rest] = shown[i] ?? []\n // Above the top spokes, below the bottom ones, centered on the sides:\n // the first line moves up to leave room for the ones under it.\n const up = rest.length * LINE_HEIGHT\n const dy = s !== 0 ? `${round(0.35 - up / 2)}em` : cos > 0 ? `${round(-up)}em` : '0.71em'\n return h(\n 'text',\n {\n key: labelKey(label),\n class: 'tc-tick-label tc-radar-label',\n x: round(x),\n y: round(y),\n 'text-anchor': s > 0 ? 'start' : s < 0 ? 'end' : 'middle',\n dy,\n },\n first,\n rest.map((line, j) => h('tspan', { key: j, x: round(x), dy: `${LINE_HEIGHT}em` }, line)),\n )\n }),\n )\n\n const valueLabels =\n axis.show !== false &&\n h(\n 'g',\n { key: 'values', class: 'tc-radar-values', 'aria-hidden': 'true' },\n ticks\n .filter((tick) => tick.position > 0)\n .map((tick) =>\n h(\n 'text',\n {\n key: tick.value,\n class: 'tc-tick-label tc-radar-value',\n x: round(cx + 4),\n y: round(cy - tick.position),\n dy: '0.35em',\n },\n tick.label,\n ),\n ),\n )\n\n const content = [\n grid,\n // Series grow from the center: the transform origin is set here, in pixels.\n h(\n 'g',\n {\n key: 'series',\n class: 'tc-series-list tc-radar-series',\n style: `transform-origin:${round(cx)}px ${round(cy)}px`,\n },\n groups,\n ),\n spokeLabels,\n valueLabels,\n ]\n return { content, interaction }\n}\n\n/**\n * Radar (spider) chart: one spoke per label, the values of each series\n * joined into a polygon around the center. Good for comparing a few series\n * over the same handful of measures.\n *\n * ```ts\n * new Chart('#el', {\n * type: radar,\n * data: {\n * labels: ['Speed', 'Range', 'Comfort', 'Price', 'Safety'],\n * series: [{ name: 'Model A', values: [80, 60, 70, 40, 90] }],\n * },\n * })\n * ```\n */\nexport const radar: ChartType<RadarOptions> = {\n name: 'radar',\n clean: cleanData(cleanSeries),\n render: renderRadar,\n legend: (options) => seriesLegend(options.data),\n table: (options, ctx, limit) =>\n seriesTable(\n {\n data: options.data,\n ...(options.r?.format ? { y: { format: options.r.format } } : {}),\n ...(options.format ? { x: { format: options.format } } : {}),\n },\n ctx,\n limit,\n ),\n}\n"],"mappings":";;;;;;;;AAsEA,MAAM,YAAY;;AAElB,MAAM,aAAa;;AAGnB,MAAM,aAAa;;AAEnB,MAAM,YAAY;;AAGlB,SAAS,SAAS,MAAc,OAAe,UAA0B;CACvE,IAAI,kBAAkB,MAAM,QAAQ,KAAK,OAAO,OAAO;CACvD,IAAI,MAAM,KAAK;CACf,OAAO,MAAM,KAAK,kBAAkB,GAAG,KAAK,MAAM,GAAG,GAAG,EAAE,IAAI,QAAQ,IAAI,OAAO;CACjF,OAAO,MAAM,IAAI,GAAG,KAAK,MAAM,GAAG,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK;AACxD;;;;;;AAOA,SAAS,KAAK,MAAc,OAAe,UAA4B;CACrE,MAAM,QAAkB,CAAC;CACzB,IAAI,OAAO;CACX,KAAK,MAAM,QAAQ,KAAK,MAAM,GAAG,GAAG;EAClC,MAAM,OAAO,OAAO,GAAG,KAAK,GAAG,SAAS;EACxC,IAAI,CAAC,QAAQ,kBAAkB,MAAM,QAAQ,KAAK,OAAO,OAAO;OAC3D;GACH,MAAM,KAAK,IAAI;GACf,OAAO;EACT;CACF;CACA,MAAM,KAAK,IAAI;CACf,IAAI,MAAM,SAAS,WACjB,MAAM,OAAO,GAAe,MAAM,QAAQ,MAAM,MAAM,CAAa,CAAC,CAAC,KAAK,GAAG,CAAC;CAChF,OAAO;AACT;;AAGA,MAAM,QAAQ,QAA6B,MAAM,KAAM,IAAI,MAAM,MAAO,KAAK;;;;;AAM7E,SAAS,UACP,MACA,QACA,QACA,UACQ;CACR,IAAI,SAAS,KAAK,IAAI,KAAK,OAAO,KAAK,MAAM,IAAI;CACjD,OAAO,SAAS,OAAO,MAA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O,EAAE,IAAI,CAAC;CAC5D,GACA,KACA,KACF;AACJ"}
@@ -1,6 +1,6 @@
1
- import { Q as CartesianData, a as ChartType, tt as Label } from "./chart-QilhWP8Z.js";
1
+ import { o as ChartType, pt as Label, ut as CartesianData } from "./chart-CE9EVbfV.js";
2
2
  import { c as NumberFormat } from "./time-DRIDgv2a.js";
3
- import { a as InsetsInput } from "./annotations-B02GR_KU.js";
3
+ import { n as InsetsInput } from "./layout-CYerDebD.js";
4
4
  /** Options for the radial value axis. */
5
5
  interface RadialAxisOptions {
6
6
  /** Render the value labels along the first spoke. Defaults to `true`. */
@@ -1,6 +1,6 @@
1
- import { a as ChartType, at as Label, nt as CartesianData } from "./chart-kqFMEwDo.cjs";
1
+ import { _t as Label, mt as CartesianData, o as ChartType } from "./chart-Dz4geQZy.cjs";
2
2
  import { c as NumberFormat } from "./time-B4oxWHQI.cjs";
3
- import { a as InsetsInput } from "./annotations-CHafaGd4.cjs";
3
+ import { n as InsetsInput } from "./layout-CYerDebD.cjs";
4
4
  /** Options for the radial value axis. */
5
5
  interface RadialAxisOptions {
6
6
  /** Render the value labels along the first spoke. Defaults to `true`. */
@@ -1,6 +1,7 @@
1
- const require_cartesian = require("./cartesian-DV02PsBe.cjs");
1
+ const require_axis = require("./axis-BzBkkC5X.cjs");
2
2
  const require_format = require("./format-CAE5ruy6.cjs");
3
- const require_layout = require("./layout-JY2aR-yE.cjs");
3
+ const require_layout = require("./layout-Cfg9x1k2.cjs");
4
+ const require_cartesian = require("./cartesian-B9CrasFJ.cjs");
4
5
  const require_vnode = require("./vnode-ClAiw28x.cjs");
5
6
  const require_clean = require("./clean-Die2iCNc.cjs");
6
7
  // src/charts/radar.ts
@@ -98,7 +99,7 @@ function renderRadar(options, ctx) {
98
99
  const values = visible.flatMap((s) => s.values);
99
100
  const domain = require_cartesian.domainOf(values, axis, true, count);
100
101
  const scale = require_cartesian.linear(domain, [0, radius], { clamp: true });
101
- const ticks = require_cartesian.linearTicks(scale, {
102
+ const ticks = require_axis.linearTicks(scale, {
102
103
  count,
103
104
  format: axis.format,
104
105
  locale
@@ -141,7 +142,8 @@ function renderRadar(options, ctx) {
141
142
  height: radius * 2
142
143
  },
143
144
  items,
144
- guide: {
145
+ highlight: {
146
+ kind: "spoke",
145
147
  x1: cx,
146
148
  y1: cy,
147
149
  x2,
@@ -164,7 +166,6 @@ function renderRadar(options, ctx) {
164
166
  return hit;
165
167
  }
166
168
  };
167
- ctx.onHitTest(interaction);
168
169
  const grid = require_vnode.h("g", {
169
170
  key: "grid",
170
171
  class: "tc-radar-grid",
@@ -184,6 +185,7 @@ function renderRadar(options, ctx) {
184
185
  y2: require_layout.round(y2)
185
186
  });
186
187
  }));
188
+ const shape = require_cartesian.markerShape(options);
187
189
  const groups = series.map((s, index) => {
188
190
  if (ctx.hidden.has(require_cartesian.seriesKey(s))) return null;
189
191
  const d = polygon(labels.map((_, i) => radiusOf(s.values[i])));
@@ -197,13 +199,7 @@ function renderRadar(options, ctx) {
197
199
  const v = s.values[i];
198
200
  if (v == null || !Number.isFinite(v)) return null;
199
201
  const [x, y] = at(i, scale(v));
200
- return require_vnode.h("circle", {
201
- key: require_cartesian.labelKey(label),
202
- class: "tc-point",
203
- cx: require_layout.round(x),
204
- cy: require_layout.round(y),
205
- r: pointRadius
206
- });
202
+ return require_cartesian.pointMark(shape, index, require_cartesian.labelKey(label), "tc-point", require_layout.round(x), require_layout.round(y), pointRadius);
207
203
  })));
208
204
  });
209
205
  const spokeLabels = require_vnode.h("g", {
@@ -242,16 +238,19 @@ function renderRadar(options, ctx) {
242
238
  y: require_layout.round(cy - tick.position),
243
239
  dy: "0.35em"
244
240
  }, tick.label)));
245
- return [
246
- grid,
247
- require_vnode.h("g", {
248
- key: "series",
249
- class: "tc-series-list tc-radar-series",
250
- style: `transform-origin:${require_layout.round(cx)}px ${require_layout.round(cy)}px`
251
- }, groups),
252
- spokeLabels,
253
- valueLabels
254
- ];
241
+ return {
242
+ content: [
243
+ grid,
244
+ require_vnode.h("g", {
245
+ key: "series",
246
+ class: "tc-series-list tc-radar-series",
247
+ style: `transform-origin:${require_layout.round(cx)}px ${require_layout.round(cy)}px`
248
+ }, groups),
249
+ spokeLabels,
250
+ valueLabels
251
+ ],
252
+ interaction
253
+ };
255
254
  }
256
255
  /**
257
256
  * Radar (spider) chart: one spoke per label, the values of each series
@@ -286,4 +285,4 @@ Object.defineProperty(exports, "radar", {
286
285
  }
287
286
  });
288
287
 
289
- //# sourceMappingURL=radar-HPDrIdzc.cjs.map
288
+ //# sourceMappingURL=radar-wDyX17S3.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radar-wDyX17S3.cjs","names":["estimateTextWidth","LINE_HEIGHT","resolveLabels","seriesKey","formatDetail","insets","innerRect","tickCount","domainOf","linear","linearTicks","round","labelKey","h","markerShape","seriesAttrs","pointMark","cleanData","cleanSeries","seriesLegend","seriesTable"],"sources":["../src/charts/radar.ts"],"sourcesContent":["import type { ChartType, RenderContext, RenderResult } from '../chart.ts'\nimport { linearTicks } from '../components/axis.ts'\nimport { formatDetail, type NumberFormat } from '../format.ts'\nimport type { Hit, HitItem, Interaction } from '../interaction.ts'\nimport {\n estimateTextWidth,\n type InsetsInput,\n innerRect,\n insets,\n LINE_HEIGHT,\n round,\n} from '../layout.ts'\nimport { linear } from '../scales/linear.ts'\nimport { h } from '../vnode.ts'\nimport {\n type CartesianData,\n domainOf,\n type Label,\n labelKey,\n markerShape,\n pointMark,\n resolveLabels,\n seriesAttrs,\n seriesKey,\n seriesLegend,\n seriesTable,\n tickCount,\n} from './cartesian.ts'\nimport { cleanData, cleanSeries } from './clean.ts'\n\n/** Options for the radial value axis. */\nexport interface RadialAxisOptions {\n /** Render the value labels along the first spoke. Defaults to `true`. */\n show?: boolean\n /** Value at the center. Defaults to `0` (or the data minimum when it is negative). */\n min?: number\n /** Value at the outer ring. Defaults to the niced data maximum. */\n max?: number\n /** Extend the domain to round values. Defaults to `true`. */\n nice?: boolean\n /** Approximate number of rings. Defaults to one per ~40px of radius. */\n ticks?: number\n format?: NumberFormat\n}\n\nexport interface RadarOptions {\n /** One spoke per label, one polygon per series. */\n data: CartesianData\n /** The radial value axis. */\n r?: RadialAxisOptions\n /** Format of the spoke labels (axis, tooltips and the table). */\n format?: (label: Label, index: number) => string\n /** Shape of the rings. Defaults to `'polygon'`. */\n grid?: 'polygon' | 'circle'\n /** Fill each polygon. Defaults to `true`. */\n fill?: boolean\n /** Draw a dot on every value. Defaults to `false`. */\n points?: boolean\n /** Dot radius in pixels. Defaults to `4`. */\n pointRadius?: number\n /**\n * Widest spoke label, in pixels: a longer one wraps at its spaces onto up\n * to three lines. Defaults to a quarter of the chart's width.\n */\n labelWidth?: number\n /** Extra space around the chart, in pixels. */\n padding?: InsetsInput\n}\n\n/** Space between the outer ring and the spoke labels. */\nconst LABEL_GAP = 8\n/** Pixels around the outer ring that still count as hovering it. */\nconst HOVER_SLOP = 8\n\n/** Smallest radius, as a share of the space, however long the labels. */\nconst MIN_RADIUS = 0.5\n/** Most lines a wrapped spoke label takes. */\nconst MAX_LINES = 3\n\n/** `text`, cut short with an ellipsis to fit `width` pixels. */\nfunction truncate(text: string, width: number, fontSize: number): string {\n if (estimateTextWidth(text, fontSize) <= width) return text\n let end = text.length\n while (end > 0 && estimateTextWidth(`${text.slice(0, end)}…`, fontSize) > width) end--\n return end > 0 ? `${text.slice(0, end).trimEnd()}…` : ''\n}\n\n/**\n * `text` split at its spaces into lines no wider than `width` pixels (a word\n * wider than that gets a line of its own), at most `MAX_LINES` of them: what\n * is left joins the last line.\n */\nfunction wrap(text: string, width: number, fontSize: number): string[] {\n const lines: string[] = []\n let line = ''\n for (const word of text.split(' ')) {\n const next = line ? `${line} ${word}` : word\n if (!line || estimateTextWidth(next, fontSize) <= width) line = next\n else {\n lines.push(line)\n line = word\n }\n }\n lines.push(line)\n if (lines.length > MAX_LINES)\n lines.splice(MAX_LINES - 1, lines.length, lines.slice(MAX_LINES - 1).join(' '))\n return lines\n}\n\n/** Text anchor of a spoke label on the side its spoke points to. */\nconst side = (sin: number): -1 | 0 | 1 => (sin > 0.1 ? 1 : sin < -0.1 ? -1 : 0)\n\n/**\n * The largest radius at which every spoke label still fits in `area`:\n * labels sit beyond the outer ring, on the side their spoke points to.\n */\nfunction fitRadius(\n area: { width: number; height: number },\n angles: readonly number[],\n labels: readonly (readonly string[])[],\n fontSize: number,\n): number {\n let radius = Math.min(area.width, area.height) / 2\n angles.forEach((angle, i) => {\n const sin = Math.sin(angle)\n const cos = Math.cos(angle)\n const lines = labels[i] ?? []\n const w = Math.max(0, ...lines.map((line) => estimateTextWidth(line, fontSize)))\n const height = blockHeight(lines.length, fontSize)\n const s = side(sin)\n // Horizontal: the label runs outwards from the spoke end (or is centered on it).\n const across = s === 0 ? w / 2 : w + LABEL_GAP\n if (Math.abs(sin) > 1e-6) radius = Math.min(radius, (area.width / 2 - across) / Math.abs(sin))\n // Vertical: the lines of text above the top spokes, below the bottom ones,\n // centered on the ones at the sides.\n if (Math.abs(cos) > 1e-6) {\n const along = (s === 0 ? height + LABEL_GAP : height / 2) / Math.abs(cos)\n radius = Math.min(radius, area.height / 2 / Math.abs(cos) - along)\n }\n })\n return Math.max(0, radius)\n}\n\n/** Height of `lines` lines of text, in pixels. */\nconst blockHeight = (lines: number, fontSize: number) =>\n fontSize * (1 + Math.max(0, lines - 1) * LINE_HEIGHT)\n\nfunction renderRadar(options: RadarOptions, ctx: RenderContext): RenderResult {\n const { width, height, fontSize, locale } = ctx\n const axis = options.r ?? {}\n const { fill = true, points = false, pointRadius = 4 } = options\n const series = options.data.series\n const labels = resolveLabels(options.data)\n const n = labels.length\n const visible = series.filter((s) => !ctx.hidden.has(seriesKey(s)))\n const formatLabel = options.format ?? ((label: Label) => String(label))\n const formatValue = formatDetail(axis.format, locale)\n\n const pad = insets(options.padding)\n const area = innerRect(width, height, {\n top: pad.top + LABEL_GAP,\n right: pad.right + LABEL_GAP,\n bottom: pad.bottom + LABEL_GAP,\n left: pad.left + LABEL_GAP,\n })\n const cx = area.x + area.width / 2\n const cy = area.y + area.height / 2\n const angles = labels.map((_, i) => (i / Math.max(1, n)) * Math.PI * 2)\n const texts = labels.map((label, i) => formatLabel(label, i))\n // Long labels wrap onto a few lines, then the radius fits them, but never\n // shrinks below a share of the space: lines that still do not fit are cut\n // short (the tooltip and the table keep the labels whole).\n const labelWidth = options.labelWidth ?? area.width / 4\n const wrapped = texts.map((text) => wrap(text, labelWidth, fontSize))\n const radius = Math.max(\n fitRadius(area, angles, wrapped, fontSize),\n (Math.min(area.width, area.height) / 2) * MIN_RADIUS,\n )\n const shown = wrapped.map((lines, i) => {\n const sin = Math.sin(angles[i] as number)\n const room = side(sin) === 0 ? area.width : area.width / 2 - radius * Math.abs(sin) - LABEL_GAP\n return lines.map((line) => truncate(line, room, fontSize))\n })\n\n const count = tickCount(axis, Math.max(2, Math.round(radius / 40)))\n const values = visible.flatMap((s) => s.values)\n const domain = domainOf(values, axis, true, count)\n const scale = linear(domain, [0, radius], { clamp: true })\n const ticks = linearTicks(scale, { count, format: axis.format, locale })\n\n /** Point at `r` pixels from the center along spoke `i`. */\n const at = (i: number, r: number): [number, number] => [\n cx + r * Math.sin(angles[i] as number),\n cy - r * Math.cos(angles[i] as number),\n ]\n /** A closed path through one radius per spoke (the same commands for any values). */\n const polygon = (radii: readonly number[]) =>\n `${radii.map((r, i) => `${i ? 'L' : 'M'}${at(i, r).map(round).join(',')}`).join('')}Z`\n const ring = (r: number) =>\n options.grid === 'circle'\n ? `M${round(cx)},${round(cy - r)}A${round(r)},${round(r)},0,1,1,${round(cx)},${round(cy + r)}A${round(r)},${round(r)},0,1,1,${round(cx)},${round(cy - r)}Z`\n : polygon(labels.map(() => r))\n /** Pixel radius of a value; missing values sit at the center. */\n const radiusOf = (v: number | null | undefined) =>\n v != null && Number.isFinite(v) ? scale(v) : 0\n\n const hitAt = (index: number): Hit => {\n const items: HitItem[] = []\n series.forEach((s, seriesIndex) => {\n if (ctx.hidden.has(seriesKey(s))) return\n const raw = s.values[index]\n const value = raw != null && Number.isFinite(raw) ? raw : null\n const [x, y] = at(index, radiusOf(value))\n const item: HitItem = {\n name: s.name,\n seriesIndex,\n value,\n text: value === null ? '–' : formatValue(value),\n x,\n y: value === null ? null : y,\n }\n if (s.color) item.color = s.color\n items.push(item)\n })\n const [x2, y2] = at(index, radius)\n return {\n index,\n label: labelKey(labels[index] as Label),\n title: texts[index] as string,\n x: x2,\n area: { x: cx - radius, y: cy - radius, width: radius * 2, height: radius * 2 },\n items,\n highlight: { kind: 'spoke', x1: cx, y1: cy, x2, y2 },\n }\n }\n\n const interaction: Interaction = {\n count: n,\n hitTest(px, py) {\n if (n === 0 || Math.hypot(px - cx, py - cy) > radius + HOVER_SLOP) return null\n // The nearest spoke by angle, clockwise from 12 o'clock.\n const angle = Math.atan2(px - cx, cy - py)\n const turn = (angle < 0 ? angle + Math.PI * 2 : angle) / (Math.PI * 2)\n return hitAt(Math.round(turn * n) % n)\n },\n hitIndex(index, seriesIndex) {\n if (index < 0 || index >= n) return null\n const hit = hitAt(index)\n if (seriesIndex !== undefined && hit.items.some((item) => item.seriesIndex === seriesIndex)) {\n hit.seriesIndex = seriesIndex\n }\n return hit\n },\n }\n\n const grid = h(\n 'g',\n { key: 'grid', class: 'tc-radar-grid', 'aria-hidden': 'true' },\n ticks\n .filter((tick) => tick.position > 0)\n .map((tick) =>\n h('path', { key: tick.value, class: 'tc-radar-ring', d: ring(tick.position) }),\n ),\n labels.map((label, i) => {\n const [x2, y2] = at(i, radius)\n return h('line', {\n key: labelKey(label),\n class: 'tc-radar-spoke',\n x1: round(cx),\n y1: round(cy),\n x2: round(x2),\n y2: round(y2),\n })\n }),\n )\n\n const shape = markerShape(options)\n const groups = series.map((s, index) => {\n if (ctx.hidden.has(seriesKey(s))) return null\n const d = polygon(labels.map((_, i) => radiusOf(s.values[i])))\n return h(\n 'g',\n seriesAttrs(s, index),\n fill && h('path', { class: 'tc-area', d }),\n h('path', { class: 'tc-line', d }),\n points &&\n h(\n 'g',\n { class: 'tc-points' },\n labels.map((label, i) => {\n const v = s.values[i]\n if (v == null || !Number.isFinite(v)) return null\n const [x, y] = at(i, scale(v))\n return pointMark(\n shape,\n index,\n labelKey(label),\n 'tc-point',\n round(x),\n round(y),\n pointRadius,\n )\n }),\n ),\n )\n })\n\n const spokeLabels = h(\n 'g',\n { key: 'labels', class: 'tc-radar-labels', 'aria-hidden': 'true' },\n labels.map((label, i) => {\n const angle = angles[i] as number\n const s = side(Math.sin(angle))\n const cos = Math.cos(angle)\n const [x, y] = at(i, radius + LABEL_GAP)\n const [first = '', ...rest] = shown[i] ?? []\n // Above the top spokes, below the bottom ones, centered on the sides:\n // the first line moves up to leave room for the ones under it.\n const up = rest.length * LINE_HEIGHT\n const dy = s !== 0 ? `${round(0.35 - up / 2)}em` : cos > 0 ? `${round(-up)}em` : '0.71em'\n return h(\n 'text',\n {\n key: labelKey(label),\n class: 'tc-tick-label tc-radar-label',\n x: round(x),\n y: round(y),\n 'text-anchor': s > 0 ? 'start' : s < 0 ? 'end' : 'middle',\n dy,\n },\n first,\n rest.map((line, j) => h('tspan', { key: j, x: round(x), dy: `${LINE_HEIGHT}em` }, line)),\n )\n }),\n )\n\n const valueLabels =\n axis.show !== false &&\n h(\n 'g',\n { key: 'values', class: 'tc-radar-values', 'aria-hidden': 'true' },\n ticks\n .filter((tick) => tick.position > 0)\n .map((tick) =>\n h(\n 'text',\n {\n key: tick.value,\n class: 'tc-tick-label tc-radar-value',\n x: round(cx + 4),\n y: round(cy - tick.position),\n dy: '0.35em',\n },\n tick.label,\n ),\n ),\n )\n\n const content = [\n grid,\n // Series grow from the center: the transform origin is set here, in pixels.\n h(\n 'g',\n {\n key: 'series',\n class: 'tc-series-list tc-radar-series',\n style: `transform-origin:${round(cx)}px ${round(cy)}px`,\n },\n groups,\n ),\n spokeLabels,\n valueLabels,\n ]\n return { content, interaction }\n}\n\n/**\n * Radar (spider) chart: one spoke per label, the values of each series\n * joined into a polygon around the center. Good for comparing a few series\n * over the same handful of measures.\n *\n * ```ts\n * new Chart('#el', {\n * type: radar,\n * data: {\n * labels: ['Speed', 'Range', 'Comfort', 'Price', 'Safety'],\n * series: [{ name: 'Model A', values: [80, 60, 70, 40, 90] }],\n * },\n * })\n * ```\n */\nexport const radar: ChartType<RadarOptions> = {\n name: 'radar',\n clean: cleanData(cleanSeries),\n render: renderRadar,\n legend: (options) => seriesLegend(options.data),\n table: (options, ctx, limit) =>\n seriesTable(\n {\n data: options.data,\n ...(options.r?.format ? { y: { format: options.r.format } } : {}),\n ...(options.format ? { x: { format: options.format } } : {}),\n },\n ctx,\n limit,\n ),\n}\n"],"mappings":";;;;;;;;AAsEA,MAAM,YAAY;;AAElB,MAAM,aAAa;;AAGnB,MAAM,aAAa;;AAEnB,MAAM,YAAY;;AAGlB,SAAS,SAAS,MAAc,OAAe,UAA0B;CACvE,IAAIA,eAAAA,kBAAkB,MAAM,QAAQ,KAAK,OAAO,OAAO;CACvD,IAAI,MAAM,KAAK;CACf,OAAO,MAAM,KAAKA,eAAAA,kBAAkB,GAAG,KAAK,MAAM,GAAG,GAAG,EAAE,IAAI,QAAQ,IAAI,OAAO;CACjF,OAAO,MAAM,IAAI,GAAG,KAAK,MAAM,GAAG,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK;AACxD;;;;;;AAOA,SAAS,KAAK,MAAc,OAAe,UAA4B;CACrE,MAAM,QAAkB,CAAC;CACzB,IAAI,OAAO;CACX,KAAK,MAAM,QAAQ,KAAK,MAAM,GAAG,GAAG;EAClC,MAAM,OAAO,OAAO,GAAG,KAAK,GAAG,SAAS;EACxC,IAAI,CAAC,QAAQA,eAAAA,kBAAkB,MAAM,QAAQ,KAAK,OAAO,OAAO;OAC3D;GACH,MAAM,KAAK,IAAI;GACf,OAAO;EACT;CACF;CACA,MAAM,KAAK,IAAI;CACf,IAAI,MAAM,SAAS,WACjB,MAAM,OAAO,GAAe,MAAM,QAAQ,MAAM,MAAM,CAAa,CAAC,C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,WAAW,CAAC,CAAC,CACnC,KAAK,SACJA,cAAAA,EACE,QACA;EACE,KAAK,KAAK;EACV,OAAO;EACP,GAAGF,eAAAA,MAAM,KAAK,CAAC;EACf,GAAGA,eAAAA,MAAM,KAAK,KAAK,QAAQ;EAC3B,IAAI;CACN,GACA,KAAK,KACP,CACF,CACJ;CAiBF,OAAO;EAAE,SAAA;GAdP;GAEAE,cAAAA,EACE,KACA;IACE,KAAK;IACL,OAAO;IACP,OAAO,oBAAoBF,eAAAA,MAAM,EAAE,EAAE,KAAKA,eAAAA,MAAM,EAAE,EAAE;GACtD,GACA,MACF;GACA;GACA;EAEa;EAAG;CAAY;AAChC;;;;;;;;;;;;;;;;AAiBA,MAAa,QAAiC;CAC5C,MAAM;CACN,OAAOM,cAAAA,UAAUC,cAAAA,WAAW;CAC5B,QAAQ;CACR,SAAS,YAAYC,kBAAAA,aAAa,QAAQ,IAAI;CAC9C,QAAQ,SAAS,KAAK,UACpBC,kBAAAA,YACE;EACE,MAAM,QAAQ;EACd,GAAI,QAAQ,GAAG,SAAS,EAAE,GAAG,EAAE,QAAQ,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC;EAC/D,GAAI,QAAQ,SAAS,EAAE,GAAG,EAAE,QAAQ,QAAQ,OAAO,EAAE,IAAI,CAAC;CAC5D,GACA,KACA,KACF;AACJ"}
package/dist/radar.cjs CHANGED
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_radar = require("./radar-HPDrIdzc.cjs");
2
+ const require_radar = require("./radar-wDyX17S3.cjs");
3
3
  exports.radar = require_radar.radar;
package/dist/radar.d.cts CHANGED
@@ -1,3 +1,3 @@
1
1
  /** Standalone entry: `import { radar } from '@tabler/charts/radar'`. */
2
- import { n as RadialAxisOptions, r as radar, t as RadarOptions } from "./radar-D1-lItDy.cjs";
2
+ import { n as RadialAxisOptions, r as radar, t as RadarOptions } from "./radar-DxmjXhMc.cjs";
3
3
  export { type RadarOptions, type RadialAxisOptions, radar };
package/dist/radar.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /** Standalone entry: `import { radar } from '@tabler/charts/radar'`. */
2
- import { n as RadialAxisOptions, r as radar, t as RadarOptions } from "./radar-BC9Skgpj.js";
2
+ import { n as RadialAxisOptions, r as radar, t as RadarOptions } from "./radar-DEer2jjd.js";
3
3
  export { type RadarOptions, type RadialAxisOptions, radar };
package/dist/radar.js CHANGED
@@ -1 +1 @@
1
- export { t as radar } from "./radar-BR-mumDd.js";
1
+ export { t as radar } from "./radar-Bg-IiIWB.js";
@@ -0,0 +1,348 @@
1
+ const require_axis = require("./axis-BzBkkC5X.cjs");
2
+ const require_features = require("./features-DEDP5CEQ.cjs");
3
+ const require_format = require("./format-CAE5ruy6.cjs");
4
+ const require_layout = require("./layout-Cfg9x1k2.cjs");
5
+ const require_cartesian = require("./cartesian-B9CrasFJ.cjs");
6
+ const require_extent = require("./extent-DuYDcvM9.cjs");
7
+ const require_rect = require("./rect-DPr9QRxl.cjs");
8
+ const require_vnode = require("./vnode-ClAiw28x.cjs");
9
+ const require_clean = require("./clean-Die2iCNc.cjs");
10
+ // src/charts/range-bar.ts
11
+ /** The shortest bar drawn, in pixels: a range with no length (a milestone) still shows. */
12
+ const MIN_LENGTH = 2;
13
+ /** Pixels around the plot area that still count as hovering it. */
14
+ const HOVER_SLOP = 8;
15
+ const DAY = 864e5;
16
+ /** A value in axis units (milliseconds on a time axis), or `null` when it has no place there. */
17
+ const position = (value, timed) => {
18
+ if (!timed) return require_clean.finite(value);
19
+ const ms = require_cartesian.toMs(value);
20
+ return Number.isFinite(ms) ? ms : null;
21
+ };
22
+ function prepare(options) {
23
+ const timed = options.x?.type === "time";
24
+ const rows = [];
25
+ const index = /* @__PURE__ */ new Map();
26
+ const seen = /* @__PURE__ */ new Map();
27
+ const bars = [];
28
+ for (const item of options.data) {
29
+ const a = position(item.from, timed);
30
+ const b = position(item.to, timed);
31
+ if (a === null || b === null) continue;
32
+ let row = index.get(item.name);
33
+ if (row === void 0) {
34
+ row = rows.length;
35
+ index.set(item.name, row);
36
+ rows.push(item.name);
37
+ }
38
+ const base = item.id ?? item.name;
39
+ const nth = seen.get(base) ?? 0;
40
+ seen.set(base, nth + 1);
41
+ bars.push({
42
+ item,
43
+ key: nth ? `${base}/${nth}` : base,
44
+ row,
45
+ from: Math.min(a, b),
46
+ to: Math.max(a, b)
47
+ });
48
+ }
49
+ return {
50
+ ...options,
51
+ timed,
52
+ rows,
53
+ bars
54
+ };
55
+ }
56
+ /** How the ends of the ranges read in tooltips and the table. */
57
+ function valueFormat(model, locale) {
58
+ const { format, utc } = model.x ?? {};
59
+ if (!model.timed) return require_format.formatDetail(format, locale);
60
+ if (typeof format === "function") return format;
61
+ const [lo, hi] = require_extent.extent(model.bars.flatMap((bar) => [bar.from, bar.to])) ?? [0, 0];
62
+ const date = require_features.feature("dates")([lo, hi], utc, locale);
63
+ return (value) => date(value);
64
+ }
65
+ /**
66
+ * The annotations as the cartesian layers read them: there `y` is a value
67
+ * on the value axis and `x` a category, here `x` runs along the ranges and
68
+ * `y` names rows.
69
+ */
70
+ function annotationsOf(model) {
71
+ const at = (v) => position(v, model.timed);
72
+ return require_clean.list(model.annotations).filter(require_clean.isRecord).flatMap((a) => {
73
+ const { x, y, ...rest } = a;
74
+ const out = { ...rest };
75
+ if (x !== void 0) {
76
+ const ends = Array.isArray(x) ? x.map(at) : at(x);
77
+ if (ends === null || Array.isArray(ends) && (ends.length !== 2 || ends.includes(null))) return [];
78
+ out.y = ends;
79
+ }
80
+ if (y !== void 0) out.x = typeof y === "string" && (x === void 0 || Array.isArray(x)) ? [y, y] : y;
81
+ return [out];
82
+ });
83
+ }
84
+ /** The range axis before the plot is placed: its domain and the ticks of a scale over it. */
85
+ function rangeAxis(model, ctx, extra) {
86
+ const options = model.x ?? {};
87
+ const count = require_cartesian.tickCount(options, Math.max(2, Math.round(ctx.width / 80)));
88
+ const values = [...model.bars.flatMap((bar) => [bar.from, bar.to]), ...extra];
89
+ const min = position(options.min, model.timed);
90
+ const max = position(options.max, model.timed);
91
+ if (!model.timed) {
92
+ const { format } = options;
93
+ const bounds = {
94
+ ...min === null ? {} : { min },
95
+ ...max === null ? {} : { max }
96
+ };
97
+ const domain = require_cartesian.domainOf(values, {
98
+ ...bounds,
99
+ nice: options.nice !== false
100
+ }, false, count);
101
+ return {
102
+ domain,
103
+ ticks: (range) => require_axis.linearTicks(require_cartesian.linear(domain, range), {
104
+ count,
105
+ format,
106
+ locale: ctx.locale
107
+ })
108
+ };
109
+ }
110
+ const time = require_features.feature("time").scale;
111
+ const utc = options.utc === true;
112
+ let [lo, hi] = require_extent.extent(values) ?? [0, DAY];
113
+ if (lo === hi) {
114
+ lo -= DAY / 2;
115
+ hi += DAY / 2;
116
+ }
117
+ if (min !== null) lo = min;
118
+ if (max !== null) hi = max;
119
+ if (options.nice !== false) for (let pass = 0; pass < 2; pass++) {
120
+ const [nlo, nhi] = time([lo, hi], [0, 1], { utc }).nice(count).domain;
121
+ if (min === null) lo = nlo;
122
+ if (max === null) hi = nhi;
123
+ }
124
+ const domain = [lo, hi];
125
+ const { format } = options;
126
+ return {
127
+ domain,
128
+ ticks(range) {
129
+ const scale = time(domain, range, { utc });
130
+ const text = typeof format === "function" ? (date) => format(date.getTime()) : scale.tickFormat(count, ctx.locale);
131
+ return scale.ticks(count).map((date) => ({
132
+ value: date.getTime(),
133
+ position: scale(date),
134
+ label: text(date)
135
+ }));
136
+ }
137
+ };
138
+ }
139
+ function renderRangeBar(model, ctx) {
140
+ const { radius = 4, maxBarWidth = 24, groupPadding = .3, rows, bars } = model;
141
+ const { fontSize } = ctx;
142
+ const xOptions = model.x ?? {};
143
+ const yOptions = model.y ?? {};
144
+ const annotations = annotationsOf(model);
145
+ const axis = rangeAxis(model, ctx, annotations.flatMap((a) => a.y === void 0 ? [] : a.y));
146
+ const showValues = xOptions.show !== false;
147
+ const showRows = yOptions.show !== false && rows.length > 0;
148
+ const probe = axis.ticks([0, 1]);
149
+ const names = rows.map((name) => ({
150
+ value: name,
151
+ position: 0,
152
+ label: name
153
+ }));
154
+ const edgeLabel = (tick) => showValues && tick ? Math.ceil(require_layout.estimateTextWidth(tick.label, fontSize) / 2) : 0;
155
+ const { area, side, range } = require_layout.plotFrame(ctx, model.padding, (pad) => ({
156
+ top: pad.top + 4,
157
+ bottom: pad.bottom + Math.max((showValues ? require_axis.axisSize("bottom", probe, fontSize) : 0) + require_axis.axisTitleSize(xOptions.title, fontSize), 4),
158
+ start: pad.start + Math.max((showRows ? require_axis.axisSize("left", names, fontSize) : 0) + require_axis.axisTitleSize(yOptions.title, fontSize), edgeLabel(probe[0]), 8),
159
+ end: pad.end + Math.max(edgeLabel(probe[probe.length - 1]), 8)
160
+ }));
161
+ const across = require_cartesian.band(rows, [area.y, area.y + area.height], {
162
+ paddingInner: groupPadding,
163
+ paddingOuter: groupPadding / 2
164
+ });
165
+ const along = require_cartesian.linear(axis.domain, range());
166
+ const valueTicks = require_axis.thinTicks(axis.ticks(along.range), "bottom", fontSize);
167
+ const rowTicks = showRows ? require_axis.thinTicks(require_axis.bandTicks(across), "left", fontSize) : [];
168
+ const cartesian = {
169
+ data: { series: [] },
170
+ x: {
171
+ show: yOptions.show !== false,
172
+ grid: yOptions.grid === true,
173
+ title: yOptions.title
174
+ },
175
+ y: {
176
+ show: showValues,
177
+ grid: xOptions.grid !== false,
178
+ title: xOptions.title
179
+ },
180
+ annotations
181
+ };
182
+ const layout = require_cartesian.finishLayout(cartesian, ctx, side, 0, {
183
+ area,
184
+ labels: rows,
185
+ x: across,
186
+ y: along,
187
+ horizontal: true,
188
+ xTicks: rowTicks,
189
+ yTicks: valueTicks
190
+ }, rows);
191
+ const thickness = Math.max(1, Math.min(maxBarWidth, across.bandwidth));
192
+ const top = (bar) => across.at(bar.row) + (across.bandwidth - thickness) / 2;
193
+ /** The bar's ends in pixels, left first. */
194
+ const ends = (bar) => {
195
+ const a = along(bar.from);
196
+ const b = along(bar.to);
197
+ const lo = Math.min(a, b);
198
+ const hi = Math.max(a, b);
199
+ if (hi - lo >= MIN_LENGTH) return [lo, hi];
200
+ const mid = (lo + hi) / 2;
201
+ return [mid - MIN_LENGTH / 2, mid + MIN_LENGTH / 2];
202
+ };
203
+ const text = valueFormat(model, ctx.locale);
204
+ const hitFor = (i) => {
205
+ const bar = bars[i];
206
+ const [lo, hi] = ends(bar);
207
+ const y = top(bar);
208
+ const item = {
209
+ name: bar.item.name,
210
+ seriesIndex: 0,
211
+ value: bar.to - bar.from,
212
+ text: `${text(bar.from)} – ${text(bar.to)}`,
213
+ x: ctx.rtl ? lo : hi,
214
+ y: y + thickness / 2,
215
+ box: {
216
+ x: lo,
217
+ y,
218
+ width: hi - lo,
219
+ height: thickness
220
+ }
221
+ };
222
+ if (bar.item.color) item.color = bar.item.color;
223
+ return {
224
+ index: i,
225
+ label: bar.item.name,
226
+ title: "",
227
+ x: (lo + hi) / 2,
228
+ y: across.at(bar.row) + across.bandwidth / 2,
229
+ axis: "y",
230
+ area,
231
+ items: [item],
232
+ highlight: {
233
+ kind: "band",
234
+ x: area.x,
235
+ y: across.at(bar.row),
236
+ width: area.width,
237
+ height: across.bandwidth
238
+ }
239
+ };
240
+ };
241
+ const interaction = {
242
+ count: bars.length,
243
+ hitIndex: (i) => i >= 0 && i < bars.length ? hitFor(i) : null,
244
+ hitTest(px, py) {
245
+ if (px < area.x - HOVER_SLOP || px > area.x + area.width + HOVER_SLOP || py < area.y - HOVER_SLOP || py > area.y + area.height + HOVER_SLOP) return null;
246
+ const row = across.indexAt(py);
247
+ let found = -1;
248
+ let nearest = Number.POSITIVE_INFINITY;
249
+ bars.forEach((bar, i) => {
250
+ if (bar.row !== row) return;
251
+ const [lo, hi] = ends(bar);
252
+ const distance = Math.max(lo - px, px - hi, 0);
253
+ if (distance <= nearest) {
254
+ nearest = distance;
255
+ found = i;
256
+ }
257
+ });
258
+ if (found < 0) return null;
259
+ const hit = hitFor(found);
260
+ if (nearest === 0) hit.seriesIndex = 0;
261
+ return hit;
262
+ }
263
+ };
264
+ const marks = bars.map((bar) => {
265
+ const [lo, hi] = ends(bar);
266
+ return require_vnode.h("path", {
267
+ key: bar.key,
268
+ class: [
269
+ "tc-bar",
270
+ "tc-bar-horizontal",
271
+ "tc-range-bar",
272
+ bar.item.class
273
+ ],
274
+ "data-series": bar.item.name,
275
+ d: require_rect.rectPath(lo, top(bar), hi - lo, thickness, Math.max(0, radius)),
276
+ style: { "--tc-series-color": bar.item.color }
277
+ });
278
+ });
279
+ return {
280
+ content: [
281
+ require_vnode.h("defs", { key: "defs" }, layout.clip.def),
282
+ layout.background,
283
+ require_vnode.h("g", {
284
+ key: "series",
285
+ class: "tc-series-list tc-range-bars",
286
+ "clip-path": layout.clip.url
287
+ }, require_vnode.h("g", { class: "tc-series tc-series-1" }, marks)),
288
+ layout.foreground
289
+ ],
290
+ interaction
291
+ };
292
+ }
293
+ function rangeBarTable(model, ctx, limit) {
294
+ const text = valueFormat(model, ctx.locale);
295
+ const { bars } = model;
296
+ const shown = bars.length > limit ? bars.slice(0, limit) : bars;
297
+ return {
298
+ columns: [
299
+ "",
300
+ "From",
301
+ "To"
302
+ ],
303
+ total: bars.length,
304
+ rows: shown.map((bar) => [
305
+ bar.item.name,
306
+ text(bar.from),
307
+ text(bar.to)
308
+ ])
309
+ };
310
+ }
311
+ /** Ranges with text for names; ends that are no number or date are left for `prepare` to drop. */
312
+ const cleanRanges = (data) => require_clean.records(data, (r) => ({
313
+ ...require_clean.named(r),
314
+ from: require_clean.label(r.from),
315
+ to: require_clean.label(r.to)
316
+ }));
317
+ /**
318
+ * Range bar (timeline) chart: one row per name with a bar from `from` to
319
+ * `to`, along a time axis (a roadmap, a schedule) or a number axis (floating
320
+ * bars: salary bands, temperature ranges). Ranges with the same name share
321
+ * a row.
322
+ *
323
+ * ```ts
324
+ * new Chart('#el', {
325
+ * type: rangeBar,
326
+ * data: [
327
+ * { name: 'Research', from: '2026-01-05', to: '2026-02-10' },
328
+ * { name: 'Design', from: '2026-02-01', to: '2026-03-15' },
329
+ * ],
330
+ * x: { type: 'time' },
331
+ * })
332
+ * ```
333
+ */
334
+ const rangeBar = {
335
+ name: "range-bar",
336
+ clean: require_clean.cleanData(cleanRanges),
337
+ prepare,
338
+ render: renderRangeBar,
339
+ table: rangeBarTable
340
+ };
341
+ Object.defineProperty(exports, "rangeBar", {
342
+ enumerable: true,
343
+ get: function() {
344
+ return rangeBar;
345
+ }
346
+ });
347
+
348
+ //# sourceMappingURL=range-bar-BnKjJP89.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range-bar-BnKjJP89.cjs","names":["finite","toMs","formatDetail","extent","feature","list","isRecord","tickCount","domainOf","linearTicks","linear","estimateTextWidth","plotFrame","axisSize","axisTitleSize","band","thinTicks","bandTicks","finishLayout","h","rectPath","records","named","label","cleanData"],"sources":["../src/charts/range-bar.ts"],"sourcesContent":["import type { DataTable } from '../a11y.ts'\nimport type { ChartType, RenderContext, RenderResult, TableContext } from '../chart.ts'\nimport {\n axisSize,\n axisTitleSize,\n bandTicks,\n linearTicks,\n type Tick,\n thinTicks,\n} from '../components/axis.ts'\nimport { feature } from '../features.ts'\nimport { formatDetail, type Locale, type NumberFormat } from '../format.ts'\nimport type { Hit, HitItem, Interaction } from '../interaction.ts'\nimport { estimateTextWidth, type InsetsInput, plotFrame } from '../layout.ts'\nimport { band } from '../scales/band.ts'\nimport { extent } from '../scales/extent.ts'\nimport { linear } from '../scales/linear.ts'\nimport { rectPath } from '../shapes/rect.ts'\nimport { type ClassValue, h } from '../vnode.ts'\nimport type { Annotation } from './annotations.ts'\nimport {\n type CartesianOptions,\n domainOf,\n EDGE,\n finishLayout,\n TICK_SPACING_X,\n tickCount,\n toMs,\n} from './cartesian.ts'\nimport { cleanData, finite, isRecord, label, list, named, records } from './clean.ts'\n\n/** Where a range starts or ends: a number, or a date (a `Date`, a timestamp, an ISO string) on a time axis. */\nexport type RangeValue = number | string | Date\n\n/** One range: a bar from `from` to `to`, in the row of its `name`. */\nexport interface RangeBarItem {\n /** The row of the range; ranges with the same name share a row. */\n name: string\n from: RangeValue\n to: RangeValue\n /** Stable identity for keyed updates. Defaults to `name`. */\n id?: string\n /**\n * Custom color; overrides the palette slot via `--tc-series-color`.\n * Values that could inject CSS (`;`, quotes, `url()` …) are ignored, so colors from user data are safe.\n */\n color?: string\n /** Extra classes on the bar. */\n class?: ClassValue\n}\n\n/** Options for the axis the ranges run along (at the bottom). */\nexport interface RangeAxisOptions {\n /**\n * `'time'` reads `from` and `to` as dates or timestamps and draws\n * calendar-aware ticks. Needs `@tabler/charts/time` (included in\n * `@tabler/charts`). Defaults to `'linear'`: plain numbers.\n */\n type?: 'linear' | 'time'\n /** Align time ticks to UTC instead of local time (use it for SSR). */\n utc?: boolean\n /** Render the axis labels. Defaults to `true`. */\n show?: boolean\n /** Title of the axis, below its labels. */\n title?: string\n /** Render vertical grid lines. Defaults to `true`. */\n grid?: boolean\n /** Fixed lower bound; overrides the data. */\n min?: RangeValue\n /** Fixed upper bound. */\n max?: RangeValue\n /** Extend the domain to round tick values. Defaults to `true`. */\n nice?: boolean\n /** Approximate tick count. Defaults to one per ~80px of width. */\n ticks?: number\n /**\n * Format of the values (ticks, tooltip, table). On a time axis only a\n * function counts: it gets the timestamp in milliseconds.\n */\n format?: NumberFormat\n}\n\n/** Options for the axis of the rows (beside the plot). */\nexport interface RangeRowAxisOptions {\n /** Render the row names. Defaults to `true`. */\n show?: boolean\n /** Title of the axis, turned 90° beside the names. */\n title?: string\n /** Render a horizontal grid line through every row. Defaults to `false`. */\n grid?: boolean\n}\n\n/**\n * A reference line or band of a range bar chart: a moment or a value on the\n * range axis (`x: '2026-03-01'`), a period (`x: [from, to]`), a row\n * (`y: 'Design'`) or the rows from one to another (`y: ['Design', 'Testing']`).\n * With a single `x` and a single `y` it is a point in that row.\n */\nexport interface RangeBarAnnotation extends Omit<Annotation, 'x' | 'y'> {\n x?: RangeValue | readonly [RangeValue, RangeValue]\n y?: string | readonly [string, string]\n}\n\nexport interface RangeBarOptions {\n /** The ranges, top to bottom in the order their names first come. */\n data: readonly RangeBarItem[]\n /** The axis the ranges run along. */\n x?: RangeAxisOptions\n /** The axis of the rows. */\n y?: RangeRowAxisOptions\n /** Corner radius of the bars. Defaults to `4`. */\n radius?: number\n /** Maximum bar thickness in pixels; leftover row space stays empty. Defaults to `24`. */\n maxBarWidth?: number\n /** Share of each row left empty between bars, `0…1`. Defaults to `0.3`. */\n groupPadding?: number\n /** Reference lines and bands: today, a deadline, a freeze. Needs `@tabler/charts/annotations` on the core. */\n annotations?: readonly RangeBarAnnotation[]\n /** Extra space around the plot area, in pixels. */\n padding?: InsetsInput\n}\n\n/** A range that can be drawn: its item, its row and its ends in axis units (lower first). */\ninterface Bar {\n item: RangeBarItem\n key: string\n row: number\n from: number\n to: number\n}\n\n/** The chart model: the options, with the ranges that can be drawn and their rows. */\ninterface RangeBarModel extends RangeBarOptions {\n timed: boolean\n rows: readonly string[]\n bars: readonly Bar[]\n}\n\n/** The shortest bar drawn, in pixels: a range with no length (a milestone) still shows. */\nconst MIN_LENGTH = 2\n\n/** Pixels around the plot area that still count as hovering it. */\nconst HOVER_SLOP = 8\n\nconst DAY = 24 * 60 * 60 * 1000\n\n/** A value in axis units (milliseconds on a time axis), or `null` when it has no place there. */\nconst position = (value: unknown, timed: boolean): number | null => {\n if (!timed) return finite(value)\n const ms = toMs(value as RangeValue)\n return Number.isFinite(ms) ? ms : null\n}\n\nfunction prepare(options: RangeBarOptions): RangeBarModel {\n const timed = options.x?.type === 'time'\n const rows: string[] = []\n const index = new Map<string, number>()\n const seen = new Map<string, number>()\n const bars: Bar[] = []\n for (const item of options.data) {\n const a = position(item.from, timed)\n const b = position(item.to, timed)\n if (a === null || b === null) continue\n let row = index.get(item.name)\n if (row === undefined) {\n row = rows.length\n index.set(item.name, row)\n rows.push(item.name)\n }\n // Ranges that share a name (and have no id) still need keys of their own.\n const base = item.id ?? item.name\n const nth = seen.get(base) ?? 0\n seen.set(base, nth + 1)\n bars.push({\n item,\n key: nth ? `${base}/${nth}` : base,\n row,\n from: Math.min(a, b),\n to: Math.max(a, b),\n })\n }\n return { ...options, timed, rows, bars }\n}\n\n/** How the ends of the ranges read in tooltips and the table. */\nfunction valueFormat(model: RangeBarModel, locale: Locale): (value: number) => string {\n const { format, utc } = model.x ?? {}\n if (!model.timed) return formatDetail(format, locale)\n if (typeof format === 'function') return format\n const [lo, hi] = extent(model.bars.flatMap((bar) => [bar.from, bar.to])) ?? [0, 0]\n const date = feature('dates')([lo, hi], utc, locale)\n return (value) => date(value)\n}\n\n/**\n * The annotations as the cartesian layers read them: there `y` is a value\n * on the value axis and `x` a category, here `x` runs along the ranges and\n * `y` names rows.\n */\nfunction annotationsOf(model: RangeBarModel): Annotation[] {\n const at = (v: unknown) => position(v, model.timed)\n return list(model.annotations)\n .filter(isRecord)\n .flatMap((a) => {\n const { x, y, ...rest } = a as RangeBarAnnotation\n const out: Annotation = { ...rest }\n if (x !== undefined) {\n const ends = Array.isArray(x) ? x.map(at) : at(x)\n if (ends === null || (Array.isArray(ends) && (ends.length !== 2 || ends.includes(null)))) {\n return []\n }\n out.y = ends as number | [number, number]\n }\n // A row is marked as a whole (a band), unless a single `x` makes it a point.\n if (y !== undefined) {\n out.x = typeof y === 'string' && (x === undefined || Array.isArray(x)) ? [y, y] : y\n }\n return [out]\n })\n}\n\n/** The range axis before the plot is placed: its domain and the ticks of a scale over it. */\nfunction rangeAxis(\n model: RangeBarModel,\n ctx: RenderContext,\n extra: readonly number[],\n): { domain: [number, number]; ticks(range: readonly [number, number]): Tick[] } {\n const options = model.x ?? {}\n const count = tickCount(options, Math.max(2, Math.round(ctx.width / TICK_SPACING_X)))\n const values = [...model.bars.flatMap((bar) => [bar.from, bar.to]), ...extra]\n const min = position(options.min, model.timed)\n const max = position(options.max, model.timed)\n if (!model.timed) {\n const { format } = options\n const bounds = { ...(min === null ? {} : { min }), ...(max === null ? {} : { max }) }\n const domain = domainOf(values, { ...bounds, nice: options.nice !== false }, false, count)\n return {\n domain,\n ticks: (range) => linearTicks(linear(domain, range), { count, format, locale: ctx.locale }),\n }\n }\n\n const time = feature('time').scale\n const utc = options.utc === true\n let [lo, hi] = extent(values) ?? [0, DAY]\n // A single moment still needs a visible range: the day around it.\n if (lo === hi) {\n lo -= DAY / 2\n hi += DAY / 2\n }\n if (min !== null) lo = min\n if (max !== null) hi = max\n if (options.nice !== false) {\n // Twice: the wider domain may call for a longer tick interval, whose\n // boundaries are then the ones the axis should end on.\n for (let pass = 0; pass < 2; pass++) {\n const [nlo, nhi] = time([lo, hi], [0, 1], { utc }).nice(count).domain\n if (min === null) lo = nlo\n if (max === null) hi = nhi\n }\n }\n const domain: [number, number] = [lo, hi]\n const { format } = options\n return {\n domain,\n ticks(range) {\n const scale = time(domain, range, { utc })\n const text =\n typeof format === 'function'\n ? (date: Date) => format(date.getTime())\n : scale.tickFormat(count, ctx.locale)\n return scale\n .ticks(count)\n .map((date) => ({ value: date.getTime(), position: scale(date), label: text(date) }))\n },\n }\n}\n\nfunction renderRangeBar(model: RangeBarModel, ctx: RenderContext): RenderResult {\n const { radius = 4, maxBarWidth = 24, groupPadding = 0.3, rows, bars } = model\n const { fontSize } = ctx\n const xOptions = model.x ?? {}\n const yOptions = model.y ?? {}\n const annotations = annotationsOf(model)\n // Annotations on the range axis stay in view, like targets on a value axis.\n const marked = annotations.flatMap((a) => (a.y === undefined ? [] : a.y))\n const axis = rangeAxis(model, ctx, marked)\n const showValues = xOptions.show !== false\n const showRows = yOptions.show !== false && rows.length > 0\n\n const probe = axis.ticks([0, 1])\n const names: Tick[] = rows.map((name) => ({ value: name, position: 0, label: name }))\n const edgeLabel = (tick: Tick | undefined) =>\n showValues && tick ? Math.ceil(estimateTextWidth(tick.label, fontSize) / 2) : 0\n\n const { area, side, range } = plotFrame(ctx, model.padding, (pad) => ({\n top: pad.top + EDGE / 2,\n bottom:\n pad.bottom +\n Math.max(\n (showValues ? axisSize('bottom', probe, fontSize) : 0) +\n axisTitleSize(xOptions.title, fontSize),\n EDGE / 2,\n ),\n start:\n pad.start +\n Math.max(\n (showRows ? axisSize('left', names, fontSize) : 0) +\n axisTitleSize(yOptions.title, fontSize),\n edgeLabel(probe[0]),\n EDGE,\n ),\n end: pad.end + Math.max(edgeLabel(probe[probe.length - 1]), EDGE),\n }))\n\n const across = band(rows, [area.y, area.y + area.height], {\n paddingInner: groupPadding,\n paddingOuter: groupPadding / 2,\n })\n // The ranges run from the start side: from the right in a right-to-left chart.\n const along = linear(axis.domain, range())\n const valueTicks = thinTicks(axis.ticks(along.range), 'bottom', fontSize)\n const rowTicks = showRows ? thinTicks(bandTicks(across), 'left', fontSize) : []\n\n // The shared layers read categories as `x` and values as `y`, whichever way they run.\n const cartesian: CartesianOptions = {\n data: { series: [] },\n x: { show: yOptions.show !== false, grid: yOptions.grid === true, title: yOptions.title },\n y: { show: showValues, grid: xOptions.grid !== false, title: xOptions.title },\n annotations,\n }\n const layout = finishLayout(\n cartesian,\n ctx,\n side,\n 0,\n {\n area,\n labels: rows,\n x: across,\n y: along,\n horizontal: true,\n xTicks: rowTicks,\n yTicks: valueTicks,\n },\n rows,\n )\n\n const thickness = Math.max(1, Math.min(maxBarWidth, across.bandwidth))\n const top = (bar: Bar) => across.at(bar.row) + (across.bandwidth - thickness) / 2\n /** The bar's ends in pixels, left first. */\n const ends = (bar: Bar): [number, number] => {\n const a = along(bar.from)\n const b = along(bar.to)\n const lo = Math.min(a, b)\n const hi = Math.max(a, b)\n if (hi - lo >= MIN_LENGTH) return [lo, hi]\n const mid = (lo + hi) / 2\n return [mid - MIN_LENGTH / 2, mid + MIN_LENGTH / 2]\n }\n\n const text = valueFormat(model, ctx.locale)\n const hitFor = (i: number): Hit => {\n const bar = bars[i] as Bar\n const [lo, hi] = ends(bar)\n const y = top(bar)\n const item: HitItem = {\n name: bar.item.name,\n seriesIndex: 0,\n // The length of the range; value labels write the range itself.\n value: bar.to - bar.from,\n text: `${text(bar.from)} – ${text(bar.to)}`,\n // The end the bar runs to.\n x: ctx.rtl ? lo : hi,\n y: y + thickness / 2,\n box: { x: lo, y, width: hi - lo, height: thickness },\n }\n if (bar.item.color) item.color = bar.item.color\n return {\n index: i,\n label: bar.item.name,\n title: '',\n x: (lo + hi) / 2,\n y: across.at(bar.row) + across.bandwidth / 2,\n axis: 'y',\n area,\n items: [item],\n highlight: {\n kind: 'band',\n x: area.x,\n y: across.at(bar.row),\n width: area.width,\n height: across.bandwidth,\n },\n }\n }\n\n const interaction: Interaction = {\n count: bars.length,\n hitIndex: (i) => (i >= 0 && i < bars.length ? hitFor(i) : null),\n hitTest(px, py) {\n if (\n px < area.x - HOVER_SLOP ||\n px > area.x + area.width + HOVER_SLOP ||\n py < area.y - HOVER_SLOP ||\n py > area.y + area.height + HOVER_SLOP\n ) {\n return null\n }\n // The bar under the pointer in its row (the one drawn last), or the nearest one there.\n const row = across.indexAt(py)\n let found = -1\n let nearest = Number.POSITIVE_INFINITY\n bars.forEach((bar, i) => {\n if (bar.row !== row) return\n const [lo, hi] = ends(bar)\n const distance = Math.max(lo - px, px - hi, 0)\n if (distance <= nearest) {\n nearest = distance\n found = i\n }\n })\n if (found < 0) return null\n const hit = hitFor(found)\n if (nearest === 0) hit.seriesIndex = 0\n return hit\n },\n }\n\n const marks = bars.map((bar) => {\n const [lo, hi] = ends(bar)\n return h('path', {\n key: bar.key,\n class: ['tc-bar', 'tc-bar-horizontal', 'tc-range-bar', bar.item.class],\n 'data-series': bar.item.name,\n // A path, not a rect, so it morphs between updates (d), in Safari too.\n d: rectPath(lo, top(bar), hi - lo, thickness, Math.max(0, radius)),\n // A map, so values from data cannot inject CSS (see normalizeStyle).\n style: { '--tc-series-color': bar.item.color },\n })\n })\n\n const content = [\n h('defs', { key: 'defs' }, layout.clip.def),\n layout.background,\n h(\n 'g',\n { key: 'series', class: 'tc-series-list tc-range-bars', 'clip-path': layout.clip.url },\n // One color slot for every range: a bar's own `color` sets it apart.\n h('g', { class: 'tc-series tc-series-1' }, marks),\n ),\n layout.foreground,\n ]\n return { content, interaction }\n}\n\nfunction rangeBarTable(model: RangeBarModel, ctx: TableContext, limit: number): DataTable {\n const text = valueFormat(model, ctx.locale)\n const { bars } = model\n const shown = bars.length > limit ? bars.slice(0, limit) : bars\n return {\n columns: ['', 'From', 'To'],\n total: bars.length,\n rows: shown.map((bar) => [bar.item.name, text(bar.from), text(bar.to)]),\n }\n}\n\n/** Ranges with text for names; ends that are no number or date are left for `prepare` to drop. */\nconst cleanRanges = (data: unknown): unknown =>\n records(data, (r) => ({ ...named(r), from: label(r.from), to: label(r.to) }))\n\n/**\n * Range bar (timeline) chart: one row per name with a bar from `from` to\n * `to`, along a time axis (a roadmap, a schedule) or a number axis (floating\n * bars: salary bands, temperature ranges). Ranges with the same name share\n * a row.\n *\n * ```ts\n * new Chart('#el', {\n * type: rangeBar,\n * data: [\n * { name: 'Research', from: '2026-01-05', to: '2026-02-10' },\n * { name: 'Design', from: '2026-02-01', to: '2026-03-15' },\n * ],\n * x: { type: 'time' },\n * })\n * ```\n */\nexport const rangeBar: ChartType<RangeBarOptions, RangeBarModel> = {\n name: 'range-bar',\n clean: cleanData(cleanRanges),\n prepare,\n render: renderRangeBar,\n table: rangeBarTable,\n}\n"],"mappings":";;;;;;;;;;;AA2IA,MAAM,aAAa;;AAGnB,MAAM,aAAa;AAEnB,MAAM,MAAM;;AAGZ,MAAM,YAAY,OAAgB,UAAkC;CAClE,IAAI,CAAC,OAAO,OAAOA,cAAAA,OAAO,KAAK;CAC/B,MAAM,KAAKC,kBAAAA,KAAK,KAAmB;CACnC,OAAO,OAAO,SAAS,EAAE,IAAI,KAAK;AACpC;AAEA,SAAS,QAAQ,SAAyC;CACxD,MAAM,QAAQ,QAAQ,GAAG,SAAS;CAClC,MAAM,OAAiB,CAAC;CACxB,MAAM,wBAAQ,IAAI,IAAoB;CACtC,MAAM,uBAAO,IAAI,IAAoB;CACrC,MAAM,OAAc,CAAC;CACrB,KAAK,MA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