@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
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as estimateTextWidth, i as Rect, n as InsetsInput, o as innerRect, r as LINE_HEIGHT, s as insets, t as Insets } from "./layout-CYerDebD.js";
|
|
2
2
|
import { a as point, i as band, n as BandScale, r as BandScaleOptions, t as BandKey } from "./band-CNKvdnTC.js";
|
|
3
3
|
import { a as ClassValue, c as StyleValue, d as normalizeClass, f as normalizeStyle, i as ChildInput, l as VNode, n as Attrs, o as Key, r as Child, s as Props, t as AttrValue, u as h } from "./vnode-Du2cC8Fm.js";
|
|
4
|
+
import { t as Annotation } from "./annotations-CCDUC1lW.js";
|
|
4
5
|
import { a as linear, i as LinearScaleOptions, n as log, r as LinearScale, t as LogScaleOptions } from "./log-CI41TmcU.js";
|
|
5
6
|
import { a as timePointScale, c as NumberFormat, d as formatDetail, f as formatNumber, g as stepPrecision, h as getNumberFormat, i as time, l as NumberFormatOptions, m as getDateFormat, n as TimeScaleOptions, o as DateFormat, p as formatTicks, r as TimeValue, s as Locale, t as TimeScale, u as formatDate } from "./time-DRIDgv2a.js";
|
|
6
7
|
import { n as lttbIndices, t as lttb } from "./decimate-Du87fMLG.js";
|
|
7
|
-
import { A as download, At as HitItem, B as features, C as TooltipPlacement, Ct as linearTicks, D as DownloadFormat, Dt as tableContent, E as tooltipContent, Et as describeHit, G as ImageOptions, H as DownloadOptions, J as exportSVG, K as downloadChart, M as BeforeRenderState, Mt as Interaction, N as ChartPlugin, O as DownloadMenuOptions, Ot as Highlight, P as PluginInstance, R as Features, S as TooltipOptions, St as bandTicks, T as placeTooltip, Tt as DataTable, U as ExportOptions, V as register, W as ExportTarget, _ as chartToString, _t as AxisPosition, a as ChartEvents, at as CartesianData, b as resolveLegend, bt as axis, c as RenderContext, ct as Label, d as Size, dt as categoryInteraction, f as TableContext, ft as domainOf, g as chartModel, gt as AxisOptions, h as chartLabel, ht as seriesTable, i as ChartConfig, it as legendContent, j as AfterRenderState, jt as HitTester, k as DownloadOption, kt as Hit, l as RenderResult, lt as Series, m as chartEvents, mt as seriesLegend, n as BuiltChart, nt as LegendOptions, o as ChartType, ot as CartesianOptions, p as buildChart, pt as seriesKey, q as exportImage, r as Chart$1, rt as defaultHidden, s as ContextOptions, st as CategoryAxisOptions, t as BaseOptions, tt as LegendItem, u as ResolvedLegend, ut as ValueAxisOptions, v as renderChart, vt as LinearTicksOptions, w as hitAnchor, wt as thinTicks, x as resolveSize, xt as axisSize, y as renderContext, yt as Tick, z as feature } from "./chart-CYrrUCi3.js";
|
|
8
8
|
import { a as linePath, i as areaPath, n as PathOptions, r as Point, t as Curve } from "./path-YeUiOfG8.js";
|
|
9
|
-
import { n as
|
|
10
|
-
import { n as
|
|
11
|
-
import { n as
|
|
12
|
-
import {
|
|
13
|
-
import { n as
|
|
14
|
-
import { n as
|
|
15
|
-
import { n as
|
|
16
|
-
import { n as
|
|
17
|
-
import {
|
|
18
|
-
import { n as
|
|
19
|
-
import { n as
|
|
20
|
-
import {
|
|
21
|
-
import { n as
|
|
22
|
-
import {
|
|
23
|
-
import { i as
|
|
24
|
-
import { n as
|
|
25
|
-
import { n as
|
|
26
|
-
import {
|
|
9
|
+
import { A as DownloadOption, At as axis, B as BeforeRenderState, Bt as HitCursor, C as TooltipOptions, D as tooltipContent, Dt as AxisPosition, E as placeTooltip, Et as AxisOptions, F as Features, Ft as DataTable, G as ExportOptions, H as PluginInstance, Ht as HitTester, I as feature, It as describeHit, J as downloadChart, K as ExportTarget, L as features, Lt as tableContent, Mt as bandTicks, Nt as linearTicks, O as DownloadFormat, Ot as LinearTicksOptions, Pt as thinTicks, R as register, Rt as Highlight, S as resolveSize, St as ZoomOptions, T as hitAnchor, U as CSVOptions, Ut as Interaction, V as ChartPlugin, Vt as HitItem, W as DownloadOptions, X as exportImage, Y as exportCSV, Z as exportSVG, _ as chartModel, _t as domainOf, a as ChartEvents, at as LegendOptions, b as renderContext, bt as seriesTable, c as CrosshairOptions, d as ResolvedLegend, dt as CartesianOptions, f as Size, ft as CategoryAxisOptions, g as chartLabel, gt as categoryInteraction, h as chartEvents, ht as ValueAxisOptions, i as ChartConfig, it as LegendItem, j as download, jt as axisSize, k as DownloadMenuOptions, kt as Tick, l as RenderContext, m as buildChart, mt as Series, n as BuiltChart, o as ChartType, ot as defaultHidden, p as TableContext, pt as Label, q as ImageOptions, r as Chart$1, s as ContextOptions, st as legendContent, t as BaseOptions, u as RenderResult, ut as CartesianData, v as chartToString, vt as seriesKey, w as TooltipPlacement, x as resolveLegend, xt as ViewWindow, y as renderChart, yt as seriesLegend, z as AfterRenderState, zt as Hit } from "./chart-CE9EVbfV.js";
|
|
10
|
+
import { n as line, t as LineOptions } from "./line-TkzA7wMK.js";
|
|
11
|
+
import { n as area, t as AreaOptions } from "./area-DEFL-Yun.js";
|
|
12
|
+
import { n as bar, t as BarOptions } from "./bar-Bs_rPqgR.js";
|
|
13
|
+
import { a as calendar, i as CalendarSeries, n as CalendarEntry, r as CalendarOptions, t as CalendarData } from "./calendar-D10_ki1S.js";
|
|
14
|
+
import { n as CandlestickOptions, r as candlestick, t as Candle } from "./candlestick-XpqJvarq.js";
|
|
15
|
+
import { n as FunnelStage, r as funnel, t as FunnelOptions } from "./funnel-FogM8flk.js";
|
|
16
|
+
import { n as GaugeRing, r as gauge, t as GaugeOptions } from "./gauge-D78oq1Lx.js";
|
|
17
|
+
import { n as HeatmapRange, r as heatmap, t as HeatmapOptions } from "./heatmap-mFCnP6aB.js";
|
|
18
|
+
import { a as MapOptions, c as map, i as MapMarker, l as MapLayout, n as MapHit, o as MapRegion, r as MapLine, s as addMap, t as MapData, u as MapView } from "./map-DNqog2Xs.js";
|
|
19
|
+
import { n as ParliamentParty, r as parliament, t as ParliamentOptions } from "./parliament-CHdf13XU.js";
|
|
20
|
+
import { n as PercentageBarSegment, r as percentageBar, t as PercentageBarOptions } from "./percentage-bar-CSAbzDOn.js";
|
|
21
|
+
import { i as pie, n as PieSlice, r as donut, t as PieOptions } from "./pie-Cn2H3pz8.js";
|
|
22
|
+
import { n as RadialAxisOptions, r as radar, t as RadarOptions } from "./radar-DEer2jjd.js";
|
|
23
|
+
import { a as RangeRowAxisOptions, i as RangeBarOptions, n as RangeBarAnnotation, o as RangeValue, r as RangeBarItem, s as rangeBar, t as RangeAxisOptions } from "./range-bar-C4cRaaQE.js";
|
|
24
|
+
import { a as sankey, i as SankeyOptions, n as SankeyLink, r as SankeyNode, t as SankeyData } from "./sankey-DpYJsOI4.js";
|
|
25
|
+
import { a as scatter, i as ScatterSeries, n as ScatterOptions, r as ScatterPoint, t as ScatterData } from "./scatter-BAL5K9_4.js";
|
|
26
|
+
import { n as sparkline, t as SparklineOptions } from "./sparkline-CtoBJe-a.js";
|
|
27
|
+
import { n as TreemapOptions, r as treemap, t as TreemapNode } from "./treemap-D_zbubo3.js";
|
|
28
|
+
import { A as grid, C as legend, D as hoverUnderlay, E as hoverOverlay, M as arcCentroid, N as arcPathStable, O as hoverValue, P as padAngleForGap, S as pointer, T as highlight, _ as defaultPlugins, a as flush, b as dataTable, c as tickIncrement, d as extent, f as RenderToStringOptions, g as render, h as renderToString, i as cancel, j as ArcOptions, k as GridOptions, l as tickStep, m as escapeText, n as barPath, o as schedule, p as escapeAttr, r as hbarPath, s as niceDomain, t as VERSION, u as ticks, v as zoom, w as keyboard, x as sync, y as tooltip } from "./core-BUQzLsRJ.js";
|
|
27
29
|
/**
|
|
28
30
|
* A chart with every built-in plugin installed: hover highlight, legend,
|
|
29
31
|
* tooltip, data table and keyboard navigation. Each can be switched off in
|
|
@@ -43,4 +45,4 @@ export declare class Chart<O extends object = object> extends Chart$1<O> {
|
|
|
43
45
|
* brings every type along: code that knows its types imports them directly.
|
|
44
46
|
*/
|
|
45
47
|
export declare const types: Readonly<Record<string, ChartType<never>>>;
|
|
46
|
-
export { type AfterRenderState, type Annotation, type ArcOptions, type AreaOptions, type AttrValue, type Attrs, type AxisOptions, type AxisPosition, type BandKey, type BandScale, type BandScaleOptions, type BarOptions, type BaseOptions, type BeforeRenderState, type BuiltChart, type CalendarData, type CalendarEntry, type CalendarOptions, type CalendarSeries, type Candle, type CandlestickOptions, type CartesianData, type CartesianOptions, type CategoryAxisOptions, type ChartConfig, type ChartEvents, type ChartPlugin, type ChartType, type Child, type ChildInput, type ClassValue, type ContextOptions, type Curve, type DataTable, type DateFormat, type DownloadFormat, type DownloadMenuOptions, type DownloadOption, type DownloadOptions, type ExportOptions, type ExportTarget, type Features, type FunnelOptions, type FunnelStage, type GaugeOptions, type GaugeRing, type GridOptions, type HeatmapOptions, type HeatmapRange, type Highlight, type Hit, type HitItem, type HitTester, type ImageOptions, type Insets, type InsetsInput, type Interaction, type Key, LINE_HEIGHT, type Label, type LegendItem, type LegendOptions, type LineOptions, type LinearScale, type LinearScaleOptions, type LinearTicksOptions, type Locale, type LogScaleOptions, type MapData, type MapHit, type MapLayout, type MapLine, type MapMarker, type MapOptions, type MapRegion, type MapView, type NumberFormat, type NumberFormatOptions, type ParliamentOptions, type ParliamentParty, type PathOptions, type PercentageBarOptions, type PercentageBarSegment, type PieOptions, type PieSlice, type PluginInstance, type Point, type Props, type RadarOptions, type RadialAxisOptions, type Rect, type RenderContext, type RenderResult, type RenderToStringOptions, type ResolvedLegend, type SankeyData, type SankeyLink, type SankeyNode, type SankeyOptions, type ScatterOptions, type ScatterPoint, type ScatterSeries, type Series, type Size, type SparklineOptions, type StyleValue, type TableContext, type Tick, type TimeScale, type TimeScaleOptions, type TimeValue, type TooltipOptions, type TooltipPlacement, type TreemapNode, type TreemapOptions, VERSION, type VNode, type ValueAxisOptions, addMap, arcCentroid, arcPathStable, area, areaPath, axis, axisSize, band, bandTicks, bar, barPath, buildChart, calendar, cancel, candlestick, categoryInteraction, chartEvents, chartLabel, chartModel, chartToString, dataTable, defaultHidden, defaultPlugins, describeHit, domainOf, donut, download, downloadChart, escapeAttr, escapeText, estimateTextWidth, exportImage, exportSVG, extent, feature, features, flush, formatDate, formatDetail, formatNumber, formatTicks, funnel, gauge, getDateFormat, getNumberFormat, grid, h, hbarPath, heatmap, highlight, hitAnchor, hoverOverlay, hoverUnderlay, innerRect, insets, keyboard, legend, legendContent, line, linePath, linear, linearTicks, log, lttb, lttbIndices, map, niceDomain, normalizeClass, normalizeStyle, padAngleForGap, parliament, percentageBar, pie, placeTooltip, point, pointer, radar, register, render, renderChart, renderContext, renderToString, resolveLegend, resolveSize, sankey, scatter, schedule, seriesKey, seriesLegend, seriesTable, sparkline, stepPrecision, sync, tableContent, thinTicks, tickIncrement, tickStep, ticks, time, timePointScale, tooltip, tooltipContent, treemap };
|
|
48
|
+
export { type AfterRenderState, type Annotation, type ArcOptions, type AreaOptions, type AttrValue, type Attrs, type AxisOptions, type AxisPosition, type BandKey, type BandScale, type BandScaleOptions, type BarOptions, type BaseOptions, type BeforeRenderState, type BuiltChart, type CSVOptions, type CalendarData, type CalendarEntry, type CalendarOptions, type CalendarSeries, type Candle, type CandlestickOptions, type CartesianData, type CartesianOptions, type CategoryAxisOptions, type ChartConfig, type ChartEvents, type ChartPlugin, type ChartType, type Child, type ChildInput, type ClassValue, type ContextOptions, type CrosshairOptions, type Curve, type DataTable, type DateFormat, type DownloadFormat, type DownloadMenuOptions, type DownloadOption, type DownloadOptions, type ExportOptions, type ExportTarget, type Features, type FunnelOptions, type FunnelStage, type GaugeOptions, type GaugeRing, type GridOptions, type HeatmapOptions, type HeatmapRange, type Highlight, type Hit, type HitCursor, type HitItem, type HitTester, type ImageOptions, type Insets, type InsetsInput, type Interaction, type Key, LINE_HEIGHT, type Label, type LegendItem, type LegendOptions, type LineOptions, type LinearScale, type LinearScaleOptions, type LinearTicksOptions, type Locale, type LogScaleOptions, type MapData, type MapHit, type MapLayout, type MapLine, type MapMarker, type MapOptions, type MapRegion, type MapView, type NumberFormat, type NumberFormatOptions, type ParliamentOptions, type ParliamentParty, type PathOptions, type PercentageBarOptions, type PercentageBarSegment, type PieOptions, type PieSlice, type PluginInstance, type Point, type Props, type RadarOptions, type RadialAxisOptions, type RangeAxisOptions, type RangeBarAnnotation, type RangeBarItem, type RangeBarOptions, type RangeRowAxisOptions, type RangeValue, type Rect, type RenderContext, type RenderResult, type RenderToStringOptions, type ResolvedLegend, type SankeyData, type SankeyLink, type SankeyNode, type SankeyOptions, type ScatterData, type ScatterOptions, type ScatterPoint, type ScatterSeries, type Series, type Size, type SparklineOptions, type StyleValue, type TableContext, type Tick, type TimeScale, type TimeScaleOptions, type TimeValue, type TooltipOptions, type TooltipPlacement, type TreemapNode, type TreemapOptions, VERSION, type VNode, type ValueAxisOptions, type ViewWindow, type ZoomOptions, addMap, arcCentroid, arcPathStable, area, areaPath, axis, axisSize, band, bandTicks, bar, barPath, buildChart, calendar, cancel, candlestick, categoryInteraction, chartEvents, chartLabel, chartModel, chartToString, dataTable, defaultHidden, defaultPlugins, describeHit, domainOf, donut, download, downloadChart, escapeAttr, escapeText, estimateTextWidth, exportCSV, exportImage, exportSVG, extent, feature, features, flush, formatDate, formatDetail, formatNumber, formatTicks, funnel, gauge, getDateFormat, getNumberFormat, grid, h, hbarPath, heatmap, highlight, hitAnchor, hoverOverlay, hoverUnderlay, hoverValue, innerRect, insets, keyboard, legend, legendContent, line, linePath, linear, linearTicks, log, lttb, lttbIndices, map, niceDomain, normalizeClass, normalizeStyle, padAngleForGap, parliament, percentageBar, pie, placeTooltip, point, pointer, radar, rangeBar, register, render, renderChart, renderContext, renderToString, resolveLegend, resolveSize, sankey, scatter, schedule, seriesKey, seriesLegend, seriesTable, sparkline, stepPrecision, sync, tableContent, thinTicks, tickIncrement, tickStep, ticks, time, timePointScale, tooltip, tooltipContent, treemap, zoom };
|
package/dist/index.js
CHANGED
|
@@ -1,44 +1,47 @@
|
|
|
1
1
|
import { i as insets, n as estimateTextWidth, r as innerRect, t as LINE_HEIGHT } from "./layout-DqAte3H8.js";
|
|
2
2
|
import { n as normalizeClass, r as normalizeStyle, t as h } from "./vnode-_EMUqysL.js";
|
|
3
3
|
import { a as getDateFormat, i as formatTicks, n as formatDetail, o as getNumberFormat, r as formatNumber, s as stepPrecision, t as formatDate } from "./format-it1kepFG.js";
|
|
4
|
-
import { a as bandTicks, c as niceDomain, d as ticks, l as tickIncrement, n as axisSize, o as linearTicks, s as thinTicks, t as axis, u as tickStep } from "./axis-
|
|
5
|
-
import {
|
|
6
|
-
import { n as annotationValues, t as annotationLayers } from "./annotations-
|
|
4
|
+
import { a as bandTicks, c as niceDomain, d as ticks, l as tickIncrement, n as axisSize, o as linearTicks, s as thinTicks, t as axis, u as tickStep } from "./axis-C5obgdJt.js";
|
|
5
|
+
import { D as grid, E as point, T as band, _ as seriesTable, h as seriesLegend, m as seriesKey, n as categoryInteraction, r as domainOf, w as linear } from "./cartesian-COglz544.js";
|
|
6
|
+
import { n as annotationValues, t as annotationLayers } from "./annotations-DGITy6th.js";
|
|
7
7
|
import { t as extent } from "./extent-DOV8rs-6.js";
|
|
8
|
-
import { t as dateLabels } from "./dates-
|
|
8
|
+
import { t as dateLabels } from "./dates-CKDRgpin.js";
|
|
9
|
+
import { t as endLabels } from "./end-labels-B3oRvjxw.js";
|
|
9
10
|
import { n as logTicks, r as log, t as logDomain } from "./log-axis-DhthtHFk.js";
|
|
10
|
-
import { n as patternFills } from "./patterns-
|
|
11
|
+
import { n as patternFills } from "./patterns-CVrLrJXg.js";
|
|
11
12
|
import { n as markerPath, t as markerClip } from "./point-shapes-DI6GhcI7.js";
|
|
12
13
|
import { a as render } from "./dom-CTse6Rvd.js";
|
|
13
|
-
import {
|
|
14
|
-
import { t as
|
|
14
|
+
import { t as sliceLabels } from "./slice-labels-C9ucsBVW.js";
|
|
15
|
+
import { n as time, r as timePointScale, t as timeAxis } from "./time-axis-CkmbAw4Z.js";
|
|
16
|
+
import { t as labelsStep } from "./value-labels-B0VeheyE.js";
|
|
15
17
|
import { i as register, n as feature, r as features, t as addPost } from "./features-B55rwpQC.js";
|
|
16
18
|
import { t as hydrate } from "./hydrate-BB3MlR36.js";
|
|
17
19
|
import { t as morph } from "./morph-GfBab-b3.js";
|
|
18
20
|
import { n as lttbIndices, t as lttb } from "./decimate-CapfgiDY.js";
|
|
19
21
|
import { n as areaPath, r as linePath } from "./fade-CDrQjnDz.js";
|
|
20
|
-
import { _ as
|
|
21
|
-
import { _ as
|
|
22
|
-
import { t as area } from "./area-
|
|
23
|
-
import { t as bar } from "./bar-
|
|
22
|
+
import { _ as escapeAttr, a as chartModel, b as defaultHidden, c as renderChart, d as resolveSize, f as cancel, g as schedule, i as chartLabel, l as renderContext, n as buildChart, o as chartToString, p as flush, r as chartEvents, t as Chart$1, u as resolveLegend, v as escapeText, x as legendContent, y as renderToString } from "./chart-B97FBRCd.js";
|
|
23
|
+
import { _ as hoverUnderlay, a as hitAnchor, c as dataTable, d as keyboard, f as describeHit, g as hoverOverlay, h as pointer, i as tooltip, l as sync, m as highlight, n as defaultPlugins, o as placeTooltip, p as tableContent, r as zoom, s as tooltipContent, t as VERSION, u as legend, v as hoverValue, y as download } from "./core-7fgM3su0.js";
|
|
24
|
+
import { t as area } from "./area-BN0uE9R0.js";
|
|
25
|
+
import { t as bar } from "./bar-D_KKd2fL.js";
|
|
24
26
|
import { n as hbarPath, t as barPath } from "./bar-CgpC2EpX.js";
|
|
25
|
-
import { t as calendar } from "./calendar-
|
|
26
|
-
import { t as candlestick } from "./candlestick-
|
|
27
|
+
import { t as calendar } from "./calendar-CF3gfDQk.js";
|
|
28
|
+
import { t as candlestick } from "./candlestick-B1onjo1o.js";
|
|
27
29
|
import { t as funnel } from "./funnel-CYCv8cq2.js";
|
|
28
30
|
import { t as gauge } from "./gauge-DiTk5aWO.js";
|
|
29
31
|
import { i as padAngleForGap, n as arcCentroid, r as arcPathStable } from "./arc-B3V5IR0w.js";
|
|
30
|
-
import { t as heatmap } from "./heatmap-
|
|
31
|
-
import { t as line } from "./line-
|
|
32
|
-
import { n as map, t as addMap } from "./map-
|
|
32
|
+
import { t as heatmap } from "./heatmap-J7fxG7MM.js";
|
|
33
|
+
import { t as line } from "./line-CXH0L10d.js";
|
|
34
|
+
import { n as map, t as addMap } from "./map-CYp6x-uS.js";
|
|
33
35
|
import { t as parliament } from "./parliament-BKN6ikBJ.js";
|
|
34
36
|
import { t as percentageBar } from "./percentage-bar-CaInxrL8.js";
|
|
35
|
-
import { n as pie, t as donut } from "./pie-
|
|
36
|
-
import { t as radar } from "./radar-
|
|
37
|
+
import { n as pie, t as donut } from "./pie-Ch6Bx0ih.js";
|
|
38
|
+
import { t as radar } from "./radar-Bg-IiIWB.js";
|
|
39
|
+
import { t as rangeBar } from "./range-bar-Dx6ce0J1.js";
|
|
37
40
|
import { t as sankey } from "./sankey-Dp4CuLVe.js";
|
|
38
|
-
import { t as scatter } from "./scatter-
|
|
39
|
-
import { t as sparkline } from "./sparkline-
|
|
40
|
-
import { t as treemap } from "./treemap-
|
|
41
|
-
import { n as
|
|
41
|
+
import { t as scatter } from "./scatter-0Z7K_YUz.js";
|
|
42
|
+
import { t as sparkline } from "./sparkline-_dxwtdli.js";
|
|
43
|
+
import { t as treemap } from "./treemap-lbYxb-7h.js";
|
|
44
|
+
import { i as exportSVG, n as exportCSV, r as exportImage, t as downloadChart } from "./export-chart-BOH_nfcH.js";
|
|
42
45
|
// src/chart-default.ts
|
|
43
46
|
/**
|
|
44
47
|
* A chart with every built-in plugin installed: hover highlight, legend,
|
|
@@ -79,16 +82,18 @@ const types = {
|
|
|
79
82
|
parliament,
|
|
80
83
|
treemap,
|
|
81
84
|
"percentage-bar": percentageBar,
|
|
82
|
-
funnel
|
|
85
|
+
funnel,
|
|
86
|
+
"range-bar": rangeBar
|
|
83
87
|
};
|
|
84
88
|
// src/index.ts
|
|
85
89
|
/**
|
|
86
90
|
* `@tabler/charts`: everything from `@tabler/charts/core`, with a `Chart`
|
|
87
91
|
* that installs the built-in plugins (tooltip, legend, keyboard, …) and
|
|
88
92
|
* every optional feature registered (time and log axes, decimation,
|
|
89
|
-
* annotations, pattern fills, value labels, point shapes). The
|
|
90
|
-
*
|
|
91
|
-
* so charts that never offer a
|
|
93
|
+
* annotations, pattern fills, value labels, end labels, slice labels, point shapes). The exceptions
|
|
94
|
+
* are the `download` menu's saver and zoom: `import '@tabler/charts/export'`
|
|
95
|
+
* and `import '@tabler/charts/zoom'` add them, so charts that never offer a
|
|
96
|
+
* download or a zoom do not carry their code.
|
|
92
97
|
*/
|
|
93
98
|
register({
|
|
94
99
|
time: {
|
|
@@ -111,6 +116,8 @@ register({
|
|
|
111
116
|
layers: annotationLayers,
|
|
112
117
|
values: annotationValues
|
|
113
118
|
},
|
|
119
|
+
"end-labels": endLabels,
|
|
120
|
+
"slice-labels": sliceLabels,
|
|
114
121
|
patterns: patternFills,
|
|
115
122
|
"point-shapes": markerPath,
|
|
116
123
|
swatch: markerClip,
|
|
@@ -118,6 +125,6 @@ register({
|
|
|
118
125
|
morph
|
|
119
126
|
});
|
|
120
127
|
addPost(labelsStep);
|
|
121
|
-
export { Chart, LINE_HEIGHT, VERSION, addMap, arcCentroid, arcPathStable, area, areaPath, axis, axisSize, band, bandTicks, bar, barPath, buildChart, calendar, cancel, candlestick, categoryInteraction, chartEvents, chartLabel, chartModel, chartToString, dataTable, defaultHidden, defaultPlugins, describeHit, domainOf, donut, download, downloadChart, escapeAttr, escapeText, estimateTextWidth, exportImage, exportSVG, extent, feature, features, flush, formatDate, formatDetail, formatNumber, formatTicks, funnel, gauge, getDateFormat, getNumberFormat, grid, h, hbarPath, heatmap, highlight, hitAnchor, hoverOverlay, hoverUnderlay, innerRect, insets, keyboard, legend, legendContent, line, linePath, linear, linearTicks, log, lttb, lttbIndices, map, niceDomain, normalizeClass, normalizeStyle, padAngleForGap, parliament, percentageBar, pie, placeTooltip, point, pointer, radar, register, render, renderChart, renderContext, renderToString, resolveLegend, resolveSize, sankey, scatter, schedule, seriesKey, seriesLegend, seriesTable, sparkline, stepPrecision, sync, tableContent, thinTicks, tickIncrement, tickStep, ticks, time, timePointScale, tooltip, tooltipContent, treemap, types };
|
|
128
|
+
export { Chart, LINE_HEIGHT, VERSION, addMap, arcCentroid, arcPathStable, area, areaPath, axis, axisSize, band, bandTicks, bar, barPath, buildChart, calendar, cancel, candlestick, categoryInteraction, chartEvents, chartLabel, chartModel, chartToString, dataTable, defaultHidden, defaultPlugins, describeHit, domainOf, donut, download, downloadChart, escapeAttr, escapeText, estimateTextWidth, exportCSV, exportImage, exportSVG, extent, feature, features, flush, formatDate, formatDetail, formatNumber, formatTicks, funnel, gauge, getDateFormat, getNumberFormat, grid, h, hbarPath, heatmap, highlight, hitAnchor, hoverOverlay, hoverUnderlay, hoverValue, innerRect, insets, keyboard, legend, legendContent, line, linePath, linear, linearTicks, log, lttb, lttbIndices, map, niceDomain, normalizeClass, normalizeStyle, padAngleForGap, parliament, percentageBar, pie, placeTooltip, point, pointer, radar, rangeBar, register, render, renderChart, renderContext, renderToString, resolveLegend, resolveSize, sankey, scatter, schedule, seriesKey, seriesLegend, seriesTable, sparkline, stepPrecision, sync, tableContent, thinTicks, tickIncrement, tickStep, ticks, time, timePointScale, tooltip, tooltipContent, treemap, types, zoom };
|
|
122
129
|
|
|
123
130
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CoreChart"],"sources":["../src/chart-default.ts","../src/chart-types.ts","../src/index.ts"],"sourcesContent":["import { type ChartConfig, Chart as CoreChart } from './chart.ts'\nimport { defaultPlugins } from './plugins/index.ts'\n\n/**\n * A chart with every built-in plugin installed: hover highlight, legend,\n * tooltip, data table and keyboard navigation. Each can be switched off in\n * the config (`tooltip: false`, …). For the smallest bundle, use the bare\n * `Chart` from `@tabler/charts/core` and pick plugins explicitly.\n *\n * ```ts\n * const chart = new Chart('#sales', { type: line, data })\n * ```\n */\nexport class Chart<O extends object = object> extends CoreChart<O> {\n constructor(target: HTMLElement | string, config: ChartConfig<O>) {\n super(target, config, defaultPlugins())\n }\n}\n","import type { ChartType } from './chart.ts'\nimport { area } from './charts/area.ts'\nimport { bar } from './charts/bar.ts'\nimport { calendar } from './charts/calendar.ts'\nimport { candlestick } from './charts/candlestick.ts'\nimport { funnel } from './charts/funnel.ts'\nimport { gauge } from './charts/gauge.ts'\nimport { heatmap } from './charts/heatmap.ts'\nimport { line } from './charts/line.ts'\nimport { map } from './charts/map.ts'\nimport { parliament } from './charts/parliament.ts'\nimport { percentageBar } from './charts/percentage-bar.ts'\nimport { donut, pie } from './charts/pie.ts'\nimport { radar } from './charts/radar.ts'\nimport { sankey } from './charts/sankey.ts'\nimport { scatter } from './charts/scatter.ts'\nimport { sparkline } from './charts/sparkline.ts'\nimport { treemap } from './charts/treemap.ts'\n\n/**\n * Every built-in chart type by its name, for charts declared in markup\n * (`<tabler-chart type=\"line\">`, `data-tc-chart=\"line\"`). Importing it\n * brings every type along: code that knows its types imports them directly.\n */\nexport const types: Readonly<Record<string, ChartType<never>>> = {\n line,\n area,\n bar,\n pie,\n donut,\n scatter,\n sparkline,\n gauge,\n heatmap,\n calendar,\n map,\n candlestick,\n radar,\n sankey,\n parliament,\n treemap,\n 'percentage-bar': percentageBar,\n funnel,\n} as Record<string, ChartType<never>>\n","/**\n * `@tabler/charts`: everything from `@tabler/charts/core`, with a `Chart`\n * that installs the built-in plugins (tooltip, legend, keyboard, …) and\n * every optional feature registered (time and log axes, decimation,\n * annotations, pattern fills, value labels, point shapes). The
|
|
1
|
+
{"version":3,"file":"index.js","names":["CoreChart"],"sources":["../src/chart-default.ts","../src/chart-types.ts","../src/index.ts"],"sourcesContent":["import { type ChartConfig, Chart as CoreChart } from './chart.ts'\nimport { defaultPlugins } from './plugins/index.ts'\n\n/**\n * A chart with every built-in plugin installed: hover highlight, legend,\n * tooltip, data table and keyboard navigation. Each can be switched off in\n * the config (`tooltip: false`, …). For the smallest bundle, use the bare\n * `Chart` from `@tabler/charts/core` and pick plugins explicitly.\n *\n * ```ts\n * const chart = new Chart('#sales', { type: line, data })\n * ```\n */\nexport class Chart<O extends object = object> extends CoreChart<O> {\n constructor(target: HTMLElement | string, config: ChartConfig<O>) {\n super(target, config, defaultPlugins())\n }\n}\n","import type { ChartType } from './chart.ts'\nimport { area } from './charts/area.ts'\nimport { bar } from './charts/bar.ts'\nimport { calendar } from './charts/calendar.ts'\nimport { candlestick } from './charts/candlestick.ts'\nimport { funnel } from './charts/funnel.ts'\nimport { gauge } from './charts/gauge.ts'\nimport { heatmap } from './charts/heatmap.ts'\nimport { line } from './charts/line.ts'\nimport { map } from './charts/map.ts'\nimport { parliament } from './charts/parliament.ts'\nimport { percentageBar } from './charts/percentage-bar.ts'\nimport { donut, pie } from './charts/pie.ts'\nimport { radar } from './charts/radar.ts'\nimport { rangeBar } from './charts/range-bar.ts'\nimport { sankey } from './charts/sankey.ts'\nimport { scatter } from './charts/scatter.ts'\nimport { sparkline } from './charts/sparkline.ts'\nimport { treemap } from './charts/treemap.ts'\n\n/**\n * Every built-in chart type by its name, for charts declared in markup\n * (`<tabler-chart type=\"line\">`, `data-tc-chart=\"line\"`). Importing it\n * brings every type along: code that knows its types imports them directly.\n */\nexport const types: Readonly<Record<string, ChartType<never>>> = {\n line,\n area,\n bar,\n pie,\n donut,\n scatter,\n sparkline,\n gauge,\n heatmap,\n calendar,\n map,\n candlestick,\n radar,\n sankey,\n parliament,\n treemap,\n 'percentage-bar': percentageBar,\n funnel,\n 'range-bar': rangeBar,\n} as Record<string, ChartType<never>>\n","/**\n * `@tabler/charts`: everything from `@tabler/charts/core`, with a `Chart`\n * that installs the built-in plugins (tooltip, legend, keyboard, …) and\n * every optional feature registered (time and log axes, decimation,\n * annotations, pattern fills, value labels, end labels, slice labels, point shapes). The exceptions\n * are the `download` menu's saver and zoom: `import '@tabler/charts/export'`\n * and `import '@tabler/charts/zoom'` add them, so charts that never offer a\n * download or a zoom do not carry their code.\n */\n\nimport { annotationLayers, annotationValues } from './charts/annotations.ts'\nimport { dateLabels } from './charts/dates.ts'\nimport { endLabels } from './charts/end-labels.ts'\nimport { logDomain, logTicks } from './charts/log-axis.ts'\nimport { patternFills } from './charts/patterns.ts'\nimport { markerClip, markerPath } from './charts/point-shapes.ts'\nimport { sliceLabels } from './charts/slice-labels.ts'\nimport { timeAxis } from './charts/time-axis.ts'\nimport { labelsStep } from './charts/value-labels.ts'\nimport { addPost, register } from './features.ts'\nimport { hydrate } from './render/hydrate.ts'\nimport { morph } from './render/morph.ts'\nimport { log } from './scales/log.ts'\nimport { time, timePointScale } from './scales/time.ts'\nimport { lttb, lttbIndices } from './shapes/decimate.ts'\nimport { areaPath, linePath } from './shapes/path.ts'\n\n// Registered here, in the entry itself, so no bundler can shake it away.\nregister({\n time: { scale: time, points: timePointScale, axis: timeAxis },\n dates: dateLabels,\n log: { scale: log, domain: logDomain, ticks: logTicks },\n decimate: lttbIndices,\n line: { linePath, areaPath },\n annotations: { layers: annotationLayers, values: annotationValues },\n 'end-labels': endLabels,\n 'slice-labels': sliceLabels,\n patterns: patternFills,\n 'point-shapes': markerPath,\n swatch: markerClip,\n hydrate,\n morph,\n})\n\n// The step that finishes the content: value labels over the marks.\naddPost(labelsStep)\n\nexport { Chart } from './chart-default.ts'\nexport { types } from './chart-types.ts'\nexport * from './core.ts'\nexport type {\n CSVOptions,\n DownloadOptions,\n ExportOptions,\n ExportTarget,\n ImageOptions,\n} from './export-chart.ts'\nexport { downloadChart, exportCSV, exportImage, exportSVG } from './export-chart.ts'\nexport type { LogScaleOptions } from './scales/log.ts'\nexport type { TimeScale, TimeScaleOptions, TimeValue } from './scales/time.ts'\nexport { log, lttb, lttbIndices, time, timePointScale }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAa,QAAb,cAAsDA,QAAa;CACjE,YAAY,QAA8B,QAAwB;EAChE,MAAM,QAAQ,QAAQ,eAAe,CAAC;CACxC;AACF;;;;;;;ACQA,MAAa,QAAoD;CAC/D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,kBAAkB;CAClB;CACA,aAAa;AACf;;;;;;;;;;;ACjBA,SAAS;CACP,MAAM;EAAE,OAAO;EAAM,QAAQ;EAAgB,MAAM;CAAS;CAC5D,OAAO;CACP,KAAK;EAAE,OAAO;EAAK,QAAQ;EAAW,OAAO;CAAS;CACtD,UAAU;CACV,MAAM;EAAE;EAAU;CAAS;CAC3B,aAAa;EAAE,QAAQ;EAAkB,QAAQ;CAAiB;CAClE,cAAc;CACd,gBAAgB;CAChB,UAAU;CACV,gBAAgB;CAChB,QAAQ;CACR;CACA;AACF,CAAC;AAGD,QAAQ,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction-DXYSjgnP.cjs","names":[],"sources":["../src/interaction.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 /** 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 /** The shape that marks the hit; a crosshair when left out. */\n highlight?: Highlight\n}\n\n/**\n * The one shape drawn to mark a hit, in chart pixels:\n *\n * - `crosshair`: a vertical line through the category across the plot, and\n * a dot on every value (point charts);\n * - `band`: the category's band behind the series (bars);\n * - `spoke`: a line from `x1, y1` to `x2, y2` (a radar spoke), and a dot on\n * every value; keyboard tooltips anchor on the value itself;\n * - `halo`: path data `d` drawn translated by `x` / `y` in the color of the\n * hit's series (a ring around a pie slice); `under` draws it below the\n * chart instead of above, so it never covers the labels.\n */\nexport type Highlight =\n | { kind: 'crosshair' }\n | { kind: 'band'; x: number; y: number; width: number; height: number }\n | { kind: 'spoke'; x1: number; y1: number; x2: number; y2: number }\n | { kind: 'halo'; d: string; x?: number; y?: number; under?: boolean }\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 /**\n * Categories fill a grid column by column, this many to a column (the days\n * of a calendar in weeks): left and right move by a column, up and down by one.\n */\n rows?: 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"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"interaction-DXYSjgnP.cjs","names":[],"sources":["../src/interaction.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 /** 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 /** The shape that marks the hit; a crosshair when left out. */\n highlight?: Highlight\n /**\n * The value under the pointer on the value axis (cartesian charts, for a\n * hit from the pointer): what `crosshair: { value: true }` shows.\n */\n cursor?: HitCursor\n}\n\n/** The value under the pointer, read off the value axis. */\nexport interface HitCursor {\n value: number\n /** The value formatted like the axis, with the precision of a pixel. */\n text: string\n /** Where the pointer is along the value axis, in chart pixels. */\n position: number\n /** The side of the plot the value axis is on. */\n side: 'left' | 'right' | 'bottom'\n /** The axis is hidden (`y.show: false`): the value is written inside the plot. */\n inside?: boolean\n}\n\n/**\n * The one shape drawn to mark a hit, in chart pixels:\n *\n * - `crosshair`: a vertical line through the category across the plot, and\n * a dot on every value (point charts);\n * - `band`: the category's band behind the series (bars);\n * - `spoke`: a line from `x1, y1` to `x2, y2` (a radar spoke), and a dot on\n * every value; keyboard tooltips anchor on the value itself;\n * - `halo`: path data `d` drawn translated by `x` / `y` in the color of the\n * hit's series (a ring around a pie slice); `under` draws it below the\n * chart instead of above, so it never covers the labels.\n */\nexport type Highlight =\n | { kind: 'crosshair' }\n | { kind: 'band'; x: number; y: number; width: number; height: number }\n | { kind: 'spoke'; x1: number; y1: number; x2: number; y2: number }\n | { kind: 'halo'; d: string; x?: number; y?: number; under?: boolean }\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 /**\n * Categories fill a grid column by column, this many to a column (the days\n * of a calendar in weeks): left and right move by a column, up and down by one.\n */\n rows?: 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"],"mappings":";;AAqGA,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction-En1KlwFO.js","names":[],"sources":["../src/interaction.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 /** 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 /** The shape that marks the hit; a crosshair when left out. */\n highlight?: Highlight\n}\n\n/**\n * The one shape drawn to mark a hit, in chart pixels:\n *\n * - `crosshair`: a vertical line through the category across the plot, and\n * a dot on every value (point charts);\n * - `band`: the category's band behind the series (bars);\n * - `spoke`: a line from `x1, y1` to `x2, y2` (a radar spoke), and a dot on\n * every value; keyboard tooltips anchor on the value itself;\n * - `halo`: path data `d` drawn translated by `x` / `y` in the color of the\n * hit's series (a ring around a pie slice); `under` draws it below the\n * chart instead of above, so it never covers the labels.\n */\nexport type Highlight =\n | { kind: 'crosshair' }\n | { kind: 'band'; x: number; y: number; width: number; height: number }\n | { kind: 'spoke'; x1: number; y1: number; x2: number; y2: number }\n | { kind: 'halo'; d: string; x?: number; y?: number; under?: boolean }\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 /**\n * Categories fill a grid column by column, this many to a column (the days\n * of a calendar in weeks): left and right move by a column, up and down by one.\n */\n rows?: 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"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"interaction-En1KlwFO.js","names":[],"sources":["../src/interaction.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 /** 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 /** The shape that marks the hit; a crosshair when left out. */\n highlight?: Highlight\n /**\n * The value under the pointer on the value axis (cartesian charts, for a\n * hit from the pointer): what `crosshair: { value: true }` shows.\n */\n cursor?: HitCursor\n}\n\n/** The value under the pointer, read off the value axis. */\nexport interface HitCursor {\n value: number\n /** The value formatted like the axis, with the precision of a pixel. */\n text: string\n /** Where the pointer is along the value axis, in chart pixels. */\n position: number\n /** The side of the plot the value axis is on. */\n side: 'left' | 'right' | 'bottom'\n /** The axis is hidden (`y.show: false`): the value is written inside the plot. */\n inside?: boolean\n}\n\n/**\n * The one shape drawn to mark a hit, in chart pixels:\n *\n * - `crosshair`: a vertical line through the category across the plot, and\n * a dot on every value (point charts);\n * - `band`: the category's band behind the series (bars);\n * - `spoke`: a line from `x1, y1` to `x2, y2` (a radar spoke), and a dot on\n * every value; keyboard tooltips anchor on the value itself;\n * - `halo`: path data `d` drawn translated by `x` / `y` in the color of the\n * hit's series (a ring around a pie slice); `under` draws it below the\n * chart instead of above, so it never covers the labels.\n */\nexport type Highlight =\n | { kind: 'crosshair' }\n | { kind: 'band'; x: number; y: number; width: number; height: number }\n | { kind: 'spoke'; x1: number; y1: number; x2: number; y2: number }\n | { kind: 'halo'; d: string; x?: number; y?: number; under?: boolean }\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 /**\n * Categories fill a grid column by column, this many to a column (the days\n * of a calendar in weeks): left and right move by a column, up and down by one.\n */\n rows?: 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"],"mappings":";;AAqGA,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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Axis-aligned rectangle in pixels. */
|
|
2
|
+
interface Rect {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
/** Space around a box, in pixels. */
|
|
9
|
+
interface Insets {
|
|
10
|
+
top: number;
|
|
11
|
+
right: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
left: number;
|
|
14
|
+
}
|
|
15
|
+
/** Insets given as one number for all sides or per side. */
|
|
16
|
+
type InsetsInput = number | Partial<Insets>;
|
|
17
|
+
/** Normalize an {@link InsetsInput}; missing sides fall back to `fallback`. */
|
|
18
|
+
declare function insets(value: InsetsInput | undefined, fallback?: number): Insets;
|
|
19
|
+
/** Rectangle left inside `width × height` after `margins`; never negative. */
|
|
20
|
+
declare function innerRect(width: number, height: number, margins: Insets): Rect;
|
|
21
|
+
/**
|
|
22
|
+
* Estimate the rendered width of `text` without a DOM, for layout on the
|
|
23
|
+
* server and in workers. Tuned for common UI sans-serif fonts; deterministic,
|
|
24
|
+
* so SSR and client layouts agree.
|
|
25
|
+
*/
|
|
26
|
+
declare function estimateTextWidth(text: string, fontSize: number): number;
|
|
27
|
+
/** Line height used for single-line labels, relative to the font size. */
|
|
28
|
+
declare const LINE_HEIGHT = 1.25;
|
|
29
|
+
export { estimateTextWidth as a, Rect as i, InsetsInput as n, innerRect as o, LINE_HEIGHT as r, insets as s, Insets as t };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Axis-aligned rectangle in pixels. */
|
|
2
|
+
interface Rect {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
/** Space around a box, in pixels. */
|
|
9
|
+
interface Insets {
|
|
10
|
+
top: number;
|
|
11
|
+
right: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
left: number;
|
|
14
|
+
}
|
|
15
|
+
/** Insets given as one number for all sides or per side. */
|
|
16
|
+
type InsetsInput = number | Partial<Insets>;
|
|
17
|
+
/** Normalize an {@link InsetsInput}; missing sides fall back to `fallback`. */
|
|
18
|
+
declare function insets(value: InsetsInput | undefined, fallback?: number): Insets;
|
|
19
|
+
/** Rectangle left inside `width × height` after `margins`; never negative. */
|
|
20
|
+
declare function innerRect(width: number, height: number, margins: Insets): Rect;
|
|
21
|
+
/**
|
|
22
|
+
* Estimate the rendered width of `text` without a DOM, for layout on the
|
|
23
|
+
* server and in workers. Tuned for common UI sans-serif fonts; deterministic,
|
|
24
|
+
* so SSR and client layouts agree.
|
|
25
|
+
*/
|
|
26
|
+
declare function estimateTextWidth(text: string, fontSize: number): number;
|
|
27
|
+
/** Line height used for single-line labels, relative to the font size. */
|
|
28
|
+
declare const LINE_HEIGHT = 1.25;
|
|
29
|
+
export { estimateTextWidth as a, Rect as i, InsetsInput as n, innerRect as o, LINE_HEIGHT as r, insets as s, Insets as t };
|
|
@@ -2,9 +2,9 @@ import { n as areaPath, r as linePath, t as fadeMask } from "./fade-CDrQjnDz.js"
|
|
|
2
2
|
import { n as feature } from "./features-B55rwpQC.js";
|
|
3
3
|
import { s as round } from "./layout-DqAte3H8.js";
|
|
4
4
|
import { t as h } from "./vnode-_EMUqysL.js";
|
|
5
|
-
import { _ as seriesTable, d as resolveLabels, f as seriesAttrs, g as seriesScale, h as seriesLegend, l as plottable, m as seriesKey, n as categoryInteraction, p as seriesAxes, s as markerShape, t as cartesianLayout, u as pointMark } from "./cartesian-
|
|
5
|
+
import { C as windowed, _ as seriesTable, d as resolveLabels, f as seriesAttrs, g as seriesScale, h as seriesLegend, l as plottable, m as seriesKey, n as categoryInteraction, o as labelKey, p as seriesAxes, s as markerShape, t as cartesianLayout, u as pointMark } from "./cartesian-COglz544.js";
|
|
6
6
|
import { r as cleanSeries, t as cleanData } from "./clean-CkoQobGv.js";
|
|
7
|
-
import { n as stackSeries, t as stackBounds } from "./stack-
|
|
7
|
+
import { n as stackSeries, t as stackBounds } from "./stack-CyVlS7Fr.js";
|
|
8
8
|
// src/charts/line.ts
|
|
9
9
|
/** Points in pixels for a series; `null` for missing values. */
|
|
10
10
|
function seriesPoints(series, count, x, y, connectNulls, valid) {
|
|
@@ -30,7 +30,8 @@ function renderLines(options, ctx, fill) {
|
|
|
30
30
|
nullAsZero: true,
|
|
31
31
|
hidden: seconds.length ? /* @__PURE__ */ new Set([...ctx.hidden, ...seconds]) : ctx.hidden
|
|
32
32
|
}) : null;
|
|
33
|
-
const
|
|
33
|
+
const ends = options.endLabels ? feature("end-labels")(options, ctx, overhang) : null;
|
|
34
|
+
const layout = cartesianLayout(ends?.options ?? options, ctx, {
|
|
34
35
|
scale: "point",
|
|
35
36
|
zero: filled || stacks !== null,
|
|
36
37
|
zero2: filled,
|
|
@@ -85,26 +86,59 @@ function renderLines(options, ctx, fill) {
|
|
|
85
86
|
mask: gradient ? `url(#${fadeId})` : void 0
|
|
86
87
|
}))));
|
|
87
88
|
const shape = markerShape(options);
|
|
89
|
+
const keys = labels.map(labelKey);
|
|
90
|
+
/** Clip paths that cut the lines with `dashFrom` in two. */
|
|
91
|
+
const cuts = [];
|
|
88
92
|
const lines = options.data.series.map((s, index) => {
|
|
89
93
|
if (!visible(s)) return null;
|
|
90
94
|
const pts = drawn(index);
|
|
91
95
|
const valid = pts.filter((p) => p != null);
|
|
92
96
|
const dots = points === "all" ? valid : points === "last" ? valid.slice(-1) : [];
|
|
93
|
-
|
|
97
|
+
const d = linePath(pts, { curve });
|
|
98
|
+
const from = s.dashFrom == null ? -1 : keys.indexOf(labelKey(s.dashFrom));
|
|
99
|
+
const cut = from > 0 && from < keys.length - 1;
|
|
100
|
+
const { dash = "5 4" } = s;
|
|
101
|
+
if (cut) {
|
|
102
|
+
const at = round(x.at(from));
|
|
103
|
+
const side = (part, before) => h("clipPath", {
|
|
104
|
+
key: `${part}-${seriesKey(s)}`,
|
|
105
|
+
id: `${ctx.id}-${part}-${index}`
|
|
106
|
+
}, h("rect", {
|
|
107
|
+
x: before ? at - 1e5 : at,
|
|
108
|
+
y: -1e5,
|
|
109
|
+
width: 1e5,
|
|
110
|
+
height: 2e5
|
|
111
|
+
}));
|
|
112
|
+
const forward = x.at(0) <= at;
|
|
113
|
+
cuts.push(side("solid", forward), side("dashed", !forward));
|
|
114
|
+
}
|
|
115
|
+
return h("g", seriesAttrs(cut ? {
|
|
116
|
+
...s,
|
|
117
|
+
dash: void 0
|
|
118
|
+
} : s, index), h("path", {
|
|
119
|
+
key: "line",
|
|
94
120
|
class: "tc-line",
|
|
95
|
-
d
|
|
121
|
+
d,
|
|
122
|
+
"clip-path": cut ? `url(#${ctx.id}-solid-${index})` : void 0
|
|
123
|
+
}), cut && h("path", {
|
|
124
|
+
key: "dashed",
|
|
125
|
+
class: "tc-line tc-line-dashed",
|
|
126
|
+
d,
|
|
127
|
+
"clip-path": `url(#${ctx.id}-dashed-${index})`,
|
|
128
|
+
style: { "--tc-series-dash": Number.isFinite(dash) ? `${dash}px` : dash }
|
|
96
129
|
}), dots.length > 0 && h("g", { class: "tc-points" }, dots.map(([cx, cy]) => pointMark(shape, index, cx, "tc-point", round(cx), round(cy), pointRadius))));
|
|
97
130
|
});
|
|
98
131
|
return {
|
|
99
132
|
content: [
|
|
100
|
-
h("defs", { key: "defs" }, layout.clip.def, gradient && fadeMask(fadeId)),
|
|
133
|
+
h("defs", { key: "defs" }, layout.clip.def, gradient && fadeMask(fadeId), cuts),
|
|
101
134
|
layout.background,
|
|
102
135
|
h("g", {
|
|
103
136
|
key: "series",
|
|
104
137
|
class: "tc-series-list",
|
|
105
138
|
"clip-path": layout.clip.url
|
|
106
139
|
}, areas, lines),
|
|
107
|
-
layout.foreground
|
|
140
|
+
layout.foreground,
|
|
141
|
+
ends?.layer(all, layout.area)
|
|
108
142
|
],
|
|
109
143
|
interaction
|
|
110
144
|
};
|
|
@@ -122,10 +156,11 @@ function renderLines(options, ctx, fill) {
|
|
|
122
156
|
const line = {
|
|
123
157
|
name: "line",
|
|
124
158
|
clean: cleanData(cleanSeries),
|
|
159
|
+
prepare: windowed,
|
|
125
160
|
render: (options, ctx) => renderLines(options, ctx, false),
|
|
126
161
|
legend: (options) => seriesLegend(options.data),
|
|
127
162
|
table: (options, ctx, limit) => seriesTable(options, ctx, limit)
|
|
128
163
|
};
|
|
129
164
|
export { renderLines as n, line as t };
|
|
130
165
|
|
|
131
|
-
//# sourceMappingURL=line-
|
|
166
|
+
//# sourceMappingURL=line-CXH0L10d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-CXH0L10d.js","names":[],"sources":["../src/charts/line.ts"],"sourcesContent":["import type { ChartType, RenderContext, RenderResult } from '../chart.ts'\nimport { fadeMask } from '../components/fade.ts'\nimport { feature } from '../features.ts'\nimport { round } from '../layout.ts'\nimport { areaPath, type Curve, linePath, type Point } from '../shapes/path.ts'\nimport { h, type VNode } from '../vnode.ts'\nimport {\n type CartesianOptions,\n cartesianLayout,\n categoryInteraction,\n labelKey,\n markerShape,\n plottable,\n pointMark,\n resolveLabels,\n type Series,\n seriesAttrs,\n seriesAxes,\n seriesKey,\n seriesLegend,\n seriesScale,\n seriesTable,\n windowed,\n} from './cartesian.ts'\nimport { cleanData, cleanSeries } from './clean.ts'\nimport type { EndLabelOptions } from './end-labels.ts'\nimport { type StackMode, stackBounds, stackSeries } from './stack.ts'\n\nexport interface LineOptions extends CartesianOptions {\n /** Interpolation between points. Defaults to `'monotone'`. */\n curve?: Curve\n /** Draw dots on every point, only on the last one, or none. Defaults to `'none'`. */\n points?: 'none' | 'last' | 'all'\n /** Dot radius in pixels. Defaults to `4`. */\n pointRadius?: number\n /** Bridge `null` values instead of leaving gaps. Defaults to `false`. */\n connectNulls?: boolean\n /** Fill the area under each line. Defaults to `false` (`true` for `area`). */\n area?: boolean\n /**\n * Area fill style: a vertical fade (strength set by `--tc-area-gradient-start`\n * / `--tc-area-gradient-end`) or a flat wash (`--tc-area-opacity`).\n * Defaults to `'gradient'`, or `'solid'` for stacked areas.\n */\n fill?: 'gradient' | 'solid'\n /**\n * Stack series on top of each other (each line draws the running total);\n * `'percent'` shows every category as 100%. Missing values count as zero.\n */\n stacked?: StackMode\n /**\n * Draw long series with at most this many points, chosen by LTTB\n * downsampling so peaks and valleys survive. Tooltips and keyboard\n * navigation still use every value. Off by default.\n */\n decimate?: number\n /**\n * Name each line at its end: the series name and its last value beside the\n * last point, past the edge of the plot, moved apart where lines end close\n * together (a thin line then joins a label to its point). Needs\n * `@tabler/charts/end-labels` on the core. Defaults to `false`.\n */\n endLabels?: boolean | EndLabelOptions\n}\n\n/** Points in pixels for a series; `null` for missing values. */\nfunction seriesPoints(\n series: Series,\n count: number,\n x: (i: number) => number,\n y: (v: number) => number,\n connectNulls: boolean,\n valid: (v: number | null | undefined) => v is number,\n): Point[] {\n const points: Point[] = []\n for (let i = 0; i < count; i++) {\n const v = series.values[i]\n if (!valid(v)) {\n if (!connectNulls) points.push(null)\n } else {\n points.push([x(i), y(v)])\n }\n }\n return points\n}\n\n/** Render line (and optionally area) series; shared by `line` and `area`. */\nexport function renderLines(options: LineOptions, ctx: RenderContext, fill: boolean): RenderResult {\n const {\n curve = 'monotone',\n points = 'none',\n pointRadius = 4,\n connectNulls = false,\n area: filled = fill,\n stacked = false,\n decimate,\n // Faded layers would show light seams between stacked areas, so stacks default to solid.\n fill: fillStyle = stacked ? 'solid' : 'gradient',\n } = options\n const overhang = points === 'none' ? 2 : pointRadius + 2\n const { series } = options.data\n const count = resolveLabels(options.data).length\n const axisOf = seriesAxes(options)\n // Series on the second axis keep out of the stacks.\n const seconds = series.filter((s) => axisOf(s).second).map(seriesKey)\n const stacks = stacked\n ? stackSeries(series, count, {\n percent: stacked === 'percent',\n nullAsZero: true,\n hidden: seconds.length ? new Set([...ctx.hidden, ...seconds]) : ctx.hidden,\n })\n : null\n // End labels stand past the end of the lines: the plot leaves them room there.\n const ends = options.endLabels ? feature('end-labels')(options, ctx, overhang) : null\n const layout = cartesianLayout(ends?.options ?? options, ctx, {\n scale: 'point',\n zero: filled || stacks !== null,\n zero2: filled,\n overhang,\n ...(stacks ? { values: stackBounds(stacks) } : {}),\n ...(stacked === 'percent' ? { tickFormat: { style: 'percent' } } : {}),\n })\n const { x, labels } = layout\n const scaleOf = (index: number) => seriesScale(layout, series[index])\n // Areas grow from zero, or from the bottom of the plot when zero is out of view.\n const baselineOf = (index: number) => {\n const y = scaleOf(index)\n return y(Math.min(Math.max(0, y.domain[0]), y.domain[1]))\n }\n // (series left out of the stacks have empty rows there)\n const stackOf = (index: number) => (!axisOf(series[index]).second && stacks?.[index]) || null\n const interaction = categoryInteraction(layout, options, ctx, (seriesIndex, i, v) => {\n const stack = stackOf(seriesIndex)\n return { x: x.at(i), y: scaleOf(seriesIndex)(stack ? (stack[i]?.y1 ?? 0) : v) }\n })\n const gradient = filled && fillStyle === 'gradient'\n const fadeId = `${ctx.id}-fade`\n\n // Hidden series keep their index (and color slot) but draw nothing.\n const visible = (s: Series) => !ctx.hidden.has(seriesKey(s))\n const all = series.map((s, index) => {\n if (!visible(s)) return []\n const y = scaleOf(index)\n // Stacked series draw their running total.\n const stack = stackOf(index)\n if (stack) return stack.map((seg, i): Point => (seg ? [x.at(i), y(seg.y1)] : null))\n const axis = axisOf(s).axis\n return seriesPoints(\n s,\n labels.length,\n (i) => x.at(i),\n y,\n connectNulls,\n (v) => plottable(v, axis),\n )\n })\n /** Indices drawn per series: a downsampled subset when `decimate` is set. */\n const kept = all.map((pts) =>\n decimate !== undefined && pts.length > decimate ? feature('decimate')(pts, decimate) : null,\n )\n const drawn = (index: number): Point[] => {\n const pts = all[index] as Point[]\n const keep = kept[index]\n return keep ? keep.map((i) => pts[i] as Point) : pts\n }\n /** Area bottom: zero, or the top of the layer below for stacks (downsampled alike). */\n const bottom = (index: number): number | (number | null)[] => {\n const stack = stackOf(index)\n if (!stack) return baselineOf(index)\n const y = scaleOf(index)\n const bottoms = stack.map((seg) => (seg ? y(seg.y0) : null))\n const keep = kept[index]\n return keep ? keep.map((i) => bottoms[i] ?? null) : bottoms\n }\n\n // All areas go below all lines, so a filled series never covers another line.\n const areas =\n filled &&\n h(\n 'g',\n { class: 'tc-areas' },\n options.data.series.map(\n (s, index) =>\n visible(s) &&\n h(\n 'g',\n seriesAttrs(s, index),\n h('path', {\n class: ['tc-area', gradient && 'tc-area-gradient'],\n d: areaPath(drawn(index), bottom(index), { curve }),\n mask: gradient ? `url(#${fadeId})` : undefined,\n }),\n ),\n ),\n )\n\n const shape = markerShape(options)\n const keys = labels.map(labelKey)\n /** Clip paths that cut the lines with `dashFrom` in two. */\n const cuts: VNode[] = []\n const lines = options.data.series.map((s, index) => {\n if (!visible(s)) return null\n const pts = drawn(index)\n const valid = pts.filter((p): p is readonly [number, number] => p != null)\n const dots = points === 'all' ? valid : points === 'last' ? valid.slice(-1) : []\n const d = linePath(pts, { curve })\n // The same path twice, each clipped to its side of the label: the curve stays whole.\n const from = s.dashFrom == null ? -1 : keys.indexOf(labelKey(s.dashFrom))\n const cut = from > 0 && from < keys.length - 1\n const { dash = '5 4' } = s\n if (cut) {\n const at = round(x.at(from))\n // Everything on one side of the label, far beyond the plot.\n const side = (part: string, before: boolean) =>\n h(\n 'clipPath',\n { key: `${part}-${seriesKey(s)}`, id: `${ctx.id}-${part}-${index}` },\n h('rect', { x: before ? at - 1e5 : at, y: -1e5, width: 1e5, height: 2e5 }),\n )\n const forward = x.at(0) <= at\n cuts.push(side('solid', forward), side('dashed', !forward))\n }\n return h(\n 'g',\n seriesAttrs(cut ? { ...s, dash: undefined } : s, index),\n h('path', {\n key: 'line',\n class: 'tc-line',\n d,\n 'clip-path': cut ? `url(#${ctx.id}-solid-${index})` : undefined,\n }),\n cut &&\n h('path', {\n key: 'dashed',\n class: 'tc-line tc-line-dashed',\n d,\n 'clip-path': `url(#${ctx.id}-dashed-${index})`,\n // A map, so values from data cannot inject CSS (see normalizeStyle).\n style: { '--tc-series-dash': Number.isFinite(dash) ? `${dash}px` : dash },\n }),\n dots.length > 0 &&\n h(\n 'g',\n { class: 'tc-points' },\n dots.map(([cx, cy]) =>\n pointMark(shape, index, cx, 'tc-point', round(cx), round(cy), pointRadius),\n ),\n ),\n )\n })\n\n const content = [\n h('defs', { key: 'defs' }, layout.clip.def, gradient && fadeMask(fadeId), cuts),\n layout.background,\n // Layers are keyed: an annotation band or a grid that comes and goes must not\n // shift the series list onto another node (that would recreate every series).\n h('g', { key: 'series', class: 'tc-series-list', 'clip-path': layout.clip.url }, areas, lines),\n layout.foreground,\n // Where each line ends: its last point (the running total in a stack).\n ends?.layer(all, layout.area),\n ]\n return { content, interaction }\n}\n\n/**\n * Line chart: one line per series over category labels.\n *\n * ```ts\n * new Chart('#el', {\n * type: line,\n * data: { labels: ['Jan', 'Feb', 'Mar'], series: [{ name: 'Sales', values: [3, 5, 4] }] },\n * })\n * ```\n */\nexport const line: ChartType<LineOptions> = {\n name: 'line',\n clean: cleanData(cleanSeries),\n prepare: windowed,\n render: (options, ctx) => renderLines(options, ctx, false),\n legend: (options) => seriesLegend(options.data),\n table: (options, ctx, limit) => seriesTable(options, ctx, limit),\n}\n"],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ft as EndLabelOptions, ht as CartesianOptions, o as ChartType } from "./chart-Dz4geQZy.cjs";
|
|
2
2
|
import { t as Curve } from "./path-YeUiOfG8.cjs";
|
|
3
|
-
import { t as StackMode } from "./stack-
|
|
3
|
+
import { t as StackMode } from "./stack-CcmyALx0.cjs";
|
|
4
4
|
interface LineOptions extends CartesianOptions {
|
|
5
5
|
/** Interpolation between points. Defaults to `'monotone'`. */
|
|
6
6
|
curve?: Curve;
|
|
@@ -29,6 +29,13 @@ interface LineOptions extends CartesianOptions {
|
|
|
29
29
|
* navigation still use every value. Off by default.
|
|
30
30
|
*/
|
|
31
31
|
decimate?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Name each line at its end: the series name and its last value beside the
|
|
34
|
+
* last point, past the edge of the plot, moved apart where lines end close
|
|
35
|
+
* together (a thin line then joins a label to its point). Needs
|
|
36
|
+
* `@tabler/charts/end-labels` on the core. Defaults to `false`.
|
|
37
|
+
*/
|
|
38
|
+
endLabels?: boolean | EndLabelOptions;
|
|
32
39
|
}
|
|
33
40
|
/**
|
|
34
41
|
* Line chart: one line per series over category labels.
|
|
@@ -2,9 +2,9 @@ const require_fade = require("./fade-CRqcKMWY.cjs");
|
|
|
2
2
|
const require_features = require("./features-DEDP5CEQ.cjs");
|
|
3
3
|
const require_layout = require("./layout-Cfg9x1k2.cjs");
|
|
4
4
|
const require_vnode = require("./vnode-ClAiw28x.cjs");
|
|
5
|
-
const require_cartesian = require("./cartesian-
|
|
5
|
+
const require_cartesian = require("./cartesian-B9CrasFJ.cjs");
|
|
6
6
|
const require_clean = require("./clean-Die2iCNc.cjs");
|
|
7
|
-
const require_stack = require("./stack-
|
|
7
|
+
const require_stack = require("./stack-DBhmYNat.cjs");
|
|
8
8
|
// src/charts/line.ts
|
|
9
9
|
/** Points in pixels for a series; `null` for missing values. */
|
|
10
10
|
function seriesPoints(series, count, x, y, connectNulls, valid) {
|
|
@@ -30,7 +30,8 @@ function renderLines(options, ctx, fill) {
|
|
|
30
30
|
nullAsZero: true,
|
|
31
31
|
hidden: seconds.length ? /* @__PURE__ */ new Set([...ctx.hidden, ...seconds]) : ctx.hidden
|
|
32
32
|
}) : null;
|
|
33
|
-
const
|
|
33
|
+
const ends = options.endLabels ? require_features.feature("end-labels")(options, ctx, overhang) : null;
|
|
34
|
+
const layout = require_cartesian.cartesianLayout(ends?.options ?? options, ctx, {
|
|
34
35
|
scale: "point",
|
|
35
36
|
zero: filled || stacks !== null,
|
|
36
37
|
zero2: filled,
|
|
@@ -85,26 +86,59 @@ function renderLines(options, ctx, fill) {
|
|
|
85
86
|
mask: gradient ? `url(#${fadeId})` : void 0
|
|
86
87
|
}))));
|
|
87
88
|
const shape = require_cartesian.markerShape(options);
|
|
89
|
+
const keys = labels.map(require_cartesian.labelKey);
|
|
90
|
+
/** Clip paths that cut the lines with `dashFrom` in two. */
|
|
91
|
+
const cuts = [];
|
|
88
92
|
const lines = options.data.series.map((s, index) => {
|
|
89
93
|
if (!visible(s)) return null;
|
|
90
94
|
const pts = drawn(index);
|
|
91
95
|
const valid = pts.filter((p) => p != null);
|
|
92
96
|
const dots = points === "all" ? valid : points === "last" ? valid.slice(-1) : [];
|
|
93
|
-
|
|
97
|
+
const d = require_fade.linePath(pts, { curve });
|
|
98
|
+
const from = s.dashFrom == null ? -1 : keys.indexOf(require_cartesian.labelKey(s.dashFrom));
|
|
99
|
+
const cut = from > 0 && from < keys.length - 1;
|
|
100
|
+
const { dash = "5 4" } = s;
|
|
101
|
+
if (cut) {
|
|
102
|
+
const at = require_layout.round(x.at(from));
|
|
103
|
+
const side = (part, before) => require_vnode.h("clipPath", {
|
|
104
|
+
key: `${part}-${require_cartesian.seriesKey(s)}`,
|
|
105
|
+
id: `${ctx.id}-${part}-${index}`
|
|
106
|
+
}, require_vnode.h("rect", {
|
|
107
|
+
x: before ? at - 1e5 : at,
|
|
108
|
+
y: -1e5,
|
|
109
|
+
width: 1e5,
|
|
110
|
+
height: 2e5
|
|
111
|
+
}));
|
|
112
|
+
const forward = x.at(0) <= at;
|
|
113
|
+
cuts.push(side("solid", forward), side("dashed", !forward));
|
|
114
|
+
}
|
|
115
|
+
return require_vnode.h("g", require_cartesian.seriesAttrs(cut ? {
|
|
116
|
+
...s,
|
|
117
|
+
dash: void 0
|
|
118
|
+
} : s, index), require_vnode.h("path", {
|
|
119
|
+
key: "line",
|
|
94
120
|
class: "tc-line",
|
|
95
|
-
d
|
|
121
|
+
d,
|
|
122
|
+
"clip-path": cut ? `url(#${ctx.id}-solid-${index})` : void 0
|
|
123
|
+
}), cut && require_vnode.h("path", {
|
|
124
|
+
key: "dashed",
|
|
125
|
+
class: "tc-line tc-line-dashed",
|
|
126
|
+
d,
|
|
127
|
+
"clip-path": `url(#${ctx.id}-dashed-${index})`,
|
|
128
|
+
style: { "--tc-series-dash": Number.isFinite(dash) ? `${dash}px` : dash }
|
|
96
129
|
}), dots.length > 0 && require_vnode.h("g", { class: "tc-points" }, dots.map(([cx, cy]) => require_cartesian.pointMark(shape, index, cx, "tc-point", require_layout.round(cx), require_layout.round(cy), pointRadius))));
|
|
97
130
|
});
|
|
98
131
|
return {
|
|
99
132
|
content: [
|
|
100
|
-
require_vnode.h("defs", { key: "defs" }, layout.clip.def, gradient && require_fade.fadeMask(fadeId)),
|
|
133
|
+
require_vnode.h("defs", { key: "defs" }, layout.clip.def, gradient && require_fade.fadeMask(fadeId), cuts),
|
|
101
134
|
layout.background,
|
|
102
135
|
require_vnode.h("g", {
|
|
103
136
|
key: "series",
|
|
104
137
|
class: "tc-series-list",
|
|
105
138
|
"clip-path": layout.clip.url
|
|
106
139
|
}, areas, lines),
|
|
107
|
-
layout.foreground
|
|
140
|
+
layout.foreground,
|
|
141
|
+
ends?.layer(all, layout.area)
|
|
108
142
|
],
|
|
109
143
|
interaction
|
|
110
144
|
};
|
|
@@ -122,6 +156,7 @@ function renderLines(options, ctx, fill) {
|
|
|
122
156
|
const line = {
|
|
123
157
|
name: "line",
|
|
124
158
|
clean: require_clean.cleanData(require_clean.cleanSeries),
|
|
159
|
+
prepare: require_cartesian.windowed,
|
|
125
160
|
render: (options, ctx) => renderLines(options, ctx, false),
|
|
126
161
|
legend: (options) => require_cartesian.seriesLegend(options.data),
|
|
127
162
|
table: (options, ctx, limit) => require_cartesian.seriesTable(options, ctx, limit)
|
|
@@ -139,4 +174,4 @@ Object.defineProperty(exports, "renderLines", {
|
|
|
139
174
|
}
|
|
140
175
|
});
|
|
141
176
|
|
|
142
|
-
//# sourceMappingURL=line-
|
|
177
|
+
//# sourceMappingURL=line-DHbYCQy4.cjs.map
|