@tabler/charts 0.2.0 → 0.3.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 +74 -4
- package/dist/{annotations-D0YQ0IoA.js → annotations-BQ8l-qHs.js} +3 -3
- package/dist/{annotations-D0YQ0IoA.js.map → annotations-BQ8l-qHs.js.map} +1 -1
- package/dist/{annotations-DdRdeBUB.cjs → annotations-CpCWA29b.cjs} +3 -3
- package/dist/{annotations-DdRdeBUB.cjs.map → annotations-CpCWA29b.cjs.map} +1 -1
- package/dist/annotations.cjs +2 -2
- package/dist/annotations.js +2 -2
- package/dist/{area-d11XePuw.d.ts → area-DEFQm_SQ.d.ts} +2 -2
- package/dist/{area-4eRs3c0K.cjs → area-DYdQ_sMV.cjs} +3 -3
- package/dist/{area-4eRs3c0K.cjs.map → area-DYdQ_sMV.cjs.map} +1 -1
- package/dist/{area-0-L1bG9B.js → area-WdtfqvhX.js} +3 -3
- package/dist/{area-0-L1bG9B.js.map → area-WdtfqvhX.js.map} +1 -1
- package/dist/{area-CJX9219z.d.cts → area-h_FvieFb.d.cts} +2 -2
- 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-MMaVoSWB.js +235 -0
- package/dist/axis-MMaVoSWB.js.map +1 -0
- package/dist/axis-YfAerNBA.cjs +300 -0
- package/dist/axis-YfAerNBA.cjs.map +1 -0
- package/dist/{bar-BNZ3GhIw.js → bar-BOcRcArc.js} +74 -56
- package/dist/bar-BOcRcArc.js.map +1 -0
- package/dist/{bar-Da6dE_nI.cjs → bar-CVkOJ7WA.cjs} +76 -58
- package/dist/bar-CVkOJ7WA.cjs.map +1 -0
- 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-XwzM6Pb0.d.ts → bar-D9B_arKf.d.ts} +1 -1
- package/dist/{bar-BDLR4p9c.d.cts → bar-DZCQ-kyf.d.cts} +2 -2
- 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-BSvO8nRb.d.cts +106 -0
- package/dist/calendar-BXgIX5H1.js +502 -0
- package/dist/calendar-BXgIX5H1.js.map +1 -0
- package/dist/calendar-Bq3vFzPl.d.ts +106 -0
- package/dist/calendar-DAFXjV99.cjs +507 -0
- package/dist/calendar-DAFXjV99.cjs.map +1 -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-D0xKkdqd.d.ts → candlestick-B3WcLzph.d.ts} +1 -1
- package/dist/{candlestick-Dq7qp-F0.d.cts → candlestick-BcomxeVG.d.cts} +1 -1
- package/dist/{candlestick-BHQkQfxH.js → candlestick-BtT9glp9.js} +16 -14
- package/dist/{candlestick-BHQkQfxH.js.map → candlestick-BtT9glp9.js.map} +1 -1
- package/dist/{candlestick-CYCQXgky.cjs → candlestick-CSmRuZ4v.cjs} +16 -14
- package/dist/{candlestick-CYCQXgky.cjs.map → candlestick-CSmRuZ4v.cjs.map} +1 -1
- 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-CI2x6N7N.js → cartesian-BrPqb5Qn.js} +122 -248
- package/dist/cartesian-BrPqb5Qn.js.map +1 -0
- package/dist/{cartesian-DV02PsBe.cjs → cartesian-DRSXHxWe.cjs} +146 -308
- package/dist/cartesian-DRSXHxWe.cjs.map +1 -0
- package/dist/{chart-DWn9v6qw.js → chart-B6TTY4Kr.js} +94 -62
- package/dist/chart-B6TTY4Kr.js.map +1 -0
- package/dist/{chart-QilhWP8Z.d.ts → chart-CYrrUCi3.d.ts} +193 -56
- package/dist/{chart-kqFMEwDo.d.cts → chart-CbPzP5Dp.d.cts} +193 -56
- package/dist/{chart-e2VqomCI.cjs → chart-D_lyOy-M.cjs} +106 -68
- package/dist/chart-D_lyOy-M.cjs.map +1 -0
- package/dist/{core-PAX5ogLk.d.cts → core-9BnLEW4K.d.cts} +24 -20
- package/dist/{core-DRUCk67j.d.ts → core-C3qEppSm.d.ts} +7 -6
- package/dist/{core-BKRQvPAT.js → core-CQ0FaJ4G.js} +112 -65
- package/dist/core-CQ0FaJ4G.js.map +1 -0
- package/dist/{core-DIOC61up.cjs → core-D2PSked3.cjs} +113 -66
- package/dist/core-D2PSked3.cjs.map +1 -0
- package/dist/core.cjs +41 -31
- package/dist/core.d.cts +20 -17
- package/dist/core.d.ts +20 -17
- package/dist/core.js +27 -23
- package/dist/{dates-C2RzY3rE.js → dates-DLe2Ww64.js} +2 -2
- package/dist/{dates-C2RzY3rE.js.map → dates-DLe2Ww64.js.map} +1 -1
- package/dist/{dates-DurEr9WT.cjs → dates-DerXTb1J.cjs} +2 -2
- package/dist/{dates-DurEr9WT.cjs.map → dates-DerXTb1J.cjs.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/{export-chart-mYgEfK-L.cjs → export-chart-CPtXmZvi.cjs} +17 -12
- package/dist/export-chart-CPtXmZvi.cjs.map +1 -0
- package/dist/{export-chart-83UYH48t.js → export-chart-DoeiAyR2.js} +17 -12
- package/dist/export-chart-DoeiAyR2.js.map +1 -0
- package/dist/export.cjs +2 -2
- package/dist/export.d.cts +1 -1
- package/dist/export.d.ts +1 -1
- package/dist/export.js +2 -2
- 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-BdcfUkb5.d.ts +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-CarOh8w_.d.cts +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-ts0kqN1-.js → gauge-DiTk5aWO.js} +28 -28
- package/dist/gauge-DiTk5aWO.js.map +1 -0
- package/dist/{gauge-BSist7My.d.cts → gauge-Ds9k1UV2.d.cts} +1 -1
- package/dist/{gauge-0VJuAHWF.d.ts → gauge-Zy25jfps.d.ts} +1 -1
- 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/{heatmap-19BGJTKF.js → heatmap-C1v8bwpq.js} +35 -33
- package/dist/heatmap-C1v8bwpq.js.map +1 -0
- package/dist/{heatmap-Dp_oyEe0.d.cts → heatmap-CJ-0dfhJ.d.cts} +1 -1
- package/dist/{heatmap-CXhlrLTl.cjs → heatmap-Dcc_bsoQ.cjs} +39 -37
- package/dist/heatmap-Dcc_bsoQ.cjs.map +1 -0
- package/dist/{heatmap-59lmClj9.d.ts → heatmap-Jp5sHRTo.d.ts} +1 -1
- 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 +55 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -18
- package/dist/index.d.ts +21 -18
- package/dist/index.js +41 -34
- 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-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-DtSh7HQU.d.ts → line-Bpr5uVLQ.d.ts} +1 -1
- package/dist/{line-DO66LtwH.js → line-CxR4tg1Q.js} +46 -34
- package/dist/line-CxR4tg1Q.js.map +1 -0
- package/dist/{line-Dbt6KFRK.cjs → line-YiCuhVMI.cjs} +46 -34
- package/dist/line-YiCuhVMI.cjs.map +1 -0
- package/dist/{line-_rNdeKmS.d.cts → line-vyWO030v.d.cts} +2 -3
- 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-49FcfdmJ.d.cts +156 -0
- package/dist/map-BMC61J-P.d.ts +156 -0
- package/dist/map-BqrZ80vT.cjs +818 -0
- package/dist/map-BqrZ80vT.cjs.map +1 -0
- package/dist/map-C15NC7kW.js +807 -0
- package/dist/map-C15NC7kW.js.map +1 -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-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/others-ls5eKtZ4.d.cts +31 -0
- package/dist/{parliament-Cru4IcuM.js → parliament-BKN6ikBJ.js} +30 -29
- package/dist/parliament-BKN6ikBJ.js.map +1 -0
- package/dist/{parliament-CgsVnWEe.d.cts → parliament-C7V8UJj1.d.cts} +1 -1
- package/dist/{parliament-CLCI7tUO.d.ts → parliament-Cz9n_DoK.d.ts} +1 -1
- 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-CufKZYhm.js → patterns-BMUINoka.js} +2 -2
- package/dist/{patterns-CufKZYhm.js.map → patterns-BMUINoka.js.map} +1 -1
- package/dist/{patterns-D3-wQagb.cjs → patterns-Dw7OMD_2.cjs} +2 -2
- package/dist/{patterns-D3-wQagb.cjs.map → patterns-Dw7OMD_2.cjs.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-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-R1--2grK.d.cts} +10 -14
- package/dist/{percentage-bar-nhTeakD_.d.ts → percentage-bar-cSeiLdwU.d.ts} +10 -14
- 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-CFptILSm.d.ts → pie-BQQkvy1N.d.ts} +7 -13
- package/dist/{pie-CVsc-6qD.js → pie-Bd8wyrtY.js} +45 -44
- package/dist/pie-Bd8wyrtY.js.map +1 -0
- package/dist/{pie-BpjvSPnz.cjs → pie-BseZlCgP.cjs} +45 -44
- package/dist/pie-BseZlCgP.cjs.map +1 -0
- package/dist/{pie-BXg2gNpb.d.cts → pie-vD5-g8je.d.cts} +7 -13
- 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-D1-lItDy.d.cts → radar-7I6hsY_h.d.cts} +1 -1
- package/dist/{radar-BR-mumDd.js → radar-D6XqkFWQ.js} +21 -22
- package/dist/radar-D6XqkFWQ.js.map +1 -0
- package/dist/{radar-HPDrIdzc.cjs → radar-DjISDnSf.cjs} +22 -23
- package/dist/radar-DjISDnSf.cjs.map +1 -0
- package/dist/{radar-BC9Skgpj.d.ts → radar-vLxilcr4.d.ts} +1 -1
- package/dist/radar.cjs +1 -1
- package/dist/radar.d.cts +1 -1
- package/dist/radar.d.ts +1 -1
- package/dist/radar.js +1 -1
- package/dist/{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-D_v7KxnJ.d.ts → sankey-7As41Fo4.d.ts} +1 -1
- package/dist/{sankey-D6JeZfK5.js → sankey-Dp4CuLVe.js} +72 -71
- package/dist/sankey-Dp4CuLVe.js.map +1 -0
- package/dist/{sankey-Dk7jUt8x.d.cts → sankey-DqiuxUx7.d.cts} +1 -1
- 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-CXEsioOJ.d.ts → scatter-BXkXGgM_.d.ts} +7 -1
- package/dist/{scatter-DVqB_fP9.cjs → scatter-Bwkblr4L.cjs} +40 -38
- package/dist/scatter-Bwkblr4L.cjs.map +1 -0
- package/dist/{scatter-C0TWjFpW.js → scatter-DCMAtt5L.js} +38 -36
- package/dist/scatter-DCMAtt5L.js.map +1 -0
- package/dist/{scatter-DZeEIfyo.d.cts → scatter-DL0zAV09.d.cts} +7 -1
- package/dist/scatter.cjs +1 -1
- package/dist/scatter.d.cts +1 -1
- package/dist/scatter.d.ts +1 -1
- package/dist/scatter.js +1 -1
- package/dist/{sparkline-cbvRkWqS.d.ts → sparkline-BElUSd0r.d.ts} +1 -1
- package/dist/{sparkline-B39NA0Mi.cjs → sparkline-BMSuEPHP.cjs} +13 -15
- package/dist/sparkline-BMSuEPHP.cjs.map +1 -0
- package/dist/{sparkline-XO_TqCNP.js → sparkline-NDmq90kP.js} +13 -15
- package/dist/sparkline-NDmq90kP.js.map +1 -0
- package/dist/{sparkline-DAP6jtzw.d.cts → sparkline-RYly7bR0.d.cts} +1 -1
- package/dist/sparkline.cjs +1 -1
- package/dist/sparkline.d.cts +1 -1
- package/dist/sparkline.d.ts +1 -1
- package/dist/sparkline.js +1 -1
- package/dist/{stack-BgPzoQmv.cjs → stack-BO4624CY.cjs} +2 -2
- package/dist/{stack-BgPzoQmv.cjs.map → stack-BO4624CY.cjs.map} +1 -1
- package/dist/{stack-Dagxq7l2.d.cts → stack-BTWYIwLO.d.cts} +1 -1
- package/dist/{stack-2H2Gfs1Q.js → stack-jVKvg2x_.js} +2 -2
- package/dist/{stack-2H2Gfs1Q.js.map → stack-jVKvg2x_.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{time-axis-BjZ1bYTK.cjs → time-axis-B3VekUfX.cjs} +4 -3
- package/dist/{time-axis-BjZ1bYTK.cjs.map → time-axis-B3VekUfX.cjs.map} +1 -1
- package/dist/{time-axis-FLONo54E.js → time-axis-CLjqOakA.js} +3 -2
- package/dist/{time-axis-FLONo54E.js.map → time-axis-CLjqOakA.js.map} +1 -1
- package/dist/time.cjs +3 -3
- package/dist/time.js +3 -3
- package/dist/{treemap-BAkhmVQc.d.cts → treemap-25vHO_UK.d.cts} +12 -2
- package/dist/{treemap-BNpxFBao.d.ts → treemap-BCXUbixd.d.ts} +12 -2
- package/dist/{treemap-CQdavQ9u.js → treemap-C4glsx-g.js} +20 -25
- package/dist/treemap-C4glsx-g.js.map +1 -0
- package/dist/{treemap-BWpEUlDh.cjs → treemap-CZk8kKFD.cjs} +21 -26
- package/dist/treemap-CZk8kKFD.cjs.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-C7GrhOXJ.js} +25 -5
- package/dist/value-labels-C7GrhOXJ.js.map +1 -0
- package/dist/{value-labels-BV9keAuL.cjs → value-labels-DzaKIWKp.cjs} +25 -5
- package/dist/value-labels-DzaKIWKp.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/package.json +93 -233
- package/dist/bar-BNZ3GhIw.js.map +0 -1
- package/dist/bar-Da6dE_nI.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,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 { _ 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, w as band } from "./cartesian-BrPqb5Qn.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-MMaVoSWB.js";
|
|
7
|
+
import { n as estimateTextWidth, o as plotFrame } from "./layout-DqAte3H8.js";
|
|
8
|
+
import { n as stackSeries, t as stackBounds } from "./stack-jVKvg2x_.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,
|
|
@@ -78,37 +76,51 @@ const bar = {
|
|
|
78
76
|
const count = resolveLabels(options.data).length;
|
|
79
77
|
const isLine = (index) => (series[index]?.type ?? "bar") !== "bar";
|
|
80
78
|
const lineKeys = series.filter((_, index) => isLine(index)).map(seriesKey);
|
|
81
|
-
const
|
|
79
|
+
const axisOf = seriesAxes(options);
|
|
80
|
+
const onY2 = (index) => axisOf(series[index]).second;
|
|
81
|
+
const apart = series.filter((_, index) => isLine(index) || onY2(index)).map(seriesKey);
|
|
82
|
+
const stackHidden = apart.length ? /* @__PURE__ */ new Set([...ctx.hidden, ...apart]) : ctx.hidden;
|
|
82
83
|
const stacks = stacked ? stackSeries(series, count, {
|
|
83
84
|
percent: stacked === "percent",
|
|
84
85
|
hidden: stackHidden
|
|
85
86
|
}) : null;
|
|
87
|
+
const inStack = (index) => !!stacks && !isLine(index) && !onY2(index);
|
|
86
88
|
const layoutOptions = {
|
|
87
89
|
scale: "band",
|
|
88
90
|
zero: true,
|
|
89
91
|
paddingInner: groupPadding,
|
|
90
92
|
paddingOuter: groupPadding / 2,
|
|
91
|
-
|
|
93
|
+
zero2: series.some((s, index) => onY2(index) && s.type !== "line"),
|
|
94
|
+
...stacks ? { values: [...stackBounds(stacks), ...series.flatMap((s, index) => isLine(index) && !onY2(index) ? s.values : [])] } : {},
|
|
92
95
|
...stacked === "percent" ? { tickFormat: { style: "percent" } } : {}
|
|
93
96
|
};
|
|
94
97
|
const layout = horizontal ? horizontalLayout(options, ctx, layoutOptions) : cartesianLayout(options, ctx, layoutOptions);
|
|
95
|
-
const { x,
|
|
98
|
+
const { x, labels } = layout;
|
|
99
|
+
const scaleOf = (index) => seriesScale(layout, series[index]);
|
|
96
100
|
const slots = /* @__PURE__ */ new Map();
|
|
101
|
+
let used = 0;
|
|
102
|
+
let stackColumn = -1;
|
|
97
103
|
series.forEach((s, index) => {
|
|
98
|
-
if (
|
|
104
|
+
if (ctx.hidden.has(seriesKey(s)) || isLine(index)) return;
|
|
105
|
+
if (!inStack(index)) slots.set(index, used++);
|
|
106
|
+
else {
|
|
107
|
+
if (stackColumn < 0) stackColumn = used++;
|
|
108
|
+
slots.set(index, stackColumn);
|
|
109
|
+
}
|
|
99
110
|
});
|
|
100
111
|
const order = [...slots.keys()];
|
|
101
|
-
const columns =
|
|
102
|
-
const barWidth = Math.max(0, Math.min(maxBarWidth, (x.bandwidth -
|
|
103
|
-
const groupWidth = barWidth * columns +
|
|
112
|
+
const columns = Math.max(1, used);
|
|
113
|
+
const barWidth = Math.max(0, Math.min(maxBarWidth, (x.bandwidth - gap * (columns - 1)) / columns));
|
|
114
|
+
const groupWidth = barWidth * columns + gap * (columns - 1);
|
|
104
115
|
const offset = (x.bandwidth - groupWidth) / 2;
|
|
105
116
|
const slotAt = (slot) => x.range[1] < x.range[0] ? columns - 1 - slot : slot;
|
|
106
|
-
const barLeft = (seriesIndex, i) => x.at(i) + offset +
|
|
117
|
+
const barLeft = (seriesIndex, i) => x.at(i) + offset + slotAt(slots.get(seriesIndex) ?? 0) * (barWidth + gap);
|
|
107
118
|
/** Data extent of a bar: from zero to the value, or its stacked segment. */
|
|
108
119
|
const segment = (seriesIndex, i) => {
|
|
109
|
-
if (
|
|
110
|
-
const
|
|
111
|
-
|
|
120
|
+
if (inStack(seriesIndex)) return stacks?.[seriesIndex]?.[i] ?? null;
|
|
121
|
+
const s = series[seriesIndex];
|
|
122
|
+
const v = s?.values[i];
|
|
123
|
+
return plottable(v, axisOf(s).axis) ? {
|
|
112
124
|
y0: 0,
|
|
113
125
|
y1: v
|
|
114
126
|
} : null;
|
|
@@ -117,6 +129,7 @@ const bar = {
|
|
|
117
129
|
let up = -1;
|
|
118
130
|
let down = -1;
|
|
119
131
|
for (const index of order) {
|
|
132
|
+
if (!inStack(index)) continue;
|
|
120
133
|
const seg = segment(index, i);
|
|
121
134
|
if (!seg) continue;
|
|
122
135
|
if (seg.y1 > seg.y0) up = index;
|
|
@@ -127,7 +140,8 @@ const bar = {
|
|
|
127
140
|
down
|
|
128
141
|
};
|
|
129
142
|
});
|
|
130
|
-
|
|
143
|
+
const interaction = categoryInteraction(layout, options, ctx, (seriesIndex, i, v) => {
|
|
144
|
+
const y = scaleOf(seriesIndex);
|
|
131
145
|
if (isLine(seriesIndex)) {
|
|
132
146
|
const across = x.at(i) + x.bandwidth / 2;
|
|
133
147
|
return horizontal ? {
|
|
@@ -166,28 +180,27 @@ const bar = {
|
|
|
166
180
|
}, (px, py, i) => {
|
|
167
181
|
const across = horizontal ? py : px;
|
|
168
182
|
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)];
|
|
183
|
+
const column = slotAt(Math.floor((across - (x.at(i) + offset) + gap / 2) / (barWidth + gap)));
|
|
184
|
+
if (column === stackColumn) return order.find((index) => {
|
|
185
|
+
if (!inStack(index)) return false;
|
|
186
|
+
const seg = segment(index, i);
|
|
187
|
+
if (!seg) return false;
|
|
188
|
+
const y = scaleOf(index);
|
|
189
|
+
const a = y(seg.y0);
|
|
190
|
+
const b = y(seg.y1);
|
|
191
|
+
return along >= Math.min(a, b) - gap / 2 && along <= Math.max(a, b) + gap / 2;
|
|
192
|
+
});
|
|
193
|
+
const seriesIndex = order.find((index) => slots.get(index) === column);
|
|
182
194
|
return seriesIndex !== void 0 && segment(seriesIndex, i) ? seriesIndex : void 0;
|
|
183
|
-
})
|
|
195
|
+
});
|
|
184
196
|
const groups = series.map((s, index) => slots.has(index) && h("g", seriesAttrs(s, index), labels.map((label, i) => {
|
|
185
197
|
const seg = segment(index, i);
|
|
186
198
|
if (!seg) return null;
|
|
199
|
+
const y = scaleOf(index);
|
|
187
200
|
const negative = seg.y1 < seg.y0;
|
|
188
201
|
const away = Math.sign(y(seg.y1) - y(seg.y0));
|
|
189
202
|
const inner = seg.y0 === 0 ? 0 : away * gap;
|
|
190
|
-
const rounded = !
|
|
203
|
+
const rounded = !inStack(index) || (negative ? outer[i]?.down : outer[i]?.up) === index;
|
|
191
204
|
const draw = horizontal ? hbarPath : barPath;
|
|
192
205
|
return h("path", {
|
|
193
206
|
key: labelKey(label),
|
|
@@ -200,13 +213,15 @@ const bar = {
|
|
|
200
213
|
});
|
|
201
214
|
})));
|
|
202
215
|
const paths = lineKeys.length ? feature("line") : null;
|
|
203
|
-
const baseline = y(Math.min(Math.max(0, y.domain[0]), y.domain[1]));
|
|
204
216
|
const lines = series.map((s, index) => {
|
|
205
217
|
if (!paths) return null;
|
|
206
218
|
if (!isLine(index) || ctx.hidden.has(seriesKey(s))) return null;
|
|
219
|
+
const y = scaleOf(index);
|
|
220
|
+
const axis = axisOf(s).axis;
|
|
221
|
+
const baseline = y(Math.min(Math.max(0, y.domain[0]), y.domain[1]));
|
|
207
222
|
const points = labels.map((_, i) => {
|
|
208
223
|
const v = s.values[i];
|
|
209
|
-
if (!plottable(v,
|
|
224
|
+
if (!plottable(v, axis)) return null;
|
|
210
225
|
const center = x.at(i) + x.bandwidth / 2;
|
|
211
226
|
return horizontal ? [y(v), center] : [center, y(v)];
|
|
212
227
|
});
|
|
@@ -219,20 +234,23 @@ const bar = {
|
|
|
219
234
|
d: paths.linePath(points, { curve })
|
|
220
235
|
}));
|
|
221
236
|
});
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
237
|
+
return {
|
|
238
|
+
content: [
|
|
239
|
+
h("defs", { key: "defs" }, layout.clip.def),
|
|
240
|
+
layout.background,
|
|
241
|
+
h("g", {
|
|
242
|
+
key: "series",
|
|
243
|
+
class: "tc-series-list",
|
|
244
|
+
"clip-path": layout.clip.url
|
|
245
|
+
}, groups, lines),
|
|
246
|
+
layout.foreground
|
|
247
|
+
],
|
|
248
|
+
interaction
|
|
249
|
+
};
|
|
232
250
|
},
|
|
233
251
|
legend: (options) => seriesLegend(options.data),
|
|
234
252
|
table: (options, ctx, limit) => seriesTable(options, ctx, limit)
|
|
235
253
|
};
|
|
236
254
|
export { bar as t };
|
|
237
255
|
|
|
238
|
-
//# sourceMappingURL=bar-
|
|
256
|
+
//# sourceMappingURL=bar-BOcRcArc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bar-BOcRcArc.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} 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 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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I,CAAC,QAAQ,EAAE,CAAC,CAAC;GACpD,CAAC;GAED,MAAM,SAAS,EAAE,SAAS,UAAU,CAAC;GACrC,OAAO,EACL,KACA,YAAY,GAAG,KAAK,GACpB,UAAU,EAAE,QAAQ;IAAE,OAAO;IAAW,GAAG,MAAM,SAAS,QAAQ,UAAU,EAAE,MAAM,CAAC;GAAE,CAAC,GACxF,EAAE,QAAQ;IAAE,OAAO;IAAW,GAAG,MAAM,SAAS,QAAQ,EAAE,MAAM,CAAC;GAAE,CAAC,CACtE;EACF,CAAC;EAeD,OAAO;GAAE,SAAA;IAZP,EAAE,QAAQ,EAAE,KAAK,OAAO,GAAG,OAAO,KAAK,GAAG;IAC1C,OAAO;IAGP,EACE,KACA;KAAE,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,10 +1,11 @@
|
|
|
1
|
-
const require_features = require("./features-
|
|
2
|
-
const require_bar = require("./bar-
|
|
1
|
+
const require_features = require("./features-DEDP5CEQ.cjs");
|
|
2
|
+
const require_bar = require("./bar-wVykm1us.cjs");
|
|
3
3
|
const require_vnode = require("./vnode-ClAiw28x.cjs");
|
|
4
|
-
const require_cartesian = require("./cartesian-
|
|
4
|
+
const require_cartesian = require("./cartesian-DRSXHxWe.cjs");
|
|
5
5
|
const require_clean = require("./clean-Die2iCNc.cjs");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const require_axis = require("./axis-YfAerNBA.cjs");
|
|
7
|
+
const require_layout = require("./layout-Cfg9x1k2.cjs");
|
|
8
|
+
const require_stack = require("./stack-BO4624CY.cjs");
|
|
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 @@ const require_stack = require("./stack-BgPzoQmv.cjs");
|
|
|
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 = require_layout.mirrorSides(require_layout.insets(options.padding), rtl);
|
|
20
20
|
const labels = require_cartesian.resolveLabels(options.data);
|
|
21
21
|
const format = require_cartesian.labelFormatter(options, ctx);
|
|
22
22
|
const value = require_cartesian.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(require_layout.estimateTextWidth(tick.label, fontSize) / 2) : 0;
|
|
32
|
-
const
|
|
32
|
+
const { area, side, range } = require_layout.plotFrame(ctx, options.padding, (pad) => ({
|
|
33
33
|
top: pad.top + Math.max(overhang, 4),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
const area = require_layout.innerRect(width, height, margins);
|
|
34
|
+
bottom: pad.bottom + Math.max((showValues ? require_axis.axisSize("bottom", probeValues, fontSize) : 0) + require_axis.axisTitleSize(yOptions.title, fontSize), overhang, 4),
|
|
35
|
+
start: pad.start + Math.max((showCategories ? require_axis.axisSize("left", probeCategories, fontSize) : 0) + require_axis.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(require_cartesian.labelKey);
|
|
40
39
|
const x = require_cartesian.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
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
return require_cartesian.finishLayout(options, ctx, overhang, {
|
|
43
|
+
const y = value.scale(range());
|
|
44
|
+
const yTicks = require_axis.thinTicks(value.ticks(y), "bottom", fontSize);
|
|
45
|
+
const xTicks = showCategories ? require_axis.thinTicks(require_axis.bandTicks(x, (_, i) => format(labels[i], i)), "left", fontSize) : [];
|
|
46
|
+
return require_cartesian.finishLayout(options, ctx, side, overhang, {
|
|
49
47
|
area,
|
|
50
48
|
labels,
|
|
51
49
|
x,
|
|
@@ -78,37 +76,51 @@ const bar = {
|
|
|
78
76
|
const count = require_cartesian.resolveLabels(options.data).length;
|
|
79
77
|
const isLine = (index) => (series[index]?.type ?? "bar") !== "bar";
|
|
80
78
|
const lineKeys = series.filter((_, index) => isLine(index)).map(require_cartesian.seriesKey);
|
|
81
|
-
const
|
|
79
|
+
const axisOf = require_cartesian.seriesAxes(options);
|
|
80
|
+
const onY2 = (index) => axisOf(series[index]).second;
|
|
81
|
+
const apart = series.filter((_, index) => isLine(index) || onY2(index)).map(require_cartesian.seriesKey);
|
|
82
|
+
const stackHidden = apart.length ? /* @__PURE__ */ new Set([...ctx.hidden, ...apart]) : ctx.hidden;
|
|
82
83
|
const stacks = stacked ? require_stack.stackSeries(series, count, {
|
|
83
84
|
percent: stacked === "percent",
|
|
84
85
|
hidden: stackHidden
|
|
85
86
|
}) : null;
|
|
87
|
+
const inStack = (index) => !!stacks && !isLine(index) && !onY2(index);
|
|
86
88
|
const layoutOptions = {
|
|
87
89
|
scale: "band",
|
|
88
90
|
zero: true,
|
|
89
91
|
paddingInner: groupPadding,
|
|
90
92
|
paddingOuter: groupPadding / 2,
|
|
91
|
-
|
|
93
|
+
zero2: series.some((s, index) => onY2(index) && s.type !== "line"),
|
|
94
|
+
...stacks ? { values: [...require_stack.stackBounds(stacks), ...series.flatMap((s, index) => isLine(index) && !onY2(index) ? s.values : [])] } : {},
|
|
92
95
|
...stacked === "percent" ? { tickFormat: { style: "percent" } } : {}
|
|
93
96
|
};
|
|
94
97
|
const layout = horizontal ? horizontalLayout(options, ctx, layoutOptions) : require_cartesian.cartesianLayout(options, ctx, layoutOptions);
|
|
95
|
-
const { x,
|
|
98
|
+
const { x, labels } = layout;
|
|
99
|
+
const scaleOf = (index) => require_cartesian.seriesScale(layout, series[index]);
|
|
96
100
|
const slots = /* @__PURE__ */ new Map();
|
|
101
|
+
let used = 0;
|
|
102
|
+
let stackColumn = -1;
|
|
97
103
|
series.forEach((s, index) => {
|
|
98
|
-
if (
|
|
104
|
+
if (ctx.hidden.has(require_cartesian.seriesKey(s)) || isLine(index)) return;
|
|
105
|
+
if (!inStack(index)) slots.set(index, used++);
|
|
106
|
+
else {
|
|
107
|
+
if (stackColumn < 0) stackColumn = used++;
|
|
108
|
+
slots.set(index, stackColumn);
|
|
109
|
+
}
|
|
99
110
|
});
|
|
100
111
|
const order = [...slots.keys()];
|
|
101
|
-
const columns =
|
|
102
|
-
const barWidth = Math.max(0, Math.min(maxBarWidth, (x.bandwidth -
|
|
103
|
-
const groupWidth = barWidth * columns +
|
|
112
|
+
const columns = Math.max(1, used);
|
|
113
|
+
const barWidth = Math.max(0, Math.min(maxBarWidth, (x.bandwidth - gap * (columns - 1)) / columns));
|
|
114
|
+
const groupWidth = barWidth * columns + gap * (columns - 1);
|
|
104
115
|
const offset = (x.bandwidth - groupWidth) / 2;
|
|
105
116
|
const slotAt = (slot) => x.range[1] < x.range[0] ? columns - 1 - slot : slot;
|
|
106
|
-
const barLeft = (seriesIndex, i) => x.at(i) + offset +
|
|
117
|
+
const barLeft = (seriesIndex, i) => x.at(i) + offset + slotAt(slots.get(seriesIndex) ?? 0) * (barWidth + gap);
|
|
107
118
|
/** Data extent of a bar: from zero to the value, or its stacked segment. */
|
|
108
119
|
const segment = (seriesIndex, i) => {
|
|
109
|
-
if (
|
|
110
|
-
const
|
|
111
|
-
|
|
120
|
+
if (inStack(seriesIndex)) return stacks?.[seriesIndex]?.[i] ?? null;
|
|
121
|
+
const s = series[seriesIndex];
|
|
122
|
+
const v = s?.values[i];
|
|
123
|
+
return require_cartesian.plottable(v, axisOf(s).axis) ? {
|
|
112
124
|
y0: 0,
|
|
113
125
|
y1: v
|
|
114
126
|
} : null;
|
|
@@ -117,6 +129,7 @@ const bar = {
|
|
|
117
129
|
let up = -1;
|
|
118
130
|
let down = -1;
|
|
119
131
|
for (const index of order) {
|
|
132
|
+
if (!inStack(index)) continue;
|
|
120
133
|
const seg = segment(index, i);
|
|
121
134
|
if (!seg) continue;
|
|
122
135
|
if (seg.y1 > seg.y0) up = index;
|
|
@@ -127,7 +140,8 @@ const bar = {
|
|
|
127
140
|
down
|
|
128
141
|
};
|
|
129
142
|
});
|
|
130
|
-
|
|
143
|
+
const interaction = require_cartesian.categoryInteraction(layout, options, ctx, (seriesIndex, i, v) => {
|
|
144
|
+
const y = scaleOf(seriesIndex);
|
|
131
145
|
if (isLine(seriesIndex)) {
|
|
132
146
|
const across = x.at(i) + x.bandwidth / 2;
|
|
133
147
|
return horizontal ? {
|
|
@@ -166,28 +180,27 @@ const bar = {
|
|
|
166
180
|
}, (px, py, i) => {
|
|
167
181
|
const across = horizontal ? py : px;
|
|
168
182
|
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)];
|
|
183
|
+
const column = slotAt(Math.floor((across - (x.at(i) + offset) + gap / 2) / (barWidth + gap)));
|
|
184
|
+
if (column === stackColumn) return order.find((index) => {
|
|
185
|
+
if (!inStack(index)) return false;
|
|
186
|
+
const seg = segment(index, i);
|
|
187
|
+
if (!seg) return false;
|
|
188
|
+
const y = scaleOf(index);
|
|
189
|
+
const a = y(seg.y0);
|
|
190
|
+
const b = y(seg.y1);
|
|
191
|
+
return along >= Math.min(a, b) - gap / 2 && along <= Math.max(a, b) + gap / 2;
|
|
192
|
+
});
|
|
193
|
+
const seriesIndex = order.find((index) => slots.get(index) === column);
|
|
182
194
|
return seriesIndex !== void 0 && segment(seriesIndex, i) ? seriesIndex : void 0;
|
|
183
|
-
})
|
|
195
|
+
});
|
|
184
196
|
const groups = series.map((s, index) => slots.has(index) && require_vnode.h("g", require_cartesian.seriesAttrs(s, index), labels.map((label, i) => {
|
|
185
197
|
const seg = segment(index, i);
|
|
186
198
|
if (!seg) return null;
|
|
199
|
+
const y = scaleOf(index);
|
|
187
200
|
const negative = seg.y1 < seg.y0;
|
|
188
201
|
const away = Math.sign(y(seg.y1) - y(seg.y0));
|
|
189
202
|
const inner = seg.y0 === 0 ? 0 : away * gap;
|
|
190
|
-
const rounded = !
|
|
203
|
+
const rounded = !inStack(index) || (negative ? outer[i]?.down : outer[i]?.up) === index;
|
|
191
204
|
const draw = horizontal ? require_bar.hbarPath : require_bar.barPath;
|
|
192
205
|
return require_vnode.h("path", {
|
|
193
206
|
key: require_cartesian.labelKey(label),
|
|
@@ -200,13 +213,15 @@ const bar = {
|
|
|
200
213
|
});
|
|
201
214
|
})));
|
|
202
215
|
const paths = lineKeys.length ? require_features.feature("line") : null;
|
|
203
|
-
const baseline = y(Math.min(Math.max(0, y.domain[0]), y.domain[1]));
|
|
204
216
|
const lines = series.map((s, index) => {
|
|
205
217
|
if (!paths) return null;
|
|
206
218
|
if (!isLine(index) || ctx.hidden.has(require_cartesian.seriesKey(s))) return null;
|
|
219
|
+
const y = scaleOf(index);
|
|
220
|
+
const axis = axisOf(s).axis;
|
|
221
|
+
const baseline = y(Math.min(Math.max(0, y.domain[0]), y.domain[1]));
|
|
207
222
|
const points = labels.map((_, i) => {
|
|
208
223
|
const v = s.values[i];
|
|
209
|
-
if (!require_cartesian.plottable(v,
|
|
224
|
+
if (!require_cartesian.plottable(v, axis)) return null;
|
|
210
225
|
const center = x.at(i) + x.bandwidth / 2;
|
|
211
226
|
return horizontal ? [y(v), center] : [center, y(v)];
|
|
212
227
|
});
|
|
@@ -219,16 +234,19 @@ const bar = {
|
|
|
219
234
|
d: paths.linePath(points, { curve })
|
|
220
235
|
}));
|
|
221
236
|
});
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
237
|
+
return {
|
|
238
|
+
content: [
|
|
239
|
+
require_vnode.h("defs", { key: "defs" }, layout.clip.def),
|
|
240
|
+
layout.background,
|
|
241
|
+
require_vnode.h("g", {
|
|
242
|
+
key: "series",
|
|
243
|
+
class: "tc-series-list",
|
|
244
|
+
"clip-path": layout.clip.url
|
|
245
|
+
}, groups, lines),
|
|
246
|
+
layout.foreground
|
|
247
|
+
],
|
|
248
|
+
interaction
|
|
249
|
+
};
|
|
232
250
|
},
|
|
233
251
|
legend: (options) => require_cartesian.seriesLegend(options.data),
|
|
234
252
|
table: (options, ctx, limit) => require_cartesian.seriesTable(options, ctx, limit)
|
|
@@ -240,4 +258,4 @@ Object.defineProperty(exports, "bar", {
|
|
|
240
258
|
}
|
|
241
259
|
});
|
|
242
260
|
|
|
243
|
-
//# sourceMappingURL=bar-
|
|
261
|
+
//# sourceMappingURL=bar-CVkOJ7WA.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bar-CVkOJ7WA.cjs","names":["resolveLabels","labelFormatter","valueAxis","labelKey","estimateTextWidth","plotFrame","axisSize","axisTitleSize","band","thinTicks","bandTicks","finishLayout","cleanData","cleanSeries","resolveLabels","seriesKey","seriesAxes","stackSeries","stackBounds","cartesianLayout","seriesScale","plottable","categoryInteraction","h","seriesAttrs","hbarPath","barPath","labelKey","feature","seriesLegend","seriesTable"],"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} 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 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,SAASA,kBAAAA,cAAc,QAAQ,IAAI;CACzC,MAAM,SAASC,kBAAAA,eAAe,SAAS,GAAG;CAC1C,MAAM,QAAQC,kBAAAA,UAAU,SAAS,KAAK,QAAQ,KAAK,MAAM,QAAA,EAAsB,C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,EAAE,SAAS,UAAU,CAAC;GACrC,OAAOE,cAAAA,EACL,KACAC,kBAAAA,YAAY,GAAG,KAAK,GACpB,UAAUD,cAAAA,EAAE,QAAQ;IAAE,OAAO;IAAW,GAAG,MAAM,SAAS,QAAQ,UAAU,EAAE,MAAM,CAAC;GAAE,CAAC,GACxFA,cAAAA,EAAE,QAAQ;IAAE,OAAO;IAAW,GAAG,MAAM,SAAS,QAAQ,EAAE,MAAM,CAAC;GAAE,CAAC,CACtE;EACF,CAAC;EAeD,OAAO;GAAE,SAAA;IAZPA,cAAAA,EAAE,QAAQ,EAAE,KAAK,OAAO,GAAG,OAAO,KAAK,GAAG;IAC1C,OAAO;IAGPA,cAAAA,EACE,KACA;KAAE,KAAK;KAAU,OAAO;KAAkB,aAAa,OAAO,KAAK;IAAI,GACvE,QACA,KACF;IACA,OAAO;GAEM;GAAG;EAAY;CAChC;CACA,SAAS,YAAYM,kBAAAA,aAAa,QAAQ,IAAI;CAC9C,QAAQ,SAAS,KAAK,UAAUC,kBAAAA,YAAY,SAAS,KAAK,KAAK;AACjE"}
|
|
@@ -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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I,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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as ChartType, ot as CartesianOptions } from "./chart-CYrrUCi3.js";
|
|
2
2
|
import { t as Curve } from "./path-YeUiOfG8.js";
|
|
3
3
|
import { t as StackMode } from "./stack-DR0eQTsB.js";
|
|
4
4
|
interface BarOptions extends CartesianOptions {
|