@tabler/charts 0.0.1-alpha.0 → 0.2.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.
- package/README.md +33 -5
- package/dist/{annotations-Bp7HwtF5.d.ts → annotations-B02GR_KU.d.ts} +3 -8
- package/dist/{annotations-lyt0I3HU.d.cts → annotations-CHafaGd4.d.cts} +3 -8
- package/dist/{annotations-BszTTjf9.js → annotations-D0YQ0IoA.js} +6 -7
- package/dist/{annotations-BszTTjf9.js.map → annotations-D0YQ0IoA.js.map} +1 -1
- package/dist/{annotations-DpETO8dE.cjs → annotations-DdRdeBUB.cjs} +6 -7
- package/dist/{annotations-DpETO8dE.cjs.map → annotations-DdRdeBUB.cjs.map} +1 -1
- package/dist/annotations.cjs +3 -5
- package/dist/annotations.cjs.map +1 -1
- package/dist/annotations.d.cts +2 -1
- package/dist/annotations.d.ts +2 -1
- package/dist/annotations.js +3 -4
- package/dist/{sweep-WSgn2etB.js → arc-B3V5IR0w.js} +3 -60
- package/dist/arc-B3V5IR0w.js.map +1 -0
- package/dist/{sweep-Duowaput.cjs → arc-CYhI62kO.cjs} +2 -71
- package/dist/arc-CYhI62kO.cjs.map +1 -0
- package/dist/{area-DQsLERhx.js → area-0-L1bG9B.js} +5 -6
- package/dist/{area-DQsLERhx.js.map → area-0-L1bG9B.js.map} +1 -1
- package/dist/{area-sHCE3pg5.cjs → area-4eRs3c0K.cjs} +5 -6
- package/dist/{area-sHCE3pg5.cjs.map → area-4eRs3c0K.cjs.map} +1 -1
- package/dist/{area-DaO4MQl4.d.ts → area-CJX9219z.d.cts} +3 -6
- package/dist/{area-BFvkc-ZM.d.cts → area-d11XePuw.d.ts} +3 -6
- package/dist/area.cjs +1 -1
- package/dist/area.d.cts +2 -1
- package/dist/area.d.ts +2 -1
- package/dist/area.js +1 -2
- package/dist/{band-DTcNDAFO.d.ts → band-CNKvdnTC.d.cts} +1 -4
- package/dist/{band-DTcNDAFO.d.cts → band-CNKvdnTC.d.ts} +1 -4
- package/dist/{bar-DM16NUvV.js → bar-B5n2oq9-.js} +3 -4
- package/dist/{bar-DM16NUvV.js.map → bar-B5n2oq9-.js.map} +1 -1
- package/dist/{bar-DdsDxk3W.d.ts → bar-BDLR4p9c.d.cts} +4 -7
- package/dist/{bar-jZEoao74.js → bar-BNZ3GhIw.js} +20 -20
- package/dist/bar-BNZ3GhIw.js.map +1 -0
- package/dist/{bar-C-7zR2qp.cjs → bar-Da6dE_nI.cjs} +20 -20
- package/dist/bar-Da6dE_nI.cjs.map +1 -0
- package/dist/{bar-DGuUN3nc.cjs → bar-LYIF8MEz.cjs} +3 -4
- package/dist/{bar-DGuUN3nc.cjs.map → bar-LYIF8MEz.cjs.map} +1 -1
- package/dist/{bar-a0h9KC8A.d.cts → bar-XwzM6Pb0.d.ts} +4 -7
- package/dist/bar.cjs +1 -1
- package/dist/bar.d.cts +2 -1
- package/dist/bar.d.ts +2 -1
- package/dist/bar.js +1 -2
- package/dist/{candlestick-DuXwAFID.js → candlestick-BHQkQfxH.js} +6 -7
- package/dist/{candlestick-DuXwAFID.js.map → candlestick-BHQkQfxH.js.map} +1 -1
- package/dist/{candlestick-B5r1w3kc.cjs → candlestick-CYCQXgky.cjs} +6 -7
- package/dist/{candlestick-B5r1w3kc.cjs.map → candlestick-CYCQXgky.cjs.map} +1 -1
- package/dist/{candlestick-BnUG1SGi.d.ts → candlestick-D0xKkdqd.d.ts} +3 -6
- package/dist/{candlestick-BKdPyorY.d.cts → candlestick-Dq7qp-F0.d.cts} +3 -6
- package/dist/candlestick.cjs +4 -5
- package/dist/candlestick.d.cts +1 -1
- package/dist/candlestick.d.ts +1 -1
- package/dist/candlestick.js +4 -6
- package/dist/{cartesian-Cr0AF0nG.js → cartesian-CI2x6N7N.js} +27 -27
- package/dist/cartesian-CI2x6N7N.js.map +1 -0
- package/dist/{cartesian-BoDfgBCV.cjs → cartesian-DV02PsBe.cjs} +27 -27
- package/dist/cartesian-DV02PsBe.cjs.map +1 -0
- package/dist/{chart-BF2CK9I_.js → chart-DWn9v6qw.js} +35 -24
- package/dist/chart-DWn9v6qw.js.map +1 -0
- package/dist/{chart-iJGxMz9z.d.ts → chart-QilhWP8Z.d.ts} +38 -49
- package/dist/{chart-CowF_lWY.cjs → chart-e2VqomCI.cjs} +35 -24
- package/dist/chart-e2VqomCI.cjs.map +1 -0
- package/dist/{chart-Qa417fJo.d.cts → chart-kqFMEwDo.d.cts} +64 -49
- package/dist/{circle-BQMuAfls.cjs → circle-Bwxy5j7B.cjs} +2 -3
- package/dist/{circle-BQMuAfls.cjs.map → circle-Bwxy5j7B.cjs.map} +1 -1
- package/dist/{circle-Z7YfCoCM.js → circle-YRDaOBpk.js} +2 -3
- package/dist/{circle-Z7YfCoCM.js.map → circle-YRDaOBpk.js.map} +1 -1
- package/dist/{clean-o1vDEhFV.js → clean-CkoQobGv.js} +3 -4
- package/dist/{clean-o1vDEhFV.js.map → clean-CkoQobGv.js.map} +1 -1
- package/dist/{clean-Byl6kzf0.cjs → clean-Die2iCNc.cjs} +8 -3
- package/dist/{clean-Byl6kzf0.cjs.map → clean-Die2iCNc.cjs.map} +1 -1
- package/dist/{core-plobgBC7.js → core-BKRQvPAT.js} +47 -46
- package/dist/core-BKRQvPAT.js.map +1 -0
- package/dist/{core-C7fPm6t7.cjs → core-DIOC61up.cjs} +47 -46
- package/dist/core-DIOC61up.cjs.map +1 -0
- package/dist/{core-CjgbhS_v.d.ts → core-DRUCk67j.d.ts} +6 -42
- package/dist/{core-CnGFKojH.d.cts → core-PAX5ogLk.d.cts} +24 -68
- package/dist/core.cjs +32 -26
- package/dist/core.d.cts +23 -20
- package/dist/core.d.ts +23 -20
- package/dist/core.js +27 -24
- package/dist/{dates-CG-FvioW.js → dates-C2RzY3rE.js} +4 -5
- package/dist/{dates-CG-FvioW.js.map → dates-C2RzY3rE.js.map} +1 -1
- package/dist/{dates-Btm7Zm6W.cjs → dates-DurEr9WT.cjs} +4 -5
- package/dist/{dates-Btm7Zm6W.cjs.map → dates-DurEr9WT.cjs.map} +1 -1
- package/dist/{decimate-tLhDk1ys.cjs → decimate-BS3x8g-f.cjs} +2 -3
- package/dist/{decimate-tLhDk1ys.cjs.map → decimate-BS3x8g-f.cjs.map} +1 -1
- package/dist/{decimate-BGg9XgF0.d.ts → decimate-BxxYBJJk.d.cts} +2 -5
- package/dist/{decimate-C87cl_Sp.js → decimate-CapfgiDY.js} +2 -3
- package/dist/{decimate-C87cl_Sp.js.map → decimate-CapfgiDY.js.map} +1 -1
- package/dist/{decimate-CNSpgGa5.d.cts → decimate-Du87fMLG.d.ts} +2 -5
- package/dist/decimate.cjs +3 -4
- package/dist/decimate.d.cts +1 -1
- package/dist/decimate.d.ts +1 -1
- package/dist/decimate.js +3 -4
- package/dist/{dom-vP3IcMak.js → dom-CuceR8gt.js} +4 -6
- package/dist/{dom-vP3IcMak.js.map → dom-CuceR8gt.js.map} +1 -1
- package/dist/{dom-CLF868Qs.cjs → dom-D_g13XWY.cjs} +4 -6
- package/dist/{dom-CLF868Qs.cjs.map → dom-D_g13XWY.cjs.map} +1 -1
- package/dist/{export-chart-9w8t3rjZ.js → export-chart-83UYH48t.js} +3 -4
- package/dist/{export-chart-9w8t3rjZ.js.map → export-chart-83UYH48t.js.map} +1 -1
- package/dist/{export-chart-BhhYgksr.cjs → export-chart-mYgEfK-L.cjs} +3 -4
- package/dist/{export-chart-BhhYgksr.cjs.map → export-chart-mYgEfK-L.cjs.map} +1 -1
- package/dist/export.cjs +3 -5
- package/dist/export.cjs.map +1 -1
- package/dist/export.d.cts +8 -1
- package/dist/export.d.ts +8 -1
- package/dist/export.js +3 -4
- package/dist/{extent-BAMZo0Nq.js → extent-DOV8rs-6.js} +2 -3
- package/dist/{extent-BAMZo0Nq.js.map → extent-DOV8rs-6.js.map} +1 -1
- package/dist/{extent-DsFWvAHJ.cjs → extent-DuYDcvM9.cjs} +2 -3
- package/dist/{extent-DsFWvAHJ.cjs.map → extent-DuYDcvM9.cjs.map} +1 -1
- package/dist/{fade-Cs74puQS.cjs → fade-DVTkhrFU.cjs} +4 -6
- package/dist/{fade-Cs74puQS.cjs.map → fade-DVTkhrFU.cjs.map} +1 -1
- package/dist/{fade-D3NxH5Qg.js → fade-GGxcBdss.js} +4 -6
- package/dist/{fade-D3NxH5Qg.js.map → fade-GGxcBdss.js.map} +1 -1
- package/dist/{features-wASyHGic.js → features-BMxkqCyS.js} +2 -3
- package/dist/{features-wASyHGic.js.map → features-BMxkqCyS.js.map} +1 -1
- package/dist/{features-BclHgg2W.cjs → features-DCXEvoya.cjs} +2 -3
- package/dist/{features-BclHgg2W.cjs.map → features-DCXEvoya.cjs.map} +1 -1
- package/dist/{format-B0yKXBTH.cjs → format-CAE5ruy6.cjs} +2 -3
- package/dist/{format-B0yKXBTH.cjs.map → format-CAE5ruy6.cjs.map} +1 -1
- package/dist/{format-lStwuc1L.js → format-it1kepFG.js} +2 -3
- package/dist/{format-lStwuc1L.js.map → format-it1kepFG.js.map} +1 -1
- package/dist/{gauge-Cu9jttC0.d.ts → gauge-0VJuAHWF.d.ts} +5 -8
- package/dist/{gauge-Cu_OFxBd.d.cts → gauge-BSist7My.d.cts} +5 -8
- package/dist/{gauge-CEfkWXSu.cjs → gauge-DXkjXNCD.cjs} +14 -14
- package/dist/gauge-DXkjXNCD.cjs.map +1 -0
- package/dist/{gauge-_ljQHrMN.js → gauge-ts0kqN1-.js} +10 -10
- package/dist/{gauge-_ljQHrMN.js.map → gauge-ts0kqN1-.js.map} +1 -1
- package/dist/gauge.cjs +1 -1
- package/dist/gauge.d.cts +2 -1
- package/dist/gauge.d.ts +2 -1
- package/dist/gauge.js +1 -2
- package/dist/{heatmap-DSZ2bVIa.js → heatmap-19BGJTKF.js} +20 -22
- package/dist/heatmap-19BGJTKF.js.map +1 -0
- package/dist/{heatmap-PhLPXIg1.d.ts → heatmap-59lmClj9.d.ts} +4 -7
- package/dist/{heatmap-BK18EBgJ.cjs → heatmap-CXhlrLTl.cjs} +20 -22
- package/dist/heatmap-CXhlrLTl.cjs.map +1 -0
- package/dist/{heatmap-BwS-y0c6.d.cts → heatmap-Dp_oyEe0.d.cts} +4 -7
- package/dist/heatmap.cjs +1 -1
- package/dist/heatmap.d.cts +2 -1
- package/dist/heatmap.d.ts +2 -1
- package/dist/heatmap.js +1 -2
- package/dist/{hydrate-CzfxLfTv.d.ts → hydrate-BtAZf_5K.d.cts} +2 -5
- package/dist/{hydrate-CxwTXDqO.cjs → hydrate-CmN1k8Mo.cjs} +3 -4
- package/dist/hydrate-CmN1k8Mo.cjs.map +1 -0
- package/dist/{hydrate-DDNIHYv_.js → hydrate-OA6R2_Pn.js} +3 -4
- package/dist/{hydrate-DDNIHYv_.js.map → hydrate-OA6R2_Pn.js.map} +1 -1
- package/dist/{hydrate-CTTmQy0x.d.cts → hydrate-OjM1pIUG.d.ts} +2 -5
- package/dist/hydrate.cjs +3 -4
- package/dist/hydrate.cjs.map +1 -1
- package/dist/hydrate.d.cts +1 -1
- package/dist/hydrate.d.ts +1 -1
- package/dist/hydrate.js +3 -4
- package/dist/index.cjs +54 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -26
- package/dist/index.d.ts +24 -26
- package/dist/index.js +45 -42
- package/dist/index.js.map +1 -1
- package/dist/{layout-B3hiqVEw.js → layout-DmrrLjwN.js} +9 -4
- package/dist/layout-DmrrLjwN.js.map +1 -0
- package/dist/{layout-CtMBhNd9.cjs → layout-JY2aR-yE.cjs} +14 -3
- package/dist/layout-JY2aR-yE.cjs.map +1 -0
- package/dist/{line-B3Ed6u7j.js → line-DO66LtwH.js} +9 -10
- package/dist/{line-B3Ed6u7j.js.map → line-DO66LtwH.js.map} +1 -1
- package/dist/{line-fQbtP_jL.cjs → line-Dbt6KFRK.cjs} +9 -10
- package/dist/{line-fQbtP_jL.cjs.map → line-Dbt6KFRK.cjs.map} +1 -1
- package/dist/{line-CMDGH6q5.d.cts → line-DtSh7HQU.d.ts} +4 -7
- package/dist/{line-D5kb8e6w.d.ts → line-_rNdeKmS.d.cts} +5 -7
- package/dist/line.cjs +4 -5
- package/dist/line.cjs.map +1 -1
- package/dist/line.d.cts +1 -1
- package/dist/line.d.ts +1 -1
- package/dist/line.js +4 -6
- package/dist/{log-CaofN3-n.d.ts → log-CI41TmcU.d.cts} +1 -6
- package/dist/{log-CaofN3-n.d.cts → log-CI41TmcU.d.ts} +1 -6
- package/dist/{log-axis-83rSpvL5.cjs → log-axis-DdRNyAq8.cjs} +6 -8
- package/dist/{log-axis-83rSpvL5.cjs.map → log-axis-DdRNyAq8.cjs.map} +1 -1
- package/dist/{log-axis-B_uvvOFc.js → log-axis-DhthtHFk.js} +6 -8
- package/dist/{log-axis-B_uvvOFc.js.map → log-axis-DhthtHFk.js.map} +1 -1
- package/dist/log.cjs +3 -5
- package/dist/log.cjs.map +1 -1
- package/dist/log.d.cts +1 -1
- package/dist/log.d.ts +1 -1
- package/dist/log.js +3 -4
- package/dist/{morph-CqYDu1bY.cjs → morph-9_LJL0ra.cjs} +4 -5
- package/dist/morph-9_LJL0ra.cjs.map +1 -0
- package/dist/{morph-BMxz3X2b.d.ts → morph-Dh7gJkV4.d.cts} +1 -4
- package/dist/{morph-BMxz3X2b.d.cts → morph-Dh7gJkV4.d.ts} +1 -4
- package/dist/{morph-Bgg-24l8.js → morph-DnRxuwR-.js} +4 -5
- package/dist/{morph-Bgg-24l8.js.map → morph-DnRxuwR-.js.map} +1 -1
- package/dist/morph.cjs +3 -4
- package/dist/morph.cjs.map +1 -1
- package/dist/morph.d.cts +1 -1
- package/dist/morph.d.ts +1 -1
- package/dist/morph.js +3 -4
- package/dist/{named-BWWb5LQJ.cjs → named-BBASc8dW.cjs} +2 -3
- package/dist/{named-BWWb5LQJ.cjs.map → named-BBASc8dW.cjs.map} +1 -1
- package/dist/{named-DE15TOgh.js → named-BOiBah6I.js} +2 -3
- package/dist/{named-DE15TOgh.js.map → named-BOiBah6I.js.map} +1 -1
- package/dist/others-DWdK7vKp.cjs +60 -0
- package/dist/others-DWdK7vKp.cjs.map +1 -0
- package/dist/others-J7NCAMA0.js +49 -0
- package/dist/others-J7NCAMA0.js.map +1 -0
- package/dist/parliament-CLCI7tUO.d.ts +66 -0
- package/dist/parliament-CgsVnWEe.d.cts +66 -0
- package/dist/parliament-Cru4IcuM.js +302 -0
- package/dist/parliament-Cru4IcuM.js.map +1 -0
- package/dist/parliament-x5hcFaQ3.cjs +307 -0
- package/dist/parliament-x5hcFaQ3.cjs.map +1 -0
- package/dist/parliament.cjs +3 -0
- package/dist/parliament.d.cts +3 -0
- package/dist/parliament.d.ts +3 -0
- package/dist/parliament.js +1 -0
- package/dist/{path-CwB28da0.d.ts → path-YeUiOfG8.d.cts} +1 -4
- package/dist/{path-CwB28da0.d.cts → path-YeUiOfG8.d.ts} +1 -4
- package/dist/{patterns-DtgcnA8o.js → patterns-CufKZYhm.js} +4 -5
- package/dist/{patterns-DtgcnA8o.js.map → patterns-CufKZYhm.js.map} +1 -1
- package/dist/{patterns-LfcQAWCy.cjs → patterns-D3-wQagb.cjs} +4 -5
- package/dist/{patterns-LfcQAWCy.cjs.map → patterns-D3-wQagb.cjs.map} +1 -1
- package/dist/patterns.cjs +3 -5
- package/dist/patterns.cjs.map +1 -1
- package/dist/patterns.d.cts +5 -1
- package/dist/patterns.d.ts +5 -1
- package/dist/patterns.js +3 -4
- package/dist/percentage-bar-B6tNOqNn.js +157 -0
- package/dist/percentage-bar-B6tNOqNn.js.map +1 -0
- package/dist/percentage-bar-nhTeakD_.d.ts +62 -0
- package/dist/percentage-bar-tepMr7Hd.d.cts +62 -0
- package/dist/percentage-bar-ybNS3goo.cjs +162 -0
- package/dist/percentage-bar-ybNS3goo.cjs.map +1 -0
- package/dist/percentage-bar.cjs +3 -0
- package/dist/percentage-bar.d.cts +3 -0
- package/dist/percentage-bar.d.ts +3 -0
- package/dist/percentage-bar.js +1 -0
- package/dist/{pie-B8UlOZiq.d.ts → pie-BXg2gNpb.d.cts} +14 -8
- package/dist/{pie-C1Pa6W_l.cjs → pie-BpjvSPnz.cjs} +19 -22
- package/dist/pie-BpjvSPnz.cjs.map +1 -0
- package/dist/{pie-DnQQmxkk.d.cts → pie-CFptILSm.d.ts} +14 -8
- package/dist/{pie-RnMTQWMS.js → pie-CVsc-6qD.js} +13 -16
- package/dist/pie-CVsc-6qD.js.map +1 -0
- package/dist/pie.cjs +1 -1
- package/dist/pie.d.cts +2 -1
- package/dist/pie.d.ts +2 -1
- package/dist/pie.js +1 -2
- package/dist/{point-shapes-CGl4dugc.cjs → point-shapes--_gmdTyK.cjs} +3 -4
- package/dist/{point-shapes-CGl4dugc.cjs.map → point-shapes--_gmdTyK.cjs.map} +1 -1
- package/dist/{point-shapes-DI84NNpI.js → point-shapes-DD2Ektzm.js} +3 -4
- package/dist/{point-shapes-DI84NNpI.js.map → point-shapes-DD2Ektzm.js.map} +1 -1
- package/dist/point-shapes.cjs +3 -4
- package/dist/point-shapes.d.cts +5 -1
- package/dist/point-shapes.d.ts +5 -1
- package/dist/point-shapes.js +3 -4
- package/dist/{radar-pFI6fvOq.d.ts → radar-BC9Skgpj.d.ts} +4 -7
- package/dist/{radar-CYPab_I4.js → radar-BR-mumDd.js} +7 -8
- package/dist/{radar-CYPab_I4.js.map → radar-BR-mumDd.js.map} +1 -1
- package/dist/{radar-BB13CGmq.d.cts → radar-D1-lItDy.d.cts} +4 -7
- package/dist/{radar-CoGUNNSb.cjs → radar-HPDrIdzc.cjs} +7 -8
- package/dist/{radar-CoGUNNSb.cjs.map → radar-HPDrIdzc.cjs.map} +1 -1
- package/dist/radar.cjs +1 -1
- package/dist/radar.d.cts +2 -1
- package/dist/radar.d.ts +2 -1
- package/dist/radar.js +1 -2
- package/dist/rect-D6VhynBM.cjs +16 -0
- package/dist/rect-D6VhynBM.cjs.map +1 -0
- package/dist/rect-DSVmUZrD.js +11 -0
- package/dist/rect-DSVmUZrD.js.map +1 -0
- package/dist/{sankey-B4PNKusJ.js → sankey-D6JeZfK5.js} +33 -29
- package/dist/sankey-D6JeZfK5.js.map +1 -0
- package/dist/{sankey-Bm518bqL.d.ts → sankey-D_v7KxnJ.d.ts} +4 -7
- package/dist/{sankey-B9JYnx7e.d.cts → sankey-Dk7jUt8x.d.cts} +4 -7
- package/dist/{sankey-Bacx4fVe.cjs → sankey-fCoo1cpz.cjs} +33 -29
- package/dist/sankey-fCoo1cpz.cjs.map +1 -0
- package/dist/sankey.cjs +1 -1
- package/dist/sankey.d.cts +2 -1
- package/dist/sankey.d.ts +2 -1
- package/dist/sankey.js +1 -2
- package/dist/{scatter-kgtgR318.js → scatter-C0TWjFpW.js} +21 -18
- package/dist/scatter-C0TWjFpW.js.map +1 -0
- package/dist/{scatter-Bl7nasE6.d.ts → scatter-CXEsioOJ.d.ts} +8 -9
- package/dist/{scatter-DgMN9zRy.cjs → scatter-DVqB_fP9.cjs} +21 -18
- package/dist/scatter-DVqB_fP9.cjs.map +1 -0
- package/dist/{scatter-DrJ8xYz4.d.cts → scatter-DZeEIfyo.d.cts} +8 -9
- package/dist/scatter.cjs +1 -1
- package/dist/scatter.d.cts +2 -1
- package/dist/scatter.d.ts +2 -1
- package/dist/scatter.js +1 -2
- package/dist/{sparkline-BS9-hltA.cjs → sparkline-B39NA0Mi.cjs} +14 -13
- package/dist/sparkline-B39NA0Mi.cjs.map +1 -0
- package/dist/{sparkline-BG13V4Pz.d.cts → sparkline-DAP6jtzw.d.cts} +5 -8
- package/dist/{sparkline-BQzt27Fr.js → sparkline-XO_TqCNP.js} +14 -13
- package/dist/sparkline-XO_TqCNP.js.map +1 -0
- package/dist/{sparkline-iWuXbKpd.d.ts → sparkline-cbvRkWqS.d.ts} +5 -8
- package/dist/sparkline.cjs +1 -1
- package/dist/sparkline.d.cts +2 -1
- package/dist/sparkline.d.ts +2 -1
- package/dist/sparkline.js +1 -2
- package/dist/{stack-DRbwTeF3.js → stack-2H2Gfs1Q.js} +3 -4
- package/dist/{stack-DRbwTeF3.js.map → stack-2H2Gfs1Q.js.map} +1 -1
- package/dist/{stack-DVhJWaki.cjs → stack-BgPzoQmv.cjs} +3 -4
- package/dist/{stack-DVhJWaki.cjs.map → stack-BgPzoQmv.cjs.map} +1 -1
- package/dist/{stack-CpR6RGKd.d.ts → stack-DR0eQTsB.d.ts} +1 -4
- package/dist/{stack-CpR6RGKd.d.cts → stack-Dagxq7l2.d.cts} +2 -4
- package/dist/style.css +1 -1
- package/dist/sweep-BpRPlhs6.js +59 -0
- package/dist/sweep-BpRPlhs6.js.map +1 -0
- package/dist/sweep-Dnp6LDBz.cjs +70 -0
- package/dist/sweep-Dnp6LDBz.cjs.map +1 -0
- package/dist/{time-CNVnt-B2.d.cts → time-B4oxWHQI.d.cts} +2 -7
- package/dist/{time-CHjiY9Q4.d.ts → time-DRIDgv2a.d.ts} +2 -7
- package/dist/{time-axis-VSX34_Tb.cjs → time-axis-BjZ1bYTK.cjs} +9 -10
- package/dist/{time-axis-VSX34_Tb.cjs.map → time-axis-BjZ1bYTK.cjs.map} +1 -1
- package/dist/{time-axis-Bc9eHX1r.js → time-axis-FLONo54E.js} +9 -10
- package/dist/{time-axis-Bc9eHX1r.js.map → time-axis-FLONo54E.js.map} +1 -1
- package/dist/time.cjs +4 -6
- package/dist/time.cjs.map +1 -1
- package/dist/time.d.cts +1 -1
- package/dist/time.d.ts +1 -1
- package/dist/time.js +4 -5
- package/dist/treemap-BAkhmVQc.d.cts +55 -0
- package/dist/treemap-BNpxFBao.d.ts +55 -0
- package/dist/treemap-BWpEUlDh.cjs +303 -0
- package/dist/treemap-BWpEUlDh.cjs.map +1 -0
- package/dist/treemap-CQdavQ9u.js +298 -0
- package/dist/treemap-CQdavQ9u.js.map +1 -0
- package/dist/treemap.cjs +3 -0
- package/dist/treemap.d.cts +3 -0
- package/dist/treemap.d.ts +3 -0
- package/dist/treemap.js +1 -0
- package/dist/{tween-BCYd0RTY.js → tween-BdQqUmmv.js} +2 -3
- package/dist/{tween-BCYd0RTY.js.map → tween-BdQqUmmv.js.map} +1 -1
- package/dist/{tween-CIGBlryn.cjs → tween-c3aOmfKE.cjs} +2 -3
- package/dist/{tween-CIGBlryn.cjs.map → tween-c3aOmfKE.cjs.map} +1 -1
- package/dist/{value-labels-IZIQPhfk.js → value-labels-BBuSi4i0.js} +7 -7
- package/dist/value-labels-BBuSi4i0.js.map +1 -0
- package/dist/{value-labels-B0WJoJ7x.cjs → value-labels-BV9keAuL.cjs} +7 -7
- package/dist/value-labels-BV9keAuL.cjs.map +1 -0
- package/dist/value-labels.cjs +3 -5
- package/dist/value-labels.cjs.map +1 -1
- package/dist/value-labels.d.cts +5 -1
- package/dist/value-labels.d.ts +5 -1
- package/dist/value-labels.js +3 -4
- package/dist/{vnode-CkQ27Cxe.cjs → vnode-ClAiw28x.cjs} +2 -3
- package/dist/{vnode-CkQ27Cxe.cjs.map → vnode-ClAiw28x.cjs.map} +1 -1
- package/dist/{vnode-BUflsBsa.d.ts → vnode-Du2cC8Fm.d.cts} +1 -4
- package/dist/{vnode-BUflsBsa.d.cts → vnode-Du2cC8Fm.d.ts} +1 -4
- package/dist/{vnode-tCWItoUH.js → vnode-_EMUqysL.js} +2 -3
- package/dist/{vnode-tCWItoUH.js.map → vnode-_EMUqysL.js.map} +1 -1
- package/package.json +31 -1
- package/dist/bar-C-7zR2qp.cjs.map +0 -1
- package/dist/bar-jZEoao74.js.map +0 -1
- package/dist/cartesian-BoDfgBCV.cjs.map +0 -1
- package/dist/cartesian-Cr0AF0nG.js.map +0 -1
- package/dist/chart-BF2CK9I_.js.map +0 -1
- package/dist/chart-CowF_lWY.cjs.map +0 -1
- package/dist/core-C7fPm6t7.cjs.map +0 -1
- package/dist/core-plobgBC7.js.map +0 -1
- package/dist/gauge-CEfkWXSu.cjs.map +0 -1
- package/dist/heatmap-BK18EBgJ.cjs.map +0 -1
- package/dist/heatmap-DSZ2bVIa.js.map +0 -1
- package/dist/hydrate-CxwTXDqO.cjs.map +0 -1
- package/dist/layout-B3hiqVEw.js.map +0 -1
- package/dist/layout-CtMBhNd9.cjs.map +0 -1
- package/dist/morph-CqYDu1bY.cjs.map +0 -1
- package/dist/pie-C1Pa6W_l.cjs.map +0 -1
- package/dist/pie-RnMTQWMS.js.map +0 -1
- package/dist/sankey-B4PNKusJ.js.map +0 -1
- package/dist/sankey-Bacx4fVe.cjs.map +0 -1
- package/dist/scatter-DgMN9zRy.cjs.map +0 -1
- package/dist/scatter-kgtgR318.js.map +0 -1
- package/dist/sparkline-BQzt27Fr.js.map +0 -1
- package/dist/sparkline-BS9-hltA.cjs.map +0 -1
- package/dist/sweep-Duowaput.cjs.map +0 -1
- package/dist/sweep-WSgn2etB.js.map +0 -1
- package/dist/value-labels-B0WJoJ7x.cjs.map +0 -1
- package/dist/value-labels-IZIQPhfk.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-DWn9v6qw.js","names":[],"sources":["../src/interaction.ts","../src/legend.ts","../src/render/string.ts","../src/resize.ts","../src/scheduler.ts","../src/chart.ts"],"sourcesContent":["import type { Rect } from './layout.ts'\n\n/** One series' value at a hovered position. */\nexport interface HitItem {\n /** Series name. */\n name: string\n /** Position of the series in `data.series`. */\n seriesIndex: number\n /** Custom series color, if one was set. */\n color?: string\n value: number | null\n /** Value formatted for display (tooltips). */\n text: string\n /** Anchor of the value in chart pixels (point, bar end); `y` is `null` for gaps. */\n x: number\n y: number | null\n /** The mark's rectangle (bar, segment, cell), for value labels inside it. */\n box?: Rect\n}\n\n/** What lies under the pointer. */\nexport interface Hit {\n /** Category index. */\n index: number\n /** Category label. */\n label: string | number\n /** Label formatted for display (tooltips). */\n title: string\n /** Anchor x of the category in chart pixels (for crosshairs and tooltips); the plot center for horizontal bars. */\n x: number\n /** Plot area, in chart pixels. */\n area: Rect\n /** Axis the categories run along; `'y'` for horizontal bars. Defaults to `'x'`. */\n axis?: 'x' | 'y'\n /** Center of the category along y, when categories run along y. */\n y?: number\n /** The category's band in chart pixels, for band scales (bars). */\n band?: { x: number; y: number; width: number; height: number }\n /** Every series' value at this category. */\n items: HitItem[]\n /** Series of the mark directly under the pointer (e.g. a bar), if any. */\n seriesIndex?: number\n /**\n * The crosshair segment, when it is not vertical across the plot (a radar\n * spoke). Tooltips from the keyboard then anchor on the value itself.\n */\n guide?: { x1: number; y1: number; x2: number; y2: number }\n /**\n * A shape to highlight instead of a crosshair or band (e.g. a halo around a\n * pie slice): path data `d`, drawn translated by `x` / `y`.\n */\n mark?: { d: string; x: number; y: number }\n}\n\n/** Maps a point in chart pixels to what lies there. */\nexport type HitTester = (x: number, y: number) => Hit | null\n\n/** How a rendered chart answers pointer and keyboard interaction. */\nexport interface Interaction {\n /** What lies at a point in chart pixels. */\n hitTest: HitTester\n /** The hit for a category by index (keyboard navigation), optionally focused on a series. */\n hitIndex(index: number, seriesIndex?: number): Hit | null\n /** Number of categories. */\n count: number\n /** Categories run from the right: the left arrow key goes to the next one. */\n reversed?: boolean\n}\n\n/** Identity of a hit, used to emit hover changes only when it changes. */\nexport function hitKey(hit: Hit | null): string {\n return hit ? `${hit.index}:${hit.seriesIndex ?? ''}` : ''\n}\n\n/**\n * Convert a pointer position to chart pixels, accounting for the SVG being\n * scaled by CSS (e.g. `max-width: 100%`).\n */\nexport function toChartPoint(\n svg: Element,\n clientX: number,\n clientY: number,\n width: number,\n height: number,\n): { x: number; y: number } {\n const rect = svg.getBoundingClientRect()\n const sx = rect.width > 0 ? width / rect.width : 1\n const sy = rect.height > 0 ? height / rect.height : 1\n return { x: (clientX - rect.left) * sx, y: (clientY - rect.top) * sy }\n}\n","import { h, type VNode } from './vnode.ts'\n\n/** One legend entry: a series (or a slice, for part-to-whole charts). */\nexport interface LegendItem {\n /** Stable identity, used to toggle it. */\n key: string\n name: string\n /** Color slot: the entry wears `.tc-series-{index + 1}`. */\n index: number\n /** Custom color overriding the slot. */\n color?: string\n /** Hidden by default (e.g. `series.hidden`). */\n hidden?: boolean\n}\n\nexport interface LegendOptions {\n /** Place the legend above or below the chart. Defaults to `'top'`. */\n position?: 'top' | 'bottom'\n}\n\n/**\n * Legend content: one toggle button per entry. Buttons are native, so they\n * are focusable and work with Enter/Space; `aria-pressed` reflects visibility.\n */\nexport function legendContent(items: readonly LegendItem[], hidden: ReadonlySet<string>): VNode {\n return h(\n 'div',\n { class: 'tc-legend-items' },\n items.map((item) => {\n const off = hidden.has(item.key)\n return h(\n 'button',\n {\n key: item.key,\n type: 'button',\n class: [\n 'tc-legend-item',\n 'tc-series',\n `tc-series-${item.index + 1}`,\n off && 'tc-legend-item-hidden',\n ],\n style: { '--tc-series-color': item.color },\n 'aria-pressed': off ? 'false' : 'true',\n 'data-key': item.key,\n },\n h('span', { class: 'tc-legend-swatch', 'aria-hidden': 'true' }),\n h('span', { class: 'tc-legend-name' }, item.name),\n )\n }),\n )\n}\n\n/** Keys hidden by default, from the entries' own `hidden` flags. */\nexport function defaultHidden(items: readonly LegendItem[]): Set<string> {\n return new Set(items.filter((item) => item.hidden).map((item) => item.key))\n}\n","import type { Child, VNode } from '../vnode.ts'\nimport { isValidAttr, isValidTag } from './attrs.ts'\n\nconst SVG_NS = 'http://www.w3.org/2000/svg'\n\nexport interface RenderToStringOptions {\n /**\n * Add `xmlns` to a root `<svg>` that has none, so the output is a valid\n * standalone `.svg` file. Defaults to `true`.\n */\n xmlns?: boolean\n /**\n * Markup context of the root. By default common HTML elements (`div`,\n * `table`, `button`…) render as HTML and everything else as SVG.\n */\n namespace?: 'svg' | 'html'\n}\n\n/** Root tags treated as HTML when no namespace is given. */\nconst HTML_ROOTS = /* @__PURE__ */ new Set([\n 'a',\n 'b',\n 'button',\n 'caption',\n 'div',\n 'em',\n 'i',\n 'label',\n 'li',\n 'ol',\n 'p',\n 'section',\n 'small',\n 'span',\n 'strong',\n 'table',\n 'tbody',\n 'td',\n 'th',\n 'thead',\n 'tr',\n 'ul',\n])\n\n/** HTML elements that never have content and must not get a closing tag. */\nconst VOID = /* @__PURE__ */ new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'source',\n 'track',\n 'wbr',\n])\n\n/**\n * Serialize a VNode tree to markup (SSR, static export): SVG trees as\n * XML-compatible SVG, HTML trees (legend, table, tooltip) as HTML.\n *\n * Empty elements self-close only inside SVG; in HTML they get an explicit\n * closing tag (`<th></th>`), since `<th/>` would open an element there.\n * Text and attribute values are escaped. Invalid tag or attribute names and\n * inline event handlers (`on*`) are dropped, so data coming from chart\n * options can never inject markup or scripts.\n */\nexport function renderToString(node: Child, options: RenderToStringOptions = {}): string {\n if (typeof node === 'string') return escapeText(node)\n const root =\n options.xmlns !== false && node.tag === 'svg' && node.attrs.xmlns === undefined\n ? { ...node, attrs: { xmlns: SVG_NS, ...node.attrs } }\n : node\n const svg = options.namespace ? options.namespace === 'svg' : !HTML_ROOTS.has(node.tag)\n return renderNode(root, svg)\n}\n\nfunction renderNode(node: VNode, parentInSvg: boolean): string {\n const { tag, attrs, children } = node\n if (!isValidTag(tag)) return ''\n const inSvg = parentInSvg || tag === 'svg'\n\n let out = `<${tag}`\n for (const name in attrs) {\n if (!isValidAttr(name)) continue\n out += ` ${name}=\"${escapeAttr(String(attrs[name]))}\"`\n }\n\n if (children.length === 0) {\n if (inSvg) return `${out}/>`\n if (VOID.has(tag.toLowerCase())) return `${out}>`\n }\n\n out += '>'\n // Content of foreignObject is HTML again.\n const childInSvg = inSvg && tag !== 'foreignObject'\n for (const child of children) {\n out += typeof child === 'string' ? escapeText(child) : renderNode(child, childInSvg)\n }\n return `${out}</${tag}>`\n}\n\nconst TEXT_RE = /[&<>]/\nconst ATTR_RE = /[&\"<>]/\nconst TEXT_RE_G = /[&<>]/g\nconst ATTR_RE_G = /[&\"<>]/g\nconst ENTITIES: Record<string, string> = { '&': '&', '<': '<', '>': '>', '\"': '"' }\nconst replaceEntity = (char: string): string => ENTITIES[char] as string\n\n/** Escape text content. */\nexport function escapeText(value: string): string {\n return TEXT_RE.test(value) ? value.replace(TEXT_RE_G, replaceEntity) : value\n}\n\n/** Escape a double-quoted attribute value. */\nexport function escapeAttr(value: string): string {\n return ATTR_RE.test(value) ? value.replace(ATTR_RE_G, replaceEntity) : value\n}\n","/** One `ResizeObserver` shared by every chart on the page. */\n\ntype Listener = (width: number, height: number) => void\n\nconst listeners = /* @__PURE__ */ new WeakMap<Element, Listener>()\n/** Elements observed while in the document. */\nconst seen = /* @__PURE__ */ new WeakSet<Element>()\nlet observer: ResizeObserver | undefined\n\nfunction getObserver(): ResizeObserver | undefined {\n if (observer || typeof ResizeObserver !== 'function') return observer\n observer = new ResizeObserver((entries) => {\n for (const { target, contentRect } of entries) {\n if (target.isConnected) {\n seen.add(target)\n listeners.get(target)?.(contentRect.width, contentRect.height)\n } else if (seen.has(target)) {\n // Taken out of the page without destroy(): stop observing, or the\n // observer would keep the element and its chart in memory for good.\n // `chart.resize()` observes it again if it comes back.\n seen.delete(target)\n observer?.unobserve(target)\n }\n }\n })\n return observer\n}\n\n/**\n * Call `listener` with the content size of `el` whenever it changes.\n * Returns a function that stops observing. No-op where `ResizeObserver`\n * is unavailable (SSR, old browsers). Observing again is harmless.\n */\nexport function observeResize(el: Element, listener: Listener): () => void {\n const ro = getObserver()\n if (!ro) return () => {}\n listeners.set(el, listener)\n ro.observe(el)\n return () => {\n if (listeners.get(el) !== listener) return\n listeners.delete(el)\n ro.unobserve(el)\n }\n}\n","/**\n * Batches work from all charts into a single animation frame. Scheduling the\n * same key twice before the flush runs its latest task once.\n */\n\nconst queue = /* @__PURE__ */ new Map<object, () => void>()\nlet pending = false\n\nconst requestFrame = (callback: () => void): void => {\n if (typeof requestAnimationFrame === 'function') requestAnimationFrame(callback)\n else queueMicrotask(callback)\n}\n\n/**\n * Run a task; an error it throws is reported on its own (as an uncaught\n * error, in the console and to `window.onerror`) instead of stopping the\n * tasks of other charts in the same frame.\n */\nexport function run(task: () => void): void {\n try {\n task()\n } catch (error) {\n setTimeout(() => {\n throw error\n })\n }\n}\n\n/** Run `task` in the next frame, replacing any task already queued for `key`. */\nexport function schedule(key: object, task: () => void): void {\n queue.set(key, task)\n if (!pending) {\n pending = true\n requestFrame(flush)\n }\n}\n\n/** Work `flush()` also runs: the idle queue (`idle.ts`), once something uses it. */\nexport const flushHooks: { idle?: () => number } = {}\n\n/** Drop the task queued for `key`, if any. */\nexport function cancel(key: object): void {\n queue.delete(key)\n}\n\n/**\n * Run queued tasks now, idle ones too; returns how many ran. Tasks queued\n * meanwhile run too, but each key only once: a task queued again after it\n * ran (a chart updated from its own `render` handler) waits for the next\n * frame, instead of looping in this one and freezing the page.\n */\nexport function flush(): number {\n pending = false\n let count = 0\n const ran = new Set<object>()\n const later = new Map<object, () => void>()\n // Idle work can schedule frame work in turn.\n do {\n // (A Map also visits what is added while it is walked: tasks queued meanwhile.)\n for (const [key, task] of queue) {\n queue.delete(key)\n if (ran.has(key)) later.set(key, task)\n else {\n ran.add(key)\n run(task)\n count++\n }\n }\n count += flushHooks.idle?.() ?? 0\n } while (queue.size > 0)\n for (const [key, task] of later) schedule(key, task)\n return count\n}\n","import type { DataTable } from './a11y.ts'\nimport type { ValueLabelOptions } from './charts/value-labels.ts'\nimport { feature, features } from './features.ts'\nimport type { Locale, NumberFormat } from './format.ts'\nimport { type Hit, hitKey, type Interaction } from './interaction.ts'\nimport { defaultHidden, type LegendItem, type LegendOptions } from './legend.ts'\nimport type { ChartPlugin, PluginInstance } from './plugin.ts'\nimport type { DownloadOption } from './plugins/download.ts'\nimport { render } from './render/dom.ts'\nimport { renderToString } from './render/string.ts'\nimport { observeResize } from './resize.ts'\nimport { cancel, schedule } from './scheduler.ts'\nimport type { TooltipOptions } from './tooltip.ts'\nimport { type ChildInput, type ClassValue, h, type Props, type VNode } from './vnode.ts'\n\n/** Size and environment a chart type renders into. */\nexport interface RenderContext {\n width: number\n height: number\n /** Font size used to estimate label sizes. */\n fontSize: number\n locale: Locale\n /** Unique, stable prefix for ids inside this chart. */\n id: string\n /** Register how pointer and keyboard map to data (ignored in SSR). */\n onHitTest(interaction: Interaction): void\n /** Keys of legend entries (series) currently hidden. */\n hidden: ReadonlySet<string>\n /** Lay the chart out right to left (the `rtl` option, resolved). */\n rtl?: boolean\n}\n\n/**\n * A chart type plugin (`line`, `bar`, …). Receives the chart options and\n * returns the content of the root `<svg>`.\n */\nexport interface ChartType<O extends object = object> {\n readonly name: string\n /**\n * Clean options that may come from outside (data, annotations, axis\n * bounds from users, APIs, JSON) into the shape `render()` expects; called\n * as the config comes in, before anything reads it.\n */\n clean?(options: O): unknown\n render(options: O, context: RenderContext): ChildInput\n /** Entries for the legend (series, slices); charts without it get no legend. */\n legend?(options: O): LegendItem[]\n /**\n * The data as a text table, for screen readers and the visible table\n * option. `limit` is the most rows wanted; report the real count in `total`.\n */\n table?(options: O, context: RenderContext, limit: number): DataTable\n /**\n * Whether the chart should be focusable and keyboard-navigable by default\n * (`keyboard` in the config overrides it). Decorative types such as\n * sparklines opt out so a page of stat tiles does not multiply tab stops.\n */\n readonly keyboard?: boolean\n /**\n * How value labels (`valueLabels`) read this chart type, when not as bars\n * or points: `marks: 'slice'` writes each value as its share, inside its\n * slice; `marks: 'cell'` writes it in the middle of its mark. `format`\n * names the number format of the values in the options (by default a label\n * shows the text of the tooltip).\n */\n readonly valueLabels?: {\n marks?: 'slice' | 'cell'\n format?(options: O): NumberFormat | undefined\n }\n}\n\nexport type { DataTable, LegendItem }\n\n/** Options shared by every chart type. */\nexport interface BaseOptions {\n /** Fixed width in pixels. Defaults to the container width. */\n width?: number\n /**\n * Height in pixels, or `'container'` to follow the container's height (the\n * container then needs a height of its own). Defaults to width / aspectRatio.\n */\n height?: number | 'container'\n /** Width to height ratio used when `height` is not set. Defaults to `2`. */\n aspectRatio?: number\n /** Accessible name of the chart. */\n title?: string\n /** Longer accessible description. */\n description?: string\n /** Extra classes on the root `<svg>`. */\n class?: ClassValue\n /** Locale for number and date formatting. Set it explicitly for SSR. */\n locale?: Locale\n /**\n * Mirror the layout for right-to-left pages: the value axis on the right\n * and categories running from the right (`x.reverse` overrides the latter).\n * `'auto'` follows the `direction` of the container (left to right in SSR).\n * The legend, the tooltip and the download menu read right to left with it.\n * Cartesian charts, heatmaps, sparklines and sankey diagrams. Defaults to `false`.\n */\n rtl?: boolean | 'auto'\n /**\n * Font size used to lay out labels. In the browser it is read from the\n * `--tc-font-size` custom property of the container when not set; set it\n * explicitly for SSR so server and client layouts match. Defaults to `12`.\n */\n fontSize?: number\n /** Id prefix; set it explicitly for SSR so server and client ids match. */\n id?: string\n /** Show a tooltip on hover, optionally with custom content. Defaults to `true`. */\n tooltip?: boolean | TooltipOptions\n /** Show a vertical crosshair on hover (point charts). Defaults to `true`. */\n crosshair?: boolean\n /** Show a legend with toggles. Defaults to showing it for two or more entries. */\n legend?: boolean | LegendOptions\n /**\n * Animate entrances and data updates (reduced motion always wins). By\n * default charts animate unless they draw more than 1000 elements (e.g. a\n * scatter of a thousand points), where transitions cost far more frame\n * time than they show; `true` animates those too.\n */\n animate?: boolean\n /**\n * Fill bars, areas, slices, rings and bubbles with patterns (and dash\n * lines), so series do not depend on color alone: `true` always, `'auto'`\n * (the default) only in forced colors (Windows High Contrast), where the\n * colors are gone, `false` never. Needs `@tabler/charts/patterns` on the\n * core (`@tabler/charts` includes it).\n */\n patterns?: boolean | 'auto'\n /**\n * Write the values on the marks: bars at their end, stacked segments,\n * cells and slices inside (slices show their share), lines and points\n * above their last point (`points: 'all'` for every one). Labels that do\n * not fit are left out. Needs `@tabler/charts/value-labels` on the core\n * (`@tabler/charts` includes it).\n */\n valueLabels?: boolean | ValueLabelOptions\n /**\n * Share the hover with the other charts of this group: the category under\n * the pointer is highlighted in all of them (matched by label), with its\n * tooltip. Needs the `sync()` plugin (the `Chart` of `@tabler/charts` has it).\n */\n sync?: string\n /**\n * Give the points of each series a shape of their own (circle, square,\n * triangle, diamond…) in line, radar and scatter charts, so they do not\n * depend on color alone. Defaults to `patterns === true`. Needs\n * `@tabler/charts/point-shapes` on the core (`@tabler/charts` includes it).\n */\n shapes?: boolean\n /**\n * Render the data as an HTML table: visually hidden for screen readers\n * (`true`, the default), shown below the chart (`'visible'`), or not at all.\n * An object sets `visible` and `maxRows` (default 1000; longer data is cut\n * and the caption says so).\n */\n table?: boolean | 'visible' | { visible?: boolean; maxRows?: number }\n /** Make the chart focusable and navigable with arrow keys. Defaults to `true`. */\n keyboard?: boolean\n /**\n * A download menu in the chart's corner: `true` offers PNG and SVG, a list\n * picks the formats (`['png', 'svg', 'jpeg', 'webp']`), an object also\n * sets the file name and the export options. Needs `@tabler/charts/export`\n * imported, and on the core the `download()` plugin (the `Chart` of\n * `@tabler/charts` has it).\n */\n download?: DownloadOption\n /**\n * Extra plugins, installed when the chart is created. The default `Chart`\n * from `@tabler/charts` already includes the built-in ones; the bare `Chart`\n * from `@tabler/charts/core` only runs these.\n */\n plugins?: readonly ChartPlugin[]\n}\n\n/** Full chart configuration: base options, the chart type and its options. */\nexport type ChartConfig<O extends object = object> = BaseOptions & O & { type: ChartType<O> }\n\nexport interface Size {\n width: number\n height: number\n}\n\nconst DEFAULT_WIDTH = 600\nconst DEFAULT_ASPECT_RATIO = 2\nconst DEFAULT_FONT_SIZE = 12\n\nlet uid = 0\nconst nextId = (): string => `tc-${++uid}`\n\n/** Resolve the final pixel size from options and the measured container size. */\nexport function resolveSize(options: BaseOptions, measured?: Partial<Size>): Size {\n const measuredWidth = measured?.width ?? 0\n // (Sizes that are not finite numbers count as not set.)\n const width = Math.max(\n 0,\n Math.round(\n Number.isFinite(options.width)\n ? (options.width as number)\n : measuredWidth > 0\n ? measuredWidth\n : DEFAULT_WIDTH,\n ),\n )\n const ratio =\n options.aspectRatio && options.aspectRatio > 0 ? options.aspectRatio : DEFAULT_ASPECT_RATIO\n const height = Number.isFinite(options.height)\n ? (options.height as number)\n : options.height === 'container' && (measured?.height ?? 0) > 0\n ? (measured?.height as number)\n : width / ratio\n return { width, height: Math.max(0, Math.round(height)) }\n}\n\n/** Run the chart type's `render()` for a config and size. */\nfunction renderContent<O extends object>(\n config: ChartConfig<O>,\n size: Size,\n id: string,\n onHitTest: (interaction: Interaction) => void,\n hidden: ReadonlySet<string>,\n fontSize?: number,\n rtl?: boolean,\n): ChildInput {\n let found: Interaction | undefined\n const ctx = renderContext(\n config,\n size,\n id,\n (interaction) => {\n found = interaction\n onHitTest(interaction)\n },\n hidden,\n fontSize,\n rtl,\n )\n const content = config.type.render(config, ctx)\n // Optional features finish the content (point shapes, value labels).\n return features.post ? features.post(config as ChartConfig<object>, content, found, ctx) : content\n}\n\n/** Render context for a config and size (also used by plugins such as the data table). */\nexport function renderContext<O extends object>(\n config: ChartConfig<O>,\n size: Size,\n id: string,\n onHitTest: (interaction: Interaction) => void,\n hidden: ReadonlySet<string>,\n measuredFontSize?: number,\n rtl: boolean = config.rtl === true,\n): RenderContext {\n return {\n rtl,\n width: size.width,\n height: size.height,\n fontSize: config.fontSize ?? measuredFontSize ?? DEFAULT_FONT_SIZE,\n locale: config.locale,\n id,\n onHitTest,\n hidden,\n }\n}\n\n/**\n * The config as cleaned by its chart type, without the options that are\n * numbers nothing can be drawn with (NaN, ±Infinity, from a division or a\n * parse gone wrong outside): their defaults apply, as if they were left out.\n */\nfunction cleanData<O extends object>(config: ChartConfig<O>): ChartConfig<O> {\n const out = {\n ...(config.type?.clean ? (config.type.clean(config) as object) : config),\n } as Record<string, unknown>\n for (const key in out) {\n if (typeof out[key] === 'number' && !Number.isFinite(out[key])) delete out[key]\n }\n return out as ChartConfig<O>\n}\n\nfunction assertType(config: ChartConfig<object>): void {\n if (!config.type || typeof config.type.render !== 'function') {\n throw new TypeError('@tabler/charts: `type` must be a chart type such as line.')\n }\n}\n\n/** Legend entries of a config, whether a legend is shown and where. */\nexport interface ResolvedLegend {\n items: LegendItem[]\n show: boolean\n position: 'top' | 'bottom'\n}\n\n/** Legend entries of a config, and whether the legend is shown. */\nexport function resolveLegend<O extends object>(config: ChartConfig<O>): ResolvedLegend {\n const items = config.type.legend?.(config) ?? []\n const option = config.legend\n const show = option === undefined ? items.length >= 2 : option !== false && items.length > 0\n const position = typeof option === 'object' && option.position === 'bottom' ? 'bottom' : 'top'\n return { items, show, position }\n}\n\n/**\n * The chart's accessible name: its `title`, or else the chart type and its\n * legend entries (\"line chart: Visitors, Sign-ups\"), since an image without\n * a name is announced as nothing at all. Set `title` for a name in the\n * page's language.\n */\nexport function chartLabel(config: ChartConfig<object>): string {\n if (config.title) return config.title\n const names = (config.type.legend?.(config) ?? []).map((item) => item.name).filter(Boolean)\n const shown = names.slice(0, 6).join(', ')\n // Screen readers do not care for capitals; a long list of names is cut short.\n return `${config.type.name} chart${names.length ? `: ${shown}${names.length > 6 ? ', …' : ''}` : ''}`\n}\n\n/** Elements beyond which charts skip transitions unless `animate: true`. */\nconst ANIMATION_LIMIT = 1000\n\n/** Number of elements in chart content. */\nconst countNodes = (child: ChildInput): number =>\n Array.isArray(child)\n ? child.reduce((n: number, c: ChildInput) => n + countNodes(c), 0)\n : child && typeof child === 'object'\n ? 1 + countNodes((child as VNode).children)\n : 0\n\n/** Whether a chart renders without transitions: asked to, or too big to animate cheaply. */\nconst isStatic = (config: ChartConfig<object>, content: ChildInput): boolean =>\n config.animate === false || (config.animate !== true && countNodes(content) > ANIMATION_LIMIT)\n\n/** Wrap chart content (and hover layers) in the accessible root `<svg>`. */\nfunction composeChart(\n config: ChartConfig<object>,\n size: Size,\n id: string,\n still: boolean,\n content: ChildInput,\n underlay?: ChildInput,\n overlay?: ChildInput,\n extraAttrs?: Props,\n rtl: boolean = config.rtl === true,\n): VNode {\n const { width, height } = size\n const descId = config.description ? `${id}-desc` : undefined\n const { patterns } = config\n // [class, root style, defs] of the pattern fills, when the chart has them.\n const fills =\n patterns === false\n ? undefined\n : (patterns === true ? feature('patterns') : features.patterns)?.(config, id)\n return h(\n 'svg',\n {\n class: [\n 'tc-chart',\n `tc-chart-${config.type.name}`,\n still && 'tc-static',\n rtl && 'tc-rtl',\n fills?.[0],\n config.class,\n ],\n style: fills?.[1],\n viewBox: `0 0 ${width} ${height}`,\n width,\n height,\n role: 'img',\n // An svg <title> would also show as a native tooltip, so the name is an attribute.\n 'aria-label': chartLabel(config),\n 'aria-describedby': descId,\n ...extraAttrs,\n },\n // Keyed, so their coming and going never shifts the (unkeyed) chart\n // content in the DOM patcher: that would recreate it and restart animations.\n descId && h('desc', { key: 'desc', id: descId }, config.description),\n fills?.[2],\n underlay && h('g', { key: 'hover-under', class: 'tc-hover-layer' }, underlay),\n content,\n overlay && h('g', { key: 'hover-over', class: 'tc-hover-layer' }, overlay),\n )\n}\n\n/**\n * Build the VNode tree of a chart: a pure function of the config and size,\n * shared by the DOM chart and server-side rendering.\n */\nexport function buildChart<O extends object>(\n config: ChartConfig<O>,\n size: Size,\n id: string = config.id ?? 'tc',\n onHitTest: (interaction: Interaction) => void = () => {},\n): VNode {\n assertType(config as ChartConfig<object>)\n config = cleanData(config)\n const hidden = defaultHidden(resolveLegend(config).items)\n const content = renderContent(config, size, id, onHitTest, hidden)\n const base = config as ChartConfig<object>\n return composeChart(base, size, id, isStatic(base, content), content)\n}\n\n/**\n * Render a chart to an SVG string, e.g. on the server.\n *\n * ```ts\n * chartToString({ type: line, data, id: 'sales', locale: 'en-US' }, { width: 600, height: 300 })\n * ```\n */\nexport function chartToString<O extends object>(config: ChartConfig<O>, size: Size): string {\n return renderToString(buildChart(config, size))\n}\n\nexport interface ChartEvents {\n /** A legend entry was toggled (by the user or `toggleSeries()`). */\n 'legend-toggle': { key: string; name: string; index: number; hidden: boolean }\n /** After the chart content rendered into the DOM (not on hover-only updates). */\n render: { size: Size }\n /**\n * The highlighted category (or mark) changed, or its data changed while\n * highlighted. `hit` is `null` when the pointer left the plot.\n */\n hover: { hit: Hit | null; event?: PointerEvent }\n /** A click on the plot. */\n click: { hit: Hit; event: MouseEvent }\n}\n\n/** The name of every chart event, for adapters that pass them all on. */\nexport const chartEvents: readonly (keyof ChartEvents)[] = [\n 'hover',\n 'click',\n 'legend-toggle',\n 'render',\n]\n\ntype Handler<T> = (event: T) => void\n\n/** Where the current highlight came from. */\ntype Source =\n | { kind: 'pointer'; x: number; y: number }\n | { kind: 'index'; index: number; seriesIndex?: number }\n\n/** The output of a chart type, with what it was built for. */\ninterface Content<O extends object> {\n cfg: ChartConfig<O>\n width: number\n height: number\n hidden: string\n fontSize: number | undefined\n rtl: boolean\n content: ChildInput\n /** Whether the content renders without transitions. */\n still: boolean\n}\n\n/** The chart on each element. */\nconst mounted = /* @__PURE__ */ new WeakMap<Element, Chart<object>>()\n\n/**\n * A chart bound to a DOM element: measures its container, renders SVG into\n * it and re-renders on `update()` and resize (batched per animation frame).\n * Features such as the tooltip, the legend and pointer input (`hover` /\n * `click` events, from `pointer()`, which the highlight and tooltip plugins\n * turn on themselves) are plugins; the `Chart` exported by `@tabler/charts`\n * installs the built-in ones.\n *\n * ```ts\n * const chart = new Chart('#sales', { type: line, data })\n * chart.update({ data: next })\n * ```\n */\nexport class Chart<O extends object = object> {\n /** Element the chart renders into. */\n readonly element: Element\n /** Id prefix used for elements inside the chart. */\n readonly id: string\n #cfg: ChartConfig<O>\n /** Container size changes, from the shared ResizeObserver. */\n #onResize = (width: number, height: number): void => {\n // Our own SVG sets the container height unless it follows the container.\n const followsHeight = this.#cfg.height === 'container'\n const changed =\n width !== this.#measured.width || (followsHeight && height !== this.#measured.height)\n this.#measured = { width, height }\n // A hidden container (display: none) measures 0×0: nothing to draw until it shows again.\n if (changed && (width || height)) {\n this.#font = undefined\n this.#markResizing()\n this.#schedule()\n }\n }\n #measured: Partial<Size> = {}\n readonly #handlers = new Map<keyof ChartEvents, Set<Handler<never>>>()\n #unobserve: () => void\n readonly #plugins: PluginInstance[] = []\n #destroyed = false\n #current: Interaction | undefined\n #source: Source | undefined\n #hovered = ''\n #hit: Hit | null = null\n /** Chart type output of the last render, reused while only the highlight changes. */\n #cache: Content<O> | undefined\n #resizeTimer: ReturnType<typeof setTimeout> | undefined\n /** Visibility set by the user, overriding each entry's default. */\n readonly #toggled = new Map<string, boolean>()\n /** Server-rendered svg to take over on the first render, if any. */\n #adopt: Element | null\n /**\n * The measured `--tc-font-size` (`undefined` reads it again). Reading it\n * forces the browser to restyle the page, so new data alone reuses it.\n */\n #font: number | undefined\n /** The resolved `rtl` option, read with the font size (`'auto'` asks the container). */\n #rtl = false\n\n constructor(\n target: Element | string,\n config: ChartConfig<O>,\n defaultPlugins: readonly ChartPlugin[] = [],\n ) {\n const element = typeof target === 'string' ? document.querySelector(target) : target\n if (!element) throw new Error(`@tabler/charts: element \"${String(target)}\" not found.`)\n // One chart per element: a new one replaces the chart already there.\n mounted.get(element)?.destroy()\n mounted.set(element, this as unknown as Chart<object>)\n this.element = element\n this.#cfg = cleanData(config)\n this.id = config.id ?? nextId()\n this.#adopt = element.querySelector(':scope > svg.tc-chart')\n this.#measure()\n this.#unobserve = observeResize(element, this.#onResize)\n try {\n for (const plugin of [...defaultPlugins, ...(config.plugins ?? [])]) {\n this.#plugins.push(plugin.install(this as unknown as Chart<object>))\n }\n this.render()\n } catch (error) {\n // Nobody gets this chart to destroy it: leave the element as it was found.\n this.destroy()\n throw error\n }\n }\n\n /** Current configuration. */\n get config(): ChartConfig<O> {\n return this.#cfg\n }\n\n /** Size of the last render. */\n get size(): Size {\n // In 'container' height mode, plugins such as the legend take part of the\n // container. Only then: measuring them forces a layout of the page.\n let measured = this.#measured\n if (this.#cfg.height === 'container' && measured.height) {\n let reserved = 0\n for (const plugin of this.#plugins) reserved += plugin.reservedHeight?.() ?? 0\n if (reserved) measured = { ...measured, height: measured.height - reserved }\n }\n return resolveSize(this.#cfg, measured)\n }\n\n /**\n * Whether the chart is laid out right to left: the `rtl` option, with\n * `'auto'` read from the container (together with the font size).\n */\n get rtl(): boolean {\n const cfg = this.#cfg\n if (this.#font === undefined) {\n this.#rtl =\n cfg.rtl === 'auto'\n ? typeof getComputedStyle === 'function' &&\n getComputedStyle(this.element).direction === 'rtl'\n : cfg.rtl === true\n this.#font = cfg.fontSize ?? this.#measureFontSize()\n }\n return this.#rtl\n }\n\n /** Font size used by the last render (explicit, measured, or the default). */\n get fontSize(): number {\n return this.#cache?.fontSize ?? this.#cfg.fontSize ?? DEFAULT_FONT_SIZE\n }\n\n /** How pointer and keyboard map to data for the current render. */\n get interaction(): Interaction | undefined {\n return this.#current\n }\n\n /** The highlighted category (hover or keyboard), or `null`. */\n get active(): Hit | null {\n return this.#hit\n }\n\n /**\n * The pointer in chart pixels while it drives the highlight (`undefined`\n * for keyboard highlights). `hitAnchor(chart.active, chart.pointer)` gives\n * where a tooltip belongs either way.\n */\n get pointer(): { x: number; y: number } | undefined {\n const source = this.#source\n return this.#hit && source?.kind === 'pointer' ? { x: source.x, y: source.y } : undefined\n }\n\n /** Whether the highlight comes from the pointer or from `highlightIndex()` (keyboard). */\n get highlightSource(): 'pointer' | 'index' | undefined {\n return this.#hit ? this.#source?.kind : undefined\n }\n\n /**\n * Highlight a category by index (and optionally one series in it), as\n * keyboard navigation does. Returns the hit, or `null` for an invalid index.\n */\n highlightIndex(index: number, seriesIndex?: number): Hit | null {\n const hit = this.#current?.hitIndex(index, seriesIndex) ?? null\n if (!hit) return null\n this.#source = { kind: 'index', index, seriesIndex }\n this.#setHover(hit)\n return hit\n }\n\n /**\n * Highlight what lies at a point in chart pixels, as the pointer does (the\n * `pointer()` plugin calls it). Returns the hit, or `null` for none.\n */\n highlightAt(x: number, y: number, event?: PointerEvent): Hit | null {\n const hit = this.hitTest(x, y)\n this.#source = { kind: 'pointer', x, y }\n this.#setHover(hit, event)\n return hit\n }\n\n /** Remove any highlight. */\n clearHighlight(event?: PointerEvent): void {\n this.#source = undefined\n this.#setHover(null, event)\n }\n\n /**\n * Show or hide a legend entry (series) by key, name or index; toggles when\n * `hidden` is omitted. Re-renders in the next frame.\n */\n toggleSeries(target: string | number, hidden?: boolean): this {\n const { items } = resolveLegend(this.#cfg)\n const item =\n typeof target === 'number'\n ? items.find((entry) => entry.index === target)\n : (items.find((entry) => entry.key === target) ??\n items.find((entry) => entry.name === target))\n if (!item) return this\n const next = hidden ?? !this.#hiddenSet(items).has(item.key)\n this.#toggled.set(item.key, next)\n this.emit('legend-toggle', { key: item.key, name: item.name, index: item.index, hidden: next })\n this.#schedule()\n return this\n }\n\n /** Whether a legend entry is hidden. */\n isHidden(key: string): boolean {\n return this.#hiddenSet(resolveLegend(this.#cfg).items).has(key)\n }\n\n /** Merge `options` into the configuration and re-render in the next frame. */\n update(options: Partial<ChartConfig<O>>): this {\n this.#cfg = cleanData({ ...this.#cfg, ...options })\n // Options such as `class` may change the font size; new data does not.\n for (const key in options) if (key !== 'data') this.#font = undefined\n this.#schedule()\n return this\n }\n\n /**\n * Replace the whole configuration and re-render in the next frame: options\n * left out go back to their defaults (`update()` would keep them).\n */\n setConfig(config: ChartConfig<O>): this {\n this.#cfg = cleanData(config)\n this.#font = undefined\n this.#schedule()\n return this\n }\n\n /** Replace the data and re-render in the next frame. */\n setData(data: O extends { data: infer D } ? D : never): this {\n return this.update({ data } as unknown as Partial<ChartConfig<O>>)\n }\n\n /**\n * Re-measure the container and re-render in the next frame. Call it when a\n * container taken out of the page without `destroy()` comes back.\n */\n resize(): this {\n // A container taken out of the page and put back is observed again.\n if (!this.#destroyed) this.#unobserve = observeResize(this.element, this.#onResize)\n this.#measure()\n this.#font = undefined\n this.#schedule()\n return this\n }\n\n /** Render synchronously now. */\n render(): this {\n if (this.#destroyed) return this\n cancel(this)\n const cfg = this.#cfg\n const config = cfg as ChartConfig<object>\n assertType(config)\n const legend = resolveLegend(cfg)\n const hidden = this.#hiddenSet(legend.items)\n for (const plugin of this.#plugins) plugin.beforeRender?.({ config, legend, hidden })\n const size = this.size\n const { content, stale, changed } = this.#content(size, hidden)\n if (stale) this.#refreshHighlight()\n\n const adopted = this.#adopt\n render(this.element, this.#compose(content, size), adopted)\n this.#adopt = null\n // The server markup was hydrated in place: snap it to the real size and\n // data instead of morphing (the server could not measure the container).\n if (adopted) this.#markResizing()\n\n for (const plugin of this.#plugins)\n plugin.afterRender?.({ config, legend, hidden, size, stale, changed })\n if (stale) this.emit('render', { size })\n return this\n }\n\n /**\n * The chart type's output for the current config, size, hidden series and\n * font size: built again when one of them changed (`stale`; `changed` when\n * it is what the chart shows, not only its size), else the one of the last render.\n */\n #content(\n size: Size,\n hidden: ReadonlySet<string>,\n ): { content: Content<O>; stale: boolean; changed: boolean } {\n const cfg = this.#cfg\n const hiddenKey = [...hidden].sort().join('\\u0000')\n const rtl = this.rtl\n const fontSize = cfg.fontSize ?? this.#font\n\n let cache = this.#cache\n const changed = !cache || cache.cfg !== cfg || cache.hidden !== hiddenKey\n const stale =\n changed ||\n cache?.width !== size.width ||\n cache.height !== size.height ||\n cache.fontSize !== fontSize ||\n cache.rtl !== rtl\n if (!cache || stale) {\n this.#current = undefined\n const content = renderContent(\n cfg,\n size,\n this.id,\n (interaction) => {\n this.#current = interaction\n },\n hidden,\n fontSize,\n rtl,\n )\n cache = {\n cfg,\n width: size.width,\n height: size.height,\n hidden: hiddenKey,\n fontSize,\n rtl,\n content,\n still: isStatic(cfg as ChartConfig<object>, content),\n }\n this.#cache = cache\n }\n return { content: cache, stale, changed }\n }\n\n /** Keep the highlight (and its consumers, like tooltips) in sync with new data or layout. */\n #refreshHighlight(): void {\n const source = this.#source\n if (!source) return\n const next =\n source.kind === 'pointer'\n ? this.hitTest(source.x, source.y)\n : (this.#current?.hitIndex(source.index, source.seriesIndex) ?? null)\n this.#setHover(next, undefined, true, false)\n }\n\n /** The root svg: the content, with the plugins' hover layers and attributes. */\n #compose(content: Content<O>, size: Size): VNode {\n const config = this.#cfg as ChartConfig<object>\n const hit = this.#hit\n const under: ChildInput[] = []\n const over: ChildInput[] = []\n let attrs: Props | undefined\n for (const plugin of this.#plugins) {\n if (hit && plugin.layers) {\n const layer = plugin.layers(hit, config)\n under.push(layer.under)\n over.push(layer.over)\n }\n const extra = plugin.svgAttrs?.(config)\n if (extra) attrs = { ...attrs, ...extra }\n }\n // Hover layers only while something is highlighted (an empty list would still render).\n return composeChart(\n config,\n size,\n this.id,\n content.still,\n content.content,\n under.length ? under : undefined,\n over.length ? over : undefined,\n attrs,\n content.rtl,\n )\n }\n\n /** What lies at a point in chart pixels, or `null`. */\n hitTest(x: number, y: number): Hit | null {\n return this.#current?.hitTest(x, y) ?? null\n }\n\n /** Subscribe to an event; returns a function that unsubscribes. */\n on<K extends keyof ChartEvents>(name: K, handler: Handler<ChartEvents[K]>): () => void {\n let set = this.#handlers.get(name)\n if (!set) {\n set = new Set()\n this.#handlers.set(name, set)\n }\n set.add(handler as Handler<never>)\n return () => {\n set.delete(handler as Handler<never>)\n }\n }\n\n /** Remove the chart from the DOM and stop observing its container. */\n destroy(): void {\n if (this.#destroyed) return\n this.#destroyed = true\n if (mounted.get(this.element) === (this as never)) mounted.delete(this.element)\n cancel(this)\n clearTimeout(this.#resizeTimer)\n this.#unobserve()\n for (const plugin of this.#plugins) plugin.destroy?.()\n this.#handlers.clear()\n render(this.element, null)\n }\n\n /**\n * Update the highlighted hit: emit `hover` when it changed (or when\n * `force`d after new data) and re-render the hover layers in the next frame.\n */\n #setHover(hit: Hit | null, event?: PointerEvent, force = false, rerender = true): void {\n const key = hitKey(hit)\n if (!force && key === this.#hovered) return\n // After a re-render, only a highlight that is still active is worth repeating.\n if (force && key === '' && this.#hovered === '') return\n this.#hovered = key\n this.#hit = hit\n this.emit('hover', event ? { hit, event } : { hit })\n if (rerender) this.#schedule()\n }\n\n #hiddenSet(items: readonly LegendItem[]): Set<string> {\n const hidden = new Set<string>()\n for (const item of items) {\n if (this.#toggled.get(item.key) ?? item.hidden) hidden.add(item.key)\n }\n return hidden\n }\n\n /** Suspend transitions while the container keeps resizing (see `[data-resizing]` in CSS). */\n #markResizing(): void {\n const svg = this.element.querySelector(':scope > svg.tc-chart')\n if (!svg) return\n svg.setAttribute('data-resizing', '')\n clearTimeout(this.#resizeTimer)\n this.#resizeTimer = setTimeout(() => svg.removeAttribute('data-resizing'), 200)\n }\n\n #schedule(): void {\n if (!this.#destroyed) schedule(this, () => this.render())\n }\n\n /** The `--tc-font-size` in effect on the container, in pixels (browser only). */\n #measureFontSize(): number | undefined {\n if (typeof getComputedStyle !== 'function') return undefined\n const value = Number.parseFloat(\n getComputedStyle(this.element).getPropertyValue('--tc-font-size'),\n )\n return Number.isFinite(value) && value > 0 ? value : undefined\n }\n\n /** Measure the content box, matching what `ResizeObserver` reports. */\n #measure(): void {\n const el = this.element as HTMLElement\n const style = typeof getComputedStyle === 'function' ? getComputedStyle(el) : undefined\n const px = (value: string | undefined) => Number.parseFloat(value ?? '') || 0\n this.#measured = {\n width: el.clientWidth - px(style?.paddingLeft) - px(style?.paddingRight),\n height: el.clientHeight - px(style?.paddingTop) - px(style?.paddingBottom),\n }\n }\n\n /** Call the handlers of an event (plugins emit `click`, for instance). */\n emit<K extends keyof ChartEvents>(name: K, event: ChartEvents[K]): void {\n const set = this.#handlers.get(name)\n if (set) for (const handler of set) (handler as Handler<ChartEvents[K]>)(event)\n }\n}\n"],"mappings":";;;;;AAsEA,SAAgB,OAAO,KAAyB;CAC9C,OAAO,MAAM,GAAG,IAAI,MAAM,GAAG,IAAI,eAAe,OAAO;AACzD;;;;;AAMA,SAAgB,aACd,KACA,SACA,SACA,OACA,QAC0B;CAC1B,MAAM,OAAO,IAAI,sBAAsB;CACvC,MAAM,KAAK,KAAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ;CACjD,MAAM,KAAK,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS;CACpD,OAAO;EAAE,IAAI,UAAU,KAAK,QAAQ;EAAI,IAAI,UAAU,KAAK,OAAO;CAAG;AACvE;;;;;;ACjEA,SAAgB,cAAc,OAA8B,QAAoC;CAC9F,OAAO,EACL,OACA,EAAE,OAAO,kBAAkB,GAC3B,MAAM,KAAK,SAAS;EAClB,MAAM,MAAM,OAAO,IAAI,KAAK,GAAG;EAC/B,OAAO,EACL,UACA;GACE,KAAK,KAAK;GACV,MAAM;GACN,OAAO;IACL;IACA;IACA,aAAa,KAAK,QAAQ;IAC1B,OAAO;GACT;GACA,OAAO,EAAE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M,QAAQ,OAAO,WACnB,iBAAiB,KAAK,OAAO,CAAC,CAAC,iBAAiB,gBAAgB,CAClE;EACA,OAAO,OAAO,SAAS,KAAK,KAAK,QAAQ,IAAI,QAAQ,KAAA;CACvD;;CAGA,WAAiB;EACf,MAAM,KAAK,KAAK;EAChB,MAAM,QAAQ,OAAO,qBAAqB,aAAa,iBAAiB,EAAE,IAAI,KAAA;EAC9E,MAAM,MAAM,UAA8B,OAAO,WAAW,SAAS,EAAE,KAAK;EAC5E,KAAK,YAAY;GACf,OAAO,GAAG,cAAc,GAAG,OAAO,WAAW,IAAI,GAAG,OAAO,YAAY;GACvE,QAAQ,GAAG,eAAe,GAAG,OAAO,UAAU,IAAI,GAAG,OAAO,aAAa;EAC3E;CACF;;CAGA,KAAkC,MAAS,OAA6B;EACtE,MAAM,MAAM,KAAK,UAAU,IAAI,IAAI;EACnC,IAAI,KAAK,KAAK,MAAM,WAAW,KAAM,QAAoC,KAAK;CAChF;AACF"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { a as InsetsInput, n as annotationLayers, r as annotationValues, s as Rect, t as Annotation } from "./annotations-
|
|
2
|
-
import { n as
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
import { n as log, r as LinearScale } from "./log-
|
|
6
|
-
import { t as hydrate } from "./hydrate-
|
|
7
|
-
import { t as morph } from "./morph-
|
|
8
|
-
import { a as linePath, i as areaPath, r as Point } from "./path-
|
|
9
|
-
//#region src/interaction.d.ts
|
|
1
|
+
import { a as InsetsInput, n as annotationLayers, r as annotationValues, s as Rect, t as Annotation } from "./annotations-B02GR_KU.js";
|
|
2
|
+
import { a as ClassValue, i as ChildInput, l as VNode, n as Attrs, s as Props } from "./vnode-Du2cC8Fm.js";
|
|
3
|
+
import { a as timePointScale, c as NumberFormat, i as time, s as Locale } from "./time-DRIDgv2a.js";
|
|
4
|
+
import { n as BandScale, t as BandKey } from "./band-CNKvdnTC.js";
|
|
5
|
+
import { n as log, r as LinearScale } from "./log-CI41TmcU.js";
|
|
6
|
+
import { t as hydrate } from "./hydrate-OjM1pIUG.js";
|
|
7
|
+
import { t as morph } from "./morph-Dh7gJkV4.js";
|
|
8
|
+
import { a as linePath, i as areaPath, r as Point } from "./path-YeUiOfG8.js";
|
|
10
9
|
/** One series' value at a hovered position. */
|
|
11
10
|
interface HitItem {
|
|
12
11
|
/** Series name. */
|
|
@@ -81,9 +80,9 @@ interface Interaction {
|
|
|
81
80
|
hitIndex(index: number, seriesIndex?: number): Hit | null;
|
|
82
81
|
/** Number of categories. */
|
|
83
82
|
count: number;
|
|
83
|
+
/** Categories run from the right: the left arrow key goes to the next one. */
|
|
84
|
+
reversed?: boolean;
|
|
84
85
|
}
|
|
85
|
-
//#endregion
|
|
86
|
-
//#region src/a11y.d.ts
|
|
87
86
|
/** The data behind a chart as text: header cells and one row per category. */
|
|
88
87
|
interface DataTable {
|
|
89
88
|
/** Column headers; the first one labels the row headers (may be empty). */
|
|
@@ -100,8 +99,6 @@ interface DataTable {
|
|
|
100
99
|
declare function tableContent(table: DataTable, caption?: string): VNode;
|
|
101
100
|
/** Short sentence describing a hit, announced during keyboard navigation. */
|
|
102
101
|
declare function describeHit(hit: Hit): string;
|
|
103
|
-
//#endregion
|
|
104
|
-
//#region src/components/axis.d.ts
|
|
105
102
|
type AxisPosition = "top" | "right" | "bottom" | "left";
|
|
106
103
|
/** A single axis tick: its data value, pixel position along the axis and label. */
|
|
107
104
|
interface Tick {
|
|
@@ -148,8 +145,6 @@ declare function axisSize(position: AxisPosition, ticks: readonly Tick[], fontSi
|
|
|
148
145
|
* transition when the scale changes.
|
|
149
146
|
*/
|
|
150
147
|
declare function axis(options: AxisOptions): VNode;
|
|
151
|
-
//#endregion
|
|
152
|
-
//#region src/charts/cartesian.d.ts
|
|
153
148
|
/** Category label on the x axis. */
|
|
154
149
|
type Label = string | number | Date;
|
|
155
150
|
/** One data series. `null` values are gaps. */
|
|
@@ -228,6 +223,8 @@ interface CategoryAxisOptions {
|
|
|
228
223
|
type?: "category" | "time";
|
|
229
224
|
/** Align time ticks to UTC instead of local time (use it for SSR). */
|
|
230
225
|
utc?: boolean;
|
|
226
|
+
/** Run the categories from the right. Defaults to the chart's `rtl`. */
|
|
227
|
+
reverse?: boolean;
|
|
231
228
|
}
|
|
232
229
|
interface CartesianOptions {
|
|
233
230
|
data: CartesianData;
|
|
@@ -290,21 +287,15 @@ declare function categoryInteraction(layout: CartesianLayout, options: Cartesian
|
|
|
290
287
|
}, markAt?: (x: number, y: number, index: number) => number | undefined): Interaction;
|
|
291
288
|
/** Accessible table of series values: one row per category, one column per visible series. */
|
|
292
289
|
declare function seriesTable(options: CartesianOptions, ctx: RenderContext, limit?: number): DataTable;
|
|
293
|
-
//#endregion
|
|
294
|
-
//#region src/charts/dates.d.ts
|
|
295
290
|
/**
|
|
296
291
|
* Formatter for date labels on a time axis (tooltips, tables, band axes):
|
|
297
292
|
* the date, with the time of day when the labels span less than a few days.
|
|
298
293
|
*/
|
|
299
294
|
declare function dateLabels(labels: readonly Label[], utc: boolean | undefined, locale: Locale): (label: Label) => string;
|
|
300
|
-
//#endregion
|
|
301
|
-
//#region src/charts/log-axis.d.ts
|
|
302
295
|
/** Domain of a log axis: positive values only, niced to whole powers of ten. */
|
|
303
296
|
declare function logDomain(values: readonly (number | null | undefined)[], options: ValueAxisOptions): [number, number];
|
|
304
297
|
/** Ticks of a log axis, each power formatted as is. */
|
|
305
298
|
declare function logTicks(scale: LinearScale, count: number, format: NumberFormat | undefined, locale: Locale): Tick[];
|
|
306
|
-
//#endregion
|
|
307
|
-
//#region src/legend.d.ts
|
|
308
299
|
/** One legend entry: a series (or a slice, for part-to-whole charts). */
|
|
309
300
|
interface LegendItem {
|
|
310
301
|
/** Stable identity, used to toggle it. */
|
|
@@ -328,8 +319,6 @@ interface LegendOptions {
|
|
|
328
319
|
declare function legendContent(items: readonly LegendItem[], hidden: ReadonlySet<string>): VNode;
|
|
329
320
|
/** Keys hidden by default, from the entries' own `hidden` flags. */
|
|
330
321
|
declare function defaultHidden(items: readonly LegendItem[]): Set<string>;
|
|
331
|
-
//#endregion
|
|
332
|
-
//#region src/charts/patterns.d.ts
|
|
333
322
|
/** `<pattern>` elements for the legend entries of a chart. */
|
|
334
323
|
declare function patternDefs(items: readonly LegendItem[], id: string): VNode[];
|
|
335
324
|
/** The `--tc-pattern-{n}` references for the chart root. */
|
|
@@ -341,21 +330,15 @@ declare function patternVars(items: readonly LegendItem[], id: string): Record<s
|
|
|
341
330
|
* `undefined` for a chart without legend entries.
|
|
342
331
|
*/
|
|
343
332
|
declare function patternFills(config: ChartConfig<object>, id: string): [string, Record<string, string>, VNode] | undefined;
|
|
344
|
-
//#endregion
|
|
345
|
-
//#region src/charts/point-shapes.d.ts
|
|
346
333
|
/** The path of slot `slot`'s marker of radius `r` around (`x`, `y`). */
|
|
347
334
|
declare function markerPath(slot: number, x: number, y: number, r: number): string;
|
|
348
335
|
/** The step that gives the points of charts with `shapes` (or `patterns: true`) their shapes. */
|
|
349
336
|
declare const shapesStep: PostStep;
|
|
350
|
-
//#endregion
|
|
351
|
-
//#region src/charts/time-axis.d.ts
|
|
352
337
|
/**
|
|
353
338
|
* A time category axis: points at their real distance in time, ticks on
|
|
354
339
|
* calendar boundaries labelled for the span (or with `x.format`).
|
|
355
340
|
*/
|
|
356
341
|
declare function timeAxis(labels: readonly Label[], keys: readonly BandKey[], options: CategoryAxisOptions, count: number, locale: Locale): CategoryAxis;
|
|
357
|
-
//#endregion
|
|
358
|
-
//#region src/export-chart.d.ts
|
|
359
342
|
interface ExportOptions {
|
|
360
343
|
/**
|
|
361
344
|
* Background color, `'auto'` for the chart's surface (`--tc-surface`), or
|
|
@@ -407,8 +390,6 @@ declare function exportImage(target: ExportTarget, options?: ImageOptions): Prom
|
|
|
407
390
|
* ```
|
|
408
391
|
*/
|
|
409
392
|
declare function downloadChart(target: ExportTarget, options?: DownloadOptions): Promise<void>;
|
|
410
|
-
//#endregion
|
|
411
|
-
//#region src/render/sweep.d.ts
|
|
412
393
|
/**
|
|
413
394
|
* Take `el` from the arc of its last render, `prev`, to the arc of `next`.
|
|
414
395
|
* Returns the attributes left for the caller to patch (all but `d`, set
|
|
@@ -416,8 +397,6 @@ declare function downloadChart(target: ExportTarget, options?: DownloadOptions):
|
|
|
416
397
|
* same path, no arc to come from, or a chart without transitions.
|
|
417
398
|
*/
|
|
418
399
|
declare function sweep(el: Element, prev: VNode, next: VNode): Attrs | undefined;
|
|
419
|
-
//#endregion
|
|
420
|
-
//#region src/features.d.ts
|
|
421
400
|
/**
|
|
422
401
|
* Optional features that chart types look up at render time. Each lives in
|
|
423
402
|
* its own module (`@tabler/charts/time`, `/log`, `/decimate`, `/line`, `/annotations`) and registers
|
|
@@ -479,8 +458,6 @@ declare function register(added: Features): void;
|
|
|
479
458
|
type PostStep = (config: ChartConfig<object>, content: ChildInput, interaction: Interaction | undefined, ctx: RenderContext) => ChildInput;
|
|
480
459
|
/** The registered feature, or a helpful error naming the import that provides it. */
|
|
481
460
|
declare function feature<K extends keyof Features>(name: K): NonNullable<Features[K]>;
|
|
482
|
-
//#endregion
|
|
483
|
-
//#region src/charts/value-labels.d.ts
|
|
484
461
|
interface ValueLabelOptions {
|
|
485
462
|
/** Format of the values. Defaults to the value axis format (slices: their share in percent). */
|
|
486
463
|
format?: NumberFormat;
|
|
@@ -491,8 +468,6 @@ interface ValueLabelOptions {
|
|
|
491
468
|
declare function valueLabels(config: ChartConfig<object>, interaction: Interaction, ctx: RenderContext): VNode | null;
|
|
492
469
|
/** The step that adds the labels over the content of charts with `valueLabels`. */
|
|
493
470
|
declare const labelsStep: PostStep;
|
|
494
|
-
//#endregion
|
|
495
|
-
//#region src/plugin.d.ts
|
|
496
471
|
/** What a plugin sees before the chart measures itself and renders. */
|
|
497
472
|
interface BeforeRenderState {
|
|
498
473
|
config: ChartConfig<object>;
|
|
@@ -538,8 +513,6 @@ interface ChartPlugin {
|
|
|
538
513
|
readonly name: string;
|
|
539
514
|
install(chart: Chart<object>): PluginInstance;
|
|
540
515
|
}
|
|
541
|
-
//#endregion
|
|
542
|
-
//#region src/plugins/download.d.ts
|
|
543
516
|
/** A file format of the download menu. */
|
|
544
517
|
type DownloadFormat = "png" | "svg" | "jpeg" | "webp";
|
|
545
518
|
/** The `download` option as an object. */
|
|
@@ -570,8 +543,6 @@ type DownloadOption = boolean | readonly DownloadFormat[] | DownloadMenuOptions;
|
|
|
570
543
|
* carry the export code.
|
|
571
544
|
*/
|
|
572
545
|
declare function download(): ChartPlugin;
|
|
573
|
-
//#endregion
|
|
574
|
-
//#region src/tooltip.d.ts
|
|
575
546
|
/**
|
|
576
547
|
* Where a tooltip for `hit` belongs, in chart pixels: the pointer when it
|
|
577
548
|
* drives the highlight, otherwise the focused value (keyboard).
|
|
@@ -584,6 +555,12 @@ declare function hitAnchor(hit: Hit, pointer?: {
|
|
|
584
555
|
y: number;
|
|
585
556
|
};
|
|
586
557
|
interface TooltipOptions {
|
|
558
|
+
/**
|
|
559
|
+
* Colors of the tooltip: `'dark'` (the default) is a dark box with light
|
|
560
|
+
* text, `'light'` a white one with dark text. Both keep their colors in
|
|
561
|
+
* dark mode; the `--tc-tooltip-*` tokens tune them.
|
|
562
|
+
*/
|
|
563
|
+
theme?: "dark" | "light";
|
|
587
564
|
/**
|
|
588
565
|
* Custom content for a hit: VNodes built with `h()` or plain text.
|
|
589
566
|
* Rendered safely (no HTML parsing), inside `.tc-tooltip`.
|
|
@@ -602,7 +579,8 @@ interface TooltipPlacement {
|
|
|
602
579
|
/**
|
|
603
580
|
* Place a `width × height` tooltip next to an anchor within `bounds` (from
|
|
604
581
|
* `bounds.x`, `bounds.y`, 0 by default): right of the anchor, or left when it
|
|
605
|
-
* would overflow, vertically centered on the
|
|
582
|
+
* would overflow (the other way round with `rtl`), vertically centered on the
|
|
583
|
+
* pointer and clamped.
|
|
606
584
|
*/
|
|
607
585
|
declare function placeTooltip(anchor: {
|
|
608
586
|
x: number;
|
|
@@ -615,9 +593,7 @@ declare function placeTooltip(anchor: {
|
|
|
615
593
|
y?: number;
|
|
616
594
|
width: number;
|
|
617
595
|
height: number;
|
|
618
|
-
}, offset?: number): TooltipPlacement;
|
|
619
|
-
//#endregion
|
|
620
|
-
//#region src/chart.d.ts
|
|
596
|
+
}, offset?: number, rtl?: boolean): TooltipPlacement;
|
|
621
597
|
/** Size and environment a chart type renders into. */
|
|
622
598
|
interface RenderContext {
|
|
623
599
|
width: number;
|
|
@@ -631,6 +607,8 @@ interface RenderContext {
|
|
|
631
607
|
onHitTest(interaction: Interaction): void;
|
|
632
608
|
/** Keys of legend entries (series) currently hidden. */
|
|
633
609
|
hidden: ReadonlySet<string>;
|
|
610
|
+
/** Lay the chart out right to left (the `rtl` option, resolved). */
|
|
611
|
+
rtl?: boolean;
|
|
634
612
|
}
|
|
635
613
|
/**
|
|
636
614
|
* A chart type plugin (`line`, `bar`, …). Receives the chart options and
|
|
@@ -689,6 +667,14 @@ interface BaseOptions {
|
|
|
689
667
|
class?: ClassValue;
|
|
690
668
|
/** Locale for number and date formatting. Set it explicitly for SSR. */
|
|
691
669
|
locale?: Locale;
|
|
670
|
+
/**
|
|
671
|
+
* Mirror the layout for right-to-left pages: the value axis on the right
|
|
672
|
+
* and categories running from the right (`x.reverse` overrides the latter).
|
|
673
|
+
* `'auto'` follows the `direction` of the container (left to right in SSR).
|
|
674
|
+
* The legend, the tooltip and the download menu read right to left with it.
|
|
675
|
+
* Cartesian charts, heatmaps, sparklines and sankey diagrams. Defaults to `false`.
|
|
676
|
+
*/
|
|
677
|
+
rtl?: boolean | "auto";
|
|
692
678
|
/**
|
|
693
679
|
* Font size used to lay out labels. In the browser it is read from the
|
|
694
680
|
* `--tc-font-size` custom property of the container when not set; set it
|
|
@@ -777,7 +763,7 @@ interface Size {
|
|
|
777
763
|
/** Resolve the final pixel size from options and the measured container size. */
|
|
778
764
|
declare function resolveSize(options: BaseOptions, measured?: Partial<Size>): Size;
|
|
779
765
|
/** Render context for a config and size (also used by plugins such as the data table). */
|
|
780
|
-
declare function renderContext<O extends object>(config: ChartConfig<O>, size: Size, id: string, onHitTest: (interaction: Interaction) => void, hidden: ReadonlySet<string>, measuredFontSize?: number): RenderContext;
|
|
766
|
+
declare function renderContext<O extends object>(config: ChartConfig<O>, size: Size, id: string, onHitTest: (interaction: Interaction) => void, hidden: ReadonlySet<string>, measuredFontSize?: number, rtl?: boolean): RenderContext;
|
|
781
767
|
/** Legend entries of a config, whether a legend is shown and where. */
|
|
782
768
|
interface ResolvedLegend {
|
|
783
769
|
items: LegendItem[];
|
|
@@ -859,6 +845,11 @@ declare class Chart<O extends object = object> {
|
|
|
859
845
|
get config(): ChartConfig<O>;
|
|
860
846
|
/** Size of the last render. */
|
|
861
847
|
get size(): Size;
|
|
848
|
+
/**
|
|
849
|
+
* Whether the chart is laid out right to left: the `rtl` option, with
|
|
850
|
+
* `'auto'` read from the container (together with the font size).
|
|
851
|
+
*/
|
|
852
|
+
get rtl(): boolean;
|
|
862
853
|
/** Font size used by the last render (explicit, measured, or the default). */
|
|
863
854
|
get fontSize(): number;
|
|
864
855
|
/** How pointer and keyboard map to data for the current render. */
|
|
@@ -922,6 +913,4 @@ declare class Chart<O extends object = object> {
|
|
|
922
913
|
/** Call the handlers of an event (plugins emit `click`, for instance). */
|
|
923
914
|
emit<K extends keyof ChartEvents>(name: K, event: ChartEvents[K]): void;
|
|
924
915
|
}
|
|
925
|
-
|
|
926
|
-
export { CartesianOptions as $, labelsStep as A, downloadChart as B, DownloadOption as C, HitTester as Ct, ChartPlugin as D, BeforeRenderState as E, register as F, patternDefs as G, exportSVG as H, DownloadOptions as I, LegendItem as J, patternFills as K, ExportOptions as L, Features as M, feature as N, PluginInstance as O, features as P, CartesianData as Q, ExportTarget as R, DownloadMenuOptions as S, HitItem as St, AfterRenderState as T, markerPath as U, exportImage as V, shapesStep as W, defaultHidden as X, LegendOptions as Y, legendContent as Z, TooltipPlacement as _, thinTicks as _t, ChartType as a, domainOf as at, tooltipContent as b, tableContent as bt, Size as c, seriesTable as ct, chartLabel as d, LinearTicksOptions as dt, CategoryAxisOptions as et, chartToString as f, Tick as ft, TooltipOptions as g, linearTicks as gt, resolveSize as h, bandTicks as ht, ChartEvents as i, categoryInteraction as it, valueLabels as j, ValueLabelOptions as k, buildChart as l, AxisOptions as lt, resolveLegend as m, axisSize as mt, Chart as n, Series as nt, RenderContext as o, seriesKey as ot, renderContext as p, axis as pt, patternVars as q, ChartConfig as r, ValueAxisOptions as rt, ResolvedLegend as s, seriesLegend as st, BaseOptions as t, Label as tt, chartEvents as u, AxisPosition as ut, hitAnchor as v, DataTable as vt, download as w, Interaction as wt, DownloadFormat as x, Hit as xt, placeTooltip as y, describeHit as yt, ImageOptions as z };
|
|
927
|
-
//# sourceMappingURL=chart-iJGxMz9z.d.ts.map
|
|
916
|
+
export { CartesianOptions as $, labelsStep as A, downloadChart as B, DownloadOption as C, HitTester as Ct, ChartPlugin as D, BeforeRenderState as E, register as F, patternDefs as G, exportSVG as H, DownloadOptions as I, LegendItem as J, patternFills as K, ExportOptions as L, Features as M, feature as N, PluginInstance as O, features as P, CartesianData as Q, ExportTarget as R, DownloadMenuOptions as S, HitItem as St, AfterRenderState as T, markerPath as U, exportImage as V, shapesStep as W, defaultHidden as X, LegendOptions as Y, legendContent as Z, TooltipPlacement as _, thinTicks as _t, ChartType as a, domainOf as at, tooltipContent as b, tableContent as bt, Size as c, seriesTable as ct, chartLabel as d, LinearTicksOptions as dt, CategoryAxisOptions as et, chartToString as f, Tick as ft, TooltipOptions as g, linearTicks as gt, resolveSize as h, bandTicks as ht, ChartEvents as i, categoryInteraction as it, valueLabels as j, ValueLabelOptions as k, buildChart as l, AxisOptions as lt, resolveLegend as m, axisSize as mt, Chart as n, Series as nt, RenderContext as o, seriesKey as ot, renderContext as p, axis as pt, patternVars as q, ChartConfig as r, ValueAxisOptions as rt, ResolvedLegend as s, seriesLegend as st, BaseOptions as t, Label as tt, chartEvents as u, AxisPosition as ut, hitAnchor as v, DataTable as vt, download as w, Interaction as wt, DownloadFormat as x, Hit as xt, placeTooltip as y, describeHit as yt, ImageOptions as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const require_dom = require("./dom-
|
|
4
|
-
|
|
1
|
+
const require_features = require("./features-DCXEvoya.cjs");
|
|
2
|
+
const require_vnode = require("./vnode-ClAiw28x.cjs");
|
|
3
|
+
const require_dom = require("./dom-D_g13XWY.cjs");
|
|
4
|
+
// src/interaction.ts
|
|
5
5
|
/** Identity of a hit, used to emit hover changes only when it changes. */
|
|
6
6
|
function hitKey(hit) {
|
|
7
7
|
return hit ? `${hit.index}:${hit.seriesIndex ?? ""}` : "";
|
|
@@ -19,8 +19,7 @@ function toChartPoint(svg, clientX, clientY, width, height) {
|
|
|
19
19
|
y: (clientY - rect.top) * sy
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
//#region src/legend.ts
|
|
22
|
+
// src/legend.ts
|
|
24
23
|
/**
|
|
25
24
|
* Legend content: one toggle button per entry. Buttons are native, so they
|
|
26
25
|
* are focusable and work with Enter/Space; `aria-pressed` reflects visibility.
|
|
@@ -50,8 +49,7 @@ function legendContent(items, hidden) {
|
|
|
50
49
|
function defaultHidden(items) {
|
|
51
50
|
return new Set(items.filter((item) => item.hidden).map((item) => item.key));
|
|
52
51
|
}
|
|
53
|
-
|
|
54
|
-
//#region src/render/string.ts
|
|
52
|
+
// src/render/string.ts
|
|
55
53
|
const SVG_NS = "http://www.w3.org/2000/svg";
|
|
56
54
|
/** Root tags treated as HTML when no namespace is given. */
|
|
57
55
|
const HTML_ROOTS = /* @__PURE__ */ new Set([
|
|
@@ -151,8 +149,7 @@ function escapeText(value) {
|
|
|
151
149
|
function escapeAttr(value) {
|
|
152
150
|
return ATTR_RE.test(value) ? value.replace(ATTR_RE_G, replaceEntity) : value;
|
|
153
151
|
}
|
|
154
|
-
|
|
155
|
-
//#region src/resize.ts
|
|
152
|
+
// src/resize.ts
|
|
156
153
|
const listeners = /* @__PURE__ */ new WeakMap();
|
|
157
154
|
/** Elements observed while in the document. */
|
|
158
155
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
@@ -186,8 +183,7 @@ function observeResize(el, listener) {
|
|
|
186
183
|
ro.unobserve(el);
|
|
187
184
|
};
|
|
188
185
|
}
|
|
189
|
-
|
|
190
|
-
//#region src/scheduler.ts
|
|
186
|
+
// src/scheduler.ts
|
|
191
187
|
/**
|
|
192
188
|
* Batches work from all charts into a single animation frame. Scheduling the
|
|
193
189
|
* same key twice before the flush runs its latest task once.
|
|
@@ -252,8 +248,7 @@ function flush() {
|
|
|
252
248
|
for (const [key, task] of later) schedule(key, task);
|
|
253
249
|
return count;
|
|
254
250
|
}
|
|
255
|
-
|
|
256
|
-
//#region src/chart.ts
|
|
251
|
+
// src/chart.ts
|
|
257
252
|
const DEFAULT_WIDTH = 600;
|
|
258
253
|
const DEFAULT_ASPECT_RATIO = 2;
|
|
259
254
|
const DEFAULT_FONT_SIZE = 12;
|
|
@@ -271,18 +266,19 @@ function resolveSize(options, measured) {
|
|
|
271
266
|
};
|
|
272
267
|
}
|
|
273
268
|
/** Run the chart type's `render()` for a config and size. */
|
|
274
|
-
function renderContent(config, size, id, onHitTest, hidden, fontSize) {
|
|
269
|
+
function renderContent(config, size, id, onHitTest, hidden, fontSize, rtl) {
|
|
275
270
|
let found;
|
|
276
271
|
const ctx = renderContext(config, size, id, (interaction) => {
|
|
277
272
|
found = interaction;
|
|
278
273
|
onHitTest(interaction);
|
|
279
|
-
}, hidden, fontSize);
|
|
274
|
+
}, hidden, fontSize, rtl);
|
|
280
275
|
const content = config.type.render(config, ctx);
|
|
281
276
|
return require_features.features.post ? require_features.features.post(config, content, found, ctx) : content;
|
|
282
277
|
}
|
|
283
278
|
/** Render context for a config and size (also used by plugins such as the data table). */
|
|
284
|
-
function renderContext(config, size, id, onHitTest, hidden, measuredFontSize) {
|
|
279
|
+
function renderContext(config, size, id, onHitTest, hidden, measuredFontSize, rtl = config.rtl === true) {
|
|
285
280
|
return {
|
|
281
|
+
rtl,
|
|
286
282
|
width: size.width,
|
|
287
283
|
height: size.height,
|
|
288
284
|
fontSize: config.fontSize ?? measuredFontSize ?? DEFAULT_FONT_SIZE,
|
|
@@ -334,7 +330,7 @@ const countNodes = (child) => Array.isArray(child) ? child.reduce((n, c) => n +
|
|
|
334
330
|
/** Whether a chart renders without transitions: asked to, or too big to animate cheaply. */
|
|
335
331
|
const isStatic = (config, content) => config.animate === false || config.animate !== true && countNodes(content) > ANIMATION_LIMIT;
|
|
336
332
|
/** Wrap chart content (and hover layers) in the accessible root `<svg>`. */
|
|
337
|
-
function composeChart(config, size, id, still, content, underlay, overlay, extraAttrs) {
|
|
333
|
+
function composeChart(config, size, id, still, content, underlay, overlay, extraAttrs, rtl = config.rtl === true) {
|
|
338
334
|
const { width, height } = size;
|
|
339
335
|
const descId = config.description ? `${id}-desc` : void 0;
|
|
340
336
|
const { patterns } = config;
|
|
@@ -344,6 +340,7 @@ function composeChart(config, size, id, still, content, underlay, overlay, extra
|
|
|
344
340
|
"tc-chart",
|
|
345
341
|
`tc-chart-${config.type.name}`,
|
|
346
342
|
still && "tc-static",
|
|
343
|
+
rtl && "tc-rtl",
|
|
347
344
|
fills?.[0],
|
|
348
345
|
config.class
|
|
349
346
|
],
|
|
@@ -451,6 +448,8 @@ var Chart = class {
|
|
|
451
448
|
* forces the browser to restyle the page, so new data alone reuses it.
|
|
452
449
|
*/
|
|
453
450
|
#font;
|
|
451
|
+
/** The resolved `rtl` option, read with the font size (`'auto'` asks the container). */
|
|
452
|
+
#rtl = false;
|
|
454
453
|
constructor(target, config, defaultPlugins = []) {
|
|
455
454
|
const element = typeof target === "string" ? document.querySelector(target) : target;
|
|
456
455
|
if (!element) throw new Error(`@tabler/charts: element "${String(target)}" not found.`);
|
|
@@ -487,6 +486,18 @@ var Chart = class {
|
|
|
487
486
|
}
|
|
488
487
|
return resolveSize(this.#cfg, measured);
|
|
489
488
|
}
|
|
489
|
+
/**
|
|
490
|
+
* Whether the chart is laid out right to left: the `rtl` option, with
|
|
491
|
+
* `'auto'` read from the container (together with the font size).
|
|
492
|
+
*/
|
|
493
|
+
get rtl() {
|
|
494
|
+
const cfg = this.#cfg;
|
|
495
|
+
if (this.#font === void 0) {
|
|
496
|
+
this.#rtl = cfg.rtl === "auto" ? typeof getComputedStyle === "function" && getComputedStyle(this.element).direction === "rtl" : cfg.rtl === true;
|
|
497
|
+
this.#font = cfg.fontSize ?? this.#measureFontSize();
|
|
498
|
+
}
|
|
499
|
+
return this.#rtl;
|
|
500
|
+
}
|
|
490
501
|
/** Font size used by the last render (explicit, measured, or the default). */
|
|
491
502
|
get fontSize() {
|
|
492
503
|
return this.#cache?.fontSize ?? this.#cfg.fontSize ?? DEFAULT_FONT_SIZE;
|
|
@@ -647,22 +658,23 @@ var Chart = class {
|
|
|
647
658
|
#content(size, hidden) {
|
|
648
659
|
const cfg = this.#cfg;
|
|
649
660
|
const hiddenKey = [...hidden].sort().join("\0");
|
|
650
|
-
|
|
661
|
+
const rtl = this.rtl;
|
|
651
662
|
const fontSize = cfg.fontSize ?? this.#font;
|
|
652
663
|
let cache = this.#cache;
|
|
653
664
|
const changed = !cache || cache.cfg !== cfg || cache.hidden !== hiddenKey;
|
|
654
|
-
const stale = changed || cache?.width !== size.width || cache.height !== size.height || cache.fontSize !== fontSize;
|
|
665
|
+
const stale = changed || cache?.width !== size.width || cache.height !== size.height || cache.fontSize !== fontSize || cache.rtl !== rtl;
|
|
655
666
|
if (!cache || stale) {
|
|
656
667
|
this.#current = void 0;
|
|
657
668
|
const content = renderContent(cfg, size, this.id, (interaction) => {
|
|
658
669
|
this.#current = interaction;
|
|
659
|
-
}, hidden, fontSize);
|
|
670
|
+
}, hidden, fontSize, rtl);
|
|
660
671
|
cache = {
|
|
661
672
|
cfg,
|
|
662
673
|
width: size.width,
|
|
663
674
|
height: size.height,
|
|
664
675
|
hidden: hiddenKey,
|
|
665
676
|
fontSize,
|
|
677
|
+
rtl,
|
|
666
678
|
content,
|
|
667
679
|
still: isStatic(cfg, content)
|
|
668
680
|
};
|
|
@@ -700,7 +712,7 @@ var Chart = class {
|
|
|
700
712
|
...extra
|
|
701
713
|
};
|
|
702
714
|
}
|
|
703
|
-
return composeChart(config, size, this.id, content.still, content.content, under.length ? under : void 0, over.length ? over : void 0, attrs);
|
|
715
|
+
return composeChart(config, size, this.id, content.still, content.content, under.length ? under : void 0, over.length ? over : void 0, attrs, content.rtl);
|
|
704
716
|
}
|
|
705
717
|
/** What lies at a point in chart pixels, or `null`. */
|
|
706
718
|
hitTest(x, y) {
|
|
@@ -784,7 +796,6 @@ var Chart = class {
|
|
|
784
796
|
if (set) for (const handler of set) handler(event);
|
|
785
797
|
}
|
|
786
798
|
};
|
|
787
|
-
//#endregion
|
|
788
799
|
Object.defineProperty(exports, "Chart", {
|
|
789
800
|
enumerable: true,
|
|
790
801
|
get: function() {
|
|
@@ -900,4 +911,4 @@ Object.defineProperty(exports, "toChartPoint", {
|
|
|
900
911
|
}
|
|
901
912
|
});
|
|
902
913
|
|
|
903
|
-
//# sourceMappingURL=chart-
|
|
914
|
+
//# sourceMappingURL=chart-e2VqomCI.cjs.map
|