@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
package/dist/index.d.ts
CHANGED
|
@@ -4,23 +4,26 @@ import { a as ClassValue, c as StyleValue, d as normalizeClass, f as normalizeSt
|
|
|
4
4
|
import { a as linear, i as LinearScaleOptions, n as log, r as LinearScale, t as LogScaleOptions } from "./log-CI41TmcU.js";
|
|
5
5
|
import { a as timePointScale, c as NumberFormat, d as formatDetail, f as formatNumber, g as stepPrecision, h as getNumberFormat, i as time, l as NumberFormatOptions, m as getDateFormat, n as TimeScaleOptions, o as DateFormat, p as formatTicks, r as TimeValue, s as Locale, t as TimeScale, u as formatDate } from "./time-DRIDgv2a.js";
|
|
6
6
|
import { n as lttbIndices, t as lttb } from "./decimate-Du87fMLG.js";
|
|
7
|
-
import {
|
|
7
|
+
import { A as download, At as HitItem, B as features, C as TooltipPlacement, Ct as linearTicks, D as DownloadFormat, Dt as tableContent, E as tooltipContent, Et as describeHit, G as ImageOptions, H as DownloadOptions, J as exportSVG, K as downloadChart, M as BeforeRenderState, Mt as Interaction, N as ChartPlugin, O as DownloadMenuOptions, Ot as Highlight, P as PluginInstance, R as Features, S as TooltipOptions, St as bandTicks, T as placeTooltip, Tt as DataTable, U as ExportOptions, V as register, W as ExportTarget, _ as chartToString, _t as AxisPosition, a as ChartEvents, at as CartesianData, b as resolveLegend, bt as axis, c as RenderContext, ct as Label, d as Size, dt as categoryInteraction, f as TableContext, ft as domainOf, g as chartModel, gt as AxisOptions, h as chartLabel, ht as seriesTable, i as ChartConfig, it as legendContent, j as AfterRenderState, jt as HitTester, k as DownloadOption, kt as Hit, l as RenderResult, lt as Series, m as chartEvents, mt as seriesLegend, n as BuiltChart, nt as LegendOptions, o as ChartType, ot as CartesianOptions, p as buildChart, pt as seriesKey, q as exportImage, r as Chart$1, rt as defaultHidden, s as ContextOptions, st as CategoryAxisOptions, t as BaseOptions, tt as LegendItem, u as ResolvedLegend, ut as ValueAxisOptions, v as renderChart, vt as LinearTicksOptions, w as hitAnchor, wt as thinTicks, x as resolveSize, xt as axisSize, y as renderContext, yt as Tick, z as feature } from "./chart-CYrrUCi3.js";
|
|
8
8
|
import { a as linePath, i as areaPath, n as PathOptions, r as Point, t as Curve } from "./path-YeUiOfG8.js";
|
|
9
|
-
import { n as line, t as LineOptions } from "./line-
|
|
10
|
-
import { n as area, t as AreaOptions } from "./area-
|
|
11
|
-
import { n as bar, t as BarOptions } from "./bar-
|
|
12
|
-
import { n as
|
|
13
|
-
import { n as
|
|
14
|
-
import { n as
|
|
15
|
-
import { n as
|
|
16
|
-
import { n as
|
|
17
|
-
import { i as
|
|
18
|
-
import { n as
|
|
19
|
-
import {
|
|
20
|
-
import { i as
|
|
21
|
-
import { n as
|
|
22
|
-
import { n as
|
|
23
|
-
import {
|
|
9
|
+
import { n as line, t as LineOptions } from "./line-Bpr5uVLQ.js";
|
|
10
|
+
import { n as area, t as AreaOptions } from "./area-DEFQm_SQ.js";
|
|
11
|
+
import { n as bar, t as BarOptions } from "./bar-D9B_arKf.js";
|
|
12
|
+
import { a as calendar, i as CalendarSeries, n as CalendarEntry, r as CalendarOptions, t as CalendarData } from "./calendar-Bq3vFzPl.js";
|
|
13
|
+
import { n as CandlestickOptions, r as candlestick, t as Candle } from "./candlestick-B3WcLzph.js";
|
|
14
|
+
import { n as FunnelStage, r as funnel, t as FunnelOptions } from "./funnel-BdcfUkb5.js";
|
|
15
|
+
import { n as GaugeRing, r as gauge, t as GaugeOptions } from "./gauge-Zy25jfps.js";
|
|
16
|
+
import { n as HeatmapRange, r as heatmap, t as HeatmapOptions } from "./heatmap-Jp5sHRTo.js";
|
|
17
|
+
import { a as MapOptions, c as map, i as MapMarker, l as MapLayout, n as MapHit, o as MapRegion, r as MapLine, s as addMap, t as MapData, u as MapView } from "./map-BMC61J-P.js";
|
|
18
|
+
import { n as ParliamentParty, r as parliament, t as ParliamentOptions } from "./parliament-Cz9n_DoK.js";
|
|
19
|
+
import { n as PercentageBarSegment, r as percentageBar, t as PercentageBarOptions } from "./percentage-bar-cSeiLdwU.js";
|
|
20
|
+
import { i as pie, n as PieSlice, r as donut, t as PieOptions } from "./pie-BQQkvy1N.js";
|
|
21
|
+
import { n as RadialAxisOptions, r as radar, t as RadarOptions } from "./radar-vLxilcr4.js";
|
|
22
|
+
import { a as sankey, i as SankeyOptions, n as SankeyLink, r as SankeyNode, t as SankeyData } from "./sankey-7As41Fo4.js";
|
|
23
|
+
import { i as scatter, n as ScatterPoint, r as ScatterSeries, t as ScatterOptions } from "./scatter-BXkXGgM_.js";
|
|
24
|
+
import { n as sparkline, t as SparklineOptions } from "./sparkline-BElUSd0r.js";
|
|
25
|
+
import { n as TreemapOptions, r as treemap, t as TreemapNode } from "./treemap-BCXUbixd.js";
|
|
26
|
+
import { A as arcCentroid, C as keyboard, D as GridOptions, E as hoverUnderlay, M as padAngleForGap, O as grid, S as legend, T as hoverOverlay, _ as defaultPlugins, a as flush, b as sync, c as tickIncrement, d as extent, f as RenderToStringOptions, g as render, h as renderToString, i as cancel, j as arcPathStable, k as ArcOptions, l as tickStep, m as escapeText, n as barPath, o as schedule, p as escapeAttr, r as hbarPath, s as niceDomain, t as VERSION, u as ticks, v as tooltip, w as highlight, x as pointer, y as dataTable } from "./core-C3qEppSm.js";
|
|
24
27
|
/**
|
|
25
28
|
* A chart with every built-in plugin installed: hover highlight, legend,
|
|
26
29
|
* tooltip, data table and keyboard navigation. Each can be switched off in
|
|
@@ -32,7 +35,7 @@ import { A as arcCentroid, C as keyboard, D as GridOptions, E as hoverUnderlay,
|
|
|
32
35
|
* ```
|
|
33
36
|
*/
|
|
34
37
|
export declare class Chart<O extends object = object> extends Chart$1<O> {
|
|
35
|
-
constructor(target:
|
|
38
|
+
constructor(target: HTMLElement | string, config: ChartConfig<O>);
|
|
36
39
|
}
|
|
37
40
|
/**
|
|
38
41
|
* Every built-in chart type by its name, for charts declared in markup
|
|
@@ -40,4 +43,4 @@ export declare class Chart<O extends object = object> extends Chart$1<O> {
|
|
|
40
43
|
* brings every type along: code that knows its types imports them directly.
|
|
41
44
|
*/
|
|
42
45
|
export declare const types: Readonly<Record<string, ChartType<never>>>;
|
|
43
|
-
export { type AfterRenderState, type Annotation, type ArcOptions, type AreaOptions, type AttrValue, type Attrs, type AxisOptions, type AxisPosition, type BandKey, type BandScale, type BandScaleOptions, type BarOptions, type BaseOptions, type BeforeRenderState, type Candle, type CandlestickOptions, type CartesianData, type CartesianOptions, type CategoryAxisOptions, type ChartConfig, type ChartEvents, type ChartPlugin, type ChartType, type Child, type ChildInput, type ClassValue, type Curve, type DataTable, type DateFormat, type DownloadFormat, type DownloadMenuOptions, type DownloadOption, type DownloadOptions, type ExportOptions, type ExportTarget, type Features, type GaugeOptions, type GaugeRing, type GridOptions, type HeatmapOptions, type HeatmapRange, type Hit, type HitItem, type HitTester, type ImageOptions, type Insets, type InsetsInput, type Interaction, type Key, LINE_HEIGHT, type Label, type LegendItem, type LegendOptions, type LineOptions, type LinearScale, type LinearScaleOptions, type LinearTicksOptions, type Locale, type LogScaleOptions, type NumberFormat, type NumberFormatOptions, type ParliamentOptions, type ParliamentParty, type PathOptions, type PercentageBarOptions, type PercentageBarSegment, type PieOptions, type PieSlice, type PluginInstance, type Point, type Props, type RadarOptions, type RadialAxisOptions, type Rect, type RenderContext, type RenderToStringOptions, type ResolvedLegend, type SankeyData, type SankeyLink, type SankeyNode, type SankeyOptions, type ScatterOptions, type ScatterPoint, type ScatterSeries, type Series, type Size, type SparklineOptions, type StyleValue, type Tick, type TimeScale, type TimeScaleOptions, type TimeValue, type TooltipOptions, type TooltipPlacement, type TreemapNode, type TreemapOptions, VERSION, type VNode, type ValueAxisOptions, arcCentroid, arcPathStable, area, areaPath, axis, axisSize, band, bandTicks, bar, barPath, buildChart, cancel, candlestick, categoryInteraction, chartEvents, chartLabel, chartToString, dataTable, defaultHidden, defaultPlugins, describeHit, domainOf, donut, download, downloadChart, escapeAttr, escapeText, estimateTextWidth, exportImage, exportSVG, extent, feature, features, flush, formatDate, formatDetail, formatNumber, formatTicks, gauge, getDateFormat, getNumberFormat, grid, h, hbarPath, heatmap, highlight, hitAnchor, hoverOverlay, hoverUnderlay, innerRect, insets, keyboard, legend, legendContent, line, linePath, linear, linearTicks, log, lttb, lttbIndices, niceDomain, normalizeClass, normalizeStyle, padAngleForGap, parliament, percentageBar, pie, placeTooltip, point, pointer, radar, register, render, renderContext, renderToString, resolveLegend, resolveSize, sankey, scatter, schedule, seriesKey, seriesLegend, seriesTable, sparkline, stepPrecision, sync, tableContent, thinTicks, tickIncrement, tickStep, ticks, time, timePointScale, tooltip, tooltipContent, treemap };
|
|
46
|
+
export { type AfterRenderState, type Annotation, type ArcOptions, type AreaOptions, type AttrValue, type Attrs, type AxisOptions, type AxisPosition, type BandKey, type BandScale, type BandScaleOptions, type BarOptions, type BaseOptions, type BeforeRenderState, type BuiltChart, type CalendarData, type CalendarEntry, type CalendarOptions, type CalendarSeries, type Candle, type CandlestickOptions, type CartesianData, type CartesianOptions, type CategoryAxisOptions, type ChartConfig, type ChartEvents, type ChartPlugin, type ChartType, type Child, type ChildInput, type ClassValue, type ContextOptions, type Curve, type DataTable, type DateFormat, type DownloadFormat, type DownloadMenuOptions, type DownloadOption, type DownloadOptions, type ExportOptions, type ExportTarget, type Features, type FunnelOptions, type FunnelStage, type GaugeOptions, type GaugeRing, type GridOptions, type HeatmapOptions, type HeatmapRange, type Highlight, type Hit, type HitItem, type HitTester, type ImageOptions, type Insets, type InsetsInput, type Interaction, type Key, LINE_HEIGHT, type Label, type LegendItem, type LegendOptions, type LineOptions, type LinearScale, type LinearScaleOptions, type LinearTicksOptions, type Locale, type LogScaleOptions, type MapData, type MapHit, type MapLayout, type MapLine, type MapMarker, type MapOptions, type MapRegion, type MapView, type NumberFormat, type NumberFormatOptions, type ParliamentOptions, type ParliamentParty, type PathOptions, type PercentageBarOptions, type PercentageBarSegment, type PieOptions, type PieSlice, type PluginInstance, type Point, type Props, type RadarOptions, type RadialAxisOptions, type Rect, type RenderContext, type RenderResult, type RenderToStringOptions, type ResolvedLegend, type SankeyData, type SankeyLink, type SankeyNode, type SankeyOptions, type ScatterOptions, type ScatterPoint, type ScatterSeries, type Series, type Size, type SparklineOptions, type StyleValue, type TableContext, type Tick, type TimeScale, type TimeScaleOptions, type TimeValue, type TooltipOptions, type TooltipPlacement, type TreemapNode, type TreemapOptions, VERSION, type VNode, type ValueAxisOptions, addMap, arcCentroid, arcPathStable, area, areaPath, axis, axisSize, band, bandTicks, bar, barPath, buildChart, calendar, cancel, candlestick, categoryInteraction, chartEvents, chartLabel, chartModel, chartToString, dataTable, defaultHidden, defaultPlugins, describeHit, domainOf, donut, download, downloadChart, escapeAttr, escapeText, estimateTextWidth, exportImage, exportSVG, extent, feature, features, flush, formatDate, formatDetail, formatNumber, formatTicks, funnel, gauge, getDateFormat, getNumberFormat, grid, h, hbarPath, heatmap, highlight, hitAnchor, hoverOverlay, hoverUnderlay, innerRect, insets, keyboard, legend, legendContent, line, linePath, linear, linearTicks, log, lttb, lttbIndices, map, niceDomain, normalizeClass, normalizeStyle, padAngleForGap, parliament, percentageBar, pie, placeTooltip, point, pointer, radar, register, render, renderChart, renderContext, renderToString, resolveLegend, resolveSize, sankey, scatter, schedule, seriesKey, seriesLegend, seriesTable, sparkline, stepPrecision, sync, tableContent, thinTicks, tickIncrement, tickStep, ticks, time, timePointScale, tooltip, tooltipContent, treemap };
|
package/dist/index.js
CHANGED
|
@@ -1,40 +1,44 @@
|
|
|
1
|
-
import { i as insets, n as estimateTextWidth, r as innerRect, t as LINE_HEIGHT } from "./layout-
|
|
1
|
+
import { i as insets, n as estimateTextWidth, r as innerRect, t as LINE_HEIGHT } from "./layout-DqAte3H8.js";
|
|
2
2
|
import { n as normalizeClass, r as normalizeStyle, t as h } from "./vnode-_EMUqysL.js";
|
|
3
3
|
import { a as getDateFormat, i as formatTicks, n as formatDetail, o as getNumberFormat, r as formatNumber, s as stepPrecision, t as formatDate } from "./format-it1kepFG.js";
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
4
|
+
import { a as bandTicks, c as niceDomain, d as ticks, l as tickIncrement, n as axisSize, o as linearTicks, s as thinTicks, t as axis, u as tickStep } from "./axis-MMaVoSWB.js";
|
|
5
|
+
import { C as linear, E as grid, T as point, _ as seriesTable, h as seriesLegend, m as seriesKey, n as categoryInteraction, r as domainOf, w as band } from "./cartesian-BrPqb5Qn.js";
|
|
6
|
+
import { n as annotationValues, t as annotationLayers } from "./annotations-BQ8l-qHs.js";
|
|
6
7
|
import { t as extent } from "./extent-DOV8rs-6.js";
|
|
7
|
-
import { t as dateLabels } from "./dates-
|
|
8
|
+
import { t as dateLabels } from "./dates-DLe2Ww64.js";
|
|
8
9
|
import { n as logTicks, r as log, t as logDomain } from "./log-axis-DhthtHFk.js";
|
|
9
|
-
import { n as patternFills } from "./patterns-
|
|
10
|
-
import { n as
|
|
11
|
-
import { a as render } from "./dom-
|
|
12
|
-
import { n as time, r as timePointScale, t as timeAxis } from "./time-axis-
|
|
13
|
-
import { t as labelsStep } from "./value-labels-
|
|
14
|
-
import { i as register, n as feature, r as features, t as addPost } from "./features-
|
|
15
|
-
import { t as hydrate } from "./hydrate-
|
|
16
|
-
import { t as morph } from "./morph-
|
|
10
|
+
import { n as patternFills } from "./patterns-BMUINoka.js";
|
|
11
|
+
import { n as markerPath, t as markerClip } from "./point-shapes-DI6GhcI7.js";
|
|
12
|
+
import { a as render } from "./dom-CTse6Rvd.js";
|
|
13
|
+
import { n as time, r as timePointScale, t as timeAxis } from "./time-axis-CLjqOakA.js";
|
|
14
|
+
import { t as labelsStep } from "./value-labels-C7GrhOXJ.js";
|
|
15
|
+
import { i as register, n as feature, r as features, t as addPost } from "./features-B55rwpQC.js";
|
|
16
|
+
import { t as hydrate } from "./hydrate-BB3MlR36.js";
|
|
17
|
+
import { t as morph } from "./morph-GfBab-b3.js";
|
|
17
18
|
import { n as lttbIndices, t as lttb } from "./decimate-CapfgiDY.js";
|
|
18
|
-
import { n as areaPath, r as linePath } from "./fade-
|
|
19
|
-
import { _ as
|
|
20
|
-
import { _ as download, a as placeTooltip, c as sync, d as describeHit, f as tableContent, g as hoverUnderlay, h as hoverOverlay, i as hitAnchor, l as legend, m as pointer, n as defaultPlugins, o as tooltipContent, p as highlight, r as tooltip, s as dataTable, t as VERSION, u as keyboard } from "./core-
|
|
21
|
-
import { t as area } from "./area-
|
|
22
|
-
import { t as bar } from "./bar-
|
|
23
|
-
import { n as hbarPath, t as barPath } from "./bar-
|
|
24
|
-
import { t as
|
|
25
|
-
import { t as
|
|
19
|
+
import { n as areaPath, r as linePath } from "./fade-CDrQjnDz.js";
|
|
20
|
+
import { _ as escapeText, a as chartModel, b as legendContent, c as renderContext, d as cancel, f as flush, g as escapeAttr, h as schedule, i as chartLabel, l as resolveLegend, n as buildChart, o as chartToString, r as chartEvents, s as renderChart, t as Chart$1, u as resolveSize, v as renderToString, y as defaultHidden } from "./chart-B6TTY4Kr.js";
|
|
21
|
+
import { _ as download, a as placeTooltip, c as sync, d as describeHit, f as tableContent, g as hoverUnderlay, h as hoverOverlay, i as hitAnchor, l as legend, m as pointer, n as defaultPlugins, o as tooltipContent, p as highlight, r as tooltip, s as dataTable, t as VERSION, u as keyboard } from "./core-CQ0FaJ4G.js";
|
|
22
|
+
import { t as area } from "./area-WdtfqvhX.js";
|
|
23
|
+
import { t as bar } from "./bar-BOcRcArc.js";
|
|
24
|
+
import { n as hbarPath, t as barPath } from "./bar-CgpC2EpX.js";
|
|
25
|
+
import { t as calendar } from "./calendar-BXgIX5H1.js";
|
|
26
|
+
import { t as candlestick } from "./candlestick-BtT9glp9.js";
|
|
27
|
+
import { t as funnel } from "./funnel-CYCv8cq2.js";
|
|
28
|
+
import { t as gauge } from "./gauge-DiTk5aWO.js";
|
|
26
29
|
import { i as padAngleForGap, n as arcCentroid, r as arcPathStable } from "./arc-B3V5IR0w.js";
|
|
27
|
-
import { t as heatmap } from "./heatmap-
|
|
28
|
-
import { t as line } from "./line-
|
|
29
|
-
import { t as
|
|
30
|
-
import { t as
|
|
31
|
-
import {
|
|
32
|
-
import { t as
|
|
33
|
-
import { t as
|
|
34
|
-
import { t as
|
|
35
|
-
import { t as
|
|
36
|
-
import { t as
|
|
37
|
-
import {
|
|
30
|
+
import { t as heatmap } from "./heatmap-C1v8bwpq.js";
|
|
31
|
+
import { t as line } from "./line-CxR4tg1Q.js";
|
|
32
|
+
import { n as map, t as addMap } from "./map-C15NC7kW.js";
|
|
33
|
+
import { t as parliament } from "./parliament-BKN6ikBJ.js";
|
|
34
|
+
import { t as percentageBar } from "./percentage-bar-CaInxrL8.js";
|
|
35
|
+
import { n as pie, t as donut } from "./pie-Bd8wyrtY.js";
|
|
36
|
+
import { t as radar } from "./radar-D6XqkFWQ.js";
|
|
37
|
+
import { t as sankey } from "./sankey-Dp4CuLVe.js";
|
|
38
|
+
import { t as scatter } from "./scatter-DCMAtt5L.js";
|
|
39
|
+
import { t as sparkline } from "./sparkline-NDmq90kP.js";
|
|
40
|
+
import { t as treemap } from "./treemap-C4glsx-g.js";
|
|
41
|
+
import { n as exportImage, r as exportSVG, t as downloadChart } from "./export-chart-DoeiAyR2.js";
|
|
38
42
|
// src/chart-default.ts
|
|
39
43
|
/**
|
|
40
44
|
* A chart with every built-in plugin installed: hover highlight, legend,
|
|
@@ -67,12 +71,15 @@ const types = {
|
|
|
67
71
|
sparkline,
|
|
68
72
|
gauge,
|
|
69
73
|
heatmap,
|
|
74
|
+
calendar,
|
|
75
|
+
map,
|
|
70
76
|
candlestick,
|
|
71
77
|
radar,
|
|
72
78
|
sankey,
|
|
73
79
|
parliament,
|
|
74
80
|
treemap,
|
|
75
|
-
"percentage-bar": percentageBar
|
|
81
|
+
"percentage-bar": percentageBar,
|
|
82
|
+
funnel
|
|
76
83
|
};
|
|
77
84
|
// src/index.ts
|
|
78
85
|
/**
|
|
@@ -106,11 +113,11 @@ register({
|
|
|
106
113
|
},
|
|
107
114
|
patterns: patternFills,
|
|
108
115
|
"point-shapes": markerPath,
|
|
116
|
+
swatch: markerClip,
|
|
109
117
|
hydrate,
|
|
110
118
|
morph
|
|
111
119
|
});
|
|
112
|
-
addPost(shapesStep);
|
|
113
120
|
addPost(labelsStep);
|
|
114
|
-
export { Chart, LINE_HEIGHT, VERSION, arcCentroid, arcPathStable, area, areaPath, axis, axisSize, band, bandTicks, bar, barPath, buildChart, cancel, candlestick, categoryInteraction, chartEvents, chartLabel, chartToString, dataTable, defaultHidden, defaultPlugins, describeHit, domainOf, donut, download, downloadChart, escapeAttr, escapeText, estimateTextWidth, exportImage, exportSVG, extent, feature, features, flush, formatDate, formatDetail, formatNumber, formatTicks, gauge, getDateFormat, getNumberFormat, grid, h, hbarPath, heatmap, highlight, hitAnchor, hoverOverlay, hoverUnderlay, innerRect, insets, keyboard, legend, legendContent, line, linePath, linear, linearTicks, log, lttb, lttbIndices, niceDomain, normalizeClass, normalizeStyle, padAngleForGap, parliament, percentageBar, pie, placeTooltip, point, pointer, radar, register, render, renderContext, renderToString, resolveLegend, resolveSize, sankey, scatter, schedule, seriesKey, seriesLegend, seriesTable, sparkline, stepPrecision, sync, tableContent, thinTicks, tickIncrement, tickStep, ticks, time, timePointScale, tooltip, tooltipContent, treemap, types };
|
|
121
|
+
export { Chart, LINE_HEIGHT, VERSION, addMap, arcCentroid, arcPathStable, area, areaPath, axis, axisSize, band, bandTicks, bar, barPath, buildChart, calendar, cancel, candlestick, categoryInteraction, chartEvents, chartLabel, chartModel, chartToString, dataTable, defaultHidden, defaultPlugins, describeHit, domainOf, donut, download, downloadChart, escapeAttr, escapeText, estimateTextWidth, exportImage, exportSVG, extent, feature, features, flush, formatDate, formatDetail, formatNumber, formatTicks, funnel, gauge, getDateFormat, getNumberFormat, grid, h, hbarPath, heatmap, highlight, hitAnchor, hoverOverlay, hoverUnderlay, innerRect, insets, keyboard, legend, legendContent, line, linePath, linear, linearTicks, log, lttb, lttbIndices, map, niceDomain, normalizeClass, normalizeStyle, padAngleForGap, parliament, percentageBar, pie, placeTooltip, point, pointer, radar, register, render, renderChart, renderContext, renderToString, resolveLegend, resolveSize, sankey, scatter, schedule, seriesKey, seriesLegend, seriesTable, sparkline, stepPrecision, sync, tableContent, thinTicks, tickIncrement, tickStep, ticks, time, timePointScale, tooltip, tooltipContent, treemap, types };
|
|
115
122
|
|
|
116
123
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CoreChart"],"sources":["../src/chart-default.ts","../src/chart-types.ts","../src/index.ts"],"sourcesContent":["import { type ChartConfig, Chart as CoreChart } from './chart.ts'\nimport { defaultPlugins } from './plugins/index.ts'\n\n/**\n * A chart with every built-in plugin installed: hover highlight, legend,\n * tooltip, data table and keyboard navigation. Each can be switched off in\n * the config (`tooltip: false`, …). For the smallest bundle, use the bare\n * `Chart` from `@tabler/charts/core` and pick plugins explicitly.\n *\n * ```ts\n * const chart = new Chart('#sales', { type: line, data })\n * ```\n */\nexport class Chart<O extends object = object> extends CoreChart<O> {\n constructor(target:
|
|
1
|
+
{"version":3,"file":"index.js","names":["CoreChart"],"sources":["../src/chart-default.ts","../src/chart-types.ts","../src/index.ts"],"sourcesContent":["import { type ChartConfig, Chart as CoreChart } from './chart.ts'\nimport { defaultPlugins } from './plugins/index.ts'\n\n/**\n * A chart with every built-in plugin installed: hover highlight, legend,\n * tooltip, data table and keyboard navigation. Each can be switched off in\n * the config (`tooltip: false`, …). For the smallest bundle, use the bare\n * `Chart` from `@tabler/charts/core` and pick plugins explicitly.\n *\n * ```ts\n * const chart = new Chart('#sales', { type: line, data })\n * ```\n */\nexport class Chart<O extends object = object> extends CoreChart<O> {\n constructor(target: HTMLElement | string, config: ChartConfig<O>) {\n super(target, config, defaultPlugins())\n }\n}\n","import type { ChartType } from './chart.ts'\nimport { area } from './charts/area.ts'\nimport { bar } from './charts/bar.ts'\nimport { calendar } from './charts/calendar.ts'\nimport { candlestick } from './charts/candlestick.ts'\nimport { funnel } from './charts/funnel.ts'\nimport { gauge } from './charts/gauge.ts'\nimport { heatmap } from './charts/heatmap.ts'\nimport { line } from './charts/line.ts'\nimport { map } from './charts/map.ts'\nimport { parliament } from './charts/parliament.ts'\nimport { percentageBar } from './charts/percentage-bar.ts'\nimport { donut, pie } from './charts/pie.ts'\nimport { radar } from './charts/radar.ts'\nimport { sankey } from './charts/sankey.ts'\nimport { scatter } from './charts/scatter.ts'\nimport { sparkline } from './charts/sparkline.ts'\nimport { treemap } from './charts/treemap.ts'\n\n/**\n * Every built-in chart type by its name, for charts declared in markup\n * (`<tabler-chart type=\"line\">`, `data-tc-chart=\"line\"`). Importing it\n * brings every type along: code that knows its types imports them directly.\n */\nexport const types: Readonly<Record<string, ChartType<never>>> = {\n line,\n area,\n bar,\n pie,\n donut,\n scatter,\n sparkline,\n gauge,\n heatmap,\n calendar,\n map,\n candlestick,\n radar,\n sankey,\n parliament,\n treemap,\n 'percentage-bar': percentageBar,\n funnel,\n} as Record<string, ChartType<never>>\n","/**\n * `@tabler/charts`: everything from `@tabler/charts/core`, with a `Chart`\n * that installs the built-in plugins (tooltip, legend, keyboard, …) and\n * every optional feature registered (time and log axes, decimation,\n * annotations, pattern fills, value labels, point shapes). The one exception\n * is the `download` menu's saver: `import '@tabler/charts/export'` adds it,\n * so charts that never offer a download do not carry the export code.\n */\n\nimport { annotationLayers, annotationValues } from './charts/annotations.ts'\nimport { dateLabels } from './charts/dates.ts'\nimport { logDomain, logTicks } from './charts/log-axis.ts'\nimport { patternFills } from './charts/patterns.ts'\nimport { markerClip, markerPath } from './charts/point-shapes.ts'\nimport { timeAxis } from './charts/time-axis.ts'\nimport { labelsStep } from './charts/value-labels.ts'\nimport { addPost, register } from './features.ts'\nimport { hydrate } from './render/hydrate.ts'\nimport { morph } from './render/morph.ts'\nimport { log } from './scales/log.ts'\nimport { time, timePointScale } from './scales/time.ts'\nimport { lttb, lttbIndices } from './shapes/decimate.ts'\nimport { areaPath, linePath } from './shapes/path.ts'\n\n// Registered here, in the entry itself, so no bundler can shake it away.\nregister({\n time: { scale: time, points: timePointScale, axis: timeAxis },\n dates: dateLabels,\n log: { scale: log, domain: logDomain, ticks: logTicks },\n decimate: lttbIndices,\n line: { linePath, areaPath },\n annotations: { layers: annotationLayers, values: annotationValues },\n patterns: patternFills,\n 'point-shapes': markerPath,\n swatch: markerClip,\n hydrate,\n morph,\n})\n\n// The step that finishes the content: value labels over the marks.\naddPost(labelsStep)\n\nexport { Chart } from './chart-default.ts'\nexport { types } from './chart-types.ts'\nexport * from './core.ts'\nexport type { DownloadOptions, ExportOptions, ExportTarget, ImageOptions } from './export-chart.ts'\nexport { downloadChart, exportImage, exportSVG } from './export-chart.ts'\nexport type { LogScaleOptions } from './scales/log.ts'\nexport type { TimeScale, TimeScaleOptions, TimeValue } from './scales/time.ts'\nexport { log, lttb, lttbIndices, time, timePointScale }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAa,QAAb,cAAsDA,QAAa;CACjE,YAAY,QAA8B,QAAwB;EAChE,MAAM,QAAQ,QAAQ,eAAe,CAAC;CACxC;AACF;;;;;;;ACOA,MAAa,QAAoD;CAC/D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,kBAAkB;CAClB;AACF;;;;;;;;;;AClBA,SAAS;CACP,MAAM;EAAE,OAAO;EAAM,QAAQ;EAAgB,MAAM;CAAS;CAC5D,OAAO;CACP,KAAK;EAAE,OAAO;EAAK,QAAQ;EAAW,OAAO;CAAS;CACtD,UAAU;CACV,MAAM;EAAE;EAAU;CAAS;CAC3B,aAAa;EAAE,QAAQ;EAAkB,QAAQ;CAAiB;CAClE,UAAU;CACV,gBAAgB;CAChB,QAAQ;CACR;CACA;AACF,CAAC;AAGD,QAAQ,UAAU"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/interaction.ts
|
|
2
|
+
/** Identity of a hit, used to emit hover changes only when it changes. */
|
|
3
|
+
function hitKey(hit) {
|
|
4
|
+
return hit ? `${hit.index}:${hit.seriesIndex ?? ""}` : "";
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Convert a pointer position to chart pixels, accounting for the SVG being
|
|
8
|
+
* scaled by CSS (e.g. `max-width: 100%`).
|
|
9
|
+
*/
|
|
10
|
+
function toChartPoint(svg, clientX, clientY, width, height) {
|
|
11
|
+
const rect = svg.getBoundingClientRect();
|
|
12
|
+
const sx = rect.width > 0 ? width / rect.width : 1;
|
|
13
|
+
const sy = rect.height > 0 ? height / rect.height : 1;
|
|
14
|
+
return {
|
|
15
|
+
x: (clientX - rect.left) * sx,
|
|
16
|
+
y: (clientY - rect.top) * sy
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(exports, "hitKey", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function() {
|
|
22
|
+
return hitKey;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "toChartPoint", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function() {
|
|
28
|
+
return toChartPoint;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=interaction-DXYSjgnP.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction-DXYSjgnP.cjs","names":[],"sources":["../src/interaction.ts"],"sourcesContent":["import type { Rect } from './layout.ts'\n\n/** One series' value at a hovered position. */\nexport interface HitItem {\n /** Series name. */\n name: string\n /** Position of the series in `data.series`. */\n seriesIndex: number\n /** Custom series color, if one was set. */\n color?: string\n value: number | null\n /** Value formatted for display (tooltips). */\n text: string\n /** Anchor of the value in chart pixels (point, bar end); `y` is `null` for gaps. */\n x: number\n y: number | null\n /** The mark's rectangle (bar, segment, cell), for value labels inside it. */\n box?: Rect\n}\n\n/** What lies under the pointer. */\nexport interface Hit {\n /** Category index. */\n index: number\n /** Category label. */\n label: string | number\n /** Label formatted for display (tooltips). */\n title: string\n /** Anchor x of the category in chart pixels (for crosshairs and tooltips); the plot center for horizontal bars. */\n x: number\n /** Plot area, in chart pixels. */\n area: Rect\n /** Axis the categories run along; `'y'` for horizontal bars. Defaults to `'x'`. */\n axis?: 'x' | 'y'\n /** Center of the category along y, when categories run along y. */\n y?: number\n /** Every series' value at this category. */\n items: HitItem[]\n /** Series of the mark directly under the pointer (e.g. a bar), if any. */\n seriesIndex?: number\n /** The shape that marks the hit; a crosshair when left out. */\n highlight?: Highlight\n}\n\n/**\n * The one shape drawn to mark a hit, in chart pixels:\n *\n * - `crosshair`: a vertical line through the category across the plot, and\n * a dot on every value (point charts);\n * - `band`: the category's band behind the series (bars);\n * - `spoke`: a line from `x1, y1` to `x2, y2` (a radar spoke), and a dot on\n * every value; keyboard tooltips anchor on the value itself;\n * - `halo`: path data `d` drawn translated by `x` / `y` in the color of the\n * hit's series (a ring around a pie slice); `under` draws it below the\n * chart instead of above, so it never covers the labels.\n */\nexport type Highlight =\n | { kind: 'crosshair' }\n | { kind: 'band'; x: number; y: number; width: number; height: number }\n | { kind: 'spoke'; x1: number; y1: number; x2: number; y2: number }\n | { kind: 'halo'; d: string; x?: number; y?: number; under?: boolean }\n\n/** Maps a point in chart pixels to what lies there. */\nexport type HitTester = (x: number, y: number) => Hit | null\n\n/** How a rendered chart answers pointer and keyboard interaction. */\nexport interface Interaction {\n /** What lies at a point in chart pixels. */\n hitTest: HitTester\n /** The hit for a category by index (keyboard navigation), optionally focused on a series. */\n hitIndex(index: number, seriesIndex?: number): Hit | null\n /** Number of categories. */\n count: number\n /**\n * Categories fill a grid column by column, this many to a column (the days\n * of a calendar in weeks): left and right move by a column, up and down by one.\n */\n rows?: number\n /** Categories run from the right: the left arrow key goes to the next one. */\n reversed?: boolean\n}\n\n/** Identity of a hit, used to emit hover changes only when it changes. */\nexport function hitKey(hit: Hit | null): string {\n return hit ? `${hit.index}:${hit.seriesIndex ?? ''}` : ''\n}\n\n/**\n * Convert a pointer position to chart pixels, accounting for the SVG being\n * scaled by CSS (e.g. `max-width: 100%`).\n */\nexport function toChartPoint(\n svg: Element,\n clientX: number,\n clientY: number,\n width: number,\n height: number,\n): { x: number; y: number } {\n const rect = svg.getBoundingClientRect()\n const sx = rect.width > 0 ? width / rect.width : 1\n const sy = rect.height > 0 ? height / rect.height : 1\n return { x: (clientX - rect.left) * sx, y: (clientY - rect.top) * sy }\n}\n"],"mappings":";;AAmFA,SAAgB,OAAO,KAAyB;CAC9C,OAAO,MAAM,GAAG,IAAI,MAAM,GAAG,IAAI,eAAe,OAAO;AACzD;;;;;AAMA,SAAgB,aACd,KACA,SACA,SACA,OACA,QAC0B;CAC1B,MAAM,OAAO,IAAI,sBAAsB;CACvC,MAAM,KAAK,KAAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ;CACjD,MAAM,KAAK,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS;CACpD,OAAO;EAAE,IAAI,UAAU,KAAK,QAAQ;EAAI,IAAI,UAAU,KAAK,OAAO;CAAG;AACvE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/interaction.ts
|
|
2
|
+
/** Identity of a hit, used to emit hover changes only when it changes. */
|
|
3
|
+
function hitKey(hit) {
|
|
4
|
+
return hit ? `${hit.index}:${hit.seriesIndex ?? ""}` : "";
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Convert a pointer position to chart pixels, accounting for the SVG being
|
|
8
|
+
* scaled by CSS (e.g. `max-width: 100%`).
|
|
9
|
+
*/
|
|
10
|
+
function toChartPoint(svg, clientX, clientY, width, height) {
|
|
11
|
+
const rect = svg.getBoundingClientRect();
|
|
12
|
+
const sx = rect.width > 0 ? width / rect.width : 1;
|
|
13
|
+
const sy = rect.height > 0 ? height / rect.height : 1;
|
|
14
|
+
return {
|
|
15
|
+
x: (clientX - rect.left) * sx,
|
|
16
|
+
y: (clientY - rect.top) * sy
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export { toChartPoint as n, hitKey as t };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=interaction-En1KlwFO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction-En1KlwFO.js","names":[],"sources":["../src/interaction.ts"],"sourcesContent":["import type { Rect } from './layout.ts'\n\n/** One series' value at a hovered position. */\nexport interface HitItem {\n /** Series name. */\n name: string\n /** Position of the series in `data.series`. */\n seriesIndex: number\n /** Custom series color, if one was set. */\n color?: string\n value: number | null\n /** Value formatted for display (tooltips). */\n text: string\n /** Anchor of the value in chart pixels (point, bar end); `y` is `null` for gaps. */\n x: number\n y: number | null\n /** The mark's rectangle (bar, segment, cell), for value labels inside it. */\n box?: Rect\n}\n\n/** What lies under the pointer. */\nexport interface Hit {\n /** Category index. */\n index: number\n /** Category label. */\n label: string | number\n /** Label formatted for display (tooltips). */\n title: string\n /** Anchor x of the category in chart pixels (for crosshairs and tooltips); the plot center for horizontal bars. */\n x: number\n /** Plot area, in chart pixels. */\n area: Rect\n /** Axis the categories run along; `'y'` for horizontal bars. Defaults to `'x'`. */\n axis?: 'x' | 'y'\n /** Center of the category along y, when categories run along y. */\n y?: number\n /** Every series' value at this category. */\n items: HitItem[]\n /** Series of the mark directly under the pointer (e.g. a bar), if any. */\n seriesIndex?: number\n /** The shape that marks the hit; a crosshair when left out. */\n highlight?: Highlight\n}\n\n/**\n * The one shape drawn to mark a hit, in chart pixels:\n *\n * - `crosshair`: a vertical line through the category across the plot, and\n * a dot on every value (point charts);\n * - `band`: the category's band behind the series (bars);\n * - `spoke`: a line from `x1, y1` to `x2, y2` (a radar spoke), and a dot on\n * every value; keyboard tooltips anchor on the value itself;\n * - `halo`: path data `d` drawn translated by `x` / `y` in the color of the\n * hit's series (a ring around a pie slice); `under` draws it below the\n * chart instead of above, so it never covers the labels.\n */\nexport type Highlight =\n | { kind: 'crosshair' }\n | { kind: 'band'; x: number; y: number; width: number; height: number }\n | { kind: 'spoke'; x1: number; y1: number; x2: number; y2: number }\n | { kind: 'halo'; d: string; x?: number; y?: number; under?: boolean }\n\n/** Maps a point in chart pixels to what lies there. */\nexport type HitTester = (x: number, y: number) => Hit | null\n\n/** How a rendered chart answers pointer and keyboard interaction. */\nexport interface Interaction {\n /** What lies at a point in chart pixels. */\n hitTest: HitTester\n /** The hit for a category by index (keyboard navigation), optionally focused on a series. */\n hitIndex(index: number, seriesIndex?: number): Hit | null\n /** Number of categories. */\n count: number\n /**\n * Categories fill a grid column by column, this many to a column (the days\n * of a calendar in weeks): left and right move by a column, up and down by one.\n */\n rows?: number\n /** Categories run from the right: the left arrow key goes to the next one. */\n reversed?: boolean\n}\n\n/** Identity of a hit, used to emit hover changes only when it changes. */\nexport function hitKey(hit: Hit | null): string {\n return hit ? `${hit.index}:${hit.seriesIndex ?? ''}` : ''\n}\n\n/**\n * Convert a pointer position to chart pixels, accounting for the SVG being\n * scaled by CSS (e.g. `max-width: 100%`).\n */\nexport function toChartPoint(\n svg: Element,\n clientX: number,\n clientY: number,\n width: number,\n height: number,\n): { x: number; y: number } {\n const rect = svg.getBoundingClientRect()\n const sx = rect.width > 0 ? width / rect.width : 1\n const sy = rect.height > 0 ? height / rect.height : 1\n return { x: (clientX - rect.left) * sx, y: (clientY - rect.top) * sy }\n}\n"],"mappings":";;AAmFA,SAAgB,OAAO,KAAyB;CAC9C,OAAO,MAAM,GAAG,IAAI,MAAM,GAAG,IAAI,eAAe,OAAO;AACzD;;;;;AAMA,SAAgB,aACd,KACA,SACA,SACA,OACA,QAC0B;CAC1B,MAAM,OAAO,IAAI,sBAAsB;CACvC,MAAM,KAAK,KAAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ;CACjD,MAAM,KAAK,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS;CACpD,OAAO;EAAE,IAAI,UAAU,KAAK,QAAQ;EAAI,IAAI,UAAU,KAAK,OAAO;CAAG;AACvE"}
|
|
@@ -27,6 +27,31 @@ function innerRect(width, height, margins) {
|
|
|
27
27
|
height: Math.max(0, height - margins.top - margins.bottom)
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Place the plot area of a chart with axes. `margins` gets the padding by
|
|
32
|
+
* reading direction and returns the space each side needs, so a chart type
|
|
33
|
+
* works its margins out once, whichever way the chart is read.
|
|
34
|
+
*/
|
|
35
|
+
function plotFrame(size, padding, margins) {
|
|
36
|
+
const { width, height, rtl } = size;
|
|
37
|
+
const pad = insets(padding);
|
|
38
|
+
const m = margins({
|
|
39
|
+
...pad,
|
|
40
|
+
start: rtl ? pad.right : pad.left,
|
|
41
|
+
end: rtl ? pad.left : pad.right
|
|
42
|
+
});
|
|
43
|
+
const area = innerRect(width, height, {
|
|
44
|
+
...m,
|
|
45
|
+
left: rtl ? m.end : m.start,
|
|
46
|
+
right: rtl ? m.start : m.end
|
|
47
|
+
});
|
|
48
|
+
const end = area.x + area.width;
|
|
49
|
+
return {
|
|
50
|
+
area,
|
|
51
|
+
side: rtl ? "right" : "left",
|
|
52
|
+
range: (reverse = rtl) => reverse ? [end, area.x] : [area.x, end]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
30
55
|
const THIN = " !'.,:;|ijlI`";
|
|
31
56
|
const NARROW = "()[]{}-/frt";
|
|
32
57
|
const ROUND = "CDGHNOQU";
|
|
@@ -99,6 +124,12 @@ Object.defineProperty(exports, "mirrorSides", {
|
|
|
99
124
|
return mirrorSides;
|
|
100
125
|
}
|
|
101
126
|
});
|
|
127
|
+
Object.defineProperty(exports, "plotFrame", {
|
|
128
|
+
enumerable: true,
|
|
129
|
+
get: function() {
|
|
130
|
+
return plotFrame;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
102
133
|
Object.defineProperty(exports, "round", {
|
|
103
134
|
enumerable: true,
|
|
104
135
|
get: function() {
|
|
@@ -106,4 +137,4 @@ Object.defineProperty(exports, "round", {
|
|
|
106
137
|
}
|
|
107
138
|
});
|
|
108
139
|
|
|
109
|
-
//# sourceMappingURL=layout-
|
|
140
|
+
//# sourceMappingURL=layout-Cfg9x1k2.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-Cfg9x1k2.cjs","names":[],"sources":["../src/layout.ts"],"sourcesContent":["/** Axis-aligned rectangle in pixels. */\nexport interface Rect {\n x: number\n y: number\n width: number\n height: number\n}\n\n/** Space around a box, in pixels. */\nexport interface Insets {\n top: number\n right: number\n bottom: number\n left: number\n}\n\n/** Insets given as one number for all sides or per side. */\nexport type InsetsInput = number | Partial<Insets>\n\n/** Normalize an {@link InsetsInput}; missing sides fall back to `fallback`. */\nexport function insets(value: InsetsInput | undefined, fallback = 0): Insets {\n // A side that is not a finite number (left out, or junk from outside) takes the fallback.\n const side = (key: keyof Insets): number => {\n const v = typeof value === 'number' ? value : value?.[key]\n return Number.isFinite(v) ? (v as number) : fallback\n }\n return { top: side('top'), right: side('right'), bottom: side('bottom'), left: side('left') }\n}\n\n/** Swap the left and right of `sides` in a right-to-left chart. */\nexport const mirrorSides = <T extends { left: number; right: number }>(\n sides: T,\n rtl: boolean | undefined,\n): T => (rtl ? { ...sides, left: sides.right, right: sides.left } : sides)\n\n/** Rectangle left inside `width × height` after `margins`; never negative. */\nexport function innerRect(width: number, height: number, margins: Insets): Rect {\n return {\n x: margins.left,\n y: margins.top,\n width: Math.max(0, width - margins.left - margins.right),\n height: Math.max(0, height - margins.top - margins.bottom),\n }\n}\n\n/**\n * Space around a box by reading direction: `start` is the side the chart is\n * read from (the left, or the right in a right-to-left chart), `end` the other.\n */\nexport interface FrameInsets {\n top: number\n bottom: number\n start: number\n end: number\n}\n\n/** A plot area placed for the chart's reading direction. */\nexport interface PlotFrame {\n /** Where the data is drawn. */\n area: Rect\n /** The start side, where the axis beside the plot sits. */\n side: 'left' | 'right'\n /** The plot's horizontal range, from the end side when `reverse` (by default in a right-to-left chart). */\n range(reverse?: boolean): [number, number]\n}\n\n/**\n * Place the plot area of a chart with axes. `margins` gets the padding by\n * reading direction and returns the space each side needs, so a chart type\n * works its margins out once, whichever way the chart is read.\n */\nexport function plotFrame(\n size: { width: number; height: number; rtl?: boolean },\n padding: InsetsInput | undefined,\n margins: (padding: FrameInsets) => FrameInsets,\n): PlotFrame {\n const { width, height, rtl } = size\n const pad = insets(padding)\n const m = margins({\n ...pad,\n start: rtl ? pad.right : pad.left,\n end: rtl ? pad.left : pad.right,\n })\n const area = innerRect(width, height, {\n ...m,\n left: rtl ? m.end : m.start,\n right: rtl ? m.start : m.end,\n })\n const end = area.x + area.width\n return {\n area,\n side: rtl ? 'right' : 'left',\n range: (reverse = rtl) => (reverse ? [end, area.x] : [area.x, end]),\n }\n}\n\n// Approximate advance widths in em for common UI sans-serif fonts\n// (system-ui / SF, Segoe UI, Roboto), measured in the browser.\nconst THIN = \" !'.,:;|ijlI`\"\nconst NARROW = '()[]{}-/frt'\nconst ROUND = 'CDGHNOQU'\nconst WIDE = '%@MWmw'\n\n/**\n * Full-width characters, a whole em each: Hangul, CJK and kana, compatibility\n * ideographs, fullwidth forms and pictographs (emoji).\n */\nconst isWide = (code: number): boolean =>\n code >= 0x1100 &&\n (code <= 0x115f ||\n (code >= 0x2e80 && code <= 0xa4cf) ||\n (code >= 0xac00 && code <= 0xd7a3) ||\n (code >= 0xf900 && code <= 0xfaff) ||\n (code >= 0xff00 && code <= 0xff60) ||\n code >= 0x1f300)\n\n/** The width of an ASCII character, in em. */\nfunction charWidth(char: string): number {\n if (char >= '0' && char <= '9') return char === '1' ? 0.45 : 0.63\n if (THIN.includes(char)) return 0.27\n if (NARROW.includes(char)) return 0.38\n if (WIDE.includes(char)) return 0.88\n if (ROUND.includes(char)) return 0.76\n if (char >= 'A' && char <= 'Z') return 0.66\n return 0.57\n}\n\n/**\n * Estimate the rendered width of `text` without a DOM, for layout on the\n * server and in workers. Tuned for common UI sans-serif fonts; deterministic,\n * so SSR and client layouts agree.\n */\nexport function estimateTextWidth(text: string, fontSize: number): number {\n let em = 0\n for (let i = 0; i < text.length; i++) {\n const point = text.codePointAt(i) as number\n // Beyond ASCII a character is a whole em or an average one; a pair of surrogates is one.\n em += ASCII[point] ?? (isWide(point) ? 1 : 0.57)\n if (point > 0xffff) i++\n }\n return em * fontSize\n}\n\n/**\n * The width of every ASCII character, looked up instead of worked out: an\n * axis of 100,000 long labels estimates millions of characters per render.\n */\nconst ASCII = /* @__PURE__ */ Array.from({ length: 128 }, (_, code) =>\n charWidth(String.fromCharCode(code)),\n)\n\n/** A pixel value rounded to two decimals, as written into attributes and path data. */\nexport const round = (value: number): number => Math.round(value * 100) / 100\n\n/** Line height used for single-line labels, relative to the font size. */\nexport const LINE_HEIGHT = 1.25\n"],"mappings":";;AAoBA,SAAgB,OAAO,OAAgC,WAAW,GAAW;CAE3E,MAAM,QAAQ,QAA8B;EAC1C,MAAM,IAAI,OAAO,UAAU,WAAW,QAAQ,QAAQ;EACtD,OAAO,OAAO,SAAS,CAAC,IAAK,IAAe;CAC9C;CACA,OAAO;EAAE,KAAK,KAAK,KAAK;EAAG,OAAO,KAAK,OAAO;EAAG,QAAQ,KAAK,QAAQ;EAAG,MAAM,KAAK,MAAM;CAAE;AAC9F;;AAGA,MAAa,eACX,OACA,QACO,MAAM;CAAE,GAAG;CAAO,MAAM,MAAM;CAAO,OAAO,MAAM;AAAK,IAAI;;AAGpE,SAAgB,UAAU,OAAe,QAAgB,SAAuB;CAC9E,OAAO;EACL,GAAG,QAAQ;EACX,GAAG,QAAQ;EACX,OAAO,KAAK,IAAI,GAAG,QAAQ,QAAQ,OAAO,QAAQ,KAAK;EACvD,QAAQ,KAAK,IAAI,GAAG,SAAS,QAAQ,MAAM,QAAQ,MAAM;CAC3D;AACF;;;;;;AA4BA,SAAgB,UACd,MACA,SACA,SACW;CACX,MAAM,EAAE,OAAO,QAAQ,QAAQ;CAC/B,MAAM,MAAM,OAAO,OAAO;CAC1B,MAAM,IAAI,QAAQ;EAChB,GAAG;EACH,OAAO,MAAM,IAAI,QAAQ,IAAI;EAC7B,KAAK,MAAM,IAAI,OAAO,IAAI;CAC5B,CAAC;CACD,MAAM,OAAO,UAAU,OAAO,QAAQ;EACpC,GAAG;EACH,MAAM,MAAM,EAAE,MAAM,EAAE;EACtB,OAAO,MAAM,EAAE,QAAQ,EAAE;CAC3B,CAAC;CACD,MAAM,MAAM,KAAK,IAAI,KAAK;CAC1B,OAAO;EACL;EACA,MAAM,MAAM,UAAU;EACtB,QAAQ,UAAU,QAAS,UAAU,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG;CACnE;AACF;AAIA,MAAM,OAAO;AACb,MAAM,SAAS;AACf,MAAM,QAAQ;AACd,MAAM,OAAO;;;;;AAMb,MAAM,UAAU,SACd,QAAQ,SACP,QAAQ,QACN,QAAQ,SAAU,QAAQ,SAC1B,QAAQ,SAAU,QAAQ,SAC1B,QAAQ,SAAU,QAAQ,SAC1B,QAAQ,SAAU,QAAQ,SAC3B,QAAQ;;AAGZ,SAAS,UAAU,MAAsB;CACvC,IAAI,QAAQ,OAAO,QAAQ,KAAK,OAAO,SAAS,MAAM,MAAO;CAC7D,IAAI,KAAK,SAAS,IAAI,GAAG,OAAO;CAChC,IAAI,OAAO,SAAS,IAAI,GAAG,OAAO;CAClC,IAAI,KAAK,SAAS,IAAI,GAAG,OAAO;CAChC,IAAI,MAAM,SAAS,IAAI,GAAG,OAAO;CACjC,IAAI,QAAQ,OAAO,QAAQ,KAAK,OAAO;CACvC,OAAO;AACT;;;;;;AAOA,SAAgB,kBAAkB,MAAc,UAA0B;CACxE,IAAI,KAAK;CACT,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,QAAQ,KAAK,YAAY,CAAC;EAEhC,MAAM,MAAM,WAAW,OAAO,KAAK,IAAI,IAAI;EAC3C,IAAI,QAAQ,OAAQ;CACtB;CACA,OAAO,KAAK;AACd;;;;;AAMA,MAAM,QAAwB,sBAAM,KAAK,EAAE,QAAQ,IAAI,IAAI,GAAG,SAC5D,UAAU,OAAO,aAAa,IAAI,CAAC,CACrC;;AAGA,MAAa,SAAS,UAA0B,KAAK,MAAM,QAAQ,GAAG,IAAI;;AAG1E,MAAa,cAAc"}
|
|
@@ -27,6 +27,31 @@ function innerRect(width, height, margins) {
|
|
|
27
27
|
height: Math.max(0, height - margins.top - margins.bottom)
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Place the plot area of a chart with axes. `margins` gets the padding by
|
|
32
|
+
* reading direction and returns the space each side needs, so a chart type
|
|
33
|
+
* works its margins out once, whichever way the chart is read.
|
|
34
|
+
*/
|
|
35
|
+
function plotFrame(size, padding, margins) {
|
|
36
|
+
const { width, height, rtl } = size;
|
|
37
|
+
const pad = insets(padding);
|
|
38
|
+
const m = margins({
|
|
39
|
+
...pad,
|
|
40
|
+
start: rtl ? pad.right : pad.left,
|
|
41
|
+
end: rtl ? pad.left : pad.right
|
|
42
|
+
});
|
|
43
|
+
const area = innerRect(width, height, {
|
|
44
|
+
...m,
|
|
45
|
+
left: rtl ? m.end : m.start,
|
|
46
|
+
right: rtl ? m.start : m.end
|
|
47
|
+
});
|
|
48
|
+
const end = area.x + area.width;
|
|
49
|
+
return {
|
|
50
|
+
area,
|
|
51
|
+
side: rtl ? "right" : "left",
|
|
52
|
+
range: (reverse = rtl) => reverse ? [end, area.x] : [area.x, end]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
30
55
|
const THIN = " !'.,:;|ijlI`";
|
|
31
56
|
const NARROW = "()[]{}-/frt";
|
|
32
57
|
const ROUND = "CDGHNOQU";
|
|
@@ -69,6 +94,6 @@ const ASCII = /* @__PURE__ */ Array.from({ length: 128 }, (_, code) => charWidth
|
|
|
69
94
|
const round = (value) => Math.round(value * 100) / 100;
|
|
70
95
|
/** Line height used for single-line labels, relative to the font size. */
|
|
71
96
|
const LINE_HEIGHT = 1.25;
|
|
72
|
-
export { mirrorSides as a, insets as i, estimateTextWidth as n,
|
|
97
|
+
export { mirrorSides as a, insets as i, estimateTextWidth as n, plotFrame as o, innerRect as r, round as s, LINE_HEIGHT as t };
|
|
73
98
|
|
|
74
|
-
//# sourceMappingURL=layout-
|
|
99
|
+
//# sourceMappingURL=layout-DqAte3H8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-DqAte3H8.js","names":[],"sources":["../src/layout.ts"],"sourcesContent":["/** Axis-aligned rectangle in pixels. */\nexport interface Rect {\n x: number\n y: number\n width: number\n height: number\n}\n\n/** Space around a box, in pixels. */\nexport interface Insets {\n top: number\n right: number\n bottom: number\n left: number\n}\n\n/** Insets given as one number for all sides or per side. */\nexport type InsetsInput = number | Partial<Insets>\n\n/** Normalize an {@link InsetsInput}; missing sides fall back to `fallback`. */\nexport function insets(value: InsetsInput | undefined, fallback = 0): Insets {\n // A side that is not a finite number (left out, or junk from outside) takes the fallback.\n const side = (key: keyof Insets): number => {\n const v = typeof value === 'number' ? value : value?.[key]\n return Number.isFinite(v) ? (v as number) : fallback\n }\n return { top: side('top'), right: side('right'), bottom: side('bottom'), left: side('left') }\n}\n\n/** Swap the left and right of `sides` in a right-to-left chart. */\nexport const mirrorSides = <T extends { left: number; right: number }>(\n sides: T,\n rtl: boolean | undefined,\n): T => (rtl ? { ...sides, left: sides.right, right: sides.left } : sides)\n\n/** Rectangle left inside `width × height` after `margins`; never negative. */\nexport function innerRect(width: number, height: number, margins: Insets): Rect {\n return {\n x: margins.left,\n y: margins.top,\n width: Math.max(0, width - margins.left - margins.right),\n height: Math.max(0, height - margins.top - margins.bottom),\n }\n}\n\n/**\n * Space around a box by reading direction: `start` is the side the chart is\n * read from (the left, or the right in a right-to-left chart), `end` the other.\n */\nexport interface FrameInsets {\n top: number\n bottom: number\n start: number\n end: number\n}\n\n/** A plot area placed for the chart's reading direction. */\nexport interface PlotFrame {\n /** Where the data is drawn. */\n area: Rect\n /** The start side, where the axis beside the plot sits. */\n side: 'left' | 'right'\n /** The plot's horizontal range, from the end side when `reverse` (by default in a right-to-left chart). */\n range(reverse?: boolean): [number, number]\n}\n\n/**\n * Place the plot area of a chart with axes. `margins` gets the padding by\n * reading direction and returns the space each side needs, so a chart type\n * works its margins out once, whichever way the chart is read.\n */\nexport function plotFrame(\n size: { width: number; height: number; rtl?: boolean },\n padding: InsetsInput | undefined,\n margins: (padding: FrameInsets) => FrameInsets,\n): PlotFrame {\n const { width, height, rtl } = size\n const pad = insets(padding)\n const m = margins({\n ...pad,\n start: rtl ? pad.right : pad.left,\n end: rtl ? pad.left : pad.right,\n })\n const area = innerRect(width, height, {\n ...m,\n left: rtl ? m.end : m.start,\n right: rtl ? m.start : m.end,\n })\n const end = area.x + area.width\n return {\n area,\n side: rtl ? 'right' : 'left',\n range: (reverse = rtl) => (reverse ? [end, area.x] : [area.x, end]),\n }\n}\n\n// Approximate advance widths in em for common UI sans-serif fonts\n// (system-ui / SF, Segoe UI, Roboto), measured in the browser.\nconst THIN = \" !'.,:;|ijlI`\"\nconst NARROW = '()[]{}-/frt'\nconst ROUND = 'CDGHNOQU'\nconst WIDE = '%@MWmw'\n\n/**\n * Full-width characters, a whole em each: Hangul, CJK and kana, compatibility\n * ideographs, fullwidth forms and pictographs (emoji).\n */\nconst isWide = (code: number): boolean =>\n code >= 0x1100 &&\n (code <= 0x115f ||\n (code >= 0x2e80 && code <= 0xa4cf) ||\n (code >= 0xac00 && code <= 0xd7a3) ||\n (code >= 0xf900 && code <= 0xfaff) ||\n (code >= 0xff00 && code <= 0xff60) ||\n code >= 0x1f300)\n\n/** The width of an ASCII character, in em. */\nfunction charWidth(char: string): number {\n if (char >= '0' && char <= '9') return char === '1' ? 0.45 : 0.63\n if (THIN.includes(char)) return 0.27\n if (NARROW.includes(char)) return 0.38\n if (WIDE.includes(char)) return 0.88\n if (ROUND.includes(char)) return 0.76\n if (char >= 'A' && char <= 'Z') return 0.66\n return 0.57\n}\n\n/**\n * Estimate the rendered width of `text` without a DOM, for layout on the\n * server and in workers. Tuned for common UI sans-serif fonts; deterministic,\n * so SSR and client layouts agree.\n */\nexport function estimateTextWidth(text: string, fontSize: number): number {\n let em = 0\n for (let i = 0; i < text.length; i++) {\n const point = text.codePointAt(i) as number\n // Beyond ASCII a character is a whole em or an average one; a pair of surrogates is one.\n em += ASCII[point] ?? (isWide(point) ? 1 : 0.57)\n if (point > 0xffff) i++\n }\n return em * fontSize\n}\n\n/**\n * The width of every ASCII character, looked up instead of worked out: an\n * axis of 100,000 long labels estimates millions of characters per render.\n */\nconst ASCII = /* @__PURE__ */ Array.from({ length: 128 }, (_, code) =>\n charWidth(String.fromCharCode(code)),\n)\n\n/** A pixel value rounded to two decimals, as written into attributes and path data. */\nexport const round = (value: number): number => Math.round(value * 100) / 100\n\n/** Line height used for single-line labels, relative to the font size. */\nexport const LINE_HEIGHT = 1.25\n"],"mappings":";;AAoBA,SAAgB,OAAO,OAAgC,WAAW,GAAW;CAE3E,MAAM,QAAQ,QAA8B;EAC1C,MAAM,IAAI,OAAO,UAAU,WAAW,QAAQ,QAAQ;EACtD,OAAO,OAAO,SAAS,CAAC,IAAK,IAAe;CAC9C;CACA,OAAO;EAAE,KAAK,KAAK,KAAK;EAAG,OAAO,KAAK,OAAO;EAAG,QAAQ,KAAK,QAAQ;EAAG,MAAM,KAAK,MAAM;CAAE;AAC9F;;AAGA,MAAa,eACX,OACA,QACO,MAAM;CAAE,GAAG;CAAO,MAAM,MAAM;CAAO,OAAO,MAAM;AAAK,IAAI;;AAGpE,SAAgB,UAAU,OAAe,QAAgB,SAAuB;CAC9E,OAAO;EACL,GAAG,QAAQ;EACX,GAAG,QAAQ;EACX,OAAO,KAAK,IAAI,GAAG,QAAQ,QAAQ,OAAO,QAAQ,KAAK;EACvD,QAAQ,KAAK,IAAI,GAAG,SAAS,QAAQ,MAAM,QAAQ,MAAM;CAC3D;AACF;;;;;;AA4BA,SAAgB,UACd,MACA,SACA,SACW;CACX,MAAM,EAAE,OAAO,QAAQ,QAAQ;CAC/B,MAAM,MAAM,OAAO,OAAO;CAC1B,MAAM,IAAI,QAAQ;EAChB,GAAG;EACH,OAAO,MAAM,IAAI,QAAQ,IAAI;EAC7B,KAAK,MAAM,IAAI,OAAO,IAAI;CAC5B,CAAC;CACD,MAAM,OAAO,UAAU,OAAO,QAAQ;EACpC,GAAG;EACH,MAAM,MAAM,EAAE,MAAM,EAAE;EACtB,OAAO,MAAM,EAAE,QAAQ,EAAE;CAC3B,CAAC;CACD,MAAM,MAAM,KAAK,IAAI,KAAK;CAC1B,OAAO;EACL;EACA,MAAM,MAAM,UAAU;EACtB,QAAQ,UAAU,QAAS,UAAU,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG;CACnE;AACF;AAIA,MAAM,OAAO;AACb,MAAM,SAAS;AACf,MAAM,QAAQ;AACd,MAAM,OAAO;;;;;AAMb,MAAM,UAAU,SACd,QAAQ,SACP,QAAQ,QACN,QAAQ,SAAU,QAAQ,SAC1B,QAAQ,SAAU,QAAQ,SAC1B,QAAQ,SAAU,QAAQ,SAC1B,QAAQ,SAAU,QAAQ,SAC3B,QAAQ;;AAGZ,SAAS,UAAU,MAAsB;CACvC,IAAI,QAAQ,OAAO,QAAQ,KAAK,OAAO,SAAS,MAAM,MAAO;CAC7D,IAAI,KAAK,SAAS,IAAI,GAAG,OAAO;CAChC,IAAI,OAAO,SAAS,IAAI,GAAG,OAAO;CAClC,IAAI,KAAK,SAAS,IAAI,GAAG,OAAO;CAChC,IAAI,MAAM,SAAS,IAAI,GAAG,OAAO;CACjC,IAAI,QAAQ,OAAO,QAAQ,KAAK,OAAO;CACvC,OAAO;AACT;;;;;;AAOA,SAAgB,kBAAkB,MAAc,UAA0B;CACxE,IAAI,KAAK;CACT,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,QAAQ,KAAK,YAAY,CAAC;EAEhC,MAAM,MAAM,WAAW,OAAO,KAAK,IAAI,IAAI;EAC3C,IAAI,QAAQ,OAAQ;CACtB;CACA,OAAO,KAAK;AACd;;;;;AAMA,MAAM,QAAwB,sBAAM,KAAK,EAAE,QAAQ,IAAI,IAAI,GAAG,SAC5D,UAAU,OAAO,aAAa,IAAI,CAAC,CACrC;;AAGA,MAAa,SAAS,UAA0B,KAAK,MAAM,QAAQ,GAAG,IAAI;;AAG1E,MAAa,cAAc"}
|
|
@@ -1,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 LineOptions extends CartesianOptions {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as areaPath, r as linePath, t as fadeMask } from "./fade-
|
|
2
|
-
import { n as feature } from "./features-
|
|
3
|
-
import {
|
|
1
|
+
import { n as areaPath, r as linePath, t as fadeMask } from "./fade-CDrQjnDz.js";
|
|
2
|
+
import { n as feature } from "./features-B55rwpQC.js";
|
|
3
|
+
import { s as round } from "./layout-DqAte3H8.js";
|
|
4
4
|
import { t as h } from "./vnode-_EMUqysL.js";
|
|
5
|
-
import { d as
|
|
5
|
+
import { _ as seriesTable, d as resolveLabels, f as seriesAttrs, g as seriesScale, h as seriesLegend, l as plottable, m as seriesKey, n as categoryInteraction, p as seriesAxes, s as markerShape, t as cartesianLayout, u as pointMark } from "./cartesian-BrPqb5Qn.js";
|
|
6
6
|
import { r as cleanSeries, t as cleanData } from "./clean-CkoQobGv.js";
|
|
7
|
-
import { n as stackSeries, t as stackBounds } from "./stack-
|
|
7
|
+
import { n as stackSeries, t as stackBounds } from "./stack-jVKvg2x_.js";
|
|
8
8
|
// src/charts/line.ts
|
|
9
9
|
/** Points in pixels for a series; `null` for missing values. */
|
|
10
10
|
function seriesPoints(series, count, x, y, connectNulls, valid) {
|
|
@@ -23,32 +23,45 @@ function renderLines(options, ctx, fill) {
|
|
|
23
23
|
const overhang = points === "none" ? 2 : pointRadius + 2;
|
|
24
24
|
const { series } = options.data;
|
|
25
25
|
const count = resolveLabels(options.data).length;
|
|
26
|
+
const axisOf = seriesAxes(options);
|
|
27
|
+
const seconds = series.filter((s) => axisOf(s).second).map(seriesKey);
|
|
26
28
|
const stacks = stacked ? stackSeries(series, count, {
|
|
27
29
|
percent: stacked === "percent",
|
|
28
30
|
nullAsZero: true,
|
|
29
|
-
hidden: ctx.hidden
|
|
31
|
+
hidden: seconds.length ? /* @__PURE__ */ new Set([...ctx.hidden, ...seconds]) : ctx.hidden
|
|
30
32
|
}) : null;
|
|
31
33
|
const layout = cartesianLayout(options, ctx, {
|
|
32
34
|
scale: "point",
|
|
33
35
|
zero: filled || stacks !== null,
|
|
36
|
+
zero2: filled,
|
|
34
37
|
overhang,
|
|
35
38
|
...stacks ? { values: stackBounds(stacks) } : {},
|
|
36
39
|
...stacked === "percent" ? { tickFormat: { style: "percent" } } : {}
|
|
37
40
|
});
|
|
38
|
-
const { x,
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
41
|
+
const { x, labels } = layout;
|
|
42
|
+
const scaleOf = (index) => seriesScale(layout, series[index]);
|
|
43
|
+
const baselineOf = (index) => {
|
|
44
|
+
const y = scaleOf(index);
|
|
45
|
+
return y(Math.min(Math.max(0, y.domain[0]), y.domain[1]));
|
|
46
|
+
};
|
|
47
|
+
const stackOf = (index) => !axisOf(series[index]).second && stacks?.[index] || null;
|
|
48
|
+
const interaction = categoryInteraction(layout, options, ctx, (seriesIndex, i, v) => {
|
|
49
|
+
const stack = stackOf(seriesIndex);
|
|
50
|
+
return {
|
|
51
|
+
x: x.at(i),
|
|
52
|
+
y: scaleOf(seriesIndex)(stack ? stack[i]?.y1 ?? 0 : v)
|
|
53
|
+
};
|
|
54
|
+
});
|
|
44
55
|
const gradient = filled && fillStyle === "gradient";
|
|
45
56
|
const fadeId = `${ctx.id}-fade`;
|
|
46
57
|
const visible = (s) => !ctx.hidden.has(seriesKey(s));
|
|
47
58
|
const all = series.map((s, index) => {
|
|
48
59
|
if (!visible(s)) return [];
|
|
49
|
-
const
|
|
60
|
+
const y = scaleOf(index);
|
|
61
|
+
const stack = stackOf(index);
|
|
50
62
|
if (stack) return stack.map((seg, i) => seg ? [x.at(i), y(seg.y1)] : null);
|
|
51
|
-
|
|
63
|
+
const axis = axisOf(s).axis;
|
|
64
|
+
return seriesPoints(s, labels.length, (i) => x.at(i), y, connectNulls, (v) => plottable(v, axis));
|
|
52
65
|
});
|
|
53
66
|
/** Indices drawn per series: a downsampled subset when `decimate` is set. */
|
|
54
67
|
const kept = all.map((pts) => decimate !== void 0 && pts.length > decimate ? feature("decimate")(pts, decimate) : null);
|
|
@@ -59,8 +72,9 @@ function renderLines(options, ctx, fill) {
|
|
|
59
72
|
};
|
|
60
73
|
/** Area bottom: zero, or the top of the layer below for stacks (downsampled alike). */
|
|
61
74
|
const bottom = (index) => {
|
|
62
|
-
const stack =
|
|
63
|
-
if (!stack) return
|
|
75
|
+
const stack = stackOf(index);
|
|
76
|
+
if (!stack) return baselineOf(index);
|
|
77
|
+
const y = scaleOf(index);
|
|
64
78
|
const bottoms = stack.map((seg) => seg ? y(seg.y0) : null);
|
|
65
79
|
const keep = kept[index];
|
|
66
80
|
return keep ? keep.map((i) => bottoms[i] ?? null) : bottoms;
|
|
@@ -70,6 +84,7 @@ function renderLines(options, ctx, fill) {
|
|
|
70
84
|
d: areaPath(drawn(index), bottom(index), { curve }),
|
|
71
85
|
mask: gradient ? `url(#${fadeId})` : void 0
|
|
72
86
|
}))));
|
|
87
|
+
const shape = markerShape(options);
|
|
73
88
|
const lines = options.data.series.map((s, index) => {
|
|
74
89
|
if (!visible(s)) return null;
|
|
75
90
|
const pts = drawn(index);
|
|
@@ -78,24 +93,21 @@ function renderLines(options, ctx, fill) {
|
|
|
78
93
|
return h("g", seriesAttrs(s, index), h("path", {
|
|
79
94
|
class: "tc-line",
|
|
80
95
|
d: linePath(pts, { curve })
|
|
81
|
-
}), dots.length > 0 && h("g", { class: "tc-points" }, dots.map(([cx, cy]) =>
|
|
82
|
-
key: cx,
|
|
83
|
-
class: "tc-point",
|
|
84
|
-
cx: round(cx),
|
|
85
|
-
cy: round(cy),
|
|
86
|
-
r: pointRadius
|
|
87
|
-
}))));
|
|
96
|
+
}), dots.length > 0 && h("g", { class: "tc-points" }, dots.map(([cx, cy]) => pointMark(shape, index, cx, "tc-point", round(cx), round(cy), pointRadius))));
|
|
88
97
|
});
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
return {
|
|
99
|
+
content: [
|
|
100
|
+
h("defs", { key: "defs" }, layout.clip.def, gradient && fadeMask(fadeId)),
|
|
101
|
+
layout.background,
|
|
102
|
+
h("g", {
|
|
103
|
+
key: "series",
|
|
104
|
+
class: "tc-series-list",
|
|
105
|
+
"clip-path": layout.clip.url
|
|
106
|
+
}, areas, lines),
|
|
107
|
+
layout.foreground
|
|
108
|
+
],
|
|
109
|
+
interaction
|
|
110
|
+
};
|
|
99
111
|
}
|
|
100
112
|
/**
|
|
101
113
|
* Line chart: one line per series over category labels.
|
|
@@ -116,4 +128,4 @@ const line = {
|
|
|
116
128
|
};
|
|
117
129
|
export { renderLines as n, line as t };
|
|
118
130
|
|
|
119
|
-
//# sourceMappingURL=line-
|
|
131
|
+
//# sourceMappingURL=line-CxR4tg1Q.js.map
|