@tabler/charts 0.2.0 → 0.3.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 (364) hide show
  1. package/README.md +74 -4
  2. package/dist/{annotations-D0YQ0IoA.js → annotations-BQ8l-qHs.js} +3 -3
  3. package/dist/{annotations-D0YQ0IoA.js.map → annotations-BQ8l-qHs.js.map} +1 -1
  4. package/dist/{annotations-DdRdeBUB.cjs → annotations-CpCWA29b.cjs} +3 -3
  5. package/dist/{annotations-DdRdeBUB.cjs.map → annotations-CpCWA29b.cjs.map} +1 -1
  6. package/dist/annotations.cjs +2 -2
  7. package/dist/annotations.js +2 -2
  8. package/dist/{area-d11XePuw.d.ts → area-DEFQm_SQ.d.ts} +2 -2
  9. package/dist/{area-4eRs3c0K.cjs → area-DYdQ_sMV.cjs} +3 -3
  10. package/dist/{area-4eRs3c0K.cjs.map → area-DYdQ_sMV.cjs.map} +1 -1
  11. package/dist/{area-0-L1bG9B.js → area-WdtfqvhX.js} +3 -3
  12. package/dist/{area-0-L1bG9B.js.map → area-WdtfqvhX.js.map} +1 -1
  13. package/dist/{area-CJX9219z.d.cts → area-h_FvieFb.d.cts} +2 -2
  14. package/dist/area.cjs +1 -1
  15. package/dist/area.d.cts +1 -1
  16. package/dist/area.d.ts +1 -1
  17. package/dist/area.js +1 -1
  18. package/dist/axis-MMaVoSWB.js +235 -0
  19. package/dist/axis-MMaVoSWB.js.map +1 -0
  20. package/dist/axis-YfAerNBA.cjs +300 -0
  21. package/dist/axis-YfAerNBA.cjs.map +1 -0
  22. package/dist/{bar-BNZ3GhIw.js → bar-BOcRcArc.js} +74 -56
  23. package/dist/bar-BOcRcArc.js.map +1 -0
  24. package/dist/{bar-Da6dE_nI.cjs → bar-CVkOJ7WA.cjs} +76 -58
  25. package/dist/bar-CVkOJ7WA.cjs.map +1 -0
  26. package/dist/{bar-B5n2oq9-.js → bar-CgpC2EpX.js} +2 -2
  27. package/dist/{bar-B5n2oq9-.js.map → bar-CgpC2EpX.js.map} +1 -1
  28. package/dist/{bar-XwzM6Pb0.d.ts → bar-D9B_arKf.d.ts} +1 -1
  29. package/dist/{bar-BDLR4p9c.d.cts → bar-DZCQ-kyf.d.cts} +2 -2
  30. package/dist/{bar-LYIF8MEz.cjs → bar-wVykm1us.cjs} +2 -2
  31. package/dist/{bar-LYIF8MEz.cjs.map → bar-wVykm1us.cjs.map} +1 -1
  32. package/dist/bar.cjs +1 -1
  33. package/dist/bar.d.cts +1 -1
  34. package/dist/bar.d.ts +1 -1
  35. package/dist/bar.js +1 -1
  36. package/dist/calendar-BSvO8nRb.d.cts +106 -0
  37. package/dist/calendar-BXgIX5H1.js +502 -0
  38. package/dist/calendar-BXgIX5H1.js.map +1 -0
  39. package/dist/calendar-Bq3vFzPl.d.ts +106 -0
  40. package/dist/calendar-DAFXjV99.cjs +507 -0
  41. package/dist/calendar-DAFXjV99.cjs.map +1 -0
  42. package/dist/calendar.cjs +3 -0
  43. package/dist/calendar.d.cts +3 -0
  44. package/dist/calendar.d.ts +3 -0
  45. package/dist/calendar.js +1 -0
  46. package/dist/{candlestick-D0xKkdqd.d.ts → candlestick-B3WcLzph.d.ts} +1 -1
  47. package/dist/{candlestick-Dq7qp-F0.d.cts → candlestick-BcomxeVG.d.cts} +1 -1
  48. package/dist/{candlestick-BHQkQfxH.js → candlestick-BtT9glp9.js} +16 -14
  49. package/dist/{candlestick-BHQkQfxH.js.map → candlestick-BtT9glp9.js.map} +1 -1
  50. package/dist/{candlestick-CYCQXgky.cjs → candlestick-CSmRuZ4v.cjs} +16 -14
  51. package/dist/{candlestick-CYCQXgky.cjs.map → candlestick-CSmRuZ4v.cjs.map} +1 -1
  52. package/dist/candlestick.cjs +3 -3
  53. package/dist/candlestick.d.cts +1 -1
  54. package/dist/candlestick.d.ts +1 -1
  55. package/dist/candlestick.js +3 -3
  56. package/dist/{cartesian-CI2x6N7N.js → cartesian-BrPqb5Qn.js} +122 -248
  57. package/dist/cartesian-BrPqb5Qn.js.map +1 -0
  58. package/dist/{cartesian-DV02PsBe.cjs → cartesian-DRSXHxWe.cjs} +146 -308
  59. package/dist/cartesian-DRSXHxWe.cjs.map +1 -0
  60. package/dist/{chart-DWn9v6qw.js → chart-B6TTY4Kr.js} +94 -62
  61. package/dist/chart-B6TTY4Kr.js.map +1 -0
  62. package/dist/{chart-QilhWP8Z.d.ts → chart-CYrrUCi3.d.ts} +193 -56
  63. package/dist/{chart-kqFMEwDo.d.cts → chart-CbPzP5Dp.d.cts} +193 -56
  64. package/dist/{chart-e2VqomCI.cjs → chart-D_lyOy-M.cjs} +106 -68
  65. package/dist/chart-D_lyOy-M.cjs.map +1 -0
  66. package/dist/{core-PAX5ogLk.d.cts → core-9BnLEW4K.d.cts} +24 -20
  67. package/dist/{core-DRUCk67j.d.ts → core-C3qEppSm.d.ts} +7 -6
  68. package/dist/{core-BKRQvPAT.js → core-CQ0FaJ4G.js} +112 -65
  69. package/dist/core-CQ0FaJ4G.js.map +1 -0
  70. package/dist/{core-DIOC61up.cjs → core-D2PSked3.cjs} +113 -66
  71. package/dist/core-D2PSked3.cjs.map +1 -0
  72. package/dist/core.cjs +41 -31
  73. package/dist/core.d.cts +20 -17
  74. package/dist/core.d.ts +20 -17
  75. package/dist/core.js +27 -23
  76. package/dist/{dates-C2RzY3rE.js → dates-DLe2Ww64.js} +2 -2
  77. package/dist/{dates-C2RzY3rE.js.map → dates-DLe2Ww64.js.map} +1 -1
  78. package/dist/{dates-DurEr9WT.cjs → dates-DerXTb1J.cjs} +2 -2
  79. package/dist/{dates-DurEr9WT.cjs.map → dates-DerXTb1J.cjs.map} +1 -1
  80. package/dist/decimate.cjs +1 -1
  81. package/dist/decimate.js +1 -1
  82. package/dist/{dom-D_g13XWY.cjs → dom-C33zvtPo.cjs} +3 -7
  83. package/dist/dom-C33zvtPo.cjs.map +1 -0
  84. package/dist/{dom-CuceR8gt.js → dom-CTse6Rvd.js} +3 -7
  85. package/dist/dom-CTse6Rvd.js.map +1 -0
  86. package/dist/{export-chart-mYgEfK-L.cjs → export-chart-CPtXmZvi.cjs} +17 -12
  87. package/dist/export-chart-CPtXmZvi.cjs.map +1 -0
  88. package/dist/{export-chart-83UYH48t.js → export-chart-DoeiAyR2.js} +17 -12
  89. package/dist/export-chart-DoeiAyR2.js.map +1 -0
  90. package/dist/export.cjs +2 -2
  91. package/dist/export.d.cts +1 -1
  92. package/dist/export.d.ts +1 -1
  93. package/dist/export.js +2 -2
  94. package/dist/{fade-GGxcBdss.js → fade-CDrQjnDz.js} +56 -78
  95. package/dist/fade-CDrQjnDz.js.map +1 -0
  96. package/dist/{fade-DVTkhrFU.cjs → fade-CRqcKMWY.cjs} +56 -78
  97. package/dist/fade-CRqcKMWY.cjs.map +1 -0
  98. package/dist/{features-BMxkqCyS.js → features-B55rwpQC.js} +4 -2
  99. package/dist/features-B55rwpQC.js.map +1 -0
  100. package/dist/{features-DCXEvoya.cjs → features-DEDP5CEQ.cjs} +9 -1
  101. package/dist/features-DEDP5CEQ.cjs.map +1 -0
  102. package/dist/fit-BPyPRnsK.js +16 -0
  103. package/dist/fit-BPyPRnsK.js.map +1 -0
  104. package/dist/fit-D4MIIQQz.cjs +21 -0
  105. package/dist/fit-D4MIIQQz.cjs.map +1 -0
  106. package/dist/funnel-BdcfUkb5.d.ts +50 -0
  107. package/dist/funnel-CFEEulw_.cjs +244 -0
  108. package/dist/funnel-CFEEulw_.cjs.map +1 -0
  109. package/dist/funnel-CYCv8cq2.js +239 -0
  110. package/dist/funnel-CYCv8cq2.js.map +1 -0
  111. package/dist/funnel-CarOh8w_.d.cts +50 -0
  112. package/dist/funnel.cjs +3 -0
  113. package/dist/funnel.d.cts +3 -0
  114. package/dist/funnel.d.ts +3 -0
  115. package/dist/funnel.js +1 -0
  116. package/dist/{gauge-DXkjXNCD.cjs → gauge-6HfDcLMJ.cjs} +28 -28
  117. package/dist/gauge-6HfDcLMJ.cjs.map +1 -0
  118. package/dist/{gauge-ts0kqN1-.js → gauge-DiTk5aWO.js} +28 -28
  119. package/dist/gauge-DiTk5aWO.js.map +1 -0
  120. package/dist/{gauge-BSist7My.d.cts → gauge-Ds9k1UV2.d.cts} +1 -1
  121. package/dist/{gauge-0VJuAHWF.d.ts → gauge-Zy25jfps.d.ts} +1 -1
  122. package/dist/gauge.cjs +1 -1
  123. package/dist/gauge.d.cts +1 -1
  124. package/dist/gauge.d.ts +1 -1
  125. package/dist/gauge.js +1 -1
  126. package/dist/{heatmap-19BGJTKF.js → heatmap-C1v8bwpq.js} +35 -33
  127. package/dist/heatmap-C1v8bwpq.js.map +1 -0
  128. package/dist/{heatmap-Dp_oyEe0.d.cts → heatmap-CJ-0dfhJ.d.cts} +1 -1
  129. package/dist/{heatmap-CXhlrLTl.cjs → heatmap-Dcc_bsoQ.cjs} +39 -37
  130. package/dist/heatmap-Dcc_bsoQ.cjs.map +1 -0
  131. package/dist/{heatmap-59lmClj9.d.ts → heatmap-Jp5sHRTo.d.ts} +1 -1
  132. package/dist/heatmap.cjs +1 -1
  133. package/dist/heatmap.d.cts +1 -1
  134. package/dist/heatmap.d.ts +1 -1
  135. package/dist/heatmap.js +1 -1
  136. package/dist/{hydrate-OA6R2_Pn.js → hydrate-BB3MlR36.js} +2 -2
  137. package/dist/{hydrate-OA6R2_Pn.js.map → hydrate-BB3MlR36.js.map} +1 -1
  138. package/dist/{hydrate-CmN1k8Mo.cjs → hydrate-m0I5m6ue.cjs} +2 -2
  139. package/dist/{hydrate-CmN1k8Mo.cjs.map → hydrate-m0I5m6ue.cjs.map} +1 -1
  140. package/dist/hydrate.cjs +2 -2
  141. package/dist/hydrate.js +2 -2
  142. package/dist/index.cjs +55 -42
  143. package/dist/index.cjs.map +1 -1
  144. package/dist/index.d.cts +21 -18
  145. package/dist/index.d.ts +21 -18
  146. package/dist/index.js +41 -34
  147. package/dist/index.js.map +1 -1
  148. package/dist/interaction-DXYSjgnP.cjs +32 -0
  149. package/dist/interaction-DXYSjgnP.cjs.map +1 -0
  150. package/dist/interaction-En1KlwFO.js +21 -0
  151. package/dist/interaction-En1KlwFO.js.map +1 -0
  152. package/dist/{layout-JY2aR-yE.cjs → layout-Cfg9x1k2.cjs} +32 -1
  153. package/dist/layout-Cfg9x1k2.cjs.map +1 -0
  154. package/dist/{layout-DmrrLjwN.js → layout-DqAte3H8.js} +27 -2
  155. package/dist/layout-DqAte3H8.js.map +1 -0
  156. package/dist/{line-DtSh7HQU.d.ts → line-Bpr5uVLQ.d.ts} +1 -1
  157. package/dist/{line-DO66LtwH.js → line-CxR4tg1Q.js} +46 -34
  158. package/dist/line-CxR4tg1Q.js.map +1 -0
  159. package/dist/{line-Dbt6KFRK.cjs → line-YiCuhVMI.cjs} +46 -34
  160. package/dist/line-YiCuhVMI.cjs.map +1 -0
  161. package/dist/{line-_rNdeKmS.d.cts → line-vyWO030v.d.cts} +2 -3
  162. package/dist/line.cjs +3 -3
  163. package/dist/line.d.cts +1 -1
  164. package/dist/line.d.ts +1 -1
  165. package/dist/line.js +3 -3
  166. package/dist/log.cjs +1 -1
  167. package/dist/log.js +1 -1
  168. package/dist/map-49FcfdmJ.d.cts +156 -0
  169. package/dist/map-BMC61J-P.d.ts +156 -0
  170. package/dist/map-BqrZ80vT.cjs +818 -0
  171. package/dist/map-BqrZ80vT.cjs.map +1 -0
  172. package/dist/map-C15NC7kW.js +807 -0
  173. package/dist/map-C15NC7kW.js.map +1 -0
  174. package/dist/map.cjs +4 -0
  175. package/dist/map.d.cts +3 -0
  176. package/dist/map.d.ts +3 -0
  177. package/dist/map.js +1 -0
  178. package/dist/maps/world.cjs +875 -0
  179. package/dist/maps/world.cjs.map +1 -0
  180. package/dist/maps/world.d.cts +2 -0
  181. package/dist/maps/world.d.ts +2 -0
  182. package/dist/maps/world.js +874 -0
  183. package/dist/maps/world.js.map +1 -0
  184. package/dist/{morph-9_LJL0ra.cjs → morph-3I1Nf_tR.cjs} +2 -2
  185. package/dist/{morph-9_LJL0ra.cjs.map → morph-3I1Nf_tR.cjs.map} +1 -1
  186. package/dist/{morph-DnRxuwR-.js → morph-GfBab-b3.js} +2 -2
  187. package/dist/{morph-DnRxuwR-.js.map → morph-GfBab-b3.js.map} +1 -1
  188. package/dist/morph.cjs +2 -2
  189. package/dist/morph.js +2 -2
  190. package/dist/{others-J7NCAMA0.js → others-DBIGE6jr.js} +11 -3
  191. package/dist/others-DBIGE6jr.js.map +1 -0
  192. package/dist/others-DBO4Kjwl.d.ts +29 -0
  193. package/dist/{others-DWdK7vKp.cjs → others-WfjCsjqT.cjs} +14 -6
  194. package/dist/others-WfjCsjqT.cjs.map +1 -0
  195. package/dist/others-ls5eKtZ4.d.cts +31 -0
  196. package/dist/{parliament-Cru4IcuM.js → parliament-BKN6ikBJ.js} +30 -29
  197. package/dist/parliament-BKN6ikBJ.js.map +1 -0
  198. package/dist/{parliament-CgsVnWEe.d.cts → parliament-C7V8UJj1.d.cts} +1 -1
  199. package/dist/{parliament-CLCI7tUO.d.ts → parliament-Cz9n_DoK.d.ts} +1 -1
  200. package/dist/{parliament-x5hcFaQ3.cjs → parliament-DhxAaIZ3.cjs} +30 -29
  201. package/dist/parliament-DhxAaIZ3.cjs.map +1 -0
  202. package/dist/parliament.cjs +1 -1
  203. package/dist/parliament.d.cts +1 -1
  204. package/dist/parliament.d.ts +1 -1
  205. package/dist/parliament.js +1 -1
  206. package/dist/{patterns-CufKZYhm.js → patterns-BMUINoka.js} +2 -2
  207. package/dist/{patterns-CufKZYhm.js.map → patterns-BMUINoka.js.map} +1 -1
  208. package/dist/{patterns-D3-wQagb.cjs → patterns-Dw7OMD_2.cjs} +2 -2
  209. package/dist/{patterns-D3-wQagb.cjs.map → patterns-Dw7OMD_2.cjs.map} +1 -1
  210. package/dist/patterns.cjs +2 -2
  211. package/dist/patterns.d.cts +1 -1
  212. package/dist/patterns.d.ts +1 -1
  213. package/dist/patterns.js +2 -2
  214. package/dist/{percentage-bar-ybNS3goo.cjs → percentage-bar-BChkTRoz.cjs} +37 -35
  215. package/dist/percentage-bar-BChkTRoz.cjs.map +1 -0
  216. package/dist/{percentage-bar-B6tNOqNn.js → percentage-bar-CaInxrL8.js} +37 -35
  217. package/dist/percentage-bar-CaInxrL8.js.map +1 -0
  218. package/dist/{percentage-bar-tepMr7Hd.d.cts → percentage-bar-R1--2grK.d.cts} +10 -14
  219. package/dist/{percentage-bar-nhTeakD_.d.ts → percentage-bar-cSeiLdwU.d.ts} +10 -14
  220. package/dist/percentage-bar.cjs +1 -1
  221. package/dist/percentage-bar.d.cts +1 -1
  222. package/dist/percentage-bar.d.ts +1 -1
  223. package/dist/percentage-bar.js +1 -1
  224. package/dist/{pie-CFptILSm.d.ts → pie-BQQkvy1N.d.ts} +7 -13
  225. package/dist/{pie-CVsc-6qD.js → pie-Bd8wyrtY.js} +45 -44
  226. package/dist/pie-Bd8wyrtY.js.map +1 -0
  227. package/dist/{pie-BpjvSPnz.cjs → pie-BseZlCgP.cjs} +45 -44
  228. package/dist/pie-BseZlCgP.cjs.map +1 -0
  229. package/dist/{pie-BXg2gNpb.d.cts → pie-vD5-g8je.d.cts} +7 -13
  230. package/dist/pie.cjs +1 -1
  231. package/dist/pie.d.cts +1 -1
  232. package/dist/pie.d.ts +1 -1
  233. package/dist/pie.js +1 -1
  234. package/dist/{point-shapes--_gmdTyK.cjs → point-shapes-BRawRM78.cjs} +23 -22
  235. package/dist/point-shapes-BRawRM78.cjs.map +1 -0
  236. package/dist/{point-shapes-DD2Ektzm.js → point-shapes-DI6GhcI7.js} +18 -23
  237. package/dist/point-shapes-DI6GhcI7.js.map +1 -0
  238. package/dist/point-shapes.cjs +6 -4
  239. package/dist/point-shapes.cjs.map +1 -1
  240. package/dist/point-shapes.d.cts +2 -2
  241. package/dist/point-shapes.d.ts +2 -2
  242. package/dist/point-shapes.js +7 -5
  243. package/dist/point-shapes.js.map +1 -1
  244. package/dist/{radar-D1-lItDy.d.cts → radar-7I6hsY_h.d.cts} +1 -1
  245. package/dist/{radar-BR-mumDd.js → radar-D6XqkFWQ.js} +21 -22
  246. package/dist/radar-D6XqkFWQ.js.map +1 -0
  247. package/dist/{radar-HPDrIdzc.cjs → radar-DjISDnSf.cjs} +22 -23
  248. package/dist/radar-DjISDnSf.cjs.map +1 -0
  249. package/dist/{radar-BC9Skgpj.d.ts → radar-vLxilcr4.d.ts} +1 -1
  250. package/dist/radar.cjs +1 -1
  251. package/dist/radar.d.cts +1 -1
  252. package/dist/radar.d.ts +1 -1
  253. package/dist/radar.js +1 -1
  254. package/dist/{rect-DSVmUZrD.js → rect-CZTNvMlf.js} +2 -2
  255. package/dist/{rect-DSVmUZrD.js.map → rect-CZTNvMlf.js.map} +1 -1
  256. package/dist/{rect-D6VhynBM.cjs → rect-DPr9QRxl.cjs} +2 -2
  257. package/dist/{rect-D6VhynBM.cjs.map → rect-DPr9QRxl.cjs.map} +1 -1
  258. package/dist/{sankey-fCoo1cpz.cjs → sankey-0CSp_Er9.cjs} +72 -71
  259. package/dist/sankey-0CSp_Er9.cjs.map +1 -0
  260. package/dist/{sankey-D_v7KxnJ.d.ts → sankey-7As41Fo4.d.ts} +1 -1
  261. package/dist/{sankey-D6JeZfK5.js → sankey-Dp4CuLVe.js} +72 -71
  262. package/dist/sankey-Dp4CuLVe.js.map +1 -0
  263. package/dist/{sankey-Dk7jUt8x.d.cts → sankey-DqiuxUx7.d.cts} +1 -1
  264. package/dist/sankey.cjs +1 -1
  265. package/dist/sankey.d.cts +1 -1
  266. package/dist/sankey.d.ts +1 -1
  267. package/dist/sankey.js +1 -1
  268. package/dist/{scatter-CXEsioOJ.d.ts → scatter-BXkXGgM_.d.ts} +7 -1
  269. package/dist/{scatter-DVqB_fP9.cjs → scatter-Bwkblr4L.cjs} +40 -38
  270. package/dist/scatter-Bwkblr4L.cjs.map +1 -0
  271. package/dist/{scatter-C0TWjFpW.js → scatter-DCMAtt5L.js} +38 -36
  272. package/dist/scatter-DCMAtt5L.js.map +1 -0
  273. package/dist/{scatter-DZeEIfyo.d.cts → scatter-DL0zAV09.d.cts} +7 -1
  274. package/dist/scatter.cjs +1 -1
  275. package/dist/scatter.d.cts +1 -1
  276. package/dist/scatter.d.ts +1 -1
  277. package/dist/scatter.js +1 -1
  278. package/dist/{sparkline-cbvRkWqS.d.ts → sparkline-BElUSd0r.d.ts} +1 -1
  279. package/dist/{sparkline-B39NA0Mi.cjs → sparkline-BMSuEPHP.cjs} +13 -15
  280. package/dist/sparkline-BMSuEPHP.cjs.map +1 -0
  281. package/dist/{sparkline-XO_TqCNP.js → sparkline-NDmq90kP.js} +13 -15
  282. package/dist/sparkline-NDmq90kP.js.map +1 -0
  283. package/dist/{sparkline-DAP6jtzw.d.cts → sparkline-RYly7bR0.d.cts} +1 -1
  284. package/dist/sparkline.cjs +1 -1
  285. package/dist/sparkline.d.cts +1 -1
  286. package/dist/sparkline.d.ts +1 -1
  287. package/dist/sparkline.js +1 -1
  288. package/dist/{stack-BgPzoQmv.cjs → stack-BO4624CY.cjs} +2 -2
  289. package/dist/{stack-BgPzoQmv.cjs.map → stack-BO4624CY.cjs.map} +1 -1
  290. package/dist/{stack-Dagxq7l2.d.cts → stack-BTWYIwLO.d.cts} +1 -1
  291. package/dist/{stack-2H2Gfs1Q.js → stack-jVKvg2x_.js} +2 -2
  292. package/dist/{stack-2H2Gfs1Q.js.map → stack-jVKvg2x_.js.map} +1 -1
  293. package/dist/style.css +1 -1
  294. package/dist/{time-axis-BjZ1bYTK.cjs → time-axis-B3VekUfX.cjs} +4 -3
  295. package/dist/{time-axis-BjZ1bYTK.cjs.map → time-axis-B3VekUfX.cjs.map} +1 -1
  296. package/dist/{time-axis-FLONo54E.js → time-axis-CLjqOakA.js} +3 -2
  297. package/dist/{time-axis-FLONo54E.js.map → time-axis-CLjqOakA.js.map} +1 -1
  298. package/dist/time.cjs +3 -3
  299. package/dist/time.js +3 -3
  300. package/dist/{treemap-BAkhmVQc.d.cts → treemap-25vHO_UK.d.cts} +12 -2
  301. package/dist/{treemap-BNpxFBao.d.ts → treemap-BCXUbixd.d.ts} +12 -2
  302. package/dist/{treemap-CQdavQ9u.js → treemap-C4glsx-g.js} +20 -25
  303. package/dist/treemap-C4glsx-g.js.map +1 -0
  304. package/dist/{treemap-BWpEUlDh.cjs → treemap-CZk8kKFD.cjs} +21 -26
  305. package/dist/treemap-CZk8kKFD.cjs.map +1 -0
  306. package/dist/treemap.cjs +1 -1
  307. package/dist/treemap.d.cts +1 -1
  308. package/dist/treemap.d.ts +1 -1
  309. package/dist/treemap.js +1 -1
  310. package/dist/{value-labels-BBuSi4i0.js → value-labels-C7GrhOXJ.js} +25 -5
  311. package/dist/value-labels-C7GrhOXJ.js.map +1 -0
  312. package/dist/{value-labels-BV9keAuL.cjs → value-labels-DzaKIWKp.cjs} +25 -5
  313. package/dist/value-labels-DzaKIWKp.cjs.map +1 -0
  314. package/dist/value-labels.cjs +2 -2
  315. package/dist/value-labels.d.cts +1 -1
  316. package/dist/value-labels.d.ts +1 -1
  317. package/dist/value-labels.js +2 -2
  318. package/package.json +93 -233
  319. package/dist/bar-BNZ3GhIw.js.map +0 -1
  320. package/dist/bar-Da6dE_nI.cjs.map +0 -1
  321. package/dist/cartesian-CI2x6N7N.js.map +0 -1
  322. package/dist/cartesian-DV02PsBe.cjs.map +0 -1
  323. package/dist/chart-DWn9v6qw.js.map +0 -1
  324. package/dist/chart-e2VqomCI.cjs.map +0 -1
  325. package/dist/core-BKRQvPAT.js.map +0 -1
  326. package/dist/core-DIOC61up.cjs.map +0 -1
  327. package/dist/dom-CuceR8gt.js.map +0 -1
  328. package/dist/dom-D_g13XWY.cjs.map +0 -1
  329. package/dist/export-chart-83UYH48t.js.map +0 -1
  330. package/dist/export-chart-mYgEfK-L.cjs.map +0 -1
  331. package/dist/fade-DVTkhrFU.cjs.map +0 -1
  332. package/dist/fade-GGxcBdss.js.map +0 -1
  333. package/dist/features-BMxkqCyS.js.map +0 -1
  334. package/dist/features-DCXEvoya.cjs.map +0 -1
  335. package/dist/gauge-DXkjXNCD.cjs.map +0 -1
  336. package/dist/gauge-ts0kqN1-.js.map +0 -1
  337. package/dist/heatmap-19BGJTKF.js.map +0 -1
  338. package/dist/heatmap-CXhlrLTl.cjs.map +0 -1
  339. package/dist/layout-DmrrLjwN.js.map +0 -1
  340. package/dist/layout-JY2aR-yE.cjs.map +0 -1
  341. package/dist/line-DO66LtwH.js.map +0 -1
  342. package/dist/line-Dbt6KFRK.cjs.map +0 -1
  343. package/dist/others-DWdK7vKp.cjs.map +0 -1
  344. package/dist/others-J7NCAMA0.js.map +0 -1
  345. package/dist/parliament-Cru4IcuM.js.map +0 -1
  346. package/dist/parliament-x5hcFaQ3.cjs.map +0 -1
  347. package/dist/percentage-bar-B6tNOqNn.js.map +0 -1
  348. package/dist/percentage-bar-ybNS3goo.cjs.map +0 -1
  349. package/dist/pie-BpjvSPnz.cjs.map +0 -1
  350. package/dist/pie-CVsc-6qD.js.map +0 -1
  351. package/dist/point-shapes--_gmdTyK.cjs.map +0 -1
  352. package/dist/point-shapes-DD2Ektzm.js.map +0 -1
  353. package/dist/radar-BR-mumDd.js.map +0 -1
  354. package/dist/radar-HPDrIdzc.cjs.map +0 -1
  355. package/dist/sankey-D6JeZfK5.js.map +0 -1
  356. package/dist/sankey-fCoo1cpz.cjs.map +0 -1
  357. package/dist/scatter-C0TWjFpW.js.map +0 -1
  358. package/dist/scatter-DVqB_fP9.cjs.map +0 -1
  359. package/dist/sparkline-B39NA0Mi.cjs.map +0 -1
  360. package/dist/sparkline-XO_TqCNP.js.map +0 -1
  361. package/dist/treemap-BWpEUlDh.cjs.map +0 -1
  362. package/dist/treemap-CQdavQ9u.js.map +0 -1
  363. package/dist/value-labels-BBuSi4i0.js.map +0 -1
  364. package/dist/value-labels-BV9keAuL.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-CxR4tg1Q.js","names":[],"sources":["../src/charts/line.ts"],"sourcesContent":["import type { ChartType, RenderContext, RenderResult } from '../chart.ts'\nimport { fadeMask } from '../components/fade.ts'\nimport { feature } from '../features.ts'\nimport { round } from '../layout.ts'\nimport { areaPath, type Curve, linePath, type Point } from '../shapes/path.ts'\nimport { h } from '../vnode.ts'\nimport {\n type CartesianOptions,\n cartesianLayout,\n categoryInteraction,\n markerShape,\n plottable,\n pointMark,\n resolveLabels,\n type Series,\n seriesAttrs,\n seriesAxes,\n seriesKey,\n seriesLegend,\n seriesScale,\n seriesTable,\n} from './cartesian.ts'\nimport { cleanData, cleanSeries } from './clean.ts'\nimport { type StackMode, stackBounds, stackSeries } from './stack.ts'\n\nexport interface LineOptions extends CartesianOptions {\n /** Interpolation between points. Defaults to `'monotone'`. */\n curve?: Curve\n /** Draw dots on every point, only on the last one, or none. Defaults to `'none'`. */\n points?: 'none' | 'last' | 'all'\n /** Dot radius in pixels. Defaults to `4`. */\n pointRadius?: number\n /** Bridge `null` values instead of leaving gaps. Defaults to `false`. */\n connectNulls?: boolean\n /** Fill the area under each line. Defaults to `false` (`true` for `area`). */\n area?: boolean\n /**\n * Area fill style: a vertical fade (strength set by `--tc-area-gradient-start`\n * / `--tc-area-gradient-end`) or a flat wash (`--tc-area-opacity`).\n * Defaults to `'gradient'`, or `'solid'` for stacked areas.\n */\n fill?: 'gradient' | 'solid'\n /**\n * Stack series on top of each other (each line draws the running total);\n * `'percent'` shows every category as 100%. Missing values count as zero.\n */\n stacked?: StackMode\n /**\n * Draw long series with at most this many points, chosen by LTTB\n * downsampling so peaks and valleys survive. Tooltips and keyboard\n * navigation still use every value. Off by default.\n */\n decimate?: number\n}\n\n/** Points in pixels for a series; `null` for missing values. */\nfunction seriesPoints(\n series: Series,\n count: number,\n x: (i: number) => number,\n y: (v: number) => number,\n connectNulls: boolean,\n valid: (v: number | null | undefined) => v is number,\n): Point[] {\n const points: Point[] = []\n for (let i = 0; i < count; i++) {\n const v = series.values[i]\n if (!valid(v)) {\n if (!connectNulls) points.push(null)\n } else {\n points.push([x(i), y(v)])\n }\n }\n return points\n}\n\n/** Render line (and optionally area) series; shared by `line` and `area`. */\nexport function renderLines(options: LineOptions, ctx: RenderContext, fill: boolean): RenderResult {\n const {\n curve = 'monotone',\n points = 'none',\n pointRadius = 4,\n connectNulls = false,\n area: filled = fill,\n stacked = false,\n decimate,\n // Faded layers would show light seams between stacked areas, so stacks default to solid.\n fill: fillStyle = stacked ? 'solid' : 'gradient',\n } = options\n const overhang = points === 'none' ? 2 : pointRadius + 2\n const { series } = options.data\n const count = resolveLabels(options.data).length\n const axisOf = seriesAxes(options)\n // Series on the second axis keep out of the stacks.\n const seconds = series.filter((s) => axisOf(s).second).map(seriesKey)\n const stacks = stacked\n ? stackSeries(series, count, {\n percent: stacked === 'percent',\n nullAsZero: true,\n hidden: seconds.length ? new Set([...ctx.hidden, ...seconds]) : ctx.hidden,\n })\n : null\n const layout = cartesianLayout(options, ctx, {\n scale: 'point',\n zero: filled || stacks !== null,\n zero2: filled,\n overhang,\n ...(stacks ? { values: stackBounds(stacks) } : {}),\n ...(stacked === 'percent' ? { tickFormat: { style: 'percent' } } : {}),\n })\n const { x, labels } = layout\n const scaleOf = (index: number) => seriesScale(layout, series[index])\n // Areas grow from zero, or from the bottom of the plot when zero is out of view.\n const baselineOf = (index: number) => {\n const y = scaleOf(index)\n return y(Math.min(Math.max(0, y.domain[0]), y.domain[1]))\n }\n // (series left out of the stacks have empty rows there)\n const stackOf = (index: number) => (!axisOf(series[index]).second && stacks?.[index]) || null\n const interaction = categoryInteraction(layout, options, ctx, (seriesIndex, i, v) => {\n const stack = stackOf(seriesIndex)\n return { x: x.at(i), y: scaleOf(seriesIndex)(stack ? (stack[i]?.y1 ?? 0) : v) }\n })\n const gradient = filled && fillStyle === 'gradient'\n const fadeId = `${ctx.id}-fade`\n\n // Hidden series keep their index (and color slot) but draw nothing.\n const visible = (s: Series) => !ctx.hidden.has(seriesKey(s))\n const all = series.map((s, index) => {\n if (!visible(s)) return []\n const y = scaleOf(index)\n // Stacked series draw their running total.\n const stack = stackOf(index)\n if (stack) return stack.map((seg, i): Point => (seg ? [x.at(i), y(seg.y1)] : null))\n const axis = axisOf(s).axis\n return seriesPoints(\n s,\n labels.length,\n (i) => x.at(i),\n y,\n connectNulls,\n (v) => plottable(v, axis),\n )\n })\n /** Indices drawn per series: a downsampled subset when `decimate` is set. */\n const kept = all.map((pts) =>\n decimate !== undefined && pts.length > decimate ? feature('decimate')(pts, decimate) : null,\n )\n const drawn = (index: number): Point[] => {\n const pts = all[index] as Point[]\n const keep = kept[index]\n return keep ? keep.map((i) => pts[i] as Point) : pts\n }\n /** Area bottom: zero, or the top of the layer below for stacks (downsampled alike). */\n const bottom = (index: number): number | (number | null)[] => {\n const stack = stackOf(index)\n if (!stack) return baselineOf(index)\n const y = scaleOf(index)\n const bottoms = stack.map((seg) => (seg ? y(seg.y0) : null))\n const keep = kept[index]\n return keep ? keep.map((i) => bottoms[i] ?? null) : bottoms\n }\n\n // All areas go below all lines, so a filled series never covers another line.\n const areas =\n filled &&\n h(\n 'g',\n { class: 'tc-areas' },\n options.data.series.map(\n (s, index) =>\n visible(s) &&\n h(\n 'g',\n seriesAttrs(s, index),\n h('path', {\n class: ['tc-area', gradient && 'tc-area-gradient'],\n d: areaPath(drawn(index), bottom(index), { curve }),\n mask: gradient ? `url(#${fadeId})` : undefined,\n }),\n ),\n ),\n )\n\n const shape = markerShape(options)\n const lines = options.data.series.map((s, index) => {\n if (!visible(s)) return null\n const pts = drawn(index)\n const valid = pts.filter((p): p is readonly [number, number] => p != null)\n const dots = points === 'all' ? valid : points === 'last' ? valid.slice(-1) : []\n return h(\n 'g',\n seriesAttrs(s, index),\n h('path', { class: 'tc-line', d: linePath(pts, { curve }) }),\n dots.length > 0 &&\n h(\n 'g',\n { class: 'tc-points' },\n dots.map(([cx, cy]) =>\n pointMark(shape, index, cx, 'tc-point', round(cx), round(cy), pointRadius),\n ),\n ),\n )\n })\n\n const content = [\n h('defs', { key: 'defs' }, layout.clip.def, gradient && fadeMask(fadeId)),\n layout.background,\n // Layers are keyed: an annotation band or a grid that comes and goes must not\n // shift the series list onto another node (that would recreate every series).\n h('g', { key: 'series', class: 'tc-series-list', 'clip-path': layout.clip.url }, areas, lines),\n layout.foreground,\n ]\n return { content, interaction }\n}\n\n/**\n * Line chart: one line per series over category labels.\n *\n * ```ts\n * new Chart('#el', {\n * type: line,\n * data: { labels: ['Jan', 'Feb', 'Mar'], series: [{ name: 'Sales', values: [3, 5, 4] }] },\n * })\n * ```\n */\nexport const line: ChartType<LineOptions> = {\n name: 'line',\n clean: cleanData(cleanSeries),\n render: (options, ctx) => renderLines(options, ctx, false),\n legend: (options) => seriesLegend(options.data),\n table: (options, ctx, limit) => seriesTable(options, ctx, limit),\n}\n"],"mappings":";;;;;;;;;AAwDA,SAAS,aACP,QACA,OACA,GACA,GACA,cACA,OACS;CACT,MAAM,SAAkB,CAAC;CACzB,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,KAAK;EAC9B,MAAM,IAAI,OAAO,OAAO;EACxB,IAAI,CAAC,MAAM,CAAC,GACN;OAAA,CAAC,cAAc,OAAO,KAAK,IAAI;EAAA,OAEnC,OAAO,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;CAE5B;CACA,OAAO;AACT;;AAGA,SAAgB,YAAY,SAAsB,KAAoB,MAA6B;CACjG,MAAM,EACJ,QAAQ,YACR,SAAS,QACT,cAAc,GACd,eAAe,OACf,MAAM,SAAS,MACf,UAAU,OACV,UAEA,MAAM,YAAY,UAAU,UAAU,eACpC;CACJ,MAAM,WAAW,WAAW,SAAS,IAAI,cAAc;CACvD,MAAM,EAAE,WAAW,QAAQ;CAC3B,MAAM,QAAQ,cAAc,QAAQ,IAAI,CAAC,CAAC;CAC1C,MAAM,SAAS,WAAW,OAAO;CAEjC,MAAM,UAAU,OAAO,QAAQ,MAAM,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,SAAS;CACpE,MAAM,SAAS,UACX,YAAY,QAAQ,OAAO;EACzB,SAAS,YAAY;EACrB,YAAY;EACZ,QAAQ,QAAQ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,GAAG,OAAO;EACxB,MAAM,MAAM,MAAM,KAAK;EACvB,MAAM,QAAQ,IAAI,QAAQ,MAAsC,KAAK,IAAI;EACzE,MAAM,OAAO,WAAW,QAAQ,QAAQ,WAAW,SAAS,MAAM,MAAM,EAAE,IAAI,CAAC;EAC/E,OAAO,EACL,KACA,YAAY,GAAG,KAAK,GACpB,EAAE,QAAQ;GAAE,OAAO;GAAW,GAAG,SAAS,KAAK,EAAE,MAAM,CAAC;EAAE,CAAC,GAC3D,KAAK,SAAS,KACZ,EACE,KACA,EAAE,OAAO,YAAY,GACrB,KAAK,KAAK,CAAC,IAAI,QACb,UAAU,OAAO,OAAO,IAAI,YAAY,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,WAAW,CAC3E,CACF,CACJ;CACF,CAAC;CAUD,OAAO;EAAE,SAAA;GAPP,EAAE,QAAQ,EAAE,KAAK,OAAO,GAAG,OAAO,KAAK,KAAK,YAAY,SAAS,MAAM,CAAC;GACxE,OAAO;GAGP,EAAE,KAAK;IAAE,KAAK;IAAU,OAAO;IAAkB,aAAa,OAAO,KAAK;GAAI,GAAG,OAAO,KAAK;GAC7F,OAAO;EAEM;EAAG;CAAY;AAChC;;;;;;;;;;;AAYA,MAAa,OAA+B;CAC1C,MAAM;CACN,OAAO,UAAU,WAAW;CAC5B,SAAS,SAAS,QAAQ,YAAY,SAAS,KAAK,KAAK;CACzD,SAAS,YAAY,aAAa,QAAQ,IAAI;CAC9C,QAAQ,SAAS,KAAK,UAAU,YAAY,SAAS,KAAK,KAAK;AACjE"}
@@ -1,10 +1,10 @@
1
- const require_fade = require("./fade-DVTkhrFU.cjs");
2
- const require_features = require("./features-DCXEvoya.cjs");
3
- const require_layout = require("./layout-JY2aR-yE.cjs");
1
+ const require_fade = require("./fade-CRqcKMWY.cjs");
2
+ const require_features = require("./features-DEDP5CEQ.cjs");
3
+ const require_layout = require("./layout-Cfg9x1k2.cjs");
4
4
  const require_vnode = require("./vnode-ClAiw28x.cjs");
5
- const require_cartesian = require("./cartesian-DV02PsBe.cjs");
5
+ const require_cartesian = require("./cartesian-DRSXHxWe.cjs");
6
6
  const require_clean = require("./clean-Die2iCNc.cjs");
7
- const require_stack = require("./stack-BgPzoQmv.cjs");
7
+ const require_stack = require("./stack-BO4624CY.cjs");
8
8
  // src/charts/line.ts
9
9
  /** Points in pixels for a series; `null` for missing values. */
10
10
  function seriesPoints(series, count, x, y, connectNulls, valid) {
@@ -23,32 +23,45 @@ function renderLines(options, ctx, fill) {
23
23
  const overhang = points === "none" ? 2 : pointRadius + 2;
24
24
  const { series } = options.data;
25
25
  const count = require_cartesian.resolveLabels(options.data).length;
26
+ const axisOf = require_cartesian.seriesAxes(options);
27
+ const seconds = series.filter((s) => axisOf(s).second).map(require_cartesian.seriesKey);
26
28
  const stacks = stacked ? require_stack.stackSeries(series, count, {
27
29
  percent: stacked === "percent",
28
30
  nullAsZero: true,
29
- hidden: ctx.hidden
31
+ hidden: seconds.length ? /* @__PURE__ */ new Set([...ctx.hidden, ...seconds]) : ctx.hidden
30
32
  }) : null;
31
33
  const layout = require_cartesian.cartesianLayout(options, ctx, {
32
34
  scale: "point",
33
35
  zero: filled || stacks !== null,
36
+ zero2: filled,
34
37
  overhang,
35
38
  ...stacks ? { values: require_stack.stackBounds(stacks) } : {},
36
39
  ...stacked === "percent" ? { tickFormat: { style: "percent" } } : {}
37
40
  });
38
- const { x, y, labels } = layout;
39
- const baseline = y(Math.min(Math.max(0, y.domain[0]), y.domain[1]));
40
- ctx.onHitTest(require_cartesian.categoryInteraction(layout, options, ctx, (seriesIndex, i, v) => ({
41
- x: x.at(i),
42
- y: y(stacks ? stacks[seriesIndex]?.[i]?.y1 ?? 0 : v)
43
- })));
41
+ const { x, labels } = layout;
42
+ const scaleOf = (index) => require_cartesian.seriesScale(layout, series[index]);
43
+ const baselineOf = (index) => {
44
+ const y = scaleOf(index);
45
+ return y(Math.min(Math.max(0, y.domain[0]), y.domain[1]));
46
+ };
47
+ const stackOf = (index) => !axisOf(series[index]).second && stacks?.[index] || null;
48
+ const interaction = require_cartesian.categoryInteraction(layout, options, ctx, (seriesIndex, i, v) => {
49
+ const stack = stackOf(seriesIndex);
50
+ return {
51
+ x: x.at(i),
52
+ y: scaleOf(seriesIndex)(stack ? stack[i]?.y1 ?? 0 : v)
53
+ };
54
+ });
44
55
  const gradient = filled && fillStyle === "gradient";
45
56
  const fadeId = `${ctx.id}-fade`;
46
57
  const visible = (s) => !ctx.hidden.has(require_cartesian.seriesKey(s));
47
58
  const all = series.map((s, index) => {
48
59
  if (!visible(s)) return [];
49
- const stack = stacks?.[index];
60
+ const y = scaleOf(index);
61
+ const stack = stackOf(index);
50
62
  if (stack) return stack.map((seg, i) => seg ? [x.at(i), y(seg.y1)] : null);
51
- return seriesPoints(s, labels.length, (i) => x.at(i), y, connectNulls, (v) => require_cartesian.plottable(v, options.y));
63
+ const axis = axisOf(s).axis;
64
+ return seriesPoints(s, labels.length, (i) => x.at(i), y, connectNulls, (v) => require_cartesian.plottable(v, axis));
52
65
  });
53
66
  /** Indices drawn per series: a downsampled subset when `decimate` is set. */
54
67
  const kept = all.map((pts) => decimate !== void 0 && pts.length > decimate ? require_features.feature("decimate")(pts, decimate) : null);
@@ -59,8 +72,9 @@ function renderLines(options, ctx, fill) {
59
72
  };
60
73
  /** Area bottom: zero, or the top of the layer below for stacks (downsampled alike). */
61
74
  const bottom = (index) => {
62
- const stack = stacks?.[index];
63
- if (!stack) return baseline;
75
+ const stack = stackOf(index);
76
+ if (!stack) return baselineOf(index);
77
+ const y = scaleOf(index);
64
78
  const bottoms = stack.map((seg) => seg ? y(seg.y0) : null);
65
79
  const keep = kept[index];
66
80
  return keep ? keep.map((i) => bottoms[i] ?? null) : bottoms;
@@ -70,6 +84,7 @@ function renderLines(options, ctx, fill) {
70
84
  d: require_fade.areaPath(drawn(index), bottom(index), { curve }),
71
85
  mask: gradient ? `url(#${fadeId})` : void 0
72
86
  }))));
87
+ const shape = require_cartesian.markerShape(options);
73
88
  const lines = options.data.series.map((s, index) => {
74
89
  if (!visible(s)) return null;
75
90
  const pts = drawn(index);
@@ -78,24 +93,21 @@ function renderLines(options, ctx, fill) {
78
93
  return require_vnode.h("g", require_cartesian.seriesAttrs(s, index), require_vnode.h("path", {
79
94
  class: "tc-line",
80
95
  d: require_fade.linePath(pts, { curve })
81
- }), dots.length > 0 && require_vnode.h("g", { class: "tc-points" }, dots.map(([cx, cy]) => require_vnode.h("circle", {
82
- key: cx,
83
- class: "tc-point",
84
- cx: require_layout.round(cx),
85
- cy: require_layout.round(cy),
86
- r: pointRadius
87
- }))));
96
+ }), dots.length > 0 && require_vnode.h("g", { class: "tc-points" }, dots.map(([cx, cy]) => require_cartesian.pointMark(shape, index, cx, "tc-point", require_layout.round(cx), require_layout.round(cy), pointRadius))));
88
97
  });
89
- return [
90
- require_vnode.h("defs", { key: "defs" }, layout.clip.def, gradient && require_fade.fadeMask(fadeId)),
91
- layout.background,
92
- require_vnode.h("g", {
93
- key: "series",
94
- class: "tc-series-list",
95
- "clip-path": layout.clip.url
96
- }, areas, lines),
97
- layout.foreground
98
- ];
98
+ return {
99
+ content: [
100
+ require_vnode.h("defs", { key: "defs" }, layout.clip.def, gradient && require_fade.fadeMask(fadeId)),
101
+ layout.background,
102
+ require_vnode.h("g", {
103
+ key: "series",
104
+ class: "tc-series-list",
105
+ "clip-path": layout.clip.url
106
+ }, areas, lines),
107
+ layout.foreground
108
+ ],
109
+ interaction
110
+ };
99
111
  }
100
112
  /**
101
113
  * Line chart: one line per series over category labels.
@@ -127,4 +139,4 @@ Object.defineProperty(exports, "renderLines", {
127
139
  }
128
140
  });
129
141
 
130
- //# sourceMappingURL=line-Dbt6KFRK.cjs.map
142
+ //# sourceMappingURL=line-YiCuhVMI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-YiCuhVMI.cjs","names":["resolveLabels","seriesAxes","seriesKey","stackSeries","cartesianLayout","stackBounds","seriesScale","categoryInteraction","plottable","feature","h","seriesAttrs","areaPath","markerShape","linePath","pointMark","round","fadeMask","cleanData","cleanSeries","seriesLegend","seriesTable"],"sources":["../src/charts/line.ts"],"sourcesContent":["import type { ChartType, RenderContext, RenderResult } from '../chart.ts'\nimport { fadeMask } from '../components/fade.ts'\nimport { feature } from '../features.ts'\nimport { round } from '../layout.ts'\nimport { areaPath, type Curve, linePath, type Point } from '../shapes/path.ts'\nimport { h } from '../vnode.ts'\nimport {\n type CartesianOptions,\n cartesianLayout,\n categoryInteraction,\n markerShape,\n plottable,\n pointMark,\n resolveLabels,\n type Series,\n seriesAttrs,\n seriesAxes,\n seriesKey,\n seriesLegend,\n seriesScale,\n seriesTable,\n} from './cartesian.ts'\nimport { cleanData, cleanSeries } from './clean.ts'\nimport { type StackMode, stackBounds, stackSeries } from './stack.ts'\n\nexport interface LineOptions extends CartesianOptions {\n /** Interpolation between points. Defaults to `'monotone'`. */\n curve?: Curve\n /** Draw dots on every point, only on the last one, or none. Defaults to `'none'`. */\n points?: 'none' | 'last' | 'all'\n /** Dot radius in pixels. Defaults to `4`. */\n pointRadius?: number\n /** Bridge `null` values instead of leaving gaps. Defaults to `false`. */\n connectNulls?: boolean\n /** Fill the area under each line. Defaults to `false` (`true` for `area`). */\n area?: boolean\n /**\n * Area fill style: a vertical fade (strength set by `--tc-area-gradient-start`\n * / `--tc-area-gradient-end`) or a flat wash (`--tc-area-opacity`).\n * Defaults to `'gradient'`, or `'solid'` for stacked areas.\n */\n fill?: 'gradient' | 'solid'\n /**\n * Stack series on top of each other (each line draws the running total);\n * `'percent'` shows every category as 100%. Missing values count as zero.\n */\n stacked?: StackMode\n /**\n * Draw long series with at most this many points, chosen by LTTB\n * downsampling so peaks and valleys survive. Tooltips and keyboard\n * navigation still use every value. Off by default.\n */\n decimate?: number\n}\n\n/** Points in pixels for a series; `null` for missing values. */\nfunction seriesPoints(\n series: Series,\n count: number,\n x: (i: number) => number,\n y: (v: number) => number,\n connectNulls: boolean,\n valid: (v: number | null | undefined) => v is number,\n): Point[] {\n const points: Point[] = []\n for (let i = 0; i < count; i++) {\n const v = series.values[i]\n if (!valid(v)) {\n if (!connectNulls) points.push(null)\n } else {\n points.push([x(i), y(v)])\n }\n }\n return points\n}\n\n/** Render line (and optionally area) series; shared by `line` and `area`. */\nexport function renderLines(options: LineOptions, ctx: RenderContext, fill: boolean): RenderResult {\n const {\n curve = 'monotone',\n points = 'none',\n pointRadius = 4,\n connectNulls = false,\n area: filled = fill,\n stacked = false,\n decimate,\n // Faded layers would show light seams between stacked areas, so stacks default to solid.\n fill: fillStyle = stacked ? 'solid' : 'gradient',\n } = options\n const overhang = points === 'none' ? 2 : pointRadius + 2\n const { series } = options.data\n const count = resolveLabels(options.data).length\n const axisOf = seriesAxes(options)\n // Series on the second axis keep out of the stacks.\n const seconds = series.filter((s) => axisOf(s).second).map(seriesKey)\n const stacks = stacked\n ? stackSeries(series, count, {\n percent: stacked === 'percent',\n nullAsZero: true,\n hidden: seconds.length ? new Set([...ctx.hidden, ...seconds]) : ctx.hidden,\n })\n : null\n const layout = cartesianLayout(options, ctx, {\n scale: 'point',\n zero: filled || stacks !== null,\n zero2: filled,\n overhang,\n ...(stacks ? { values: stackBounds(stacks) } : {}),\n ...(stacked === 'percent' ? { tickFormat: { style: 'percent' } } : {}),\n })\n const { x, labels } = layout\n const scaleOf = (index: number) => seriesScale(layout, series[index])\n // Areas grow from zero, or from the bottom of the plot when zero is out of view.\n const baselineOf = (index: number) => {\n const y = scaleOf(index)\n return y(Math.min(Math.max(0, y.domain[0]), y.domain[1]))\n }\n // (series left out of the stacks have empty rows there)\n const stackOf = (index: number) => (!axisOf(series[index]).second && stacks?.[index]) || null\n const interaction = categoryInteraction(layout, options, ctx, (seriesIndex, i, v) => {\n const stack = stackOf(seriesIndex)\n return { x: x.at(i), y: scaleOf(seriesIndex)(stack ? (stack[i]?.y1 ?? 0) : v) }\n })\n const gradient = filled && fillStyle === 'gradient'\n const fadeId = `${ctx.id}-fade`\n\n // Hidden series keep their index (and color slot) but draw nothing.\n const visible = (s: Series) => !ctx.hidden.has(seriesKey(s))\n const all = series.map((s, index) => {\n if (!visible(s)) return []\n const y = scaleOf(index)\n // Stacked series draw their running total.\n const stack = stackOf(index)\n if (stack) return stack.map((seg, i): Point => (seg ? [x.at(i), y(seg.y1)] : null))\n const axis = axisOf(s).axis\n return seriesPoints(\n s,\n labels.length,\n (i) => x.at(i),\n y,\n connectNulls,\n (v) => plottable(v, axis),\n )\n })\n /** Indices drawn per series: a downsampled subset when `decimate` is set. */\n const kept = all.map((pts) =>\n decimate !== undefined && pts.length > decimate ? feature('decimate')(pts, decimate) : null,\n )\n const drawn = (index: number): Point[] => {\n const pts = all[index] as Point[]\n const keep = kept[index]\n return keep ? keep.map((i) => pts[i] as Point) : pts\n }\n /** Area bottom: zero, or the top of the layer below for stacks (downsampled alike). */\n const bottom = (index: number): number | (number | null)[] => {\n const stack = stackOf(index)\n if (!stack) return baselineOf(index)\n const y = scaleOf(index)\n const bottoms = stack.map((seg) => (seg ? y(seg.y0) : null))\n const keep = kept[index]\n return keep ? keep.map((i) => bottoms[i] ?? null) : bottoms\n }\n\n // All areas go below all lines, so a filled series never covers another line.\n const areas =\n filled &&\n h(\n 'g',\n { class: 'tc-areas' },\n options.data.series.map(\n (s, index) =>\n visible(s) &&\n h(\n 'g',\n seriesAttrs(s, index),\n h('path', {\n class: ['tc-area', gradient && 'tc-area-gradient'],\n d: areaPath(drawn(index), bottom(index), { curve }),\n mask: gradient ? `url(#${fadeId})` : undefined,\n }),\n ),\n ),\n )\n\n const shape = markerShape(options)\n const lines = options.data.series.map((s, index) => {\n if (!visible(s)) return null\n const pts = drawn(index)\n const valid = pts.filter((p): p is readonly [number, number] => p != null)\n const dots = points === 'all' ? valid : points === 'last' ? valid.slice(-1) : []\n return h(\n 'g',\n seriesAttrs(s, index),\n h('path', { class: 'tc-line', d: linePath(pts, { curve }) }),\n dots.length > 0 &&\n h(\n 'g',\n { class: 'tc-points' },\n dots.map(([cx, cy]) =>\n pointMark(shape, index, cx, 'tc-point', round(cx), round(cy), pointRadius),\n ),\n ),\n )\n })\n\n const content = [\n h('defs', { key: 'defs' }, layout.clip.def, gradient && fadeMask(fadeId)),\n layout.background,\n // Layers are keyed: an annotation band or a grid that comes and goes must not\n // shift the series list onto another node (that would recreate every series).\n h('g', { key: 'series', class: 'tc-series-list', 'clip-path': layout.clip.url }, areas, lines),\n layout.foreground,\n ]\n return { content, interaction }\n}\n\n/**\n * Line chart: one line per series over category labels.\n *\n * ```ts\n * new Chart('#el', {\n * type: line,\n * data: { labels: ['Jan', 'Feb', 'Mar'], series: [{ name: 'Sales', values: [3, 5, 4] }] },\n * })\n * ```\n */\nexport const line: ChartType<LineOptions> = {\n name: 'line',\n clean: cleanData(cleanSeries),\n render: (options, ctx) => renderLines(options, ctx, false),\n legend: (options) => seriesLegend(options.data),\n table: (options, ctx, limit) => seriesTable(options, ctx, limit),\n}\n"],"mappings":";;;;;;;;;AAwDA,SAAS,aACP,QACA,OACA,GACA,GACA,cACA,OACS;CACT,MAAM,SAAkB,CAAC;CACzB,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,KAAK;EAC9B,MAAM,IAAI,OAAO,OAAO;EACxB,IAAI,CAAC,MAAM,CAAC,GACN;OAAA,CAAC,cAAc,OAAO,KAAK,IAAI;EAAA,OAEnC,OAAO,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;CAE5B;CACA,OAAO;AACT;;AAGA,SAAgB,YAAY,SAAsB,KAAoB,MAA6B;CACjG,MAAM,EACJ,QAAQ,YACR,SAAS,QACT,cAAc,GACd,eAAe,OACf,MAAM,SAAS,MACf,UAAU,OACV,UAEA,MAAM,YAAY,UAAU,UAAU,eACpC;CACJ,MAAM,WAAW,WAAW,SAAS,IAAI,cAAc;CACvD,MAAM,EAAE,WAAW,QAAQ;CAC3B,MAAM,QAAQA,kBAAAA,cAAc,QAAQ,IAAI,CAAC,CAAC;CAC1C,MAAM,SAASC,kBAAAA,WAA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,cAAAA,WAAW;CAC5B,SAAS,SAAS,QAAQ,YAAY,SAAS,KAAK,KAAK;CACzD,SAAS,YAAYC,kBAAAA,aAAa,QAAQ,IAAI;CAC9C,QAAQ,SAAS,KAAK,UAAUC,kBAAAA,YAAY,SAAS,KAAK,KAAK;AACjE"}
@@ -1,7 +1,6 @@
1
- import { a as ChartType, rt as CartesianOptions } from "./chart-kqFMEwDo.cjs";
1
+ import { o as ChartType, ut as CartesianOptions } from "./chart-CbPzP5Dp.cjs";
2
2
  import { t as Curve } from "./path-YeUiOfG8.cjs";
3
- import "./vnode-Du2cC8Fm.cjs";
4
- import { t as StackMode } from "./stack-Dagxq7l2.cjs";
3
+ import { t as StackMode } from "./stack-BTWYIwLO.cjs";
5
4
  interface LineOptions extends CartesianOptions {
6
5
  /** Interpolation between points. Defaults to `'monotone'`. */
7
6
  curve?: Curve;
package/dist/line.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_features = require("./features-DCXEvoya.cjs");
3
- const require_fade = require("./fade-DVTkhrFU.cjs");
4
- const require_line = require("./line-Dbt6KFRK.cjs");
2
+ const require_features = require("./features-DEDP5CEQ.cjs");
3
+ const require_fade = require("./fade-CRqcKMWY.cjs");
4
+ const require_line = require("./line-YiCuhVMI.cjs");
5
5
  // src/line.ts
6
6
  /** Standalone entry: `import { line } from '@tabler/charts/line'`. */
7
7
  require_features.register({ line: {
package/dist/line.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as line, t as LineOptions } from "./line-_rNdeKmS.cjs";
1
+ import { n as line, t as LineOptions } from "./line-vyWO030v.cjs";
2
2
  export { type LineOptions, line };
package/dist/line.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as line, t as LineOptions } from "./line-DtSh7HQU.js";
1
+ import { n as line, t as LineOptions } from "./line-Bpr5uVLQ.js";
2
2
  export { type LineOptions, line };
package/dist/line.js CHANGED
@@ -1,6 +1,6 @@
1
- import { i as register } from "./features-BMxkqCyS.js";
2
- import { n as areaPath, r as linePath } from "./fade-GGxcBdss.js";
3
- export { t as line } from "./line-DO66LtwH.js";
1
+ import { i as register } from "./features-B55rwpQC.js";
2
+ import { n as areaPath, r as linePath } from "./fade-CDrQjnDz.js";
3
+ export { t as line } from "./line-CxR4tg1Q.js";
4
4
  // src/line.ts
5
5
  /** Standalone entry: `import { line } from '@tabler/charts/line'`. */
6
6
  register({ line: {
package/dist/log.cjs CHANGED
@@ -5,7 +5,7 @@ const require_log_axis = require("./log-axis-DdRNyAq8.cjs");
5
5
  * Registers logarithmic value axes (`scale: 'log'`):
6
6
  * `import '@tabler/charts/log'`. Also exports the scale itself.
7
7
  */
8
- require("./features-DCXEvoya.cjs").register({ log: {
8
+ require("./features-DEDP5CEQ.cjs").register({ log: {
9
9
  scale: require_log_axis.log,
10
10
  domain: require_log_axis.logDomain,
11
11
  ticks: require_log_axis.logTicks
package/dist/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as logTicks, r as log, t as logDomain } from "./log-axis-DhthtHFk.js";
2
- import { i as register } from "./features-BMxkqCyS.js";
2
+ import { i as register } from "./features-B55rwpQC.js";
3
3
  // src/log.ts
4
4
  /**
5
5
  * Registers logarithmic value axes (`scale: 'log'`):
@@ -0,0 +1,156 @@
1
+ import { Nt as Hit, o as ChartType } from "./chart-CbPzP5Dp.cjs";
2
+ import { c as NumberFormat } from "./time-B4oxWHQI.cjs";
3
+ import { a as InsetsInput } from "./annotations-CHafaGd4.cjs";
4
+ /** The part of a map in sight. */
5
+ interface MapView {
6
+ /** The top left corner, in the coordinates of the map file. */
7
+ x: number;
8
+ y: number;
9
+ /** How many times the map is magnified; `1` shows all of it. */
10
+ scale: number;
11
+ }
12
+ /** Where the last render put the map, for the zoom to work from. */
13
+ interface MapLayout {
14
+ /** The room of the map in chart pixels. */
15
+ x: number;
16
+ y: number;
17
+ width: number;
18
+ height: number;
19
+ /** Pixels per unit of the map when all of it is in sight. */
20
+ k: number;
21
+ /** Size of the map file. */
22
+ mapWidth: number;
23
+ mapHeight: number;
24
+ /** The most the map can be magnified. */
25
+ max: number;
26
+ }
27
+ /** One region of a map (a country, a state …). */
28
+ interface MapRegion {
29
+ name: string;
30
+ /**
31
+ * SVG path data in the coordinates of the map (`M`, `L`, `H`, `V` and `Z`,
32
+ * absolute or relative; curves are drawn but not hit by the pointer).
33
+ */
34
+ path: string;
35
+ /** Too small for a shape at the scale of the map: `path` is a single point, drawn as a dot when it has a value. */
36
+ point?: boolean;
37
+ }
38
+ /** A map: shapes already projected into a `width` × `height` box, as the files in `@tabler/charts/maps/*` are. */
39
+ interface MapData {
40
+ width: number;
41
+ height: number;
42
+ /** How the shapes were projected, to place a marker by its coordinates. */
43
+ projection?: {
44
+ type: "miller";
45
+ scale: number;
46
+ translate: readonly number[];
47
+ };
48
+ /** Regions by their code, e.g. ISO 3166-1 alpha-2 for countries. */
49
+ regions: Readonly<Record<string, MapRegion>>;
50
+ }
51
+ /** A place on the map, by its coordinates. */
52
+ interface MapMarker {
53
+ /** Shown in the tooltip, and what a line refers to. */
54
+ name?: string;
55
+ /** Latitude and longitude in degrees. */
56
+ lat: number;
57
+ lng: number;
58
+ }
59
+ /** A curve between two markers, by their names. */
60
+ interface MapLine {
61
+ from: string;
62
+ to: string;
63
+ }
64
+ interface MapOptions {
65
+ /** The map: a map file (`import { world } from '@tabler/charts/maps/world'`), or the name it was given with `addMap()`. */
66
+ map: MapData | string;
67
+ /** A value per region code, e.g. `{ PL: 80, DE: 45 }`. Regions without one keep the empty shade. */
68
+ data: Readonly<Record<string, number | null>>;
69
+ /** Value shown with the lightest shade (or the first color). Defaults to the smaller of `0` and the data minimum. */
70
+ min?: number;
71
+ /** Value shown with the full color (or the last color). Defaults to the data maximum. */
72
+ max?: number;
73
+ /**
74
+ * A continuous scale through two or more colors (any CSS color, including
75
+ * `var(--tc-…)`), from `min` to `max`, instead of one hue (`--tc-heat-color`).
76
+ * Values that could inject CSS are ignored, as for series colors.
77
+ */
78
+ colors?: readonly string[];
79
+ /** Value placed on the middle color of `colors` (e.g. `0` for changes). Defaults to halfway. */
80
+ mid?: number;
81
+ /** Places drawn as dots over the map. */
82
+ markers?: readonly MapMarker[];
83
+ /** Dashed curves between markers. */
84
+ lines?: readonly MapLine[];
85
+ /** Radius of the markers and of the regions drawn as a dot, in pixels. Defaults to `4`. */
86
+ markerRadius?: number;
87
+ /** Format of the values (tooltip, scale, table). */
88
+ format?: NumberFormat;
89
+ /**
90
+ * The bar below the map with the lowest and the highest value: `false`
91
+ * hides it, an object names its ends instead of the values.
92
+ */
93
+ scale?: boolean | {
94
+ low?: string;
95
+ high?: string;
96
+ };
97
+ /** Extra space around the map, in pixels. */
98
+ padding?: InsetsInput;
99
+ /**
100
+ * Let the map be magnified with its buttons, the wheel, a double click, a
101
+ * pinch or the `+` and `-` keys, and dragged around. An object sets the
102
+ * most it magnifies (`max`, `8` by default), turns the wheel off
103
+ * (`wheel: false`) and names the buttons (`labels`).
104
+ */
105
+ zoom?: boolean | {
106
+ max?: number;
107
+ wheel?: boolean;
108
+ labels?: {
109
+ in?: string;
110
+ out?: string;
111
+ };
112
+ };
113
+ /**
114
+ * The part of the map in sight. Zooming and dragging write it; set it
115
+ * yourself to start on a part of the map, leave it out for the whole map.
116
+ */
117
+ view?: Partial<MapView>;
118
+ /**
119
+ * Let regions be selected with a click (or Enter on the region the
120
+ * keyboard is on): one at a time, or any number of them. A click on a
121
+ * selected region takes it out again.
122
+ */
123
+ select?: "single" | "multiple";
124
+ /** Codes of the selected regions. Selecting writes it; `onSelect` hears of it. */
125
+ selected?: readonly string[];
126
+ /** Called when a click or a key changes the selection, with the codes now selected and the one that changed. */
127
+ onSelect?: (selected: string[], code: string) => void;
128
+ }
129
+ /** A hit of a map: what it is on. */
130
+ interface MapHit extends Hit {
131
+ /** Code of the region, for a hit on a region. */
132
+ region?: string;
133
+ /** Name of the marker, for a hit on a marker. */
134
+ marker?: string;
135
+ }
136
+ /** Register a map under a name, so `map: 'world'` finds it (configs from JSON, `<tabler-chart>`, the data API). */
137
+ declare function addMap(name: string, data: MapData): void;
138
+ /**
139
+ * Map: the regions of a map file as SVG shapes, shaded by value from the
140
+ * empty shade to the full color (`--tc-heat-color`, the cells of the
141
+ * heatmap) or through a scale of `colors`, with markers placed by their
142
+ * coordinates, lines between them and a bar of the scale. The shapes come
143
+ * projected from the map file, so no geo library ships to the browser.
144
+ *
145
+ * ```ts
146
+ * import { world } from '@tabler/charts/maps/world'
147
+ *
148
+ * new Chart('#el', {
149
+ * type: map,
150
+ * map: world,
151
+ * data: { PL: 80, DE: 45, US: 100 },
152
+ * })
153
+ * ```
154
+ */
155
+ declare const map: ChartType<MapOptions>;
156
+ export { MapOptions as a, map as c, MapMarker as i, MapLayout as l, MapHit as n, MapRegion as o, MapLine as r, addMap as s, MapData as t, MapView as u };
@@ -0,0 +1,156 @@
1
+ import { kt as Hit, o as ChartType } from "./chart-CYrrUCi3.js";
2
+ import { c as NumberFormat } from "./time-DRIDgv2a.js";
3
+ import { a as InsetsInput } from "./annotations-B02GR_KU.js";
4
+ /** The part of a map in sight. */
5
+ interface MapView {
6
+ /** The top left corner, in the coordinates of the map file. */
7
+ x: number;
8
+ y: number;
9
+ /** How many times the map is magnified; `1` shows all of it. */
10
+ scale: number;
11
+ }
12
+ /** Where the last render put the map, for the zoom to work from. */
13
+ interface MapLayout {
14
+ /** The room of the map in chart pixels. */
15
+ x: number;
16
+ y: number;
17
+ width: number;
18
+ height: number;
19
+ /** Pixels per unit of the map when all of it is in sight. */
20
+ k: number;
21
+ /** Size of the map file. */
22
+ mapWidth: number;
23
+ mapHeight: number;
24
+ /** The most the map can be magnified. */
25
+ max: number;
26
+ }
27
+ /** One region of a map (a country, a state …). */
28
+ interface MapRegion {
29
+ name: string;
30
+ /**
31
+ * SVG path data in the coordinates of the map (`M`, `L`, `H`, `V` and `Z`,
32
+ * absolute or relative; curves are drawn but not hit by the pointer).
33
+ */
34
+ path: string;
35
+ /** Too small for a shape at the scale of the map: `path` is a single point, drawn as a dot when it has a value. */
36
+ point?: boolean;
37
+ }
38
+ /** A map: shapes already projected into a `width` × `height` box, as the files in `@tabler/charts/maps/*` are. */
39
+ interface MapData {
40
+ width: number;
41
+ height: number;
42
+ /** How the shapes were projected, to place a marker by its coordinates. */
43
+ projection?: {
44
+ type: "miller";
45
+ scale: number;
46
+ translate: readonly number[];
47
+ };
48
+ /** Regions by their code, e.g. ISO 3166-1 alpha-2 for countries. */
49
+ regions: Readonly<Record<string, MapRegion>>;
50
+ }
51
+ /** A place on the map, by its coordinates. */
52
+ interface MapMarker {
53
+ /** Shown in the tooltip, and what a line refers to. */
54
+ name?: string;
55
+ /** Latitude and longitude in degrees. */
56
+ lat: number;
57
+ lng: number;
58
+ }
59
+ /** A curve between two markers, by their names. */
60
+ interface MapLine {
61
+ from: string;
62
+ to: string;
63
+ }
64
+ interface MapOptions {
65
+ /** The map: a map file (`import { world } from '@tabler/charts/maps/world'`), or the name it was given with `addMap()`. */
66
+ map: MapData | string;
67
+ /** A value per region code, e.g. `{ PL: 80, DE: 45 }`. Regions without one keep the empty shade. */
68
+ data: Readonly<Record<string, number | null>>;
69
+ /** Value shown with the lightest shade (or the first color). Defaults to the smaller of `0` and the data minimum. */
70
+ min?: number;
71
+ /** Value shown with the full color (or the last color). Defaults to the data maximum. */
72
+ max?: number;
73
+ /**
74
+ * A continuous scale through two or more colors (any CSS color, including
75
+ * `var(--tc-…)`), from `min` to `max`, instead of one hue (`--tc-heat-color`).
76
+ * Values that could inject CSS are ignored, as for series colors.
77
+ */
78
+ colors?: readonly string[];
79
+ /** Value placed on the middle color of `colors` (e.g. `0` for changes). Defaults to halfway. */
80
+ mid?: number;
81
+ /** Places drawn as dots over the map. */
82
+ markers?: readonly MapMarker[];
83
+ /** Dashed curves between markers. */
84
+ lines?: readonly MapLine[];
85
+ /** Radius of the markers and of the regions drawn as a dot, in pixels. Defaults to `4`. */
86
+ markerRadius?: number;
87
+ /** Format of the values (tooltip, scale, table). */
88
+ format?: NumberFormat;
89
+ /**
90
+ * The bar below the map with the lowest and the highest value: `false`
91
+ * hides it, an object names its ends instead of the values.
92
+ */
93
+ scale?: boolean | {
94
+ low?: string;
95
+ high?: string;
96
+ };
97
+ /** Extra space around the map, in pixels. */
98
+ padding?: InsetsInput;
99
+ /**
100
+ * Let the map be magnified with its buttons, the wheel, a double click, a
101
+ * pinch or the `+` and `-` keys, and dragged around. An object sets the
102
+ * most it magnifies (`max`, `8` by default), turns the wheel off
103
+ * (`wheel: false`) and names the buttons (`labels`).
104
+ */
105
+ zoom?: boolean | {
106
+ max?: number;
107
+ wheel?: boolean;
108
+ labels?: {
109
+ in?: string;
110
+ out?: string;
111
+ };
112
+ };
113
+ /**
114
+ * The part of the map in sight. Zooming and dragging write it; set it
115
+ * yourself to start on a part of the map, leave it out for the whole map.
116
+ */
117
+ view?: Partial<MapView>;
118
+ /**
119
+ * Let regions be selected with a click (or Enter on the region the
120
+ * keyboard is on): one at a time, or any number of them. A click on a
121
+ * selected region takes it out again.
122
+ */
123
+ select?: "single" | "multiple";
124
+ /** Codes of the selected regions. Selecting writes it; `onSelect` hears of it. */
125
+ selected?: readonly string[];
126
+ /** Called when a click or a key changes the selection, with the codes now selected and the one that changed. */
127
+ onSelect?: (selected: string[], code: string) => void;
128
+ }
129
+ /** A hit of a map: what it is on. */
130
+ interface MapHit extends Hit {
131
+ /** Code of the region, for a hit on a region. */
132
+ region?: string;
133
+ /** Name of the marker, for a hit on a marker. */
134
+ marker?: string;
135
+ }
136
+ /** Register a map under a name, so `map: 'world'` finds it (configs from JSON, `<tabler-chart>`, the data API). */
137
+ declare function addMap(name: string, data: MapData): void;
138
+ /**
139
+ * Map: the regions of a map file as SVG shapes, shaded by value from the
140
+ * empty shade to the full color (`--tc-heat-color`, the cells of the
141
+ * heatmap) or through a scale of `colors`, with markers placed by their
142
+ * coordinates, lines between them and a bar of the scale. The shapes come
143
+ * projected from the map file, so no geo library ships to the browser.
144
+ *
145
+ * ```ts
146
+ * import { world } from '@tabler/charts/maps/world'
147
+ *
148
+ * new Chart('#el', {
149
+ * type: map,
150
+ * map: world,
151
+ * data: { PL: 80, DE: 45, US: 100 },
152
+ * })
153
+ * ```
154
+ */
155
+ declare const map: ChartType<MapOptions>;
156
+ export { MapOptions as a, map as c, MapMarker as i, MapLayout as l, MapHit as n, MapRegion as o, MapLine as r, addMap as s, MapData as t, MapView as u };