@tabler/charts 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -16
- package/dist/{annotations-CpCWA29b.cjs → annotations--m-HzMBM.cjs} +86 -10
- package/dist/annotations--m-HzMBM.cjs.map +1 -0
- package/dist/{annotations-B02GR_KU.d.ts → annotations-CCDUC1lW.d.ts} +16 -30
- package/dist/{annotations-CHafaGd4.d.cts → annotations-CqZM1z9R.d.cts} +16 -30
- package/dist/{annotations-BQ8l-qHs.js → annotations-DGITy6th.js} +86 -10
- package/dist/annotations-DGITy6th.js.map +1 -0
- package/dist/annotations.cjs +1 -1
- package/dist/annotations.d.cts +1 -1
- package/dist/annotations.d.ts +1 -1
- package/dist/annotations.js +1 -1
- package/dist/{area-WdtfqvhX.js → area-BN0uE9R0.js} +4 -3
- package/dist/area-BN0uE9R0.js.map +1 -0
- package/dist/{area-h_FvieFb.d.cts → area-D6LNLk3r.d.cts} +2 -2
- package/dist/{area-DEFQm_SQ.d.ts → area-DEFL-Yun.d.ts} +2 -2
- package/dist/{area-DYdQ_sMV.cjs → area-D_N8b4Ng.cjs} +4 -3
- package/dist/area-D_N8b4Ng.cjs.map +1 -0
- package/dist/area.cjs +1 -1
- package/dist/area.d.cts +1 -1
- package/dist/area.d.ts +1 -1
- package/dist/area.js +1 -1
- package/dist/{axis-YfAerNBA.cjs → axis-BzBkkC5X.cjs} +12 -7
- package/dist/axis-BzBkkC5X.cjs.map +1 -0
- package/dist/{axis-MMaVoSWB.js → axis-C5obgdJt.js} +12 -7
- package/dist/axis-C5obgdJt.js.map +1 -0
- package/dist/{bar-CVkOJ7WA.cjs → bar-BrmfXugT.cjs} +5 -4
- package/dist/bar-BrmfXugT.cjs.map +1 -0
- package/dist/{bar-D9B_arKf.d.ts → bar-Bs_rPqgR.d.ts} +1 -1
- package/dist/{bar-DZCQ-kyf.d.cts → bar-CEt8YRxf.d.cts} +2 -2
- package/dist/{bar-BOcRcArc.js → bar-D_KKd2fL.js} +5 -4
- package/dist/bar-D_KKd2fL.js.map +1 -0
- package/dist/bar.cjs +1 -1
- package/dist/bar.d.cts +1 -1
- package/dist/bar.d.ts +1 -1
- package/dist/bar.js +1 -1
- package/dist/{calendar-BSvO8nRb.d.cts → calendar-B7843sQu.d.cts} +2 -2
- package/dist/{calendar-DAFXjV99.cjs → calendar-BG_q_NC_.cjs} +2 -2
- package/dist/{calendar-DAFXjV99.cjs.map → calendar-BG_q_NC_.cjs.map} +1 -1
- package/dist/{calendar-BXgIX5H1.js → calendar-CF3gfDQk.js} +2 -2
- package/dist/{calendar-BXgIX5H1.js.map → calendar-CF3gfDQk.js.map} +1 -1
- package/dist/{calendar-Bq3vFzPl.d.ts → calendar-D10_ki1S.d.ts} +2 -2
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.cts +1 -1
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +1 -1
- package/dist/{candlestick-BtT9glp9.js → candlestick-B1onjo1o.js} +3 -2
- package/dist/candlestick-B1onjo1o.js.map +1 -0
- package/dist/{candlestick-BcomxeVG.d.cts → candlestick-B7YXUVVh.d.cts} +4 -3
- package/dist/{candlestick-CSmRuZ4v.cjs → candlestick-BwrFKak_.cjs} +3 -2
- package/dist/candlestick-BwrFKak_.cjs.map +1 -0
- package/dist/{candlestick-B3WcLzph.d.ts → candlestick-XpqJvarq.d.ts} +4 -3
- package/dist/candlestick.cjs +2 -2
- package/dist/candlestick.d.cts +1 -1
- package/dist/candlestick.d.ts +1 -1
- package/dist/candlestick.js +2 -2
- package/dist/{cartesian-DRSXHxWe.cjs → cartesian-B9CrasFJ.cjs} +49 -7
- package/dist/cartesian-B9CrasFJ.cjs.map +1 -0
- package/dist/{cartesian-BrPqb5Qn.js → cartesian-COglz544.js} +45 -9
- package/dist/cartesian-COglz544.js.map +1 -0
- package/dist/{chart-B6TTY4Kr.js → chart-B97FBRCd.js} +22 -12
- package/dist/chart-B97FBRCd.js.map +1 -0
- package/dist/{chart-CYrrUCi3.d.ts → chart-CE9EVbfV.d.ts} +240 -62
- package/dist/{chart-CbPzP5Dp.d.cts → chart-Dz4geQZy.d.cts} +240 -62
- package/dist/{chart-D_lyOy-M.cjs → chart-GUmmjJ7S.cjs} +27 -11
- package/dist/chart-GUmmjJ7S.cjs.map +1 -0
- package/dist/{core-CQ0FaJ4G.js → core-7fgM3su0.js} +84 -16
- package/dist/core-7fgM3su0.js.map +1 -0
- package/dist/{core-C3qEppSm.d.ts → core-BUQzLsRJ.d.ts} +21 -6
- package/dist/{core-D2PSked3.cjs → core-BZTrsPxc.cjs} +93 -13
- package/dist/core-BZTrsPxc.cjs.map +1 -0
- package/dist/{core-9BnLEW4K.d.cts → core-Ck5uHcW8.d.cts} +40 -23
- package/dist/core.cjs +20 -16
- package/dist/core.d.cts +23 -21
- package/dist/core.d.ts +23 -21
- package/dist/core.js +18 -17
- package/dist/{dates-DerXTb1J.cjs → dates-0YNY49KQ.cjs} +2 -2
- package/dist/{dates-DerXTb1J.cjs.map → dates-0YNY49KQ.cjs.map} +1 -1
- package/dist/{dates-DLe2Ww64.js → dates-CKDRgpin.js} +2 -2
- package/dist/{dates-DLe2Ww64.js.map → dates-CKDRgpin.js.map} +1 -1
- package/dist/end-labels-B3oRvjxw.js +114 -0
- package/dist/end-labels-B3oRvjxw.js.map +1 -0
- package/dist/end-labels-CS-fnpp-.cjs +119 -0
- package/dist/end-labels-CS-fnpp-.cjs.map +1 -0
- package/dist/end-labels.cjs +11 -0
- package/dist/end-labels.cjs.map +1 -0
- package/dist/end-labels.d.cts +6 -0
- package/dist/end-labels.d.ts +6 -0
- package/dist/end-labels.js +11 -0
- package/dist/end-labels.js.map +1 -0
- package/dist/{export-chart-DoeiAyR2.js → export-chart-BOH_nfcH.js} +76 -4
- package/dist/export-chart-BOH_nfcH.js.map +1 -0
- package/dist/{export-chart-CPtXmZvi.cjs → export-chart-Be4T9J3m.cjs} +81 -3
- package/dist/export-chart-Be4T9J3m.cjs.map +1 -0
- package/dist/export.cjs +4 -2
- package/dist/export.cjs.map +1 -1
- package/dist/export.d.cts +4 -3
- package/dist/export.d.ts +4 -3
- package/dist/export.js +4 -3
- package/dist/export.js.map +1 -1
- package/dist/features-B55rwpQC.js.map +1 -1
- package/dist/features-DEDP5CEQ.cjs.map +1 -1
- package/dist/{funnel-CarOh8w_.d.cts → funnel-B9ridzNx.d.cts} +2 -2
- package/dist/{funnel-BdcfUkb5.d.ts → funnel-FogM8flk.d.ts} +2 -2
- package/dist/funnel.d.cts +1 -1
- package/dist/funnel.d.ts +1 -1
- package/dist/{gauge-Ds9k1UV2.d.cts → gauge-BScJ7U6O.d.cts} +2 -2
- package/dist/{gauge-Zy25jfps.d.ts → gauge-D78oq1Lx.d.ts} +2 -2
- package/dist/gauge.d.cts +1 -1
- package/dist/gauge.d.ts +1 -1
- package/dist/heat-Bsqq4zw9.js +38 -0
- package/dist/heat-Bsqq4zw9.js.map +1 -0
- package/dist/heat-DYsivvDq.cjs +49 -0
- package/dist/heat-DYsivvDq.cjs.map +1 -0
- package/dist/{heatmap-Dcc_bsoQ.cjs → heatmap-Dyzrd4Fd.cjs} +3 -3
- package/dist/{heatmap-Dcc_bsoQ.cjs.map → heatmap-Dyzrd4Fd.cjs.map} +1 -1
- package/dist/{heatmap-C1v8bwpq.js → heatmap-J7fxG7MM.js} +3 -3
- package/dist/{heatmap-C1v8bwpq.js.map → heatmap-J7fxG7MM.js.map} +1 -1
- package/dist/{heatmap-CJ-0dfhJ.d.cts → heatmap-Jvwo7iFW.d.cts} +2 -2
- package/dist/{heatmap-Jp5sHRTo.d.ts → heatmap-mFCnP6aB.d.ts} +2 -2
- package/dist/heatmap.cjs +1 -1
- package/dist/heatmap.d.cts +1 -1
- package/dist/heatmap.d.ts +1 -1
- package/dist/heatmap.js +1 -1
- package/dist/index.cjs +37 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -21
- package/dist/index.d.ts +23 -21
- package/dist/index.js +34 -27
- package/dist/index.js.map +1 -1
- package/dist/interaction-DXYSjgnP.cjs.map +1 -1
- package/dist/interaction-En1KlwFO.js.map +1 -1
- package/dist/layout-CYerDebD.d.cts +29 -0
- package/dist/layout-CYerDebD.d.ts +29 -0
- package/dist/{line-CxR4tg1Q.js → line-CXH0L10d.js} +43 -8
- package/dist/line-CXH0L10d.js.map +1 -0
- package/dist/{line-vyWO030v.d.cts → line-Cu9ctpbv.d.cts} +9 -2
- package/dist/{line-YiCuhVMI.cjs → line-DHbYCQy4.cjs} +43 -8
- package/dist/line-DHbYCQy4.cjs.map +1 -0
- package/dist/{line-Bpr5uVLQ.d.ts → line-TkzA7wMK.d.ts} +8 -1
- package/dist/line.cjs +1 -1
- package/dist/line.d.cts +1 -1
- package/dist/line.d.ts +1 -1
- package/dist/line.js +1 -1
- package/dist/{map-49FcfdmJ.d.cts → map-BirylCmT.d.cts} +2 -2
- package/dist/{map-C15NC7kW.js → map-CYp6x-uS.js} +3 -26
- package/dist/map-CYp6x-uS.js.map +1 -0
- package/dist/{map-BqrZ80vT.cjs → map-ChwSgooH.cjs} +4 -27
- package/dist/map-ChwSgooH.cjs.map +1 -0
- package/dist/{map-BMC61J-P.d.ts → map-DNqog2Xs.d.ts} +2 -2
- package/dist/map.cjs +1 -1
- package/dist/map.d.cts +1 -1
- package/dist/map.d.ts +1 -1
- package/dist/map.js +1 -1
- package/dist/maps/world.d.cts +1 -1
- package/dist/maps/world.d.ts +1 -1
- package/dist/{others-ls5eKtZ4.d.cts → others-CuNdpvjd.d.cts} +1 -1
- package/dist/{parliament-Cz9n_DoK.d.ts → parliament-CHdf13XU.d.ts} +2 -2
- package/dist/{parliament-C7V8UJj1.d.cts → parliament-CsYgh4N2.d.cts} +2 -2
- package/dist/parliament.d.cts +1 -1
- package/dist/parliament.d.ts +1 -1
- package/dist/{patterns-Dw7OMD_2.cjs → patterns-BPN1c9qe.cjs} +2 -2
- package/dist/{patterns-Dw7OMD_2.cjs.map → patterns-BPN1c9qe.cjs.map} +1 -1
- package/dist/{patterns-BMUINoka.js → patterns-CVrLrJXg.js} +2 -2
- package/dist/{patterns-BMUINoka.js.map → patterns-CVrLrJXg.js.map} +1 -1
- package/dist/patterns.cjs +1 -1
- package/dist/patterns.d.cts +1 -1
- package/dist/patterns.d.ts +1 -1
- package/dist/patterns.js +1 -1
- package/dist/{percentage-bar-cSeiLdwU.d.ts → percentage-bar-CSAbzDOn.d.ts} +2 -2
- package/dist/{percentage-bar-R1--2grK.d.cts → percentage-bar-UZHCRvlK.d.cts} +3 -3
- package/dist/percentage-bar.d.cts +1 -1
- package/dist/percentage-bar.d.ts +1 -1
- package/dist/{pie-vD5-g8je.d.cts → pie-AFedsDcF.d.cts} +12 -3
- package/dist/{pie-Bd8wyrtY.js → pie-Ch6Bx0ih.js} +54 -39
- package/dist/pie-Ch6Bx0ih.js.map +1 -0
- package/dist/{pie-BseZlCgP.cjs → pie-Cll1OrVZ.cjs} +54 -39
- package/dist/pie-Cll1OrVZ.cjs.map +1 -0
- package/dist/{pie-BQQkvy1N.d.ts → pie-Cn2H3pz8.d.ts} +11 -2
- package/dist/pie.cjs +1 -1
- package/dist/pie.d.cts +1 -1
- package/dist/pie.d.ts +1 -1
- package/dist/pie.js +1 -1
- package/dist/point-shapes.d.cts +1 -1
- package/dist/point-shapes.d.ts +1 -1
- package/dist/{radar-D6XqkFWQ.js → radar-Bg-IiIWB.js} +3 -3
- package/dist/{radar-D6XqkFWQ.js.map → radar-Bg-IiIWB.js.map} +1 -1
- package/dist/{radar-vLxilcr4.d.ts → radar-DEer2jjd.d.ts} +2 -2
- package/dist/{radar-7I6hsY_h.d.cts → radar-DxmjXhMc.d.cts} +2 -2
- package/dist/{radar-DjISDnSf.cjs → radar-wDyX17S3.cjs} +3 -3
- package/dist/{radar-DjISDnSf.cjs.map → radar-wDyX17S3.cjs.map} +1 -1
- package/dist/radar.cjs +1 -1
- package/dist/radar.d.cts +1 -1
- package/dist/radar.d.ts +1 -1
- package/dist/radar.js +1 -1
- package/dist/range-bar-BnKjJP89.cjs +348 -0
- package/dist/range-bar-BnKjJP89.cjs.map +1 -0
- package/dist/range-bar-C4cRaaQE.d.ts +123 -0
- package/dist/range-bar-D32dIQOY.d.cts +123 -0
- package/dist/range-bar-Dx6ce0J1.js +343 -0
- package/dist/range-bar-Dx6ce0J1.js.map +1 -0
- package/dist/range-bar.cjs +3 -0
- package/dist/range-bar.d.cts +3 -0
- package/dist/range-bar.d.ts +3 -0
- package/dist/range-bar.js +1 -0
- package/dist/{sankey-DqiuxUx7.d.cts → sankey-D-8ATwBT.d.cts} +2 -2
- package/dist/{sankey-7As41Fo4.d.ts → sankey-DpYJsOI4.d.ts} +2 -2
- package/dist/sankey.d.cts +1 -1
- package/dist/sankey.d.ts +1 -1
- package/dist/{scatter-DCMAtt5L.js → scatter-0Z7K_YUz.js} +65 -19
- package/dist/scatter-0Z7K_YUz.js.map +1 -0
- package/dist/{scatter-BXkXGgM_.d.ts → scatter-BAL5K9_4.d.ts} +22 -9
- package/dist/{scatter-DL0zAV09.d.cts → scatter-BUGbnRzM.d.cts} +22 -9
- package/dist/{scatter-Bwkblr4L.cjs → scatter-CZ8do3Up.cjs} +65 -19
- package/dist/scatter-CZ8do3Up.cjs.map +1 -0
- package/dist/scatter.cjs +1 -1
- package/dist/scatter.d.cts +2 -2
- package/dist/scatter.d.ts +2 -2
- package/dist/scatter.js +1 -1
- package/dist/slice-labels-1TBq7p3q.d.cts +28 -0
- package/dist/slice-labels-C9ucsBVW.js +88 -0
- package/dist/slice-labels-C9ucsBVW.js.map +1 -0
- package/dist/slice-labels-CbFiy46l.cjs +93 -0
- package/dist/slice-labels-CbFiy46l.cjs.map +1 -0
- package/dist/slice-labels-Cm5CyV7B.d.ts +28 -0
- package/dist/slice-labels.cjs +11 -0
- package/dist/slice-labels.cjs.map +1 -0
- package/dist/slice-labels.d.cts +6 -0
- package/dist/slice-labels.d.ts +6 -0
- package/dist/slice-labels.js +11 -0
- package/dist/slice-labels.js.map +1 -0
- package/dist/{sparkline-BElUSd0r.d.ts → sparkline-CtoBJe-a.d.ts} +2 -2
- package/dist/{sparkline-BMSuEPHP.cjs → sparkline-DjR-V6BI.cjs} +2 -2
- package/dist/{sparkline-BMSuEPHP.cjs.map → sparkline-DjR-V6BI.cjs.map} +1 -1
- package/dist/{sparkline-RYly7bR0.d.cts → sparkline-DwHJfeZz.d.cts} +2 -2
- package/dist/{sparkline-NDmq90kP.js → sparkline-_dxwtdli.js} +2 -2
- package/dist/{sparkline-NDmq90kP.js.map → sparkline-_dxwtdli.js.map} +1 -1
- package/dist/sparkline.cjs +1 -1
- package/dist/sparkline.d.cts +1 -1
- package/dist/sparkline.d.ts +1 -1
- package/dist/sparkline.js +1 -1
- package/dist/{stack-BTWYIwLO.d.cts → stack-CcmyALx0.d.cts} +1 -1
- package/dist/{stack-jVKvg2x_.js → stack-CyVlS7Fr.js} +2 -2
- package/dist/{stack-jVKvg2x_.js.map → stack-CyVlS7Fr.js.map} +1 -1
- package/dist/{stack-BO4624CY.cjs → stack-DBhmYNat.cjs} +2 -2
- package/dist/{stack-BO4624CY.cjs.map → stack-DBhmYNat.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{time-axis-B3VekUfX.cjs → time-axis-CVKjQKSS.cjs} +3 -3
- package/dist/{time-axis-B3VekUfX.cjs.map → time-axis-CVKjQKSS.cjs.map} +1 -1
- package/dist/{time-axis-CLjqOakA.js → time-axis-CkmbAw4Z.js} +3 -3
- package/dist/{time-axis-CLjqOakA.js.map → time-axis-CkmbAw4Z.js.map} +1 -1
- package/dist/time.cjs +2 -2
- package/dist/time.js +2 -2
- package/dist/{treemap-25vHO_UK.d.cts → treemap-C2maqerU.d.cts} +26 -4
- package/dist/{treemap-BCXUbixd.d.ts → treemap-D_zbubo3.d.ts} +26 -4
- package/dist/{treemap-CZk8kKFD.cjs → treemap-PulGXZv0.cjs} +38 -8
- package/dist/treemap-PulGXZv0.cjs.map +1 -0
- package/dist/{treemap-C4glsx-g.js → treemap-lbYxb-7h.js} +38 -8
- package/dist/treemap-lbYxb-7h.js.map +1 -0
- package/dist/treemap.cjs +1 -1
- package/dist/treemap.d.cts +1 -1
- package/dist/treemap.d.ts +1 -1
- package/dist/treemap.js +1 -1
- package/dist/{value-labels-C7GrhOXJ.js → value-labels-B0VeheyE.js} +5 -4
- package/dist/value-labels-B0VeheyE.js.map +1 -0
- package/dist/{value-labels-DzaKIWKp.cjs → value-labels-Dcyk3GIY.cjs} +5 -4
- package/dist/value-labels-Dcyk3GIY.cjs.map +1 -0
- package/dist/value-labels.cjs +1 -1
- package/dist/value-labels.d.cts +1 -1
- package/dist/value-labels.d.ts +1 -1
- package/dist/value-labels.js +1 -1
- package/dist/zoom.cjs +810 -0
- package/dist/zoom.cjs.map +1 -0
- package/dist/zoom.d.cts +34 -0
- package/dist/zoom.d.ts +34 -0
- package/dist/zoom.js +806 -0
- package/dist/zoom.js.map +1 -0
- package/package.json +27 -2
- package/dist/annotations-BQ8l-qHs.js.map +0 -1
- package/dist/annotations-CpCWA29b.cjs.map +0 -1
- package/dist/area-DYdQ_sMV.cjs.map +0 -1
- package/dist/area-WdtfqvhX.js.map +0 -1
- package/dist/axis-MMaVoSWB.js.map +0 -1
- package/dist/axis-YfAerNBA.cjs.map +0 -1
- package/dist/bar-BOcRcArc.js.map +0 -1
- package/dist/bar-CVkOJ7WA.cjs.map +0 -1
- package/dist/candlestick-BtT9glp9.js.map +0 -1
- package/dist/candlestick-CSmRuZ4v.cjs.map +0 -1
- package/dist/cartesian-BrPqb5Qn.js.map +0 -1
- package/dist/cartesian-DRSXHxWe.cjs.map +0 -1
- package/dist/chart-B6TTY4Kr.js.map +0 -1
- package/dist/chart-D_lyOy-M.cjs.map +0 -1
- package/dist/core-CQ0FaJ4G.js.map +0 -1
- package/dist/core-D2PSked3.cjs.map +0 -1
- package/dist/export-chart-CPtXmZvi.cjs.map +0 -1
- package/dist/export-chart-DoeiAyR2.js.map +0 -1
- package/dist/line-CxR4tg1Q.js.map +0 -1
- package/dist/line-YiCuhVMI.cjs.map +0 -1
- package/dist/map-BqrZ80vT.cjs.map +0 -1
- package/dist/map-C15NC7kW.js.map +0 -1
- package/dist/pie-Bd8wyrtY.js.map +0 -1
- package/dist/pie-BseZlCgP.cjs.map +0 -1
- package/dist/scatter-Bwkblr4L.cjs.map +0 -1
- package/dist/scatter-DCMAtt5L.js.map +0 -1
- package/dist/treemap-C4glsx-g.js.map +0 -1
- package/dist/treemap-CZk8kKFD.cjs.map +0 -1
- package/dist/value-labels-C7GrhOXJ.js.map +0 -1
- package/dist/value-labels-DzaKIWKp.cjs.map +0 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as Rect, n as InsetsInput } from "./layout-CYerDebD.cjs";
|
|
2
2
|
import { a as ClassValue, i as ChildInput, l as VNode, n as Attrs, s as Props } from "./vnode-Du2cC8Fm.cjs";
|
|
3
|
+
import { n as annotationLayers, r as annotationValues, t as Annotation } from "./annotations-CqZM1z9R.cjs";
|
|
3
4
|
import { a as timePointScale, c as NumberFormat, i as time, s as Locale } from "./time-B4oxWHQI.cjs";
|
|
4
5
|
import { n as BandScale, t as BandKey } from "./band-CNKvdnTC.cjs";
|
|
5
6
|
import { n as log, r as LinearScale } from "./log-CI41TmcU.cjs";
|
|
7
|
+
import { a as linePath, i as areaPath, r as Point } from "./path-YeUiOfG8.cjs";
|
|
8
|
+
import { n as sliceLabels } from "./slice-labels-1TBq7p3q.cjs";
|
|
6
9
|
import { t as hydrate } from "./hydrate-BtAZf_5K.cjs";
|
|
7
10
|
import { t as morph } from "./morph-Dh7gJkV4.cjs";
|
|
8
|
-
import { a as linePath, i as areaPath, r as Point } from "./path-YeUiOfG8.cjs";
|
|
9
11
|
/** One series' value at a hovered position. */
|
|
10
12
|
interface HitItem {
|
|
11
13
|
/** Series name. */
|
|
@@ -45,6 +47,23 @@ interface Hit {
|
|
|
45
47
|
seriesIndex?: number;
|
|
46
48
|
/** The shape that marks the hit; a crosshair when left out. */
|
|
47
49
|
highlight?: Highlight;
|
|
50
|
+
/**
|
|
51
|
+
* The value under the pointer on the value axis (cartesian charts, for a
|
|
52
|
+
* hit from the pointer): what `crosshair: { value: true }` shows.
|
|
53
|
+
*/
|
|
54
|
+
cursor?: HitCursor;
|
|
55
|
+
}
|
|
56
|
+
/** The value under the pointer, read off the value axis. */
|
|
57
|
+
interface HitCursor {
|
|
58
|
+
value: number;
|
|
59
|
+
/** The value formatted like the axis, with the precision of a pixel. */
|
|
60
|
+
text: string;
|
|
61
|
+
/** Where the pointer is along the value axis, in chart pixels. */
|
|
62
|
+
position: number;
|
|
63
|
+
/** The side of the plot the value axis is on. */
|
|
64
|
+
side: "left" | "right" | "bottom";
|
|
65
|
+
/** The axis is hidden (`y.show: false`): the value is written inside the plot. */
|
|
66
|
+
inside?: boolean;
|
|
48
67
|
}
|
|
49
68
|
/**
|
|
50
69
|
* The one shape drawn to mark a hit, in chart pixels:
|
|
@@ -147,11 +166,14 @@ interface AxisOptions {
|
|
|
147
166
|
tickPadding?: number;
|
|
148
167
|
/** Draw the axis line along the plot edge. Defaults to `false`. */
|
|
149
168
|
line?: boolean;
|
|
169
|
+
/** Turn the labels of an axis below the plot 90°, reading bottom to top. */
|
|
170
|
+
rotate?: boolean;
|
|
150
171
|
}
|
|
151
172
|
/** Pixels an axis occupies perpendicular to the plot edge (for margins). */
|
|
152
173
|
declare function axisSize(position: AxisPosition, ticks: readonly Tick[], fontSize: number, options?: {
|
|
153
174
|
tickSize?: number;
|
|
154
175
|
tickPadding?: number;
|
|
176
|
+
rotate?: boolean;
|
|
155
177
|
}): number;
|
|
156
178
|
/**
|
|
157
179
|
* Render an axis as `<g class="tc-axis tc-axis-{x|y} tc-axis-{position}">`
|
|
@@ -159,6 +181,70 @@ declare function axisSize(position: AxisPosition, ticks: readonly Tick[], fontSi
|
|
|
159
181
|
* transition when the scale changes.
|
|
160
182
|
*/
|
|
161
183
|
declare function axis(options: AxisOptions): VNode;
|
|
184
|
+
/**
|
|
185
|
+
* The categories a chart shows, as indexes into its labels, both included.
|
|
186
|
+
* A side left out runs to that end of the data.
|
|
187
|
+
*/
|
|
188
|
+
interface ViewWindow {
|
|
189
|
+
/** Index of the first category shown. Defaults to `0`. */
|
|
190
|
+
start?: number;
|
|
191
|
+
/** Index of the last category shown. Defaults to the last one. */
|
|
192
|
+
end?: number;
|
|
193
|
+
}
|
|
194
|
+
interface ZoomOptions {
|
|
195
|
+
/** Zoom with the wheel (and a pinch on a trackpad). Defaults to `true`. */
|
|
196
|
+
wheel?: boolean;
|
|
197
|
+
/** Show the zoom in, zoom out and reset buttons. Defaults to `true`. */
|
|
198
|
+
controls?: boolean;
|
|
199
|
+
/** The fewest categories a reader can zoom in to. Defaults to `2`. */
|
|
200
|
+
min?: number;
|
|
201
|
+
/** Names of the buttons, for a page in another language. */
|
|
202
|
+
labels?: {
|
|
203
|
+
in?: string;
|
|
204
|
+
out?: string;
|
|
205
|
+
reset?: string;
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/** The options of a chart that can show a window of its categories. */
|
|
209
|
+
interface Zoomable {
|
|
210
|
+
/**
|
|
211
|
+
* Let the reader zoom along the categories: with the wheel, by dragging
|
|
212
|
+
* over a range, with a pinch, the buttons or the `+`, `-` and `0` keys;
|
|
213
|
+
* Shift with a drag, the wheel or an arrow key moves the range. The range
|
|
214
|
+
* shown lives in `view`. Needs `import '@tabler/charts/zoom'`.
|
|
215
|
+
*/
|
|
216
|
+
zoom?: boolean | ZoomOptions;
|
|
217
|
+
/**
|
|
218
|
+
* The range of categories shown; the value axis follows the values in it.
|
|
219
|
+
* Set it to show a part of the data, read it from `chart.config.view`
|
|
220
|
+
* after a zoom. Needs `import '@tabler/charts/zoom'`.
|
|
221
|
+
*/
|
|
222
|
+
view?: ViewWindow | undefined;
|
|
223
|
+
/**
|
|
224
|
+
* Make the chart a brush: it shows all its data with a range marked on
|
|
225
|
+
* it, which the reader moves, resizes by its ends or draws again, and
|
|
226
|
+
* which charts in the same `sync` group take as their `view` (matched by
|
|
227
|
+
* label). Zooming one of them moves the range too. The range lives in
|
|
228
|
+
* `selection`. `min` is the fewest categories it can cover (2 by
|
|
229
|
+
* default). The brush and the charts of its group add to their
|
|
230
|
+
* `padding` so that their plots start and end together; `align: false`
|
|
231
|
+
* leaves them as they are. Needs `import '@tabler/charts/zoom'`.
|
|
232
|
+
*/
|
|
233
|
+
brush?: boolean | {
|
|
234
|
+
min?: number;
|
|
235
|
+
align?: boolean;
|
|
236
|
+
};
|
|
237
|
+
/** The range marked on a brush; everything when left out. */
|
|
238
|
+
selection?: ViewWindow | undefined;
|
|
239
|
+
}
|
|
240
|
+
/** The first and last index of a view over `count` categories, within the data. */
|
|
241
|
+
declare function viewRange(view: ViewWindow | undefined, count: number): [number, number];
|
|
242
|
+
/**
|
|
243
|
+
* The options of a chart with only the categories of its `view`: the chart
|
|
244
|
+
* type then draws them like any other data, so axes, stacks, tooltips and
|
|
245
|
+
* the table all follow the range shown.
|
|
246
|
+
*/
|
|
247
|
+
declare function viewWindow<O extends object>(options: O): O;
|
|
162
248
|
/** Category label on the x axis. */
|
|
163
249
|
type Label = string | number | Date;
|
|
164
250
|
/** One data series. `null` values are gaps. */
|
|
@@ -180,6 +266,12 @@ interface Series {
|
|
|
180
266
|
* that could inject CSS are ignored, as for `color`.
|
|
181
267
|
*/
|
|
182
268
|
dash?: number | string;
|
|
269
|
+
/**
|
|
270
|
+
* Dash the line only from this label on (a forecast, provisional figures):
|
|
271
|
+
* it stays solid up to the label and takes `dash` (`'5 4'` when left out)
|
|
272
|
+
* after it. Line and area charts.
|
|
273
|
+
*/
|
|
274
|
+
dashFrom?: Label;
|
|
183
275
|
/** Line width in pixels; overrides `--tc-stroke-width` via `--tc-series-width`. */
|
|
184
276
|
width?: number;
|
|
185
277
|
/**
|
|
@@ -248,6 +340,12 @@ interface CategoryAxisOptions {
|
|
|
248
340
|
line?: boolean;
|
|
249
341
|
/** Format a label for display (axis ticks for categories, tooltips and the table). */
|
|
250
342
|
format?: (label: Label, index: number) => string;
|
|
343
|
+
/**
|
|
344
|
+
* Turn the labels 90°, reading bottom to top, so that many or long
|
|
345
|
+
* categories all keep their label. Categories along the bottom only: not
|
|
346
|
+
* on a time axis, nor in horizontal bars.
|
|
347
|
+
*/
|
|
348
|
+
rotate?: boolean;
|
|
251
349
|
/**
|
|
252
350
|
* `'time'` treats labels as dates or timestamps: line and area charts place
|
|
253
351
|
* points at their real distance in time, with calendar-aware ticks.
|
|
@@ -260,7 +358,7 @@ interface CategoryAxisOptions {
|
|
|
260
358
|
/** Run the categories from the right. Defaults to the chart's `rtl`. */
|
|
261
359
|
reverse?: boolean;
|
|
262
360
|
}
|
|
263
|
-
interface CartesianOptions {
|
|
361
|
+
interface CartesianOptions extends Zoomable {
|
|
264
362
|
data: CartesianData;
|
|
265
363
|
y?: ValueAxisOptions;
|
|
266
364
|
/**
|
|
@@ -336,6 +434,25 @@ declare function seriesTable(options: CartesianOptions, ctx: TableContext, limit
|
|
|
336
434
|
* the date, with the time of day when the labels span less than a few days.
|
|
337
435
|
*/
|
|
338
436
|
declare function dateLabels(labels: readonly Label[], utc: boolean | undefined, locale: Locale): (label: Label) => string;
|
|
437
|
+
interface EndLabelOptions {
|
|
438
|
+
/** Format of the values. Defaults to the format of the series' value axis. */
|
|
439
|
+
format?: NumberFormat;
|
|
440
|
+
/** Write the last value after the name. Defaults to `true`. */
|
|
441
|
+
value?: boolean;
|
|
442
|
+
}
|
|
443
|
+
type Options = CartesianOptions & {
|
|
444
|
+
endLabels?: boolean | EndLabelOptions;
|
|
445
|
+
};
|
|
446
|
+
/**
|
|
447
|
+
* The end labels of a line chart: its `options` with room for the labels
|
|
448
|
+
* beside the plot (on the side the lines end at), and the `layer` that
|
|
449
|
+
* draws them once the points of every series (`null` for gaps) and the plot
|
|
450
|
+
* area are known. `overhang` is what the marks take beyond the plot's edge.
|
|
451
|
+
*/
|
|
452
|
+
declare function endLabels<O extends Options>(options: O, ctx: RenderContext, overhang: number): {
|
|
453
|
+
options: O;
|
|
454
|
+
layer: (points: readonly (readonly Point[])[], area: Rect) => VNode | null;
|
|
455
|
+
};
|
|
339
456
|
/** Domain of a log axis: positive values only, niced to whole powers of ten. */
|
|
340
457
|
declare function logDomain(values: readonly (number | null | undefined)[], options: ValueAxisOptions): [number, number];
|
|
341
458
|
/** Ticks of a log axis, each power formatted as is. */
|
|
@@ -361,6 +478,13 @@ interface LegendOptions {
|
|
|
361
478
|
* otherwise. Defaults to `'top'`.
|
|
362
479
|
*/
|
|
363
480
|
position?: "top" | "bottom" | "left" | "right" | "auto";
|
|
481
|
+
/**
|
|
482
|
+
* Keep the legend inside the chart's `height`: a legend above or below the
|
|
483
|
+
* chart takes its height from the plot, so a chart with `height: 240` is
|
|
484
|
+
* 240 pixels tall with its legend (cards in a row stay the same size).
|
|
485
|
+
* Only with a `height` in pixels. Defaults to `false`: the legend adds to it.
|
|
486
|
+
*/
|
|
487
|
+
withinHeight?: boolean;
|
|
364
488
|
}
|
|
365
489
|
/**
|
|
366
490
|
* Legend content: one toggle button per entry. Buttons are native, so they
|
|
@@ -416,11 +540,15 @@ interface ImageOptions extends ExportOptions {
|
|
|
416
540
|
/** Quality of lossy types, `0…1`. */
|
|
417
541
|
quality?: number;
|
|
418
542
|
}
|
|
419
|
-
interface
|
|
543
|
+
interface CSVOptions {
|
|
544
|
+
/** Separator of the values. Defaults to `','`. */
|
|
545
|
+
delimiter?: string;
|
|
546
|
+
}
|
|
547
|
+
interface DownloadOptions extends ImageOptions, CSVOptions {
|
|
420
548
|
/** File name without the extension. Defaults to the chart's title, or `chart`. */
|
|
421
549
|
filename?: string;
|
|
422
550
|
/** File format. Defaults to `'png'`. */
|
|
423
|
-
format?: "svg" | "png" | "jpeg" | "webp";
|
|
551
|
+
format?: "svg" | "png" | "jpeg" | "webp" | "csv";
|
|
424
552
|
}
|
|
425
553
|
/** A chart, its container, or its root `<svg>`. */
|
|
426
554
|
type ExportTarget = Chart<object> | Element;
|
|
@@ -443,13 +571,75 @@ declare function exportSVG(target: ExportTarget, options?: ExportOptions): strin
|
|
|
443
571
|
*/
|
|
444
572
|
declare function exportImage(target: ExportTarget, options?: ImageOptions): Promise<Blob>;
|
|
445
573
|
/**
|
|
446
|
-
*
|
|
574
|
+
* The chart's data as CSV (RFC 4180): one row per category with a column per
|
|
575
|
+
* visible series, as in the chart's data table but with every row. Line,
|
|
576
|
+
* area, bar, heatmap and radar charts give plain values (numbers without
|
|
577
|
+
* their format, dates in ISO 8601, gaps empty); the other types give the
|
|
578
|
+
* text of their table. Text that a spreadsheet would run as a formula (`=`,
|
|
579
|
+
* `+`, `-` or `@` first) is prefixed with `'`. Takes the rendered chart
|
|
580
|
+
* itself, not its element.
|
|
581
|
+
*
|
|
582
|
+
* ```ts
|
|
583
|
+
* const csv = exportCSV(chart)
|
|
584
|
+
* ```
|
|
585
|
+
*/
|
|
586
|
+
declare function exportCSV(chart: Chart<object>, options?: CSVOptions): string;
|
|
587
|
+
/**
|
|
588
|
+
* Save the chart as a file: PNG by default, SVG, JPEG or WebP, or its data
|
|
589
|
+
* as CSV (which needs the chart itself, not its element).
|
|
447
590
|
*
|
|
448
591
|
* ```ts
|
|
449
592
|
* button.onclick = () => downloadChart(chart, { format: 'svg', filename: 'sales' })
|
|
450
593
|
* ```
|
|
451
594
|
*/
|
|
452
595
|
declare function downloadChart(target: ExportTarget, options?: DownloadOptions): Promise<void>;
|
|
596
|
+
/** What a plugin sees before the chart measures itself and renders. */
|
|
597
|
+
interface BeforeRenderState {
|
|
598
|
+
config: ChartConfig<object>;
|
|
599
|
+
legend: ResolvedLegend;
|
|
600
|
+
hidden: ReadonlySet<string>;
|
|
601
|
+
}
|
|
602
|
+
/** What a plugin sees after the chart rendered into the DOM. */
|
|
603
|
+
interface AfterRenderState extends BeforeRenderState {
|
|
604
|
+
size: Size;
|
|
605
|
+
/** Whether the chart content was rebuilt (config, size or hidden series changed). */
|
|
606
|
+
stale: boolean;
|
|
607
|
+
/** Whether the config or the hidden series changed (`stale` also covers size and font). */
|
|
608
|
+
changed: boolean;
|
|
609
|
+
}
|
|
610
|
+
/** Hooks of an installed plugin; every one is optional. */
|
|
611
|
+
interface PluginInstance {
|
|
612
|
+
/** Runs first on every render, e.g. to render a legend that takes up space. */
|
|
613
|
+
beforeRender?(state: BeforeRenderState): void;
|
|
614
|
+
/** Vertical space the plugin takes from the container in `height: 'container'` mode. */
|
|
615
|
+
reservedHeight?(): number;
|
|
616
|
+
/** Horizontal space the plugin takes from the container, e.g. a legend beside the chart. */
|
|
617
|
+
reservedWidth?(): number;
|
|
618
|
+
/** Extra attributes for the root `<svg>`. */
|
|
619
|
+
svgAttrs?(config: ChartConfig<object>): Props | undefined;
|
|
620
|
+
/** SVG drawn below (`under`) and above (`over`) the chart content for the active hit. */
|
|
621
|
+
layers?(hit: Hit, config: ChartConfig<object>): {
|
|
622
|
+
under?: ChildInput;
|
|
623
|
+
over?: ChildInput;
|
|
624
|
+
};
|
|
625
|
+
/** Runs after the SVG is in the DOM, e.g. to place a tooltip. */
|
|
626
|
+
afterRender?(state: AfterRenderState): void;
|
|
627
|
+
/** Clean up DOM and listeners. */
|
|
628
|
+
destroy?(): void;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* A chart feature that can be left out of the bundle: tooltip, legend, data
|
|
632
|
+
* table, keyboard navigation, hover highlight. `install` runs once per chart.
|
|
633
|
+
*
|
|
634
|
+
* ```ts
|
|
635
|
+
* import { Chart, tooltip } from '@tabler/charts/core'
|
|
636
|
+
* new Chart(el, { type: line, data, plugins: [tooltip()] })
|
|
637
|
+
* ```
|
|
638
|
+
*/
|
|
639
|
+
interface ChartPlugin {
|
|
640
|
+
readonly name: string;
|
|
641
|
+
install(chart: Chart<object>): PluginInstance;
|
|
642
|
+
}
|
|
453
643
|
interface ArcOptions {
|
|
454
644
|
innerRadius: number;
|
|
455
645
|
outerRadius: number;
|
|
@@ -485,7 +675,7 @@ declare function arcPathStable(options: ArcOptions): string;
|
|
|
485
675
|
declare function sweep(el: Element, prev: VNode, next: VNode): Attrs | undefined;
|
|
486
676
|
/**
|
|
487
677
|
* Optional features that chart types look up at render time. Each lives in
|
|
488
|
-
* its own module (`@tabler/charts/time`, `/log`, `/decimate`, `/line`, `/annotations`) and registers
|
|
678
|
+
* its own module (`@tabler/charts/time`, `/log`, `/decimate`, `/line`, `/annotations`, `/end-labels`, `/slice-labels`, `/zoom`) and registers
|
|
489
679
|
* itself when imported; `@tabler/charts` registers all of them, while
|
|
490
680
|
* `@tabler/charts/core` starts empty so unused code never ships.
|
|
491
681
|
*/
|
|
@@ -525,6 +715,10 @@ interface Features {
|
|
|
525
715
|
layers: typeof annotationLayers;
|
|
526
716
|
values: typeof annotationValues;
|
|
527
717
|
};
|
|
718
|
+
/** Names and last values at the end of lines, behind `endLabels`. */
|
|
719
|
+
"end-labels"?: typeof endLabels;
|
|
720
|
+
/** Names beside the slices of a pie, behind its `labels`. */
|
|
721
|
+
"slice-labels"?: typeof sliceLabels;
|
|
528
722
|
/** Pattern fills behind `patterns` (and forced colors, with `'auto'`). */
|
|
529
723
|
patterns?: typeof patternFills;
|
|
530
724
|
/**
|
|
@@ -536,6 +730,14 @@ interface Features {
|
|
|
536
730
|
"point-shapes"?: typeof markerPath;
|
|
537
731
|
/** The same shapes for legend and tooltip swatches, as CSS shapes. */
|
|
538
732
|
swatch?: typeof markerClip;
|
|
733
|
+
/**
|
|
734
|
+
* Behind `view` and `zoom` in cartesian charts: the window of categories a
|
|
735
|
+
* chart type draws, and what the `zoom()` plugin installs on a chart.
|
|
736
|
+
*/
|
|
737
|
+
zoom?: {
|
|
738
|
+
window: typeof viewWindow;
|
|
739
|
+
install: ChartPlugin["install"];
|
|
740
|
+
};
|
|
539
741
|
/** Saving a chart as a file, behind the `download` menu. */
|
|
540
742
|
export?: typeof downloadChart;
|
|
541
743
|
}
|
|
@@ -556,60 +758,19 @@ interface ValueLabelOptions {
|
|
|
556
758
|
format?: NumberFormat;
|
|
557
759
|
/** Which points of lines, areas and scatters get a label. Defaults to `'last'`. */
|
|
558
760
|
points?: "last" | "all";
|
|
761
|
+
/**
|
|
762
|
+
* Let the label of a point lie over a bar or a cell when it has no free
|
|
763
|
+
* place (a line over bars): every point keeps its label. Labels still
|
|
764
|
+
* never cover each other. Defaults to `false`.
|
|
765
|
+
*/
|
|
766
|
+
overMarks?: boolean;
|
|
559
767
|
}
|
|
560
768
|
/** The labels layer of a chart, or `null` when nothing gets one. */
|
|
561
769
|
declare function valueLabels(config: ChartConfig<object>, interaction: Interaction, ctx: RenderContext): VNode | null;
|
|
562
770
|
/** The step that adds the labels over the content of charts with `valueLabels`. */
|
|
563
771
|
declare const labelsStep: PostStep;
|
|
564
|
-
/** What a plugin sees before the chart measures itself and renders. */
|
|
565
|
-
interface BeforeRenderState {
|
|
566
|
-
config: ChartConfig<object>;
|
|
567
|
-
legend: ResolvedLegend;
|
|
568
|
-
hidden: ReadonlySet<string>;
|
|
569
|
-
}
|
|
570
|
-
/** What a plugin sees after the chart rendered into the DOM. */
|
|
571
|
-
interface AfterRenderState extends BeforeRenderState {
|
|
572
|
-
size: Size;
|
|
573
|
-
/** Whether the chart content was rebuilt (config, size or hidden series changed). */
|
|
574
|
-
stale: boolean;
|
|
575
|
-
/** Whether the config or the hidden series changed (`stale` also covers size and font). */
|
|
576
|
-
changed: boolean;
|
|
577
|
-
}
|
|
578
|
-
/** Hooks of an installed plugin; every one is optional. */
|
|
579
|
-
interface PluginInstance {
|
|
580
|
-
/** Runs first on every render, e.g. to render a legend that takes up space. */
|
|
581
|
-
beforeRender?(state: BeforeRenderState): void;
|
|
582
|
-
/** Vertical space the plugin takes from the container in `height: 'container'` mode. */
|
|
583
|
-
reservedHeight?(): number;
|
|
584
|
-
/** Horizontal space the plugin takes from the container, e.g. a legend beside the chart. */
|
|
585
|
-
reservedWidth?(): number;
|
|
586
|
-
/** Extra attributes for the root `<svg>`. */
|
|
587
|
-
svgAttrs?(config: ChartConfig<object>): Props | undefined;
|
|
588
|
-
/** SVG drawn below (`under`) and above (`over`) the chart content for the active hit. */
|
|
589
|
-
layers?(hit: Hit, config: ChartConfig<object>): {
|
|
590
|
-
under?: ChildInput;
|
|
591
|
-
over?: ChildInput;
|
|
592
|
-
};
|
|
593
|
-
/** Runs after the SVG is in the DOM, e.g. to place a tooltip. */
|
|
594
|
-
afterRender?(state: AfterRenderState): void;
|
|
595
|
-
/** Clean up DOM and listeners. */
|
|
596
|
-
destroy?(): void;
|
|
597
|
-
}
|
|
598
|
-
/**
|
|
599
|
-
* A chart feature that can be left out of the bundle: tooltip, legend, data
|
|
600
|
-
* table, keyboard navigation, hover highlight. `install` runs once per chart.
|
|
601
|
-
*
|
|
602
|
-
* ```ts
|
|
603
|
-
* import { Chart, tooltip } from '@tabler/charts/core'
|
|
604
|
-
* new Chart(el, { type: line, data, plugins: [tooltip()] })
|
|
605
|
-
* ```
|
|
606
|
-
*/
|
|
607
|
-
interface ChartPlugin {
|
|
608
|
-
readonly name: string;
|
|
609
|
-
install(chart: Chart<object>): PluginInstance;
|
|
610
|
-
}
|
|
611
772
|
/** A file format of the download menu. */
|
|
612
|
-
type DownloadFormat = "png" | "svg" | "jpeg" | "webp";
|
|
773
|
+
type DownloadFormat = "png" | "svg" | "jpeg" | "webp" | "csv";
|
|
613
774
|
/** The `download` option as an object. */
|
|
614
775
|
interface DownloadMenuOptions {
|
|
615
776
|
/** Formats offered, in this order. Defaults to `['png', 'svg']`. */
|
|
@@ -627,13 +788,15 @@ interface DownloadMenuOptions {
|
|
|
627
788
|
legend?: boolean;
|
|
628
789
|
/** Pixels per chart pixel in images. Defaults to `2`. */
|
|
629
790
|
scale?: number;
|
|
791
|
+
/** Separator of the values in a CSV file. Defaults to `','`. */
|
|
792
|
+
delimiter?: string;
|
|
630
793
|
}
|
|
631
794
|
/** The `download` option: on, a list of formats, or the options. */
|
|
632
795
|
type DownloadOption = boolean | readonly DownloadFormat[] | DownloadMenuOptions;
|
|
633
796
|
/**
|
|
634
797
|
* A download menu in the chart's corner (`.tc-download`): a button that opens
|
|
635
|
-
* a list of file formats, PNG and SVG by default
|
|
636
|
-
* option. The files come from `@tabler/charts/export`, which must be imported
|
|
798
|
+
* a list of file formats, PNG and SVG by default (`'csv'` adds the data as a
|
|
799
|
+
* CSV file). Shown with the `download` option. The files come from `@tabler/charts/export`, which must be imported
|
|
637
800
|
* (the chart says so otherwise): that way charts without a download never
|
|
638
801
|
* carry the export code.
|
|
639
802
|
*/
|
|
@@ -785,6 +948,10 @@ interface ChartType<O extends object = object, M extends object = [O] extends [n
|
|
|
785
948
|
*/
|
|
786
949
|
readonly plugins?: readonly ChartPlugin[];
|
|
787
950
|
}
|
|
951
|
+
interface CrosshairOptions {
|
|
952
|
+
/** A line through the pointer, and the value under it on the value axis. Defaults to `false`. */
|
|
953
|
+
value?: boolean;
|
|
954
|
+
}
|
|
788
955
|
/** Options shared by every chart type. */
|
|
789
956
|
interface BaseOptions {
|
|
790
957
|
/** Fixed width in pixels. Defaults to the container width. */
|
|
@@ -823,8 +990,18 @@ interface BaseOptions {
|
|
|
823
990
|
id?: string;
|
|
824
991
|
/** Show a tooltip on hover, optionally with custom content. Defaults to `true`. */
|
|
825
992
|
tooltip?: boolean | TooltipOptions;
|
|
826
|
-
/**
|
|
827
|
-
|
|
993
|
+
/**
|
|
994
|
+
* Show a vertical crosshair on hover (point charts). `{ value: true }` also
|
|
995
|
+
* draws a line through the pointer across the plot, with the value there
|
|
996
|
+
* written on the value axis (line, area, bar and candlestick charts; on the
|
|
997
|
+
* first axis of a chart with two). Defaults to `true`.
|
|
998
|
+
*/
|
|
999
|
+
crosshair?: boolean | CrosshairOptions;
|
|
1000
|
+
/**
|
|
1001
|
+
* Draw a dot on every value of the hovered category (point charts).
|
|
1002
|
+
* `false` leaves the crosshair and the tooltip. Defaults to `true`.
|
|
1003
|
+
*/
|
|
1004
|
+
activePoints?: boolean;
|
|
828
1005
|
/** Show a legend with toggles. Defaults to showing it for two or more entries. */
|
|
829
1006
|
legend?: boolean | LegendOptions;
|
|
830
1007
|
/**
|
|
@@ -846,7 +1023,8 @@ interface BaseOptions {
|
|
|
846
1023
|
* Write the values on the marks: bars at their end, stacked segments,
|
|
847
1024
|
* cells and slices inside (slices show their share), lines and points
|
|
848
1025
|
* above their last point (`points: 'all'` for every one). Labels that do
|
|
849
|
-
* not fit are left out
|
|
1026
|
+
* not fit are left out (`overMarks: true` keeps the labels of a line
|
|
1027
|
+
* where it crosses the bars). A series' own `valueLabels` overrides this for
|
|
850
1028
|
* that series, and each label carries its series classes
|
|
851
1029
|
* (`tc-series tc-series-{n}`). Needs `@tabler/charts/value-labels` on the
|
|
852
1030
|
* core (`@tabler/charts` includes it).
|
|
@@ -879,7 +1057,7 @@ interface BaseOptions {
|
|
|
879
1057
|
keyboard?: boolean;
|
|
880
1058
|
/**
|
|
881
1059
|
* A download menu in the chart's corner: `true` offers PNG and SVG, a list
|
|
882
|
-
* picks the formats (`['png', 'svg', 'jpeg', 'webp']`), an object also
|
|
1060
|
+
* picks the formats (`['png', 'svg', 'jpeg', 'webp', 'csv']`), an object also
|
|
883
1061
|
* sets the file name and the export options. Needs `@tabler/charts/export`
|
|
884
1062
|
* imported, and on the core the `download()` plugin (the `Chart` of
|
|
885
1063
|
* `@tabler/charts` has it).
|
|
@@ -1076,4 +1254,4 @@ declare class Chart<O extends object = object> {
|
|
|
1076
1254
|
/** Call the handlers of an event (plugins emit `click`, for instance). */
|
|
1077
1255
|
emit<K extends keyof ChartEvents>(name: K, event: ChartEvents[K]): void;
|
|
1078
1256
|
}
|
|
1079
|
-
export {
|
|
1257
|
+
export { exportCSV as $, DownloadOption as A, AxisOptions as At, arcCentroid as B, describeHit as Bt, TooltipOptions as C, seriesLegend as Ct, tooltipContent as D, Zoomable as Dt, placeTooltip as E, ZoomOptions as Et, Features as F, axisSize as Ft, ChartPlugin as G, HitItem as Gt, padAngleForGap as H, Highlight as Ht, feature as I, bandTicks as It, DownloadOptions as J, PluginInstance as K, HitTester as Kt, features as L, linearTicks as Lt, ValueLabelOptions as M, LinearTicksOptions as Mt, labelsStep as N, Tick as Nt, DownloadFormat as O, viewRange as Ot, valueLabels as P, axis as Pt, downloadChart as Q, register as R, thinTicks as Rt, resolveSize as S, seriesKey as St, hitAnchor as T, ViewWindow as Tt, AfterRenderState as U, Hit as Ut, arcPathStable as V, tableContent as Vt, BeforeRenderState as W, HitCursor as Wt, ExportTarget as X, ExportOptions as Y, ImageOptions as Z, chartModel as _, Label as _t, ChartEvents as a, patternDefs as at, renderContext as b, categoryInteraction as bt, CrosshairOptions as c, LegendItem as ct, ResolvedLegend as d, legendContent as dt, exportImage as et, Size as f, EndLabelOptions as ft, chartLabel as g, CategoryAxisOptions as gt, chartEvents as h, CartesianOptions as ht, ChartConfig as i, shapesStep as it, download as j, AxisPosition as jt, DownloadMenuOptions as k, viewWindow as kt, RenderContext as l, LegendOptions as lt, buildChart as m, CartesianData as mt, BuiltChart as n, markerClip as nt, ChartType as o, patternFills as ot, TableContext as p, endLabels as pt, CSVOptions as q, Interaction as qt, Chart as r, markerPath as rt, ContextOptions as s, patternVars as st, BaseOptions as t, exportSVG as tt, RenderResult as u, defaultHidden as ut, chartToString as v, Series as vt, TooltipPlacement as w, seriesTable as wt, resolveLegend as x, domainOf as xt, renderChart as y, ValueAxisOptions as yt, ArcOptions as z, DataTable as zt };
|
|
@@ -236,6 +236,8 @@ function flush() {
|
|
|
236
236
|
return count;
|
|
237
237
|
}
|
|
238
238
|
// src/chart.ts
|
|
239
|
+
/** Whether the chart shows the value under the pointer on its value axis. */
|
|
240
|
+
const cursorValue = (config) => typeof config.crosshair === "object" && config.crosshair?.value === true;
|
|
239
241
|
const DEFAULT_WIDTH = 600;
|
|
240
242
|
const DEFAULT_ASPECT_RATIO = 2;
|
|
241
243
|
const DEFAULT_FONT_SIZE = 12;
|
|
@@ -504,15 +506,17 @@ var Chart = class {
|
|
|
504
506
|
...measured,
|
|
505
507
|
width: measured.width - beside
|
|
506
508
|
};
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
}
|
|
515
|
-
|
|
509
|
+
const { height, legend } = this.#cfg;
|
|
510
|
+
const within = Number.isFinite(height) && typeof legend === "object" && legend?.withinHeight === true;
|
|
511
|
+
let reserved = 0;
|
|
512
|
+
if (within || height === "container" && measured.height) for (const plugin of this.#plugins) reserved += plugin.reservedHeight?.() ?? 0;
|
|
513
|
+
if (reserved && !within) measured = {
|
|
514
|
+
...measured,
|
|
515
|
+
height: measured.height - reserved
|
|
516
|
+
};
|
|
517
|
+
const size = resolveSize(this.#cfg, measured);
|
|
518
|
+
if (within) size.height = Math.max(0, size.height - Math.round(reserved));
|
|
519
|
+
return size;
|
|
516
520
|
}
|
|
517
521
|
/**
|
|
518
522
|
* Whether the chart is laid out right to left: the `rtl` option, with
|
|
@@ -781,7 +785,13 @@ var Chart = class {
|
|
|
781
785
|
*/
|
|
782
786
|
#setHover(hit, event, force = false, rerender = true) {
|
|
783
787
|
const key = require_interaction.hitKey(hit);
|
|
784
|
-
if (!force && key === this.#hovered)
|
|
788
|
+
if (!force && key === this.#hovered) {
|
|
789
|
+
if (hit?.cursor && cursorValue(this.#cfg) && hit.cursor.position !== this.#hit?.cursor?.position) {
|
|
790
|
+
this.#hit = hit;
|
|
791
|
+
if (rerender) this.#schedule();
|
|
792
|
+
}
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
785
795
|
if (force && key === "" && this.#hovered === "") return;
|
|
786
796
|
this.#hovered = key;
|
|
787
797
|
this.#hit = hit;
|
|
@@ -870,6 +880,12 @@ Object.defineProperty(exports, "chartToString", {
|
|
|
870
880
|
return chartToString;
|
|
871
881
|
}
|
|
872
882
|
});
|
|
883
|
+
Object.defineProperty(exports, "cursorValue", {
|
|
884
|
+
enumerable: true,
|
|
885
|
+
get: function() {
|
|
886
|
+
return cursorValue;
|
|
887
|
+
}
|
|
888
|
+
});
|
|
873
889
|
Object.defineProperty(exports, "defaultHidden", {
|
|
874
890
|
enumerable: true,
|
|
875
891
|
get: function() {
|
|
@@ -949,4 +965,4 @@ Object.defineProperty(exports, "schedule", {
|
|
|
949
965
|
}
|
|
950
966
|
});
|
|
951
967
|
|
|
952
|
-
//# sourceMappingURL=chart-
|
|
968
|
+
//# sourceMappingURL=chart-GUmmjJ7S.cjs.map
|