@tabler/charts 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +165 -17
- package/dist/{annotations-DdRdeBUB.cjs → annotations--m-HzMBM.cjs} +87 -11
- 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-D0YQ0IoA.js → annotations-DGITy6th.js} +87 -11
- package/dist/annotations-DGITy6th.js.map +1 -0
- package/dist/annotations.cjs +2 -2
- package/dist/annotations.d.cts +1 -1
- package/dist/annotations.d.ts +1 -1
- package/dist/annotations.js +2 -2
- package/dist/{area-0-L1bG9B.js → area-BN0uE9R0.js} +4 -3
- package/dist/area-BN0uE9R0.js.map +1 -0
- package/dist/{area-CJX9219z.d.cts → area-D6LNLk3r.d.cts} +2 -2
- package/dist/{area-d11XePuw.d.ts → area-DEFL-Yun.d.ts} +2 -2
- package/dist/{area-4eRs3c0K.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-BzBkkC5X.cjs +305 -0
- package/dist/axis-BzBkkC5X.cjs.map +1 -0
- package/dist/axis-C5obgdJt.js +240 -0
- package/dist/axis-C5obgdJt.js.map +1 -0
- package/dist/{bar-Da6dE_nI.cjs → bar-BrmfXugT.cjs} +77 -58
- package/dist/bar-BrmfXugT.cjs.map +1 -0
- package/dist/{bar-XwzM6Pb0.d.ts → bar-Bs_rPqgR.d.ts} +1 -1
- package/dist/{bar-BDLR4p9c.d.cts → bar-CEt8YRxf.d.cts} +2 -2
- package/dist/{bar-B5n2oq9-.js → bar-CgpC2EpX.js} +2 -2
- package/dist/{bar-B5n2oq9-.js.map → bar-CgpC2EpX.js.map} +1 -1
- package/dist/{bar-BNZ3GhIw.js → bar-D_KKd2fL.js} +75 -56
- package/dist/bar-D_KKd2fL.js.map +1 -0
- package/dist/{bar-LYIF8MEz.cjs → bar-wVykm1us.cjs} +2 -2
- package/dist/{bar-LYIF8MEz.cjs.map → bar-wVykm1us.cjs.map} +1 -1
- 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-B7843sQu.d.cts +106 -0
- package/dist/calendar-BG_q_NC_.cjs +507 -0
- package/dist/calendar-BG_q_NC_.cjs.map +1 -0
- package/dist/calendar-CF3gfDQk.js +502 -0
- package/dist/calendar-CF3gfDQk.js.map +1 -0
- package/dist/calendar-D10_ki1S.d.ts +106 -0
- package/dist/calendar.cjs +3 -0
- package/dist/calendar.d.cts +3 -0
- package/dist/calendar.d.ts +3 -0
- package/dist/calendar.js +1 -0
- package/dist/{candlestick-BHQkQfxH.js → candlestick-B1onjo1o.js} +17 -14
- package/dist/candlestick-B1onjo1o.js.map +1 -0
- package/dist/{candlestick-Dq7qp-F0.d.cts → candlestick-B7YXUVVh.d.cts} +4 -3
- package/dist/{candlestick-CYCQXgky.cjs → candlestick-BwrFKak_.cjs} +17 -14
- package/dist/candlestick-BwrFKak_.cjs.map +1 -0
- package/dist/{candlestick-D0xKkdqd.d.ts → candlestick-XpqJvarq.d.ts} +4 -3
- package/dist/candlestick.cjs +3 -3
- package/dist/candlestick.d.cts +1 -1
- package/dist/candlestick.d.ts +1 -1
- package/dist/candlestick.js +3 -3
- package/dist/{cartesian-DV02PsBe.cjs → cartesian-B9CrasFJ.cjs} +190 -310
- package/dist/cartesian-B9CrasFJ.cjs.map +1 -0
- package/dist/{cartesian-CI2x6N7N.js → cartesian-COglz544.js} +161 -251
- package/dist/cartesian-COglz544.js.map +1 -0
- package/dist/{chart-DWn9v6qw.js → chart-B97FBRCd.js} +114 -72
- package/dist/chart-B97FBRCd.js.map +1 -0
- package/dist/{chart-QilhWP8Z.d.ts → chart-CE9EVbfV.d.ts} +427 -112
- package/dist/{chart-kqFMEwDo.d.cts → chart-Dz4geQZy.d.cts} +427 -112
- package/dist/{chart-e2VqomCI.cjs → chart-GUmmjJ7S.cjs} +132 -78
- package/dist/chart-GUmmjJ7S.cjs.map +1 -0
- package/dist/{core-BKRQvPAT.js → core-7fgM3su0.js} +188 -73
- package/dist/core-7fgM3su0.js.map +1 -0
- package/dist/{core-DRUCk67j.d.ts → core-BUQzLsRJ.d.ts} +26 -10
- package/dist/{core-DIOC61up.cjs → core-BZTrsPxc.cjs} +200 -73
- package/dist/core-BZTrsPxc.cjs.map +1 -0
- package/dist/{core-PAX5ogLk.d.cts → core-Ck5uHcW8.d.cts} +45 -24
- package/dist/core.cjs +45 -31
- package/dist/core.d.cts +23 -18
- package/dist/core.d.ts +23 -18
- package/dist/core.js +28 -23
- package/dist/{dates-DurEr9WT.cjs → dates-0YNY49KQ.cjs} +2 -2
- package/dist/{dates-DurEr9WT.cjs.map → dates-0YNY49KQ.cjs.map} +1 -1
- package/dist/{dates-C2RzY3rE.js → dates-CKDRgpin.js} +2 -2
- package/dist/{dates-C2RzY3rE.js.map → dates-CKDRgpin.js.map} +1 -1
- package/dist/decimate.cjs +1 -1
- package/dist/decimate.js +1 -1
- package/dist/{dom-D_g13XWY.cjs → dom-C33zvtPo.cjs} +3 -7
- package/dist/dom-C33zvtPo.cjs.map +1 -0
- package/dist/{dom-CuceR8gt.js → dom-CTse6Rvd.js} +3 -7
- package/dist/dom-CTse6Rvd.js.map +1 -0
- 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-83UYH48t.js → export-chart-BOH_nfcH.js} +92 -15
- package/dist/export-chart-BOH_nfcH.js.map +1 -0
- package/dist/{export-chart-mYgEfK-L.cjs → export-chart-Be4T9J3m.cjs} +97 -14
- package/dist/export-chart-Be4T9J3m.cjs.map +1 -0
- package/dist/export.cjs +5 -3
- 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 +5 -4
- package/dist/export.js.map +1 -1
- package/dist/{fade-GGxcBdss.js → fade-CDrQjnDz.js} +56 -78
- package/dist/fade-CDrQjnDz.js.map +1 -0
- package/dist/{fade-DVTkhrFU.cjs → fade-CRqcKMWY.cjs} +56 -78
- package/dist/fade-CRqcKMWY.cjs.map +1 -0
- package/dist/{features-BMxkqCyS.js → features-B55rwpQC.js} +4 -2
- package/dist/features-B55rwpQC.js.map +1 -0
- package/dist/{features-DCXEvoya.cjs → features-DEDP5CEQ.cjs} +9 -1
- package/dist/features-DEDP5CEQ.cjs.map +1 -0
- package/dist/fit-BPyPRnsK.js +16 -0
- package/dist/fit-BPyPRnsK.js.map +1 -0
- package/dist/fit-D4MIIQQz.cjs +21 -0
- package/dist/fit-D4MIIQQz.cjs.map +1 -0
- package/dist/funnel-B9ridzNx.d.cts +50 -0
- package/dist/funnel-CFEEulw_.cjs +244 -0
- package/dist/funnel-CFEEulw_.cjs.map +1 -0
- package/dist/funnel-CYCv8cq2.js +239 -0
- package/dist/funnel-CYCv8cq2.js.map +1 -0
- package/dist/funnel-FogM8flk.d.ts +50 -0
- package/dist/funnel.cjs +3 -0
- package/dist/funnel.d.cts +3 -0
- package/dist/funnel.d.ts +3 -0
- package/dist/funnel.js +1 -0
- package/dist/{gauge-DXkjXNCD.cjs → gauge-6HfDcLMJ.cjs} +28 -28
- package/dist/gauge-6HfDcLMJ.cjs.map +1 -0
- package/dist/{gauge-BSist7My.d.cts → gauge-BScJ7U6O.d.cts} +2 -2
- package/dist/{gauge-0VJuAHWF.d.ts → gauge-D78oq1Lx.d.ts} +2 -2
- package/dist/{gauge-ts0kqN1-.js → gauge-DiTk5aWO.js} +28 -28
- package/dist/gauge-DiTk5aWO.js.map +1 -0
- package/dist/gauge.cjs +1 -1
- package/dist/gauge.d.cts +1 -1
- package/dist/gauge.d.ts +1 -1
- package/dist/gauge.js +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-CXhlrLTl.cjs → heatmap-Dyzrd4Fd.cjs} +39 -37
- package/dist/heatmap-Dyzrd4Fd.cjs.map +1 -0
- package/dist/{heatmap-19BGJTKF.js → heatmap-J7fxG7MM.js} +35 -33
- package/dist/heatmap-J7fxG7MM.js.map +1 -0
- package/dist/{heatmap-Dp_oyEe0.d.cts → heatmap-Jvwo7iFW.d.cts} +2 -2
- package/dist/{heatmap-59lmClj9.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/{hydrate-OA6R2_Pn.js → hydrate-BB3MlR36.js} +2 -2
- package/dist/{hydrate-OA6R2_Pn.js.map → hydrate-BB3MlR36.js.map} +1 -1
- package/dist/{hydrate-CmN1k8Mo.cjs → hydrate-m0I5m6ue.cjs} +2 -2
- package/dist/{hydrate-CmN1k8Mo.cjs.map → hydrate-m0I5m6ue.cjs.map} +1 -1
- package/dist/hydrate.cjs +2 -2
- package/dist/hydrate.js +2 -2
- package/dist/index.cjs +69 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -19
- package/dist/index.d.ts +24 -19
- package/dist/index.js +51 -37
- package/dist/index.js.map +1 -1
- package/dist/interaction-DXYSjgnP.cjs +32 -0
- package/dist/interaction-DXYSjgnP.cjs.map +1 -0
- package/dist/interaction-En1KlwFO.js +21 -0
- package/dist/interaction-En1KlwFO.js.map +1 -0
- package/dist/layout-CYerDebD.d.cts +29 -0
- package/dist/layout-CYerDebD.d.ts +29 -0
- package/dist/{layout-JY2aR-yE.cjs → layout-Cfg9x1k2.cjs} +32 -1
- package/dist/layout-Cfg9x1k2.cjs.map +1 -0
- package/dist/{layout-DmrrLjwN.js → layout-DqAte3H8.js} +27 -2
- package/dist/layout-DqAte3H8.js.map +1 -0
- package/dist/{line-DO66LtwH.js → line-CXH0L10d.js} +84 -37
- package/dist/line-CXH0L10d.js.map +1 -0
- package/dist/{line-_rNdeKmS.d.cts → line-Cu9ctpbv.d.cts} +9 -3
- package/dist/{line-Dbt6KFRK.cjs → line-DHbYCQy4.cjs} +84 -37
- package/dist/line-DHbYCQy4.cjs.map +1 -0
- package/dist/{line-DtSh7HQU.d.ts → line-TkzA7wMK.d.ts} +8 -1
- package/dist/line.cjs +3 -3
- package/dist/line.d.cts +1 -1
- package/dist/line.d.ts +1 -1
- package/dist/line.js +3 -3
- package/dist/log.cjs +1 -1
- package/dist/log.js +1 -1
- package/dist/map-BirylCmT.d.cts +156 -0
- package/dist/map-CYp6x-uS.js +784 -0
- package/dist/map-CYp6x-uS.js.map +1 -0
- package/dist/map-ChwSgooH.cjs +795 -0
- package/dist/map-ChwSgooH.cjs.map +1 -0
- package/dist/map-DNqog2Xs.d.ts +156 -0
- package/dist/map.cjs +4 -0
- package/dist/map.d.cts +3 -0
- package/dist/map.d.ts +3 -0
- package/dist/map.js +1 -0
- package/dist/maps/world.cjs +875 -0
- package/dist/maps/world.cjs.map +1 -0
- package/dist/maps/world.d.cts +2 -0
- package/dist/maps/world.d.ts +2 -0
- package/dist/maps/world.js +874 -0
- package/dist/maps/world.js.map +1 -0
- package/dist/{morph-9_LJL0ra.cjs → morph-3I1Nf_tR.cjs} +2 -2
- package/dist/{morph-9_LJL0ra.cjs.map → morph-3I1Nf_tR.cjs.map} +1 -1
- package/dist/{morph-DnRxuwR-.js → morph-GfBab-b3.js} +2 -2
- package/dist/{morph-DnRxuwR-.js.map → morph-GfBab-b3.js.map} +1 -1
- package/dist/morph.cjs +2 -2
- package/dist/morph.js +2 -2
- package/dist/others-CuNdpvjd.d.cts +31 -0
- package/dist/{others-J7NCAMA0.js → others-DBIGE6jr.js} +11 -3
- package/dist/others-DBIGE6jr.js.map +1 -0
- package/dist/others-DBO4Kjwl.d.ts +29 -0
- package/dist/{others-DWdK7vKp.cjs → others-WfjCsjqT.cjs} +14 -6
- package/dist/others-WfjCsjqT.cjs.map +1 -0
- package/dist/{parliament-Cru4IcuM.js → parliament-BKN6ikBJ.js} +30 -29
- package/dist/parliament-BKN6ikBJ.js.map +1 -0
- package/dist/{parliament-CLCI7tUO.d.ts → parliament-CHdf13XU.d.ts} +2 -2
- package/dist/{parliament-CgsVnWEe.d.cts → parliament-CsYgh4N2.d.cts} +2 -2
- package/dist/{parliament-x5hcFaQ3.cjs → parliament-DhxAaIZ3.cjs} +30 -29
- package/dist/parliament-DhxAaIZ3.cjs.map +1 -0
- package/dist/parliament.cjs +1 -1
- package/dist/parliament.d.cts +1 -1
- package/dist/parliament.d.ts +1 -1
- package/dist/parliament.js +1 -1
- package/dist/{patterns-D3-wQagb.cjs → patterns-BPN1c9qe.cjs} +2 -2
- package/dist/{patterns-D3-wQagb.cjs.map → patterns-BPN1c9qe.cjs.map} +1 -1
- package/dist/{patterns-CufKZYhm.js → patterns-CVrLrJXg.js} +2 -2
- package/dist/{patterns-CufKZYhm.js.map → patterns-CVrLrJXg.js.map} +1 -1
- package/dist/patterns.cjs +2 -2
- package/dist/patterns.d.cts +1 -1
- package/dist/patterns.d.ts +1 -1
- package/dist/patterns.js +2 -2
- package/dist/{percentage-bar-ybNS3goo.cjs → percentage-bar-BChkTRoz.cjs} +37 -35
- package/dist/percentage-bar-BChkTRoz.cjs.map +1 -0
- package/dist/{percentage-bar-nhTeakD_.d.ts → percentage-bar-CSAbzDOn.d.ts} +11 -15
- package/dist/{percentage-bar-B6tNOqNn.js → percentage-bar-CaInxrL8.js} +37 -35
- package/dist/percentage-bar-CaInxrL8.js.map +1 -0
- package/dist/{percentage-bar-tepMr7Hd.d.cts → percentage-bar-UZHCRvlK.d.cts} +11 -15
- package/dist/percentage-bar.cjs +1 -1
- package/dist/percentage-bar.d.cts +1 -1
- package/dist/percentage-bar.d.ts +1 -1
- package/dist/percentage-bar.js +1 -1
- package/dist/{pie-BXg2gNpb.d.cts → pie-AFedsDcF.d.cts} +17 -14
- package/dist/{pie-CVsc-6qD.js → pie-Ch6Bx0ih.js} +68 -52
- package/dist/pie-Ch6Bx0ih.js.map +1 -0
- package/dist/{pie-BpjvSPnz.cjs → pie-Cll1OrVZ.cjs} +68 -52
- package/dist/pie-Cll1OrVZ.cjs.map +1 -0
- package/dist/{pie-CFptILSm.d.ts → pie-Cn2H3pz8.d.ts} +17 -14
- 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--_gmdTyK.cjs → point-shapes-BRawRM78.cjs} +23 -22
- package/dist/point-shapes-BRawRM78.cjs.map +1 -0
- package/dist/{point-shapes-DD2Ektzm.js → point-shapes-DI6GhcI7.js} +18 -23
- package/dist/point-shapes-DI6GhcI7.js.map +1 -0
- package/dist/point-shapes.cjs +6 -4
- package/dist/point-shapes.cjs.map +1 -1
- package/dist/point-shapes.d.cts +2 -2
- package/dist/point-shapes.d.ts +2 -2
- package/dist/point-shapes.js +7 -5
- package/dist/point-shapes.js.map +1 -1
- package/dist/{radar-BR-mumDd.js → radar-Bg-IiIWB.js} +21 -22
- package/dist/radar-Bg-IiIWB.js.map +1 -0
- package/dist/{radar-BC9Skgpj.d.ts → radar-DEer2jjd.d.ts} +2 -2
- package/dist/{radar-D1-lItDy.d.cts → radar-DxmjXhMc.d.cts} +2 -2
- package/dist/{radar-HPDrIdzc.cjs → radar-wDyX17S3.cjs} +22 -23
- package/dist/radar-wDyX17S3.cjs.map +1 -0
- 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/{rect-DSVmUZrD.js → rect-CZTNvMlf.js} +2 -2
- package/dist/{rect-DSVmUZrD.js.map → rect-CZTNvMlf.js.map} +1 -1
- package/dist/{rect-D6VhynBM.cjs → rect-DPr9QRxl.cjs} +2 -2
- package/dist/{rect-D6VhynBM.cjs.map → rect-DPr9QRxl.cjs.map} +1 -1
- package/dist/{sankey-fCoo1cpz.cjs → sankey-0CSp_Er9.cjs} +72 -71
- package/dist/sankey-0CSp_Er9.cjs.map +1 -0
- package/dist/{sankey-Dk7jUt8x.d.cts → sankey-D-8ATwBT.d.cts} +2 -2
- package/dist/{sankey-D6JeZfK5.js → sankey-Dp4CuLVe.js} +72 -71
- package/dist/sankey-Dp4CuLVe.js.map +1 -0
- package/dist/{sankey-D_v7KxnJ.d.ts → sankey-DpYJsOI4.d.ts} +2 -2
- package/dist/sankey.cjs +1 -1
- package/dist/sankey.d.cts +1 -1
- package/dist/sankey.d.ts +1 -1
- package/dist/sankey.js +1 -1
- package/dist/{scatter-C0TWjFpW.js → scatter-0Z7K_YUz.js} +94 -46
- package/dist/scatter-0Z7K_YUz.js.map +1 -0
- package/dist/{scatter-CXEsioOJ.d.ts → scatter-BAL5K9_4.d.ts} +28 -9
- package/dist/{scatter-DZeEIfyo.d.cts → scatter-BUGbnRzM.d.cts} +28 -9
- package/dist/{scatter-DVqB_fP9.cjs → scatter-CZ8do3Up.cjs} +95 -47
- 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-cbvRkWqS.d.ts → sparkline-CtoBJe-a.d.ts} +2 -2
- package/dist/{sparkline-B39NA0Mi.cjs → sparkline-DjR-V6BI.cjs} +13 -15
- package/dist/sparkline-DjR-V6BI.cjs.map +1 -0
- package/dist/{sparkline-DAP6jtzw.d.cts → sparkline-DwHJfeZz.d.cts} +2 -2
- package/dist/{sparkline-XO_TqCNP.js → sparkline-_dxwtdli.js} +13 -15
- package/dist/sparkline-_dxwtdli.js.map +1 -0
- 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-Dagxq7l2.d.cts → stack-CcmyALx0.d.cts} +1 -1
- package/dist/{stack-2H2Gfs1Q.js → stack-CyVlS7Fr.js} +2 -2
- package/dist/{stack-2H2Gfs1Q.js.map → stack-CyVlS7Fr.js.map} +1 -1
- package/dist/{stack-BgPzoQmv.cjs → stack-DBhmYNat.cjs} +2 -2
- package/dist/{stack-BgPzoQmv.cjs.map → stack-DBhmYNat.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{time-axis-BjZ1bYTK.cjs → time-axis-CVKjQKSS.cjs} +4 -3
- package/dist/{time-axis-BjZ1bYTK.cjs.map → time-axis-CVKjQKSS.cjs.map} +1 -1
- package/dist/{time-axis-FLONo54E.js → time-axis-CkmbAw4Z.js} +3 -2
- package/dist/{time-axis-FLONo54E.js.map → time-axis-CkmbAw4Z.js.map} +1 -1
- package/dist/time.cjs +3 -3
- package/dist/time.js +3 -3
- package/dist/{treemap-BAkhmVQc.d.cts → treemap-C2maqerU.d.cts} +37 -5
- package/dist/{treemap-BNpxFBao.d.ts → treemap-D_zbubo3.d.ts} +37 -5
- package/dist/{treemap-BWpEUlDh.cjs → treemap-PulGXZv0.cjs} +58 -33
- package/dist/treemap-PulGXZv0.cjs.map +1 -0
- package/dist/{treemap-CQdavQ9u.js → treemap-lbYxb-7h.js} +57 -32
- 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-BBuSi4i0.js → value-labels-B0VeheyE.js} +29 -8
- package/dist/value-labels-B0VeheyE.js.map +1 -0
- package/dist/{value-labels-BV9keAuL.cjs → value-labels-Dcyk3GIY.cjs} +29 -8
- package/dist/value-labels-Dcyk3GIY.cjs.map +1 -0
- package/dist/value-labels.cjs +2 -2
- package/dist/value-labels.d.cts +1 -1
- package/dist/value-labels.d.ts +1 -1
- package/dist/value-labels.js +2 -2
- 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 +120 -235
- package/dist/annotations-D0YQ0IoA.js.map +0 -1
- package/dist/annotations-DdRdeBUB.cjs.map +0 -1
- package/dist/area-0-L1bG9B.js.map +0 -1
- package/dist/area-4eRs3c0K.cjs.map +0 -1
- package/dist/bar-BNZ3GhIw.js.map +0 -1
- package/dist/bar-Da6dE_nI.cjs.map +0 -1
- package/dist/candlestick-BHQkQfxH.js.map +0 -1
- package/dist/candlestick-CYCQXgky.cjs.map +0 -1
- package/dist/cartesian-CI2x6N7N.js.map +0 -1
- package/dist/cartesian-DV02PsBe.cjs.map +0 -1
- package/dist/chart-DWn9v6qw.js.map +0 -1
- package/dist/chart-e2VqomCI.cjs.map +0 -1
- package/dist/core-BKRQvPAT.js.map +0 -1
- package/dist/core-DIOC61up.cjs.map +0 -1
- package/dist/dom-CuceR8gt.js.map +0 -1
- package/dist/dom-D_g13XWY.cjs.map +0 -1
- package/dist/export-chart-83UYH48t.js.map +0 -1
- package/dist/export-chart-mYgEfK-L.cjs.map +0 -1
- package/dist/fade-DVTkhrFU.cjs.map +0 -1
- package/dist/fade-GGxcBdss.js.map +0 -1
- package/dist/features-BMxkqCyS.js.map +0 -1
- package/dist/features-DCXEvoya.cjs.map +0 -1
- package/dist/gauge-DXkjXNCD.cjs.map +0 -1
- package/dist/gauge-ts0kqN1-.js.map +0 -1
- package/dist/heatmap-19BGJTKF.js.map +0 -1
- package/dist/heatmap-CXhlrLTl.cjs.map +0 -1
- package/dist/layout-DmrrLjwN.js.map +0 -1
- package/dist/layout-JY2aR-yE.cjs.map +0 -1
- package/dist/line-DO66LtwH.js.map +0 -1
- package/dist/line-Dbt6KFRK.cjs.map +0 -1
- package/dist/others-DWdK7vKp.cjs.map +0 -1
- package/dist/others-J7NCAMA0.js.map +0 -1
- package/dist/parliament-Cru4IcuM.js.map +0 -1
- package/dist/parliament-x5hcFaQ3.cjs.map +0 -1
- package/dist/percentage-bar-B6tNOqNn.js.map +0 -1
- package/dist/percentage-bar-ybNS3goo.cjs.map +0 -1
- package/dist/pie-BpjvSPnz.cjs.map +0 -1
- package/dist/pie-CVsc-6qD.js.map +0 -1
- package/dist/point-shapes--_gmdTyK.cjs.map +0 -1
- package/dist/point-shapes-DD2Ektzm.js.map +0 -1
- package/dist/radar-BR-mumDd.js.map +0 -1
- package/dist/radar-HPDrIdzc.cjs.map +0 -1
- package/dist/sankey-D6JeZfK5.js.map +0 -1
- package/dist/sankey-fCoo1cpz.cjs.map +0 -1
- package/dist/scatter-C0TWjFpW.js.map +0 -1
- package/dist/scatter-DVqB_fP9.cjs.map +0 -1
- package/dist/sparkline-B39NA0Mi.cjs.map +0 -1
- package/dist/sparkline-XO_TqCNP.js.map +0 -1
- package/dist/treemap-BWpEUlDh.cjs.map +0 -1
- package/dist/treemap-CQdavQ9u.js.map +0 -1
- package/dist/value-labels-BBuSi4i0.js.map +0 -1
- package/dist/value-labels-BV9keAuL.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-DqAte3H8.js","names":[],"sources":["../src/layout.ts"],"sourcesContent":["/** Axis-aligned rectangle in pixels. */\nexport interface Rect {\n x: number\n y: number\n width: number\n height: number\n}\n\n/** Space around a box, in pixels. */\nexport interface Insets {\n top: number\n right: number\n bottom: number\n left: number\n}\n\n/** Insets given as one number for all sides or per side. */\nexport type InsetsInput = number | Partial<Insets>\n\n/** Normalize an {@link InsetsInput}; missing sides fall back to `fallback`. */\nexport function insets(value: InsetsInput | undefined, fallback = 0): Insets {\n // A side that is not a finite number (left out, or junk from outside) takes the fallback.\n const side = (key: keyof Insets): number => {\n const v = typeof value === 'number' ? value : value?.[key]\n return Number.isFinite(v) ? (v as number) : fallback\n }\n return { top: side('top'), right: side('right'), bottom: side('bottom'), left: side('left') }\n}\n\n/** Swap the left and right of `sides` in a right-to-left chart. */\nexport const mirrorSides = <T extends { left: number; right: number }>(\n sides: T,\n rtl: boolean | undefined,\n): T => (rtl ? { ...sides, left: sides.right, right: sides.left } : sides)\n\n/** Rectangle left inside `width × height` after `margins`; never negative. */\nexport function innerRect(width: number, height: number, margins: Insets): Rect {\n return {\n x: margins.left,\n y: margins.top,\n width: Math.max(0, width - margins.left - margins.right),\n height: Math.max(0, height - margins.top - margins.bottom),\n }\n}\n\n/**\n * Space around a box by reading direction: `start` is the side the chart is\n * read from (the left, or the right in a right-to-left chart), `end` the other.\n */\nexport interface FrameInsets {\n top: number\n bottom: number\n start: number\n end: number\n}\n\n/** A plot area placed for the chart's reading direction. */\nexport interface PlotFrame {\n /** Where the data is drawn. */\n area: Rect\n /** The start side, where the axis beside the plot sits. */\n side: 'left' | 'right'\n /** The plot's horizontal range, from the end side when `reverse` (by default in a right-to-left chart). */\n range(reverse?: boolean): [number, number]\n}\n\n/**\n * Place the plot area of a chart with axes. `margins` gets the padding by\n * reading direction and returns the space each side needs, so a chart type\n * works its margins out once, whichever way the chart is read.\n */\nexport function plotFrame(\n size: { width: number; height: number; rtl?: boolean },\n padding: InsetsInput | undefined,\n margins: (padding: FrameInsets) => FrameInsets,\n): PlotFrame {\n const { width, height, rtl } = size\n const pad = insets(padding)\n const m = margins({\n ...pad,\n start: rtl ? pad.right : pad.left,\n end: rtl ? pad.left : pad.right,\n })\n const area = innerRect(width, height, {\n ...m,\n left: rtl ? m.end : m.start,\n right: rtl ? m.start : m.end,\n })\n const end = area.x + area.width\n return {\n area,\n side: rtl ? 'right' : 'left',\n range: (reverse = rtl) => (reverse ? [end, area.x] : [area.x, end]),\n }\n}\n\n// Approximate advance widths in em for common UI sans-serif fonts\n// (system-ui / SF, Segoe UI, Roboto), measured in the browser.\nconst THIN = \" !'.,:;|ijlI`\"\nconst NARROW = '()[]{}-/frt'\nconst ROUND = 'CDGHNOQU'\nconst WIDE = '%@MWmw'\n\n/**\n * Full-width characters, a whole em each: Hangul, CJK and kana, compatibility\n * ideographs, fullwidth forms and pictographs (emoji).\n */\nconst isWide = (code: number): boolean =>\n code >= 0x1100 &&\n (code <= 0x115f ||\n (code >= 0x2e80 && code <= 0xa4cf) ||\n (code >= 0xac00 && code <= 0xd7a3) ||\n (code >= 0xf900 && code <= 0xfaff) ||\n (code >= 0xff00 && code <= 0xff60) ||\n code >= 0x1f300)\n\n/** The width of an ASCII character, in em. */\nfunction charWidth(char: string): number {\n if (char >= '0' && char <= '9') return char === '1' ? 0.45 : 0.63\n if (THIN.includes(char)) return 0.27\n if (NARROW.includes(char)) return 0.38\n if (WIDE.includes(char)) return 0.88\n if (ROUND.includes(char)) return 0.76\n if (char >= 'A' && char <= 'Z') return 0.66\n return 0.57\n}\n\n/**\n * Estimate the rendered width of `text` without a DOM, for layout on the\n * server and in workers. Tuned for common UI sans-serif fonts; deterministic,\n * so SSR and client layouts agree.\n */\nexport function estimateTextWidth(text: string, fontSize: number): number {\n let em = 0\n for (let i = 0; i < text.length; i++) {\n const point = text.codePointAt(i) as number\n // Beyond ASCII a character is a whole em or an average one; a pair of surrogates is one.\n em += ASCII[point] ?? (isWide(point) ? 1 : 0.57)\n if (point > 0xffff) i++\n }\n return em * fontSize\n}\n\n/**\n * The width of every ASCII character, looked up instead of worked out: an\n * axis of 100,000 long labels estimates millions of characters per render.\n */\nconst ASCII = /* @__PURE__ */ Array.from({ length: 128 }, (_, code) =>\n charWidth(String.fromCharCode(code)),\n)\n\n/** A pixel value rounded to two decimals, as written into attributes and path data. */\nexport const round = (value: number): number => Math.round(value * 100) / 100\n\n/** Line height used for single-line labels, relative to the font size. */\nexport const LINE_HEIGHT = 1.25\n"],"mappings":";;AAoBA,SAAgB,OAAO,OAAgC,WAAW,GAAW;CAE3E,MAAM,QAAQ,QAA8B;EAC1C,MAAM,IAAI,OAAO,UAAU,WAAW,QAAQ,QAAQ;EACtD,OAAO,OAAO,SAAS,CAAC,IAAK,IAAe;CAC9C;CACA,OAAO;EAAE,KAAK,KAAK,KAAK;EAAG,OAAO,KAAK,OAAO;EAAG,QAAQ,KAAK,QAAQ;EAAG,MAAM,KAAK,MAAM;CAAE;AAC9F;;AAGA,MAAa,eACX,OACA,QACO,MAAM;CAAE,GAAG;CAAO,MAAM,MAAM;CAAO,OAAO,MAAM;AAAK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;CAChC,IAAI,MAAM,SAAS,IAAI,GAAG,OAAO;CACjC,IAAI,QAAQ,OAAO,QAAQ,KAAK,OAAO;CACvC,OAAO;AACT;;;;;;AAOA,SAAgB,kBAAkB,MAAc,UAA0B;CACxE,IAAI,KAAK;CACT,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,QAAQ,KAAK,YAAY,CAAC;EAEhC,MAAM,MAAM,WAAW,OAAO,KAAK,IAAI,IAAI;EAC3C,IAAI,QAAQ,OAAQ;CACtB;CACA,OAAO,KAAK;AACd;;;;;AAMA,MAAM,QAAwB,sBAAM,KAAK,EAAE,QAAQ,IAAI,IAAI,GAAG,SAC5D,UAAU,OAAO,aAAa,IAAI,CAAC,CACrC;;AAGA,MAAa,SAAS,UAA0B,KAAK,MAAM,QAAQ,GAAG,IAAI;;AAG1E,MAAa,cAAc"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as areaPath, r as linePath, t as fadeMask } from "./fade-
|
|
2
|
-
import { n as feature } from "./features-
|
|
3
|
-
import {
|
|
1
|
+
import { n as areaPath, r as linePath, t as fadeMask } from "./fade-CDrQjnDz.js";
|
|
2
|
+
import { n as feature } from "./features-B55rwpQC.js";
|
|
3
|
+
import { s as round } from "./layout-DqAte3H8.js";
|
|
4
4
|
import { t as h } from "./vnode-_EMUqysL.js";
|
|
5
|
-
import { d as
|
|
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) {
|
|
@@ -23,32 +23,46 @@ function renderLines(options, ctx, fill) {
|
|
|
23
23
|
const overhang = points === "none" ? 2 : pointRadius + 2;
|
|
24
24
|
const { series } = options.data;
|
|
25
25
|
const count = resolveLabels(options.data).length;
|
|
26
|
+
const axisOf = seriesAxes(options);
|
|
27
|
+
const seconds = series.filter((s) => axisOf(s).second).map(seriesKey);
|
|
26
28
|
const stacks = stacked ? stackSeries(series, count, {
|
|
27
29
|
percent: stacked === "percent",
|
|
28
30
|
nullAsZero: true,
|
|
29
|
-
hidden: ctx.hidden
|
|
31
|
+
hidden: seconds.length ? /* @__PURE__ */ new Set([...ctx.hidden, ...seconds]) : ctx.hidden
|
|
30
32
|
}) : null;
|
|
31
|
-
const
|
|
33
|
+
const ends = options.endLabels ? feature("end-labels")(options, ctx, overhang) : null;
|
|
34
|
+
const layout = cartesianLayout(ends?.options ?? options, ctx, {
|
|
32
35
|
scale: "point",
|
|
33
36
|
zero: filled || stacks !== null,
|
|
37
|
+
zero2: filled,
|
|
34
38
|
overhang,
|
|
35
39
|
...stacks ? { values: stackBounds(stacks) } : {},
|
|
36
40
|
...stacked === "percent" ? { tickFormat: { style: "percent" } } : {}
|
|
37
41
|
});
|
|
38
|
-
const { x,
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
42
|
+
const { x, labels } = layout;
|
|
43
|
+
const scaleOf = (index) => seriesScale(layout, series[index]);
|
|
44
|
+
const baselineOf = (index) => {
|
|
45
|
+
const y = scaleOf(index);
|
|
46
|
+
return y(Math.min(Math.max(0, y.domain[0]), y.domain[1]));
|
|
47
|
+
};
|
|
48
|
+
const stackOf = (index) => !axisOf(series[index]).second && stacks?.[index] || null;
|
|
49
|
+
const interaction = categoryInteraction(layout, options, ctx, (seriesIndex, i, v) => {
|
|
50
|
+
const stack = stackOf(seriesIndex);
|
|
51
|
+
return {
|
|
52
|
+
x: x.at(i),
|
|
53
|
+
y: scaleOf(seriesIndex)(stack ? stack[i]?.y1 ?? 0 : v)
|
|
54
|
+
};
|
|
55
|
+
});
|
|
44
56
|
const gradient = filled && fillStyle === "gradient";
|
|
45
57
|
const fadeId = `${ctx.id}-fade`;
|
|
46
58
|
const visible = (s) => !ctx.hidden.has(seriesKey(s));
|
|
47
59
|
const all = series.map((s, index) => {
|
|
48
60
|
if (!visible(s)) return [];
|
|
49
|
-
const
|
|
61
|
+
const y = scaleOf(index);
|
|
62
|
+
const stack = stackOf(index);
|
|
50
63
|
if (stack) return stack.map((seg, i) => seg ? [x.at(i), y(seg.y1)] : null);
|
|
51
|
-
|
|
64
|
+
const axis = axisOf(s).axis;
|
|
65
|
+
return seriesPoints(s, labels.length, (i) => x.at(i), y, connectNulls, (v) => plottable(v, axis));
|
|
52
66
|
});
|
|
53
67
|
/** Indices drawn per series: a downsampled subset when `decimate` is set. */
|
|
54
68
|
const kept = all.map((pts) => decimate !== void 0 && pts.length > decimate ? feature("decimate")(pts, decimate) : null);
|
|
@@ -59,8 +73,9 @@ function renderLines(options, ctx, fill) {
|
|
|
59
73
|
};
|
|
60
74
|
/** Area bottom: zero, or the top of the layer below for stacks (downsampled alike). */
|
|
61
75
|
const bottom = (index) => {
|
|
62
|
-
const stack =
|
|
63
|
-
if (!stack) return
|
|
76
|
+
const stack = stackOf(index);
|
|
77
|
+
if (!stack) return baselineOf(index);
|
|
78
|
+
const y = scaleOf(index);
|
|
64
79
|
const bottoms = stack.map((seg) => seg ? y(seg.y0) : null);
|
|
65
80
|
const keep = kept[index];
|
|
66
81
|
return keep ? keep.map((i) => bottoms[i] ?? null) : bottoms;
|
|
@@ -70,32 +85,63 @@ function renderLines(options, ctx, fill) {
|
|
|
70
85
|
d: areaPath(drawn(index), bottom(index), { curve }),
|
|
71
86
|
mask: gradient ? `url(#${fadeId})` : void 0
|
|
72
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 = [];
|
|
73
92
|
const lines = options.data.series.map((s, index) => {
|
|
74
93
|
if (!visible(s)) return null;
|
|
75
94
|
const pts = drawn(index);
|
|
76
95
|
const valid = pts.filter((p) => p != null);
|
|
77
96
|
const dots = points === "all" ? valid : points === "last" ? valid.slice(-1) : [];
|
|
78
|
-
|
|
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",
|
|
79
120
|
class: "tc-line",
|
|
80
|
-
d
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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 }
|
|
129
|
+
}), dots.length > 0 && h("g", { class: "tc-points" }, dots.map(([cx, cy]) => pointMark(shape, index, cx, "tc-point", round(cx), round(cy), pointRadius))));
|
|
88
130
|
});
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
131
|
+
return {
|
|
132
|
+
content: [
|
|
133
|
+
h("defs", { key: "defs" }, layout.clip.def, gradient && fadeMask(fadeId), cuts),
|
|
134
|
+
layout.background,
|
|
135
|
+
h("g", {
|
|
136
|
+
key: "series",
|
|
137
|
+
class: "tc-series-list",
|
|
138
|
+
"clip-path": layout.clip.url
|
|
139
|
+
}, areas, lines),
|
|
140
|
+
layout.foreground,
|
|
141
|
+
ends?.layer(all, layout.area)
|
|
142
|
+
],
|
|
143
|
+
interaction
|
|
144
|
+
};
|
|
99
145
|
}
|
|
100
146
|
/**
|
|
101
147
|
* Line chart: one line per series over category labels.
|
|
@@ -110,10 +156,11 @@ function renderLines(options, ctx, fill) {
|
|
|
110
156
|
const line = {
|
|
111
157
|
name: "line",
|
|
112
158
|
clean: cleanData(cleanSeries),
|
|
159
|
+
prepare: windowed,
|
|
113
160
|
render: (options, ctx) => renderLines(options, ctx, false),
|
|
114
161
|
legend: (options) => seriesLegend(options.data),
|
|
115
162
|
table: (options, ctx, limit) => seriesTable(options, ctx, limit)
|
|
116
163
|
};
|
|
117
164
|
export { renderLines as n, line as t };
|
|
118
165
|
|
|
119
|
-
//# 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":";;;;;;;;;AAkEA,SAAS,aACP,QACA,OACA,GACA,GACA,cACA,OACS;CACT,MAAM,SAAkB,CAAC;CACzB,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,KAAK;EAC9B,MAAM,IAAI,OAAO,OAAO;EACxB,IAAI,CAAC,MAAM,CAAC,GACN;OAAA,CAAC,cAAc,OAAO,KAAK,IAAI;EAAA,OAEnC,OAAO,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;CAE5B;CACA,OAAO;AACT;;AAGA,SAAgB,YAAY,SAAsB,KAAoB,MAA6B;CACjG,MAAM,EACJ,QAAQ,YACR,SAAS,QACT,cAAc,GACd,eAAe,OACf,MAAM,SAAS,MACf,UAAU,OACV,UAEA,MAAM,YAAY,UAAU,UAAU,eACpC;CACJ,MAAM,WAAW,WAAW,SAAS,IAAI,cAAc;CACvD,MAAM,EAAE,WAAW,QAAQ;CAC3B,MAAM,QAAQ,cAAc,QAAQ,IAAI,CAAC,CAAC;CAC1C,MAAM,SAAS,WAAW,OAAO;CAEjC,MAAM,UAAU,OAAO,QAAQ,MAAM,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,SAAS;CACpE,MAAM,SAAS,UACX,YAAY,QAAQ,OAAO;EACzB,SAAS,YAAY;EACrB,YAAY;EACZ,QAAQ,QAAQ,yBAAS,IAAI,IAAI,CAAC,GAAG,IAAI,QAAQ,GAAG,OAAO,CAAC,IAAI,IAAI;CACtE,CAAC,IACD;CAEJ,MAAM,OAAO,QAAQ,YAAY,QA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AC,GACH,KAAK,SAAS,KACZ,EACE,KACA,EAAE,OAAO,YAAY,GACrB,KAAK,KAAK,CAAC,IAAI,QACb,UAAU,OAAO,OAAO,IAAI,YAAY,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,WAAW,CAC3E,CACF,CACJ;CACF,CAAC;CAYD,OAAO;EAAE,SAAA;GATP,EAAE,QAAQ,EAAE,KAAK,OAAO,GAAG,OAAO,KAAK,KAAK,YAAY,SAAS,MAAM,GAAG,IAAI;GAC9E,OAAO;GAGP,EAAE,KAAK;IAAE,KAAK;IAAU,OAAO;IAAkB,aAAa,OAAO,KAAK;GAAI,GAAG,OAAO,KAAK;GAC7F,OAAO;GAEP,MAAM,MAAM,KAAK,OAAO,IAAI;EAEf;EAAG;CAAY;AAChC;;;;;;;;;;;AAYA,MAAa,OAA+B;CAC1C,MAAM;CACN,OAAO,UAAU,WAAW;CAC5B,SAAS;CACT,SAAS,SAAS,QAAQ,YAAY,SAAS,KAAK,KAAK;CACzD,SAAS,YAAY,aAAa,QAAQ,IAAI;CAC9C,QAAQ,SAAS,KAAK,UAAU,YAAY,SAAS,KAAK,KAAK;AACjE"}
|
|
@@ -1,7 +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 "./
|
|
4
|
-
import { t as StackMode } from "./stack-Dagxq7l2.cjs";
|
|
3
|
+
import { t as StackMode } from "./stack-CcmyALx0.cjs";
|
|
5
4
|
interface LineOptions extends CartesianOptions {
|
|
6
5
|
/** Interpolation between points. Defaults to `'monotone'`. */
|
|
7
6
|
curve?: Curve;
|
|
@@ -30,6 +29,13 @@ interface LineOptions extends CartesianOptions {
|
|
|
30
29
|
* navigation still use every value. Off by default.
|
|
31
30
|
*/
|
|
32
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;
|
|
33
39
|
}
|
|
34
40
|
/**
|
|
35
41
|
* Line chart: one line per series over category labels.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_fade = require("./fade-
|
|
2
|
-
const require_features = require("./features-
|
|
3
|
-
const require_layout = require("./layout-
|
|
1
|
+
const require_fade = require("./fade-CRqcKMWY.cjs");
|
|
2
|
+
const require_features = require("./features-DEDP5CEQ.cjs");
|
|
3
|
+
const require_layout = require("./layout-Cfg9x1k2.cjs");
|
|
4
4
|
const require_vnode = require("./vnode-ClAiw28x.cjs");
|
|
5
|
-
const require_cartesian = require("./cartesian-
|
|
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) {
|
|
@@ -23,32 +23,46 @@ function renderLines(options, ctx, fill) {
|
|
|
23
23
|
const overhang = points === "none" ? 2 : pointRadius + 2;
|
|
24
24
|
const { series } = options.data;
|
|
25
25
|
const count = require_cartesian.resolveLabels(options.data).length;
|
|
26
|
+
const axisOf = require_cartesian.seriesAxes(options);
|
|
27
|
+
const seconds = series.filter((s) => axisOf(s).second).map(require_cartesian.seriesKey);
|
|
26
28
|
const stacks = stacked ? require_stack.stackSeries(series, count, {
|
|
27
29
|
percent: stacked === "percent",
|
|
28
30
|
nullAsZero: true,
|
|
29
|
-
hidden: ctx.hidden
|
|
31
|
+
hidden: seconds.length ? /* @__PURE__ */ new Set([...ctx.hidden, ...seconds]) : ctx.hidden
|
|
30
32
|
}) : null;
|
|
31
|
-
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, {
|
|
32
35
|
scale: "point",
|
|
33
36
|
zero: filled || stacks !== null,
|
|
37
|
+
zero2: filled,
|
|
34
38
|
overhang,
|
|
35
39
|
...stacks ? { values: require_stack.stackBounds(stacks) } : {},
|
|
36
40
|
...stacked === "percent" ? { tickFormat: { style: "percent" } } : {}
|
|
37
41
|
});
|
|
38
|
-
const { x,
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
42
|
+
const { x, labels } = layout;
|
|
43
|
+
const scaleOf = (index) => require_cartesian.seriesScale(layout, series[index]);
|
|
44
|
+
const baselineOf = (index) => {
|
|
45
|
+
const y = scaleOf(index);
|
|
46
|
+
return y(Math.min(Math.max(0, y.domain[0]), y.domain[1]));
|
|
47
|
+
};
|
|
48
|
+
const stackOf = (index) => !axisOf(series[index]).second && stacks?.[index] || null;
|
|
49
|
+
const interaction = require_cartesian.categoryInteraction(layout, options, ctx, (seriesIndex, i, v) => {
|
|
50
|
+
const stack = stackOf(seriesIndex);
|
|
51
|
+
return {
|
|
52
|
+
x: x.at(i),
|
|
53
|
+
y: scaleOf(seriesIndex)(stack ? stack[i]?.y1 ?? 0 : v)
|
|
54
|
+
};
|
|
55
|
+
});
|
|
44
56
|
const gradient = filled && fillStyle === "gradient";
|
|
45
57
|
const fadeId = `${ctx.id}-fade`;
|
|
46
58
|
const visible = (s) => !ctx.hidden.has(require_cartesian.seriesKey(s));
|
|
47
59
|
const all = series.map((s, index) => {
|
|
48
60
|
if (!visible(s)) return [];
|
|
49
|
-
const
|
|
61
|
+
const y = scaleOf(index);
|
|
62
|
+
const stack = stackOf(index);
|
|
50
63
|
if (stack) return stack.map((seg, i) => seg ? [x.at(i), y(seg.y1)] : null);
|
|
51
|
-
|
|
64
|
+
const axis = axisOf(s).axis;
|
|
65
|
+
return seriesPoints(s, labels.length, (i) => x.at(i), y, connectNulls, (v) => require_cartesian.plottable(v, axis));
|
|
52
66
|
});
|
|
53
67
|
/** Indices drawn per series: a downsampled subset when `decimate` is set. */
|
|
54
68
|
const kept = all.map((pts) => decimate !== void 0 && pts.length > decimate ? require_features.feature("decimate")(pts, decimate) : null);
|
|
@@ -59,8 +73,9 @@ function renderLines(options, ctx, fill) {
|
|
|
59
73
|
};
|
|
60
74
|
/** Area bottom: zero, or the top of the layer below for stacks (downsampled alike). */
|
|
61
75
|
const bottom = (index) => {
|
|
62
|
-
const stack =
|
|
63
|
-
if (!stack) return
|
|
76
|
+
const stack = stackOf(index);
|
|
77
|
+
if (!stack) return baselineOf(index);
|
|
78
|
+
const y = scaleOf(index);
|
|
64
79
|
const bottoms = stack.map((seg) => seg ? y(seg.y0) : null);
|
|
65
80
|
const keep = kept[index];
|
|
66
81
|
return keep ? keep.map((i) => bottoms[i] ?? null) : bottoms;
|
|
@@ -70,32 +85,63 @@ function renderLines(options, ctx, fill) {
|
|
|
70
85
|
d: require_fade.areaPath(drawn(index), bottom(index), { curve }),
|
|
71
86
|
mask: gradient ? `url(#${fadeId})` : void 0
|
|
72
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 = [];
|
|
73
92
|
const lines = options.data.series.map((s, index) => {
|
|
74
93
|
if (!visible(s)) return null;
|
|
75
94
|
const pts = drawn(index);
|
|
76
95
|
const valid = pts.filter((p) => p != null);
|
|
77
96
|
const dots = points === "all" ? valid : points === "last" ? valid.slice(-1) : [];
|
|
78
|
-
|
|
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",
|
|
79
120
|
class: "tc-line",
|
|
80
|
-
d
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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 }
|
|
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))));
|
|
88
130
|
});
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
131
|
+
return {
|
|
132
|
+
content: [
|
|
133
|
+
require_vnode.h("defs", { key: "defs" }, layout.clip.def, gradient && require_fade.fadeMask(fadeId), cuts),
|
|
134
|
+
layout.background,
|
|
135
|
+
require_vnode.h("g", {
|
|
136
|
+
key: "series",
|
|
137
|
+
class: "tc-series-list",
|
|
138
|
+
"clip-path": layout.clip.url
|
|
139
|
+
}, areas, lines),
|
|
140
|
+
layout.foreground,
|
|
141
|
+
ends?.layer(all, layout.area)
|
|
142
|
+
],
|
|
143
|
+
interaction
|
|
144
|
+
};
|
|
99
145
|
}
|
|
100
146
|
/**
|
|
101
147
|
* Line chart: one line per series over category labels.
|
|
@@ -110,6 +156,7 @@ function renderLines(options, ctx, fill) {
|
|
|
110
156
|
const line = {
|
|
111
157
|
name: "line",
|
|
112
158
|
clean: require_clean.cleanData(require_clean.cleanSeries),
|
|
159
|
+
prepare: require_cartesian.windowed,
|
|
113
160
|
render: (options, ctx) => renderLines(options, ctx, false),
|
|
114
161
|
legend: (options) => require_cartesian.seriesLegend(options.data),
|
|
115
162
|
table: (options, ctx, limit) => require_cartesian.seriesTable(options, ctx, limit)
|
|
@@ -127,4 +174,4 @@ Object.defineProperty(exports, "renderLines", {
|
|
|
127
174
|
}
|
|
128
175
|
});
|
|
129
176
|
|
|
130
|
-
//# sourceMappingURL=line-
|
|
177
|
+
//# sourceMappingURL=line-DHbYCQy4.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-DHbYCQy4.cjs","names":["resolveLabels","seriesAxes","seriesKey","stackSeries","feature","cartesianLayout","stackBounds","seriesScale","categoryInteraction","plottable","h","seriesAttrs","areaPath","markerShape","labelKey","linePath","round","pointMark","fadeMask","cleanData","cleanSeries","windowed","seriesLegend","seriesTable"],"sources":["../src/charts/line.ts"],"sourcesContent":["import type { ChartType, RenderContext, RenderResult } from '../chart.ts'\nimport { fadeMask } from '../components/fade.ts'\nimport { feature } from '../features.ts'\nimport { round } from '../layout.ts'\nimport { areaPath, type Curve, linePath, type Point } from '../shapes/path.ts'\nimport { h, 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":";;;;;;;;;AAkEA,SAAS,aACP,QACA,OACA,GACA,GACA,cACA,OACS;CACT,MAAM,SAAkB,CAAC;CACzB,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,KAAK;EAC9B,MAAM,IAAI,OAAO,OAAO;EACxB,IAAI,CAAC,MAAM,CAAC,GACN;OAAA,CAAC,cAAc,OAAO,KAAK,IAAI;EAAA,OAEnC,OAAO,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;CAE5B;CACA,OAAO;AACT;;AAGA,SAAgB,YAAY,SAAsB,KAAoB,MAA6B;CACjG,MAAM,EACJ,QAAQ,YACR,SAAS,QACT,cAAc,GACd,eAAe,OACf,MAAM,SAAS,MACf,UAAU,OACV,UAEA,MAAM,YAAY,UAAU,UAAU,eACpC;CACJ,MAAM,WAAW,WAAW,SAAS,IAAI,cAAc;CACvD,MAAM,EAAE,WAAW,QAAQ;CAC3B,MAAM,QAAQA,kBAAAA,cAAc,QAAQ,IAAI,CAAC,CAAC;CAC1C,MAAM,SAASC,kBAAAA,WAAW,OAAO;CAEjC,MAAM,UAAU,OAAO,QAAQ,MAAM,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAIC,kBAAAA,SAAS;CACpE,MAAM,SAAS,UACXC,cAAAA,YAAY,QAAQ,OAAO;EACzB,SAAS,YAAY;EACrB,YAAY;EACZ,QAAQ,QAAQ,yBAAS,IAAI,IAAI,CAAC,GAAG,IAAI,QAAQ,GAAG,OAAO,CAAC,IAAI,IAAI;CACtE,CAAC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8.js";
|
|
3
3
|
import { t as StackMode } from "./stack-DR0eQTsB.js";
|
|
4
4
|
interface LineOptions extends CartesianOptions {
|
|
@@ -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.
|
package/dist/line.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_features = require("./features-
|
|
3
|
-
const require_fade = require("./fade-
|
|
4
|
-
const require_line = require("./line-
|
|
2
|
+
const require_features = require("./features-DEDP5CEQ.cjs");
|
|
3
|
+
const require_fade = require("./fade-CRqcKMWY.cjs");
|
|
4
|
+
const require_line = require("./line-DHbYCQy4.cjs");
|
|
5
5
|
// src/line.ts
|
|
6
6
|
/** Standalone entry: `import { line } from '@tabler/charts/line'`. */
|
|
7
7
|
require_features.register({ line: {
|
package/dist/line.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as line, t as LineOptions } from "./line-
|
|
1
|
+
import { n as line, t as LineOptions } from "./line-Cu9ctpbv.cjs";
|
|
2
2
|
export { type LineOptions, line };
|
package/dist/line.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as line, t as LineOptions } from "./line-
|
|
1
|
+
import { n as line, t as LineOptions } from "./line-TkzA7wMK.js";
|
|
2
2
|
export { type LineOptions, line };
|
package/dist/line.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as register } from "./features-
|
|
2
|
-
import { n as areaPath, r as linePath } from "./fade-
|
|
3
|
-
export { t as line } from "./line-
|
|
1
|
+
import { i as register } from "./features-B55rwpQC.js";
|
|
2
|
+
import { n as areaPath, r as linePath } from "./fade-CDrQjnDz.js";
|
|
3
|
+
export { t as line } from "./line-CXH0L10d.js";
|
|
4
4
|
// src/line.ts
|
|
5
5
|
/** Standalone entry: `import { line } from '@tabler/charts/line'`. */
|
|
6
6
|
register({ line: {
|
package/dist/log.cjs
CHANGED
|
@@ -5,7 +5,7 @@ const require_log_axis = require("./log-axis-DdRNyAq8.cjs");
|
|
|
5
5
|
* Registers logarithmic value axes (`scale: 'log'`):
|
|
6
6
|
* `import '@tabler/charts/log'`. Also exports the scale itself.
|
|
7
7
|
*/
|
|
8
|
-
require("./features-
|
|
8
|
+
require("./features-DEDP5CEQ.cjs").register({ log: {
|
|
9
9
|
scale: require_log_axis.log,
|
|
10
10
|
domain: require_log_axis.logDomain,
|
|
11
11
|
ticks: require_log_axis.logTicks
|
package/dist/log.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as logTicks, r as log, t as logDomain } from "./log-axis-DhthtHFk.js";
|
|
2
|
-
import { i as register } from "./features-
|
|
2
|
+
import { i as register } from "./features-B55rwpQC.js";
|
|
3
3
|
// src/log.ts
|
|
4
4
|
/**
|
|
5
5
|
* Registers logarithmic value axes (`scale: 'log'`):
|