@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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { 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 BarOptions extends CartesianOptions {
|
|
5
5
|
/** Corner radius of the data end of each bar (or stack). Defaults to `4`. */
|
|
6
6
|
radius?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as round$1 } from "./layout-DqAte3H8.js";
|
|
2
2
|
// src/shapes/bar.ts
|
|
3
3
|
/** Rounded for path data, without a `-0`. */
|
|
4
4
|
const round = (value) => {
|
|
@@ -52,4 +52,4 @@ function hbarPath(y, height, baseline, value, radius = 0) {
|
|
|
52
52
|
}
|
|
53
53
|
export { hbarPath as n, barPath as t };
|
|
54
54
|
|
|
55
|
-
//# sourceMappingURL=bar-
|
|
55
|
+
//# sourceMappingURL=bar-CgpC2EpX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar-
|
|
1
|
+
{"version":3,"file":"bar-CgpC2EpX.js","names":["to2"],"sources":["../src/shapes/bar.ts"],"sourcesContent":["import { round as to2 } from '../layout.ts'\n\n/** Rounded for path data, without a `-0`. */\nconst round = (value: number): number => {\n const rounded = to2(value)\n return rounded === 0 ? 0 : rounded\n}\n\n/**\n * Path of a vertical bar from `baseline` to `value` (both y in pixels),\n * `x`…`x + width` wide. Only the data end is rounded, with `radius` clamped\n * to half the width and to the bar height; the baseline end stays square.\n * Works for bars growing up (value above baseline) and down (negative values).\n * Square corners are zero-radius arcs and every side is an `L`, so every\n * bar path, vertical or horizontal, has the same commands and CSS can\n * transition `d` between rounded and square (stacking) and between\n * orientations.\n */\nexport function barPath(\n x: number,\n width: number,\n baseline: number,\n value: number,\n radius = 0,\n): string {\n const w = Math.max(0, width)\n const height = Math.abs(baseline - value)\n const r = Math.max(0, Math.min(radius, w / 2, height))\n const x0 = round(x)\n const x1 = round(x + w)\n const b = round(baseline)\n const v = round(value)\n\n const up = value <= baseline\n const edge = round(up ? value + r : value - r)\n const sweep = up ? 1 : 0\n const rr = round(r)\n return (\n `M${x0},${b}L${x0},${edge}` +\n `A${rr},${rr},0,0,${sweep},${round(x + r)},${v}` +\n `L${round(x + w - r)},${v}` +\n `A${rr},${rr},0,0,${sweep},${x1},${edge}` +\n `L${x1},${b}Z`\n )\n}\n\n/**\n * Path of a horizontal bar from `baseline` to `value` (both x in pixels),\n * `y`…`y + height` tall. Only the data end is rounded, with `radius` clamped\n * to half the height and to the bar length; the baseline end stays square.\n * Works for bars growing right (positive values) and left (negative values).\n * Same commands as `barPath`, so a chart can morph between orientations.\n */\nexport function hbarPath(\n y: number,\n height: number,\n baseline: number,\n value: number,\n radius = 0,\n): string {\n const hgt = Math.max(0, height)\n const length = Math.abs(value - baseline)\n const r = Math.max(0, Math.min(radius, hgt / 2, length))\n const y0 = round(y)\n const y1 = round(y + hgt)\n const b = round(baseline)\n const v = round(value)\n\n const right = value >= baseline\n const edge = round(right ? value - r : value + r)\n const sweep = right ? 1 : 0\n const rr = round(r)\n return (\n `M${b},${y0}L${edge},${y0}` +\n `A${rr},${rr},0,0,${sweep},${v},${round(y + r)}` +\n `L${v},${round(y + hgt - r)}` +\n `A${rr},${rr},0,0,${sweep},${edge},${y1}` +\n `L${b},${y1}Z`\n )\n}\n"],"mappings":";;;AAGA,MAAM,SAAS,UAA0B;CACvC,MAAM,UAAUA,QAAI,KAAK;CACzB,OAAO,YAAY,IAAI,IAAI;AAC7B;;;;;;;;;;;AAYA,SAAgB,QACd,GACA,OACA,UACA,OACA,SAAS,GACD;CACR,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK;CAC3B,MAAM,SAAS,KAAK,IAAI,WAAW,KAAK;CACxC,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,QAAQ,IAAI,GAAG,MAAM,CAAC;CACrD,MAAM,KAAK,MAAM,CAAC;CAClB,MAAM,KAAK,MAAM,IAAI,CAAC;CACtB,MAAM,IAAI,MAAM,QAAQ;CACxB,MAAM,IAAI,MAAM,KAAK;CAErB,MAAM,KAAK,SAAS;CACpB,MAAM,OAAO,MAAM,KAAK,QAAQ,IAAI,QAAQ,CAAC;CAC7C,MAAM,QAAQ,KAAK,IAAI;CACvB,MAAM,KAAK,MAAM,CAAC;CAClB,OACE,IAAI,GAAG,GAAG,EAAE,GAAG,GAAG,GAAG,KAAA,GACjB,GAAG,GAAG,GAAG,OAAO,MAAM,GAAG,MAAM,IAAI,CAAC,EAAE,GAAG,EAAA,GACzC,MAAM,IAAI,IAAI,CAAC,EAAE,GAAG,EAAA,GACpB,GAAG,GAAG,GAAG,OAAO,MAAM,GAAG,GAAG,GAAG,KAAA,GAC/B,GAAG,GAAG,EAAE;AAEhB;;;;;;;;AASA,SAAgB,SACd,GACA,QACA,UACA,OACA,SAAS,GACD;CACR,MAAM,MAAM,KAAK,IAAI,GAAG,MAAM;CAC9B,MAAM,SAAS,KAAK,IAAI,QAAQ,QAAQ;CACxC,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,QAAQ,MAAM,GAAG,MAAM,CAAC;CACvD,MAAM,KAAK,MAAM,CAAC;CAClB,MAAM,KAAK,MAAM,IAAI,GAAG;CACxB,MAAM,IAAI,MAAM,QAAQ;CACxB,MAAM,IAAI,MAAM,KAAK;CAErB,MAAM,QAAQ,SAAS;CACvB,MAAM,OAAO,MAAM,QAAQ,QAAQ,IAAI,QAAQ,CAAC;CAChD,MAAM,QAAQ,QAAQ,IAAI;CAC1B,MAAM,KAAK,MAAM,CAAC;CAClB,OACE,IAAI,EAAE,GAAG,GAAG,GAAG,KAAK,GAAG,GAAA,GACnB,GAAG,GAAG,GAAG,OAAO,MAAM,GAAG,EAAE,GAAG,MAAM,IAAI,CAAC,EAAA,GACzC,EAAE,GAAG,MAAM,IAAI,MAAM,CAAC,EAAA,GACtB,GAAG,GAAG,GAAG,OAAO,MAAM,GAAG,KAAK,GAAG,GAAA,GACjC,EAAE,GAAG,GAAG;AAEhB"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { n as feature } from "./features-
|
|
2
|
-
import { n as hbarPath, t as barPath } from "./bar-
|
|
1
|
+
import { n as feature } from "./features-B55rwpQC.js";
|
|
2
|
+
import { n as hbarPath, t as barPath } from "./bar-CgpC2EpX.js";
|
|
3
3
|
import { t as h } from "./vnode-_EMUqysL.js";
|
|
4
|
-
import {
|
|
4
|
+
import { C as windowed, T as band, _ as seriesTable, a as labelFormatter, b as valueAxis, d as resolveLabels, f as seriesAttrs, g as seriesScale, h as seriesLegend, i as finishLayout, l as plottable, m as seriesKey, n as categoryInteraction, o as labelKey, p as seriesAxes, t as cartesianLayout } from "./cartesian-COglz544.js";
|
|
5
5
|
import { r as cleanSeries, t as cleanData } from "./clean-CkoQobGv.js";
|
|
6
|
-
import { a as
|
|
7
|
-
import { n as
|
|
6
|
+
import { a as bandTicks, i as axisTitleSize, n as axisSize, s as thinTicks } from "./axis-C5obgdJt.js";
|
|
7
|
+
import { n as estimateTextWidth, o as plotFrame } from "./layout-DqAte3H8.js";
|
|
8
|
+
import { n as stackSeries, t as stackBounds } from "./stack-CyVlS7Fr.js";
|
|
8
9
|
// src/charts/horizontal.ts
|
|
9
10
|
/**
|
|
10
11
|
* Cartesian layout with categories along y (labels on the left) and values
|
|
@@ -14,9 +15,8 @@ import { n as stackSeries, t as stackBounds } from "./stack-2H2Gfs1Q.js";
|
|
|
14
15
|
function horizontalLayout(options, ctx, layout) {
|
|
15
16
|
const yOptions = options.y ?? {};
|
|
16
17
|
const xOptions = options.x ?? {};
|
|
17
|
-
const { fontSize, width
|
|
18
|
+
const { fontSize, width } = ctx;
|
|
18
19
|
const overhang = layout.overhang ?? 0;
|
|
19
|
-
const pad = mirrorSides(insets(options.padding), rtl);
|
|
20
20
|
const labels = resolveLabels(options.data);
|
|
21
21
|
const format = labelFormatter(options, ctx);
|
|
22
22
|
const value = valueAxis(options, ctx, layout, Math.round(width / 80));
|
|
@@ -29,23 +29,21 @@ function horizontalLayout(options, ctx, layout) {
|
|
|
29
29
|
label: format(label, i)
|
|
30
30
|
}));
|
|
31
31
|
const edgeLabel = (tick) => showValues && tick ? Math.ceil(estimateTextWidth(tick.label, fontSize) / 2) : 0;
|
|
32
|
-
const
|
|
32
|
+
const { area, side, range } = plotFrame(ctx, options.padding, (pad) => ({
|
|
33
33
|
top: pad.top + Math.max(overhang, 4),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
const area = innerRect(width, height, margins);
|
|
34
|
+
bottom: pad.bottom + Math.max((showValues ? axisSize("bottom", probeValues, fontSize) : 0) + axisTitleSize(yOptions.title, fontSize), overhang, 4),
|
|
35
|
+
start: pad.start + Math.max((showCategories ? axisSize("left", probeCategories, fontSize) : 0) + axisTitleSize(xOptions.title, fontSize), edgeLabel(probeValues[0]), overhang, 8),
|
|
36
|
+
end: pad.end + Math.max(edgeLabel(probeValues[probeValues.length - 1]), overhang, 8)
|
|
37
|
+
}));
|
|
39
38
|
const keys = labels.map(labelKey);
|
|
40
39
|
const x = band(keys, [area.y, area.y + area.height], {
|
|
41
40
|
paddingInner: layout.paddingInner ?? .3,
|
|
42
41
|
paddingOuter: layout.paddingOuter ?? .15
|
|
43
42
|
});
|
|
44
|
-
const
|
|
45
|
-
const y = value.scale(rtl ? [end, area.x] : [area.x, end]);
|
|
43
|
+
const y = value.scale(range());
|
|
46
44
|
const yTicks = thinTicks(value.ticks(y), "bottom", fontSize);
|
|
47
45
|
const xTicks = showCategories ? thinTicks(bandTicks(x, (_, i) => format(labels[i], i)), "left", fontSize) : [];
|
|
48
|
-
return finishLayout(options, ctx, overhang, {
|
|
46
|
+
return finishLayout(options, ctx, side, overhang, {
|
|
49
47
|
area,
|
|
50
48
|
labels,
|
|
51
49
|
x,
|
|
@@ -71,6 +69,7 @@ function horizontalLayout(options, ctx, layout) {
|
|
|
71
69
|
const bar = {
|
|
72
70
|
name: "bar",
|
|
73
71
|
clean: cleanData(cleanSeries),
|
|
72
|
+
prepare: windowed,
|
|
74
73
|
render(options, ctx) {
|
|
75
74
|
const { radius = 4, maxBarWidth = 24, gap = 2, groupPadding = .3, stacked = false, orientation = "vertical", curve = "monotone" } = options;
|
|
76
75
|
const horizontal = orientation === "horizontal";
|
|
@@ -78,37 +77,51 @@ const bar = {
|
|
|
78
77
|
const count = resolveLabels(options.data).length;
|
|
79
78
|
const isLine = (index) => (series[index]?.type ?? "bar") !== "bar";
|
|
80
79
|
const lineKeys = series.filter((_, index) => isLine(index)).map(seriesKey);
|
|
81
|
-
const
|
|
80
|
+
const axisOf = seriesAxes(options);
|
|
81
|
+
const onY2 = (index) => axisOf(series[index]).second;
|
|
82
|
+
const apart = series.filter((_, index) => isLine(index) || onY2(index)).map(seriesKey);
|
|
83
|
+
const stackHidden = apart.length ? /* @__PURE__ */ new Set([...ctx.hidden, ...apart]) : ctx.hidden;
|
|
82
84
|
const stacks = stacked ? stackSeries(series, count, {
|
|
83
85
|
percent: stacked === "percent",
|
|
84
86
|
hidden: stackHidden
|
|
85
87
|
}) : null;
|
|
88
|
+
const inStack = (index) => !!stacks && !isLine(index) && !onY2(index);
|
|
86
89
|
const layoutOptions = {
|
|
87
90
|
scale: "band",
|
|
88
91
|
zero: true,
|
|
89
92
|
paddingInner: groupPadding,
|
|
90
93
|
paddingOuter: groupPadding / 2,
|
|
91
|
-
|
|
94
|
+
zero2: series.some((s, index) => onY2(index) && s.type !== "line"),
|
|
95
|
+
...stacks ? { values: [...stackBounds(stacks), ...series.flatMap((s, index) => isLine(index) && !onY2(index) ? s.values : [])] } : {},
|
|
92
96
|
...stacked === "percent" ? { tickFormat: { style: "percent" } } : {}
|
|
93
97
|
};
|
|
94
98
|
const layout = horizontal ? horizontalLayout(options, ctx, layoutOptions) : cartesianLayout(options, ctx, layoutOptions);
|
|
95
|
-
const { x,
|
|
99
|
+
const { x, labels } = layout;
|
|
100
|
+
const scaleOf = (index) => seriesScale(layout, series[index]);
|
|
96
101
|
const slots = /* @__PURE__ */ new Map();
|
|
102
|
+
let used = 0;
|
|
103
|
+
let stackColumn = -1;
|
|
97
104
|
series.forEach((s, index) => {
|
|
98
|
-
if (
|
|
105
|
+
if (ctx.hidden.has(seriesKey(s)) || isLine(index)) return;
|
|
106
|
+
if (!inStack(index)) slots.set(index, used++);
|
|
107
|
+
else {
|
|
108
|
+
if (stackColumn < 0) stackColumn = used++;
|
|
109
|
+
slots.set(index, stackColumn);
|
|
110
|
+
}
|
|
99
111
|
});
|
|
100
112
|
const order = [...slots.keys()];
|
|
101
|
-
const columns =
|
|
102
|
-
const barWidth = Math.max(0, Math.min(maxBarWidth, (x.bandwidth -
|
|
103
|
-
const groupWidth = barWidth * columns +
|
|
113
|
+
const columns = Math.max(1, used);
|
|
114
|
+
const barWidth = Math.max(0, Math.min(maxBarWidth, (x.bandwidth - gap * (columns - 1)) / columns));
|
|
115
|
+
const groupWidth = barWidth * columns + gap * (columns - 1);
|
|
104
116
|
const offset = (x.bandwidth - groupWidth) / 2;
|
|
105
117
|
const slotAt = (slot) => x.range[1] < x.range[0] ? columns - 1 - slot : slot;
|
|
106
|
-
const barLeft = (seriesIndex, i) => x.at(i) + offset +
|
|
118
|
+
const barLeft = (seriesIndex, i) => x.at(i) + offset + slotAt(slots.get(seriesIndex) ?? 0) * (barWidth + gap);
|
|
107
119
|
/** Data extent of a bar: from zero to the value, or its stacked segment. */
|
|
108
120
|
const segment = (seriesIndex, i) => {
|
|
109
|
-
if (
|
|
110
|
-
const
|
|
111
|
-
|
|
121
|
+
if (inStack(seriesIndex)) return stacks?.[seriesIndex]?.[i] ?? null;
|
|
122
|
+
const s = series[seriesIndex];
|
|
123
|
+
const v = s?.values[i];
|
|
124
|
+
return plottable(v, axisOf(s).axis) ? {
|
|
112
125
|
y0: 0,
|
|
113
126
|
y1: v
|
|
114
127
|
} : null;
|
|
@@ -117,6 +130,7 @@ const bar = {
|
|
|
117
130
|
let up = -1;
|
|
118
131
|
let down = -1;
|
|
119
132
|
for (const index of order) {
|
|
133
|
+
if (!inStack(index)) continue;
|
|
120
134
|
const seg = segment(index, i);
|
|
121
135
|
if (!seg) continue;
|
|
122
136
|
if (seg.y1 > seg.y0) up = index;
|
|
@@ -127,7 +141,8 @@ const bar = {
|
|
|
127
141
|
down
|
|
128
142
|
};
|
|
129
143
|
});
|
|
130
|
-
|
|
144
|
+
const interaction = categoryInteraction(layout, options, ctx, (seriesIndex, i, v) => {
|
|
145
|
+
const y = scaleOf(seriesIndex);
|
|
131
146
|
if (isLine(seriesIndex)) {
|
|
132
147
|
const across = x.at(i) + x.bandwidth / 2;
|
|
133
148
|
return horizontal ? {
|
|
@@ -166,28 +181,27 @@ const bar = {
|
|
|
166
181
|
}, (px, py, i) => {
|
|
167
182
|
const across = horizontal ? py : px;
|
|
168
183
|
const along = horizontal ? px : py;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if (
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
const slot = Math.floor((across - (x.at(i) + offset) + gap / 2) / (barWidth + gap));
|
|
181
|
-
const seriesIndex = order[slotAt(slot)];
|
|
184
|
+
const column = slotAt(Math.floor((across - (x.at(i) + offset) + gap / 2) / (barWidth + gap)));
|
|
185
|
+
if (column === stackColumn) return order.find((index) => {
|
|
186
|
+
if (!inStack(index)) return false;
|
|
187
|
+
const seg = segment(index, i);
|
|
188
|
+
if (!seg) return false;
|
|
189
|
+
const y = scaleOf(index);
|
|
190
|
+
const a = y(seg.y0);
|
|
191
|
+
const b = y(seg.y1);
|
|
192
|
+
return along >= Math.min(a, b) - gap / 2 && along <= Math.max(a, b) + gap / 2;
|
|
193
|
+
});
|
|
194
|
+
const seriesIndex = order.find((index) => slots.get(index) === column);
|
|
182
195
|
return seriesIndex !== void 0 && segment(seriesIndex, i) ? seriesIndex : void 0;
|
|
183
|
-
})
|
|
196
|
+
});
|
|
184
197
|
const groups = series.map((s, index) => slots.has(index) && h("g", seriesAttrs(s, index), labels.map((label, i) => {
|
|
185
198
|
const seg = segment(index, i);
|
|
186
199
|
if (!seg) return null;
|
|
200
|
+
const y = scaleOf(index);
|
|
187
201
|
const negative = seg.y1 < seg.y0;
|
|
188
202
|
const away = Math.sign(y(seg.y1) - y(seg.y0));
|
|
189
203
|
const inner = seg.y0 === 0 ? 0 : away * gap;
|
|
190
|
-
const rounded = !
|
|
204
|
+
const rounded = !inStack(index) || (negative ? outer[i]?.down : outer[i]?.up) === index;
|
|
191
205
|
const draw = horizontal ? hbarPath : barPath;
|
|
192
206
|
return h("path", {
|
|
193
207
|
key: labelKey(label),
|
|
@@ -200,13 +214,15 @@ const bar = {
|
|
|
200
214
|
});
|
|
201
215
|
})));
|
|
202
216
|
const paths = lineKeys.length ? feature("line") : null;
|
|
203
|
-
const baseline = y(Math.min(Math.max(0, y.domain[0]), y.domain[1]));
|
|
204
217
|
const lines = series.map((s, index) => {
|
|
205
218
|
if (!paths) return null;
|
|
206
219
|
if (!isLine(index) || ctx.hidden.has(seriesKey(s))) return null;
|
|
220
|
+
const y = scaleOf(index);
|
|
221
|
+
const axis = axisOf(s).axis;
|
|
222
|
+
const baseline = y(Math.min(Math.max(0, y.domain[0]), y.domain[1]));
|
|
207
223
|
const points = labels.map((_, i) => {
|
|
208
224
|
const v = s.values[i];
|
|
209
|
-
if (!plottable(v,
|
|
225
|
+
if (!plottable(v, axis)) return null;
|
|
210
226
|
const center = x.at(i) + x.bandwidth / 2;
|
|
211
227
|
return horizontal ? [y(v), center] : [center, y(v)];
|
|
212
228
|
});
|
|
@@ -219,20 +235,23 @@ const bar = {
|
|
|
219
235
|
d: paths.linePath(points, { curve })
|
|
220
236
|
}));
|
|
221
237
|
});
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
238
|
+
return {
|
|
239
|
+
content: [
|
|
240
|
+
h("defs", { key: "defs" }, layout.clip.def),
|
|
241
|
+
layout.background,
|
|
242
|
+
h("g", {
|
|
243
|
+
key: "series",
|
|
244
|
+
class: "tc-series-list",
|
|
245
|
+
"clip-path": layout.clip.url
|
|
246
|
+
}, groups, lines),
|
|
247
|
+
layout.foreground
|
|
248
|
+
],
|
|
249
|
+
interaction
|
|
250
|
+
};
|
|
232
251
|
},
|
|
233
252
|
legend: (options) => seriesLegend(options.data),
|
|
234
253
|
table: (options, ctx, limit) => seriesTable(options, ctx, limit)
|
|
235
254
|
};
|
|
236
255
|
export { bar as t };
|
|
237
256
|
|
|
238
|
-
//# sourceMappingURL=bar-
|
|
257
|
+
//# sourceMappingURL=bar-D_KKd2fL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bar-D_KKd2fL.js","names":[],"sources":["../src/charts/horizontal.ts","../src/charts/bar.ts"],"sourcesContent":["import type { RenderContext } from '../chart.ts'\nimport { axisSize, axisTitleSize, bandTicks, type Tick, thinTicks } from '../components/axis.ts'\nimport { estimateTextWidth, plotFrame } from '../layout.ts'\nimport { type BandKey, band } from '../scales/band.ts'\nimport {\n type CartesianLayout,\n type CartesianLayoutOptions,\n type CartesianOptions,\n EDGE,\n finishLayout,\n type Label,\n labelFormatter,\n labelKey,\n resolveLabels,\n TICK_SPACING_X,\n valueAxis,\n} from './cartesian.ts'\n\n/**\n * Cartesian layout with categories along y (labels on the left) and values\n * along x (labels at the bottom), for horizontal bars. Only bar charts use\n * it, so it lives outside `cartesianLayout()` and stays out of other bundles.\n */\nexport function horizontalLayout(\n options: CartesianOptions,\n ctx: RenderContext,\n layout: CartesianLayoutOptions,\n): CartesianLayout {\n const yOptions = options.y ?? {}\n const xOptions = options.x ?? {}\n const { fontSize, width } = ctx\n const overhang = layout.overhang ?? 0\n const labels = resolveLabels(options.data)\n const format = labelFormatter(options, ctx)\n const value = valueAxis(options, ctx, layout, Math.round(width / TICK_SPACING_X))\n const probeValues = value.probe\n const showValues = yOptions.show !== false\n const showCategories = xOptions.show !== false && labels.length > 0\n\n const probeCategories: Tick[] = labels.map((label, i) => ({\n value: labelKey(label),\n position: 0,\n label: format(label, i),\n }))\n const edgeLabel = (tick: Tick | undefined) =>\n showValues && tick ? Math.ceil(estimateTextWidth(tick.label, fontSize) / 2) : 0\n\n const { area, side, range } = plotFrame(ctx, options.padding, (pad) => ({\n top: pad.top + Math.max(overhang, EDGE / 2),\n bottom:\n pad.bottom +\n Math.max(\n (showValues ? axisSize('bottom', probeValues, fontSize) : 0) +\n axisTitleSize(yOptions.title, fontSize),\n overhang,\n EDGE / 2,\n ),\n start:\n pad.start +\n Math.max(\n (showCategories ? axisSize('left', probeCategories, fontSize) : 0) +\n axisTitleSize(xOptions.title, fontSize),\n edgeLabel(probeValues[0]),\n overhang,\n EDGE,\n ),\n end: pad.end + Math.max(edgeLabel(probeValues[probeValues.length - 1]), overhang, EDGE),\n }))\n\n const keys = labels.map(labelKey)\n const x = band(keys, [area.y, area.y + area.height], {\n paddingInner: layout.paddingInner ?? 0.3,\n paddingOuter: layout.paddingOuter ?? 0.15,\n })\n // Values grow away from the categories, from the start side.\n const y = value.scale(range())\n const yTicks = thinTicks(value.ticks(y), 'bottom', fontSize)\n const xTicks = showCategories\n ? thinTicks(\n bandTicks(x, (_: BandKey, i) => format(labels[i] as Label, i)),\n 'left',\n fontSize,\n )\n : []\n\n // The value axis runs along x here, categories along y.\n return finishLayout(\n options,\n ctx,\n side,\n overhang,\n { area, labels, x, y, horizontal: true, xTicks, yTicks },\n keys,\n )\n}\n","import type { ChartType } from '../chart.ts'\nimport { feature } from '../features.ts'\nimport { barPath, hbarPath } from '../shapes/bar.ts'\nimport type { Curve, Point } from '../shapes/path.ts'\nimport { h } from '../vnode.ts'\nimport {\n type CartesianLayoutOptions,\n type CartesianOptions,\n cartesianLayout,\n categoryInteraction,\n labelKey,\n plottable,\n resolveLabels,\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 { horizontalLayout } from './horizontal.ts'\nimport { type Segment, type StackMode, stackBounds, stackSeries } from './stack.ts'\n\nexport interface BarOptions extends CartesianOptions {\n /** Corner radius of the data end of each bar (or stack). Defaults to `4`. */\n radius?: number\n /** Maximum bar thickness in pixels; leftover band space stays empty. Defaults to `24`. */\n maxBarWidth?: number\n /** Gap between bars of a group, or between stacked segments, in pixels. Defaults to `2`. */\n gap?: number\n /** Share of each category left empty between groups, `0…1`. Defaults to `0.3`. */\n groupPadding?: number\n /**\n * Stack series in one bar per category instead of side by side; `'percent'`\n * shows each category as 100%. Negative values stack down from zero.\n */\n stacked?: StackMode\n /**\n * `'horizontal'` lays categories out along y with bars growing right\n * (left for negative values). The `x` / `y` options keep describing the\n * category / value axis. Defaults to `'vertical'`.\n */\n orientation?: 'vertical' | 'horizontal'\n /** Interpolation of series drawn as lines (`series.type`). Defaults to `'monotone'`. */\n curve?: Curve\n}\n\n/**\n * Bar chart: vertical bars per category, grouped side by side or stacked,\n * growing from zero (negative values grow down).\n *\n * ```ts\n * new Chart('#el', {\n * type: bar,\n * data: { labels: ['Q1', 'Q2'], series: [{ name: '2025', values: [3, 5] }] },\n * stacked: true,\n * })\n * ```\n */\nexport const bar: ChartType<BarOptions> = {\n name: 'bar',\n clean: cleanData(cleanSeries),\n prepare: windowed,\n render(options, ctx) {\n const {\n radius = 4,\n maxBarWidth = 24,\n gap = 2,\n groupPadding = 0.3,\n stacked = false,\n orientation = 'vertical',\n curve = 'monotone',\n } = options\n const horizontal = orientation === 'horizontal'\n const { series } = options.data\n const count = resolveLabels(options.data).length\n // Series drawn as lines sit on top of the bars and stay out of the stacks.\n const isLine = (index: number) => (series[index]?.type ?? 'bar') !== 'bar'\n const lineKeys = series.filter((_, index) => isLine(index)).map(seriesKey)\n const axisOf = seriesAxes(options)\n const onY2 = (index: number) => axisOf(series[index]).second\n // Bars on the second axis stand beside the stack, in a column of their own.\n const apart = series.filter((_, index) => isLine(index) || onY2(index)).map(seriesKey)\n const stackHidden = apart.length ? new Set([...ctx.hidden, ...apart]) : ctx.hidden\n const stacks = stacked\n ? stackSeries(series, count, { percent: stacked === 'percent', hidden: stackHidden })\n : null\n const inStack = (index: number) => !!stacks && !isLine(index) && !onY2(index)\n\n const layoutOptions: CartesianLayoutOptions = {\n scale: 'band',\n zero: true,\n paddingInner: groupPadding,\n paddingOuter: groupPadding / 2,\n // Bars and areas on the second axis grow from zero too, lines need not.\n zero2: series.some((s, index) => onY2(index) && s.type !== 'line'),\n ...(stacks\n ? {\n values: [\n ...stackBounds(stacks),\n ...series.flatMap((s, index) => (isLine(index) && !onY2(index) ? s.values : [])),\n ],\n }\n : {}),\n ...(stacked === 'percent' ? { tickFormat: { style: 'percent' } } : {}),\n }\n const layout = horizontal\n ? horizontalLayout(options, ctx, layoutOptions)\n : cartesianLayout(options, ctx, layoutOptions)\n const { x, labels } = layout\n const scaleOf = (index: number) => seriesScale(layout, series[index])\n\n // The column of each bar series in its group: a stack takes one column\n // for all its series. Hidden series keep their color slot but give up their place.\n const slots = new Map<number, number>()\n let used = 0\n let stackColumn = -1\n series.forEach((s, index) => {\n if (ctx.hidden.has(seriesKey(s)) || isLine(index)) return\n if (!inStack(index)) slots.set(index, used++)\n else {\n if (stackColumn < 0) stackColumn = used++\n slots.set(index, stackColumn)\n }\n })\n const order = [...slots.keys()]\n const columns = Math.max(1, used)\n\n const barWidth = Math.max(\n 0,\n Math.min(maxBarWidth, (x.bandwidth - gap * (columns - 1)) / columns),\n )\n const groupWidth = barWidth * columns + gap * (columns - 1)\n const offset = (x.bandwidth - groupWidth) / 2\n // Grouped bars follow the categories: from the right when those are reversed.\n const slotAt = (slot: number) => (x.range[1] < x.range[0] ? columns - 1 - slot : slot)\n const barLeft = (seriesIndex: number, i: number) =>\n x.at(i) + offset + slotAt(slots.get(seriesIndex) ?? 0) * (barWidth + gap)\n\n /** Data extent of a bar: from zero to the value, or its stacked segment. */\n const segment = (seriesIndex: number, i: number): Segment | null => {\n if (inStack(seriesIndex)) return stacks?.[seriesIndex]?.[i] ?? null\n const s = series[seriesIndex]\n const v = s?.values[i]\n return plottable(v, axisOf(s).axis) ? { y0: 0, y1: v } : null\n }\n\n // In a stack only the outermost segment of each sign gets rounded.\n const outer = labels.map((_, i) => {\n let up = -1\n let down = -1\n for (const index of order) {\n if (!inStack(index)) continue\n const seg = segment(index, i)\n if (!seg) continue\n if (seg.y1 > seg.y0) up = index\n else if (seg.y1 < seg.y0) down = index\n }\n return { up, down }\n })\n\n const interaction = categoryInteraction(\n layout,\n options,\n ctx,\n (seriesIndex, i, v) => {\n const y = scaleOf(seriesIndex)\n if (isLine(seriesIndex)) {\n const across = x.at(i) + x.bandwidth / 2\n return horizontal ? { x: y(v), y: across } : { x: across, y: y(v) }\n }\n const left = barLeft(seriesIndex, i)\n const seg = segment(seriesIndex, i)\n const end = y(seg?.y1 ?? 0)\n const base = y(seg?.y0 ?? 0)\n // The bar's box, for value labels inside it.\n const lo = Math.min(end, base)\n const length = Math.abs(end - base)\n return horizontal\n ? {\n x: end,\n y: left + barWidth / 2,\n box: { x: lo, y: left, width: length, height: barWidth },\n }\n : {\n x: left + barWidth / 2,\n y: end,\n box: { x: left, y: lo, width: barWidth, height: length },\n }\n },\n (px, py, i) => {\n // Pointer position across the categories and along the values.\n const across = horizontal ? py : px\n const along = horizontal ? px : py\n // The column under the pointer, gaps included, so thin bars are easy to hit.\n const column = slotAt(\n Math.floor((across - (x.at(i) + offset) + gap / 2) / (barWidth + gap)),\n )\n if (column === stackColumn) {\n // The segment under the pointer, within the stack (gaps included).\n return order.find((index) => {\n if (!inStack(index)) return false\n const seg = segment(index, i)\n if (!seg) return false\n const y = scaleOf(index)\n const a = y(seg.y0)\n const b = y(seg.y1)\n return along >= Math.min(a, b) - gap / 2 && along <= Math.max(a, b) + gap / 2\n })\n }\n const seriesIndex = order.find((index) => slots.get(index) === column)\n return seriesIndex !== undefined && segment(seriesIndex, i) ? seriesIndex : undefined\n },\n )\n\n const groups = series.map(\n (s, index) =>\n slots.has(index) &&\n h(\n 'g',\n seriesAttrs(s, index),\n labels.map((label, i) => {\n const seg = segment(index, i)\n if (!seg) return null\n const y = scaleOf(index)\n const negative = seg.y1 < seg.y0\n // Leave a surface-colored gap where this segment sits on another one,\n // on the side it grows to (in pixels: up, right, or left when mirrored).\n const away = Math.sign(y(seg.y1) - y(seg.y0))\n const inner = seg.y0 === 0 ? 0 : away * gap\n const rounded = !inStack(index) || (negative ? outer[i]?.down : outer[i]?.up) === index\n const draw = horizontal ? hbarPath : barPath\n return h('path', {\n key: labelKey(label),\n class: ['tc-bar', negative && 'tc-bar-negative', horizontal && 'tc-bar-horizontal'],\n d: draw(\n barLeft(index, i),\n barWidth,\n y(seg.y0) + inner,\n y(seg.y1),\n rounded ? radius : 0,\n ),\n })\n }),\n ),\n )\n\n // Lines through the band centers, drawn after (over) every bar. The path\n // generators come with the line module, so plain bar charts do not ship them.\n const paths = lineKeys.length ? feature('line') : null\n const lines = series.map((s, index) => {\n if (!paths) return null\n if (!isLine(index) || ctx.hidden.has(seriesKey(s))) return null\n const y = scaleOf(index)\n const axis = axisOf(s).axis\n const baseline = y(Math.min(Math.max(0, y.domain[0]), y.domain[1]))\n const points = labels.map((_, i): Point => {\n const v = s.values[i]\n if (!plottable(v, axis)) return null\n const center = x.at(i) + x.bandwidth / 2\n return horizontal ? [y(v), center] : [center, y(v)]\n })\n // Areas need a vertical baseline; sideways they fall back to a line.\n const filled = s.type === 'area' && !horizontal\n return h(\n 'g',\n seriesAttrs(s, index),\n filled && h('path', { class: 'tc-area', d: paths.areaPath(points, baseline, { curve }) }),\n h('path', { class: 'tc-line', d: paths.linePath(points, { curve }) }),\n )\n })\n\n const content = [\n h('defs', { key: 'defs' }, layout.clip.def),\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(\n 'g',\n { key: 'series', class: 'tc-series-list', 'clip-path': layout.clip.url },\n groups,\n lines,\n ),\n layout.foreground,\n ]\n return { content, interaction }\n },\n legend: (options) => seriesLegend(options.data),\n table: (options, ctx, limit) => seriesTable(options, ctx, limit),\n}\n"],"mappings":";;;;;;;;;;;;;;AAuBA,SAAgB,iBACd,SACA,KACA,QACiB;CACjB,MAAM,WAAW,QAAQ,KAAK,CAAC;CAC/B,MAAM,WAAW,QAAQ,KAAK,CAAC;CAC/B,MAAM,EAAE,UAAU,UAAU;CAC5B,MAAM,WAAW,OAAO,YAAY;CACpC,MAAM,SAAS,cAAc,QAAQ,IAAI;CACzC,MAAM,SAAS,eAAe,SAAS,GAAG;CAC1C,MAAM,QAAQ,UAAU,SAAS,KAAK,QAAQ,KAAK,MAAM,QAAA,EAAsB,CAAC;CAChF,MAAM,cAAc,MAAM;CAC1B,MAAM,aAAa,SAAS,SAAS;CACrC,MAAM,iBAAiB,SAAS,SAAS,SAAS,O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,KAAK;KAAU,OAAO;KAAkB,aAAa,OAAO,KAAK;IAAI,GACvE,QACA,KACF;IACA,OAAO;GAEM;GAAG;EAAY;CAChC;CACA,SAAS,YAAY,aAAa,QAAQ,IAAI;CAC9C,QAAQ,SAAS,KAAK,UAAU,YAAY,SAAS,KAAK,KAAK;AACjE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_layout = require("./layout-
|
|
1
|
+
const require_layout = require("./layout-Cfg9x1k2.cjs");
|
|
2
2
|
// src/shapes/bar.ts
|
|
3
3
|
/** Rounded for path data, without a `-0`. */
|
|
4
4
|
const round = (value) => {
|
|
@@ -63,4 +63,4 @@ Object.defineProperty(exports, "hbarPath", {
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
-
//# sourceMappingURL=bar-
|
|
66
|
+
//# sourceMappingURL=bar-wVykm1us.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar-
|
|
1
|
+
{"version":3,"file":"bar-wVykm1us.cjs","names":["to2"],"sources":["../src/shapes/bar.ts"],"sourcesContent":["import { round as to2 } from '../layout.ts'\n\n/** Rounded for path data, without a `-0`. */\nconst round = (value: number): number => {\n const rounded = to2(value)\n return rounded === 0 ? 0 : rounded\n}\n\n/**\n * Path of a vertical bar from `baseline` to `value` (both y in pixels),\n * `x`…`x + width` wide. Only the data end is rounded, with `radius` clamped\n * to half the width and to the bar height; the baseline end stays square.\n * Works for bars growing up (value above baseline) and down (negative values).\n * Square corners are zero-radius arcs and every side is an `L`, so every\n * bar path, vertical or horizontal, has the same commands and CSS can\n * transition `d` between rounded and square (stacking) and between\n * orientations.\n */\nexport function barPath(\n x: number,\n width: number,\n baseline: number,\n value: number,\n radius = 0,\n): string {\n const w = Math.max(0, width)\n const height = Math.abs(baseline - value)\n const r = Math.max(0, Math.min(radius, w / 2, height))\n const x0 = round(x)\n const x1 = round(x + w)\n const b = round(baseline)\n const v = round(value)\n\n const up = value <= baseline\n const edge = round(up ? value + r : value - r)\n const sweep = up ? 1 : 0\n const rr = round(r)\n return (\n `M${x0},${b}L${x0},${edge}` +\n `A${rr},${rr},0,0,${sweep},${round(x + r)},${v}` +\n `L${round(x + w - r)},${v}` +\n `A${rr},${rr},0,0,${sweep},${x1},${edge}` +\n `L${x1},${b}Z`\n )\n}\n\n/**\n * Path of a horizontal bar from `baseline` to `value` (both x in pixels),\n * `y`…`y + height` tall. Only the data end is rounded, with `radius` clamped\n * to half the height and to the bar length; the baseline end stays square.\n * Works for bars growing right (positive values) and left (negative values).\n * Same commands as `barPath`, so a chart can morph between orientations.\n */\nexport function hbarPath(\n y: number,\n height: number,\n baseline: number,\n value: number,\n radius = 0,\n): string {\n const hgt = Math.max(0, height)\n const length = Math.abs(value - baseline)\n const r = Math.max(0, Math.min(radius, hgt / 2, length))\n const y0 = round(y)\n const y1 = round(y + hgt)\n const b = round(baseline)\n const v = round(value)\n\n const right = value >= baseline\n const edge = round(right ? value - r : value + r)\n const sweep = right ? 1 : 0\n const rr = round(r)\n return (\n `M${b},${y0}L${edge},${y0}` +\n `A${rr},${rr},0,0,${sweep},${v},${round(y + r)}` +\n `L${v},${round(y + hgt - r)}` +\n `A${rr},${rr},0,0,${sweep},${edge},${y1}` +\n `L${b},${y1}Z`\n )\n}\n"],"mappings":";;;AAGA,MAAM,SAAS,UAA0B;CACvC,MAAM,UAAUA,eAAAA,MAAI,KAAK;CACzB,OAAO,YAAY,IAAI,IAAI;AAC7B;;;;;;;;;;;AAYA,SAAgB,QACd,GACA,OACA,UACA,OACA,SAAS,GACD;CACR,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK;CAC3B,MAAM,SAAS,KAAK,IAAI,WAAW,KAAK;CACxC,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,QAAQ,IAAI,GAAG,MAAM,CAAC;CACrD,MAAM,KAAK,MAAM,CAAC;CAClB,MAAM,KAAK,MAAM,IAAI,CAAC;CACtB,MAAM,IAAI,MAAM,Q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|
package/dist/bar.cjs
CHANGED
package/dist/bar.d.cts
CHANGED
package/dist/bar.d.ts
CHANGED
package/dist/bar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as bar } from "./bar-
|
|
1
|
+
export { t as bar } from "./bar-D_KKd2fL.js";
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { o as ChartType } from "./chart-Dz4geQZy.cjs";
|
|
2
|
+
import { c as NumberFormat, o as DateFormat } from "./time-B4oxWHQI.cjs";
|
|
3
|
+
import { n as InsetsInput } from "./layout-CYerDebD.cjs";
|
|
4
|
+
import { a as ClassValue } from "./vnode-Du2cC8Fm.cjs";
|
|
5
|
+
/** One day's value. Several entries on the same day add up. */
|
|
6
|
+
interface CalendarEntry {
|
|
7
|
+
/** The day: a `Date`, a timestamp, or anything `new Date()` reads (`'2026-10-26'`). */
|
|
8
|
+
date: Date | string | number;
|
|
9
|
+
/** `null` leaves the day empty (drawn faded, like a day without data). */
|
|
10
|
+
value: number | null;
|
|
11
|
+
}
|
|
12
|
+
/** A kind of activity (commits, reviews …), with its own legend entry. */
|
|
13
|
+
interface CalendarSeries {
|
|
14
|
+
name: string;
|
|
15
|
+
values: readonly CalendarEntry[];
|
|
16
|
+
/** Stable identity for keyed updates. Defaults to `name`. */
|
|
17
|
+
id?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Custom color of the legend and tooltip swatch. Values that could inject
|
|
20
|
+
* CSS (`;`, quotes, `url()` …) are ignored, so colors from user data are safe.
|
|
21
|
+
*/
|
|
22
|
+
color?: string;
|
|
23
|
+
/** Extra classes on the legend entry. */
|
|
24
|
+
class?: ClassValue;
|
|
25
|
+
/** Start hidden (toggle it back from the legend). */
|
|
26
|
+
hidden?: boolean;
|
|
27
|
+
}
|
|
28
|
+
interface CalendarData {
|
|
29
|
+
series: readonly CalendarSeries[];
|
|
30
|
+
}
|
|
31
|
+
interface CalendarOptions {
|
|
32
|
+
/** Days and their values, as one list or as several series that add up (the legend filters them). */
|
|
33
|
+
data: CalendarData | readonly CalendarEntry[];
|
|
34
|
+
/** First day shown (at most ten years before `to`). Defaults to the first day in the data, or the start of the `weeks` window. */
|
|
35
|
+
from?: Date | string | number;
|
|
36
|
+
/** Last day shown. Defaults to the last day in the data. */
|
|
37
|
+
to?: Date | string | number;
|
|
38
|
+
/** Number of week columns ending with the week of `to`, when `from` is not set (e.g. `12`). */
|
|
39
|
+
weeks?: number;
|
|
40
|
+
/** First day of the week: `0` Sunday … `6` Saturday. Defaults to `1` (Monday). */
|
|
41
|
+
weekStart?: number;
|
|
42
|
+
/** Read the dates in UTC instead of local time. */
|
|
43
|
+
utc?: boolean;
|
|
44
|
+
/** Value shown as empty. Defaults to the smaller of `0` and the data minimum. */
|
|
45
|
+
min?: number;
|
|
46
|
+
/** Value shown with the full color. Defaults to the data maximum. */
|
|
47
|
+
max?: number;
|
|
48
|
+
/** Number of shades between empty and the full color (the steps of the scale). Defaults to `4`. */
|
|
49
|
+
levels?: number;
|
|
50
|
+
/**
|
|
51
|
+
* A scale through two or more colors (any CSS color, including
|
|
52
|
+
* `var(--tc-…)`) from `min` to `max` in `levels` steps, instead of one hue.
|
|
53
|
+
* `'diverging'` is two hues around a neutral middle, for values with a sign
|
|
54
|
+
* (changes, balances): the middle sits on `mid`, `0` by default, and the
|
|
55
|
+
* two ends are equally far from it unless `min` or `max` is set.
|
|
56
|
+
* Values that could inject CSS are ignored, as for series colors.
|
|
57
|
+
*/
|
|
58
|
+
colors?: "diverging" | readonly string[];
|
|
59
|
+
/** Value placed on the middle color of `colors`. Defaults to `0` for `'diverging'`, else halfway. */
|
|
60
|
+
mid?: number;
|
|
61
|
+
/** Space between cells in pixels, drawn as surface. Defaults to `2`. */
|
|
62
|
+
gap?: number;
|
|
63
|
+
/** Corner radius of the cells. Defaults to `2`. */
|
|
64
|
+
radius?: number;
|
|
65
|
+
/** Format of the values (tooltip, table). */
|
|
66
|
+
format?: NumberFormat;
|
|
67
|
+
/** Format of the day in the tooltip and the table. Defaults to e.g. "Oct 26, 2026". */
|
|
68
|
+
dateFormat?: DateFormat;
|
|
69
|
+
/** Month names above the columns where a month begins. */
|
|
70
|
+
x?: {
|
|
71
|
+
show?: boolean;
|
|
72
|
+
format?: (date: Date) => string;
|
|
73
|
+
};
|
|
74
|
+
/** Weekday names on the left. */
|
|
75
|
+
y?: {
|
|
76
|
+
show?: boolean;
|
|
77
|
+
format?: (date: Date) => string;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* The low-to-high scale below the grid: `false` hides it, an object names
|
|
81
|
+
* its ends (defaults `'Less'` and `'More'`; with `colors`, the values at the ends).
|
|
82
|
+
*/
|
|
83
|
+
scale?: boolean | {
|
|
84
|
+
low?: string;
|
|
85
|
+
high?: string;
|
|
86
|
+
};
|
|
87
|
+
/** Extra space around the grid, in pixels. */
|
|
88
|
+
padding?: InsetsInput;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Calendar: a contribution-style heatmap of days, one column per week and
|
|
92
|
+
* one row per weekday, shaded in `levels` steps of one hue by the day's
|
|
93
|
+
* value (`--tc-heat-color`), with month and weekday names and a low-to-high
|
|
94
|
+
* scale; `colors` shades through a scale of colors instead, `'diverging'`
|
|
95
|
+
* for values with a sign. Several series add up per day and the legend filters them.
|
|
96
|
+
*
|
|
97
|
+
* ```ts
|
|
98
|
+
* new Chart('#el', {
|
|
99
|
+
* type: calendar,
|
|
100
|
+
* data: [{ date: '2026-10-26', value: 3 }, { date: '2026-10-27', value: 0 }],
|
|
101
|
+
* weeks: 12,
|
|
102
|
+
* })
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
declare const calendar: ChartType<CalendarOptions>;
|
|
106
|
+
export { calendar as a, CalendarSeries as i, CalendarEntry as n, CalendarOptions as r, CalendarData as t };
|