@tabler/charts 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +165 -17
- package/dist/{annotations-DdRdeBUB.cjs → annotations--m-HzMBM.cjs} +87 -11
- package/dist/annotations--m-HzMBM.cjs.map +1 -0
- package/dist/{annotations-B02GR_KU.d.ts → annotations-CCDUC1lW.d.ts} +16 -30
- package/dist/{annotations-CHafaGd4.d.cts → annotations-CqZM1z9R.d.cts} +16 -30
- package/dist/{annotations-D0YQ0IoA.js → annotations-DGITy6th.js} +87 -11
- package/dist/annotations-DGITy6th.js.map +1 -0
- package/dist/annotations.cjs +2 -2
- package/dist/annotations.d.cts +1 -1
- package/dist/annotations.d.ts +1 -1
- package/dist/annotations.js +2 -2
- package/dist/{area-0-L1bG9B.js → area-BN0uE9R0.js} +4 -3
- package/dist/area-BN0uE9R0.js.map +1 -0
- package/dist/{area-CJX9219z.d.cts → area-D6LNLk3r.d.cts} +2 -2
- package/dist/{area-d11XePuw.d.ts → area-DEFL-Yun.d.ts} +2 -2
- package/dist/{area-4eRs3c0K.cjs → area-D_N8b4Ng.cjs} +4 -3
- package/dist/area-D_N8b4Ng.cjs.map +1 -0
- package/dist/area.cjs +1 -1
- package/dist/area.d.cts +1 -1
- package/dist/area.d.ts +1 -1
- package/dist/area.js +1 -1
- package/dist/axis-BzBkkC5X.cjs +305 -0
- package/dist/axis-BzBkkC5X.cjs.map +1 -0
- package/dist/axis-C5obgdJt.js +240 -0
- package/dist/axis-C5obgdJt.js.map +1 -0
- package/dist/{bar-Da6dE_nI.cjs → bar-BrmfXugT.cjs} +77 -58
- package/dist/bar-BrmfXugT.cjs.map +1 -0
- package/dist/{bar-XwzM6Pb0.d.ts → bar-Bs_rPqgR.d.ts} +1 -1
- package/dist/{bar-BDLR4p9c.d.cts → bar-CEt8YRxf.d.cts} +2 -2
- package/dist/{bar-B5n2oq9-.js → bar-CgpC2EpX.js} +2 -2
- package/dist/{bar-B5n2oq9-.js.map → bar-CgpC2EpX.js.map} +1 -1
- package/dist/{bar-BNZ3GhIw.js → bar-D_KKd2fL.js} +75 -56
- package/dist/bar-D_KKd2fL.js.map +1 -0
- package/dist/{bar-LYIF8MEz.cjs → bar-wVykm1us.cjs} +2 -2
- package/dist/{bar-LYIF8MEz.cjs.map → bar-wVykm1us.cjs.map} +1 -1
- package/dist/bar.cjs +1 -1
- package/dist/bar.d.cts +1 -1
- package/dist/bar.d.ts +1 -1
- package/dist/bar.js +1 -1
- package/dist/calendar-B7843sQu.d.cts +106 -0
- package/dist/calendar-BG_q_NC_.cjs +507 -0
- package/dist/calendar-BG_q_NC_.cjs.map +1 -0
- package/dist/calendar-CF3gfDQk.js +502 -0
- package/dist/calendar-CF3gfDQk.js.map +1 -0
- package/dist/calendar-D10_ki1S.d.ts +106 -0
- package/dist/calendar.cjs +3 -0
- package/dist/calendar.d.cts +3 -0
- package/dist/calendar.d.ts +3 -0
- package/dist/calendar.js +1 -0
- package/dist/{candlestick-BHQkQfxH.js → candlestick-B1onjo1o.js} +17 -14
- package/dist/candlestick-B1onjo1o.js.map +1 -0
- package/dist/{candlestick-Dq7qp-F0.d.cts → candlestick-B7YXUVVh.d.cts} +4 -3
- package/dist/{candlestick-CYCQXgky.cjs → candlestick-BwrFKak_.cjs} +17 -14
- package/dist/candlestick-BwrFKak_.cjs.map +1 -0
- package/dist/{candlestick-D0xKkdqd.d.ts → candlestick-XpqJvarq.d.ts} +4 -3
- package/dist/candlestick.cjs +3 -3
- package/dist/candlestick.d.cts +1 -1
- package/dist/candlestick.d.ts +1 -1
- package/dist/candlestick.js +3 -3
- package/dist/{cartesian-DV02PsBe.cjs → cartesian-B9CrasFJ.cjs} +190 -310
- package/dist/cartesian-B9CrasFJ.cjs.map +1 -0
- package/dist/{cartesian-CI2x6N7N.js → cartesian-COglz544.js} +161 -251
- package/dist/cartesian-COglz544.js.map +1 -0
- package/dist/{chart-DWn9v6qw.js → chart-B97FBRCd.js} +114 -72
- package/dist/chart-B97FBRCd.js.map +1 -0
- package/dist/{chart-QilhWP8Z.d.ts → chart-CE9EVbfV.d.ts} +427 -112
- package/dist/{chart-kqFMEwDo.d.cts → chart-Dz4geQZy.d.cts} +427 -112
- package/dist/{chart-e2VqomCI.cjs → chart-GUmmjJ7S.cjs} +132 -78
- package/dist/chart-GUmmjJ7S.cjs.map +1 -0
- package/dist/{core-BKRQvPAT.js → core-7fgM3su0.js} +188 -73
- package/dist/core-7fgM3su0.js.map +1 -0
- package/dist/{core-DRUCk67j.d.ts → core-BUQzLsRJ.d.ts} +26 -10
- package/dist/{core-DIOC61up.cjs → core-BZTrsPxc.cjs} +200 -73
- package/dist/core-BZTrsPxc.cjs.map +1 -0
- package/dist/{core-PAX5ogLk.d.cts → core-Ck5uHcW8.d.cts} +45 -24
- package/dist/core.cjs +45 -31
- package/dist/core.d.cts +23 -18
- package/dist/core.d.ts +23 -18
- package/dist/core.js +28 -23
- package/dist/{dates-DurEr9WT.cjs → dates-0YNY49KQ.cjs} +2 -2
- package/dist/{dates-DurEr9WT.cjs.map → dates-0YNY49KQ.cjs.map} +1 -1
- package/dist/{dates-C2RzY3rE.js → dates-CKDRgpin.js} +2 -2
- package/dist/{dates-C2RzY3rE.js.map → dates-CKDRgpin.js.map} +1 -1
- package/dist/decimate.cjs +1 -1
- package/dist/decimate.js +1 -1
- package/dist/{dom-D_g13XWY.cjs → dom-C33zvtPo.cjs} +3 -7
- package/dist/dom-C33zvtPo.cjs.map +1 -0
- package/dist/{dom-CuceR8gt.js → dom-CTse6Rvd.js} +3 -7
- package/dist/dom-CTse6Rvd.js.map +1 -0
- package/dist/end-labels-B3oRvjxw.js +114 -0
- package/dist/end-labels-B3oRvjxw.js.map +1 -0
- package/dist/end-labels-CS-fnpp-.cjs +119 -0
- package/dist/end-labels-CS-fnpp-.cjs.map +1 -0
- package/dist/end-labels.cjs +11 -0
- package/dist/end-labels.cjs.map +1 -0
- package/dist/end-labels.d.cts +6 -0
- package/dist/end-labels.d.ts +6 -0
- package/dist/end-labels.js +11 -0
- package/dist/end-labels.js.map +1 -0
- package/dist/{export-chart-83UYH48t.js → export-chart-BOH_nfcH.js} +92 -15
- package/dist/export-chart-BOH_nfcH.js.map +1 -0
- package/dist/{export-chart-mYgEfK-L.cjs → export-chart-Be4T9J3m.cjs} +97 -14
- package/dist/export-chart-Be4T9J3m.cjs.map +1 -0
- package/dist/export.cjs +5 -3
- package/dist/export.cjs.map +1 -1
- package/dist/export.d.cts +4 -3
- package/dist/export.d.ts +4 -3
- package/dist/export.js +5 -4
- package/dist/export.js.map +1 -1
- package/dist/{fade-GGxcBdss.js → fade-CDrQjnDz.js} +56 -78
- package/dist/fade-CDrQjnDz.js.map +1 -0
- package/dist/{fade-DVTkhrFU.cjs → fade-CRqcKMWY.cjs} +56 -78
- package/dist/fade-CRqcKMWY.cjs.map +1 -0
- package/dist/{features-BMxkqCyS.js → features-B55rwpQC.js} +4 -2
- package/dist/features-B55rwpQC.js.map +1 -0
- package/dist/{features-DCXEvoya.cjs → features-DEDP5CEQ.cjs} +9 -1
- package/dist/features-DEDP5CEQ.cjs.map +1 -0
- package/dist/fit-BPyPRnsK.js +16 -0
- package/dist/fit-BPyPRnsK.js.map +1 -0
- package/dist/fit-D4MIIQQz.cjs +21 -0
- package/dist/fit-D4MIIQQz.cjs.map +1 -0
- package/dist/funnel-B9ridzNx.d.cts +50 -0
- package/dist/funnel-CFEEulw_.cjs +244 -0
- package/dist/funnel-CFEEulw_.cjs.map +1 -0
- package/dist/funnel-CYCv8cq2.js +239 -0
- package/dist/funnel-CYCv8cq2.js.map +1 -0
- package/dist/funnel-FogM8flk.d.ts +50 -0
- package/dist/funnel.cjs +3 -0
- package/dist/funnel.d.cts +3 -0
- package/dist/funnel.d.ts +3 -0
- package/dist/funnel.js +1 -0
- package/dist/{gauge-DXkjXNCD.cjs → gauge-6HfDcLMJ.cjs} +28 -28
- package/dist/gauge-6HfDcLMJ.cjs.map +1 -0
- package/dist/{gauge-BSist7My.d.cts → gauge-BScJ7U6O.d.cts} +2 -2
- package/dist/{gauge-0VJuAHWF.d.ts → gauge-D78oq1Lx.d.ts} +2 -2
- package/dist/{gauge-ts0kqN1-.js → gauge-DiTk5aWO.js} +28 -28
- package/dist/gauge-DiTk5aWO.js.map +1 -0
- package/dist/gauge.cjs +1 -1
- package/dist/gauge.d.cts +1 -1
- package/dist/gauge.d.ts +1 -1
- package/dist/gauge.js +1 -1
- package/dist/heat-Bsqq4zw9.js +38 -0
- package/dist/heat-Bsqq4zw9.js.map +1 -0
- package/dist/heat-DYsivvDq.cjs +49 -0
- package/dist/heat-DYsivvDq.cjs.map +1 -0
- package/dist/{heatmap-CXhlrLTl.cjs → heatmap-Dyzrd4Fd.cjs} +39 -37
- package/dist/heatmap-Dyzrd4Fd.cjs.map +1 -0
- package/dist/{heatmap-19BGJTKF.js → heatmap-J7fxG7MM.js} +35 -33
- package/dist/heatmap-J7fxG7MM.js.map +1 -0
- package/dist/{heatmap-Dp_oyEe0.d.cts → heatmap-Jvwo7iFW.d.cts} +2 -2
- package/dist/{heatmap-59lmClj9.d.ts → heatmap-mFCnP6aB.d.ts} +2 -2
- package/dist/heatmap.cjs +1 -1
- package/dist/heatmap.d.cts +1 -1
- package/dist/heatmap.d.ts +1 -1
- package/dist/heatmap.js +1 -1
- package/dist/{hydrate-OA6R2_Pn.js → hydrate-BB3MlR36.js} +2 -2
- package/dist/{hydrate-OA6R2_Pn.js.map → hydrate-BB3MlR36.js.map} +1 -1
- package/dist/{hydrate-CmN1k8Mo.cjs → hydrate-m0I5m6ue.cjs} +2 -2
- package/dist/{hydrate-CmN1k8Mo.cjs.map → hydrate-m0I5m6ue.cjs.map} +1 -1
- package/dist/hydrate.cjs +2 -2
- package/dist/hydrate.js +2 -2
- package/dist/index.cjs +69 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -19
- package/dist/index.d.ts +24 -19
- package/dist/index.js +51 -37
- package/dist/index.js.map +1 -1
- package/dist/interaction-DXYSjgnP.cjs +32 -0
- package/dist/interaction-DXYSjgnP.cjs.map +1 -0
- package/dist/interaction-En1KlwFO.js +21 -0
- package/dist/interaction-En1KlwFO.js.map +1 -0
- package/dist/layout-CYerDebD.d.cts +29 -0
- package/dist/layout-CYerDebD.d.ts +29 -0
- package/dist/{layout-JY2aR-yE.cjs → layout-Cfg9x1k2.cjs} +32 -1
- package/dist/layout-Cfg9x1k2.cjs.map +1 -0
- package/dist/{layout-DmrrLjwN.js → layout-DqAte3H8.js} +27 -2
- package/dist/layout-DqAte3H8.js.map +1 -0
- package/dist/{line-DO66LtwH.js → line-CXH0L10d.js} +84 -37
- package/dist/line-CXH0L10d.js.map +1 -0
- package/dist/{line-_rNdeKmS.d.cts → line-Cu9ctpbv.d.cts} +9 -3
- package/dist/{line-Dbt6KFRK.cjs → line-DHbYCQy4.cjs} +84 -37
- package/dist/line-DHbYCQy4.cjs.map +1 -0
- package/dist/{line-DtSh7HQU.d.ts → line-TkzA7wMK.d.ts} +8 -1
- package/dist/line.cjs +3 -3
- package/dist/line.d.cts +1 -1
- package/dist/line.d.ts +1 -1
- package/dist/line.js +3 -3
- package/dist/log.cjs +1 -1
- package/dist/log.js +1 -1
- package/dist/map-BirylCmT.d.cts +156 -0
- package/dist/map-CYp6x-uS.js +784 -0
- package/dist/map-CYp6x-uS.js.map +1 -0
- package/dist/map-ChwSgooH.cjs +795 -0
- package/dist/map-ChwSgooH.cjs.map +1 -0
- package/dist/map-DNqog2Xs.d.ts +156 -0
- package/dist/map.cjs +4 -0
- package/dist/map.d.cts +3 -0
- package/dist/map.d.ts +3 -0
- package/dist/map.js +1 -0
- package/dist/maps/world.cjs +875 -0
- package/dist/maps/world.cjs.map +1 -0
- package/dist/maps/world.d.cts +2 -0
- package/dist/maps/world.d.ts +2 -0
- package/dist/maps/world.js +874 -0
- package/dist/maps/world.js.map +1 -0
- package/dist/{morph-9_LJL0ra.cjs → morph-3I1Nf_tR.cjs} +2 -2
- package/dist/{morph-9_LJL0ra.cjs.map → morph-3I1Nf_tR.cjs.map} +1 -1
- package/dist/{morph-DnRxuwR-.js → morph-GfBab-b3.js} +2 -2
- package/dist/{morph-DnRxuwR-.js.map → morph-GfBab-b3.js.map} +1 -1
- package/dist/morph.cjs +2 -2
- package/dist/morph.js +2 -2
- package/dist/others-CuNdpvjd.d.cts +31 -0
- package/dist/{others-J7NCAMA0.js → others-DBIGE6jr.js} +11 -3
- package/dist/others-DBIGE6jr.js.map +1 -0
- package/dist/others-DBO4Kjwl.d.ts +29 -0
- package/dist/{others-DWdK7vKp.cjs → others-WfjCsjqT.cjs} +14 -6
- package/dist/others-WfjCsjqT.cjs.map +1 -0
- package/dist/{parliament-Cru4IcuM.js → parliament-BKN6ikBJ.js} +30 -29
- package/dist/parliament-BKN6ikBJ.js.map +1 -0
- package/dist/{parliament-CLCI7tUO.d.ts → parliament-CHdf13XU.d.ts} +2 -2
- package/dist/{parliament-CgsVnWEe.d.cts → parliament-CsYgh4N2.d.cts} +2 -2
- package/dist/{parliament-x5hcFaQ3.cjs → parliament-DhxAaIZ3.cjs} +30 -29
- package/dist/parliament-DhxAaIZ3.cjs.map +1 -0
- package/dist/parliament.cjs +1 -1
- package/dist/parliament.d.cts +1 -1
- package/dist/parliament.d.ts +1 -1
- package/dist/parliament.js +1 -1
- package/dist/{patterns-D3-wQagb.cjs → patterns-BPN1c9qe.cjs} +2 -2
- package/dist/{patterns-D3-wQagb.cjs.map → patterns-BPN1c9qe.cjs.map} +1 -1
- package/dist/{patterns-CufKZYhm.js → patterns-CVrLrJXg.js} +2 -2
- package/dist/{patterns-CufKZYhm.js.map → patterns-CVrLrJXg.js.map} +1 -1
- package/dist/patterns.cjs +2 -2
- package/dist/patterns.d.cts +1 -1
- package/dist/patterns.d.ts +1 -1
- package/dist/patterns.js +2 -2
- package/dist/{percentage-bar-ybNS3goo.cjs → percentage-bar-BChkTRoz.cjs} +37 -35
- package/dist/percentage-bar-BChkTRoz.cjs.map +1 -0
- package/dist/{percentage-bar-nhTeakD_.d.ts → percentage-bar-CSAbzDOn.d.ts} +11 -15
- package/dist/{percentage-bar-B6tNOqNn.js → percentage-bar-CaInxrL8.js} +37 -35
- package/dist/percentage-bar-CaInxrL8.js.map +1 -0
- package/dist/{percentage-bar-tepMr7Hd.d.cts → percentage-bar-UZHCRvlK.d.cts} +11 -15
- package/dist/percentage-bar.cjs +1 -1
- package/dist/percentage-bar.d.cts +1 -1
- package/dist/percentage-bar.d.ts +1 -1
- package/dist/percentage-bar.js +1 -1
- package/dist/{pie-BXg2gNpb.d.cts → pie-AFedsDcF.d.cts} +17 -14
- package/dist/{pie-CVsc-6qD.js → pie-Ch6Bx0ih.js} +68 -52
- package/dist/pie-Ch6Bx0ih.js.map +1 -0
- package/dist/{pie-BpjvSPnz.cjs → pie-Cll1OrVZ.cjs} +68 -52
- package/dist/pie-Cll1OrVZ.cjs.map +1 -0
- package/dist/{pie-CFptILSm.d.ts → pie-Cn2H3pz8.d.ts} +17 -14
- package/dist/pie.cjs +1 -1
- package/dist/pie.d.cts +1 -1
- package/dist/pie.d.ts +1 -1
- package/dist/pie.js +1 -1
- package/dist/{point-shapes--_gmdTyK.cjs → point-shapes-BRawRM78.cjs} +23 -22
- package/dist/point-shapes-BRawRM78.cjs.map +1 -0
- package/dist/{point-shapes-DD2Ektzm.js → point-shapes-DI6GhcI7.js} +18 -23
- package/dist/point-shapes-DI6GhcI7.js.map +1 -0
- package/dist/point-shapes.cjs +6 -4
- package/dist/point-shapes.cjs.map +1 -1
- package/dist/point-shapes.d.cts +2 -2
- package/dist/point-shapes.d.ts +2 -2
- package/dist/point-shapes.js +7 -5
- package/dist/point-shapes.js.map +1 -1
- package/dist/{radar-BR-mumDd.js → radar-Bg-IiIWB.js} +21 -22
- package/dist/radar-Bg-IiIWB.js.map +1 -0
- package/dist/{radar-BC9Skgpj.d.ts → radar-DEer2jjd.d.ts} +2 -2
- package/dist/{radar-D1-lItDy.d.cts → radar-DxmjXhMc.d.cts} +2 -2
- package/dist/{radar-HPDrIdzc.cjs → radar-wDyX17S3.cjs} +22 -23
- package/dist/radar-wDyX17S3.cjs.map +1 -0
- package/dist/radar.cjs +1 -1
- package/dist/radar.d.cts +1 -1
- package/dist/radar.d.ts +1 -1
- package/dist/radar.js +1 -1
- package/dist/range-bar-BnKjJP89.cjs +348 -0
- package/dist/range-bar-BnKjJP89.cjs.map +1 -0
- package/dist/range-bar-C4cRaaQE.d.ts +123 -0
- package/dist/range-bar-D32dIQOY.d.cts +123 -0
- package/dist/range-bar-Dx6ce0J1.js +343 -0
- package/dist/range-bar-Dx6ce0J1.js.map +1 -0
- package/dist/range-bar.cjs +3 -0
- package/dist/range-bar.d.cts +3 -0
- package/dist/range-bar.d.ts +3 -0
- package/dist/range-bar.js +1 -0
- package/dist/{rect-DSVmUZrD.js → rect-CZTNvMlf.js} +2 -2
- package/dist/{rect-DSVmUZrD.js.map → rect-CZTNvMlf.js.map} +1 -1
- package/dist/{rect-D6VhynBM.cjs → rect-DPr9QRxl.cjs} +2 -2
- package/dist/{rect-D6VhynBM.cjs.map → rect-DPr9QRxl.cjs.map} +1 -1
- package/dist/{sankey-fCoo1cpz.cjs → sankey-0CSp_Er9.cjs} +72 -71
- package/dist/sankey-0CSp_Er9.cjs.map +1 -0
- package/dist/{sankey-Dk7jUt8x.d.cts → sankey-D-8ATwBT.d.cts} +2 -2
- package/dist/{sankey-D6JeZfK5.js → sankey-Dp4CuLVe.js} +72 -71
- package/dist/sankey-Dp4CuLVe.js.map +1 -0
- package/dist/{sankey-D_v7KxnJ.d.ts → sankey-DpYJsOI4.d.ts} +2 -2
- package/dist/sankey.cjs +1 -1
- package/dist/sankey.d.cts +1 -1
- package/dist/sankey.d.ts +1 -1
- package/dist/sankey.js +1 -1
- package/dist/{scatter-C0TWjFpW.js → scatter-0Z7K_YUz.js} +94 -46
- package/dist/scatter-0Z7K_YUz.js.map +1 -0
- package/dist/{scatter-CXEsioOJ.d.ts → scatter-BAL5K9_4.d.ts} +28 -9
- package/dist/{scatter-DZeEIfyo.d.cts → scatter-BUGbnRzM.d.cts} +28 -9
- package/dist/{scatter-DVqB_fP9.cjs → scatter-CZ8do3Up.cjs} +95 -47
- package/dist/scatter-CZ8do3Up.cjs.map +1 -0
- package/dist/scatter.cjs +1 -1
- package/dist/scatter.d.cts +2 -2
- package/dist/scatter.d.ts +2 -2
- package/dist/scatter.js +1 -1
- package/dist/slice-labels-1TBq7p3q.d.cts +28 -0
- package/dist/slice-labels-C9ucsBVW.js +88 -0
- package/dist/slice-labels-C9ucsBVW.js.map +1 -0
- package/dist/slice-labels-CbFiy46l.cjs +93 -0
- package/dist/slice-labels-CbFiy46l.cjs.map +1 -0
- package/dist/slice-labels-Cm5CyV7B.d.ts +28 -0
- package/dist/slice-labels.cjs +11 -0
- package/dist/slice-labels.cjs.map +1 -0
- package/dist/slice-labels.d.cts +6 -0
- package/dist/slice-labels.d.ts +6 -0
- package/dist/slice-labels.js +11 -0
- package/dist/slice-labels.js.map +1 -0
- package/dist/{sparkline-cbvRkWqS.d.ts → sparkline-CtoBJe-a.d.ts} +2 -2
- package/dist/{sparkline-B39NA0Mi.cjs → sparkline-DjR-V6BI.cjs} +13 -15
- package/dist/sparkline-DjR-V6BI.cjs.map +1 -0
- package/dist/{sparkline-DAP6jtzw.d.cts → sparkline-DwHJfeZz.d.cts} +2 -2
- package/dist/{sparkline-XO_TqCNP.js → sparkline-_dxwtdli.js} +13 -15
- package/dist/sparkline-_dxwtdli.js.map +1 -0
- package/dist/sparkline.cjs +1 -1
- package/dist/sparkline.d.cts +1 -1
- package/dist/sparkline.d.ts +1 -1
- package/dist/sparkline.js +1 -1
- package/dist/{stack-Dagxq7l2.d.cts → stack-CcmyALx0.d.cts} +1 -1
- package/dist/{stack-2H2Gfs1Q.js → stack-CyVlS7Fr.js} +2 -2
- package/dist/{stack-2H2Gfs1Q.js.map → stack-CyVlS7Fr.js.map} +1 -1
- package/dist/{stack-BgPzoQmv.cjs → stack-DBhmYNat.cjs} +2 -2
- package/dist/{stack-BgPzoQmv.cjs.map → stack-DBhmYNat.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{time-axis-BjZ1bYTK.cjs → time-axis-CVKjQKSS.cjs} +4 -3
- package/dist/{time-axis-BjZ1bYTK.cjs.map → time-axis-CVKjQKSS.cjs.map} +1 -1
- package/dist/{time-axis-FLONo54E.js → time-axis-CkmbAw4Z.js} +3 -2
- package/dist/{time-axis-FLONo54E.js.map → time-axis-CkmbAw4Z.js.map} +1 -1
- package/dist/time.cjs +3 -3
- package/dist/time.js +3 -3
- package/dist/{treemap-BAkhmVQc.d.cts → treemap-C2maqerU.d.cts} +37 -5
- package/dist/{treemap-BNpxFBao.d.ts → treemap-D_zbubo3.d.ts} +37 -5
- package/dist/{treemap-BWpEUlDh.cjs → treemap-PulGXZv0.cjs} +58 -33
- package/dist/treemap-PulGXZv0.cjs.map +1 -0
- package/dist/{treemap-CQdavQ9u.js → treemap-lbYxb-7h.js} +57 -32
- package/dist/treemap-lbYxb-7h.js.map +1 -0
- package/dist/treemap.cjs +1 -1
- package/dist/treemap.d.cts +1 -1
- package/dist/treemap.d.ts +1 -1
- package/dist/treemap.js +1 -1
- package/dist/{value-labels-BBuSi4i0.js → value-labels-B0VeheyE.js} +29 -8
- package/dist/value-labels-B0VeheyE.js.map +1 -0
- package/dist/{value-labels-BV9keAuL.cjs → value-labels-Dcyk3GIY.cjs} +29 -8
- package/dist/value-labels-Dcyk3GIY.cjs.map +1 -0
- package/dist/value-labels.cjs +2 -2
- package/dist/value-labels.d.cts +1 -1
- package/dist/value-labels.d.ts +1 -1
- package/dist/value-labels.js +2 -2
- package/dist/zoom.cjs +810 -0
- package/dist/zoom.cjs.map +1 -0
- package/dist/zoom.d.cts +34 -0
- package/dist/zoom.d.ts +34 -0
- package/dist/zoom.js +806 -0
- package/dist/zoom.js.map +1 -0
- package/package.json +120 -235
- package/dist/annotations-D0YQ0IoA.js.map +0 -1
- package/dist/annotations-DdRdeBUB.cjs.map +0 -1
- package/dist/area-0-L1bG9B.js.map +0 -1
- package/dist/area-4eRs3c0K.cjs.map +0 -1
- package/dist/bar-BNZ3GhIw.js.map +0 -1
- package/dist/bar-Da6dE_nI.cjs.map +0 -1
- package/dist/candlestick-BHQkQfxH.js.map +0 -1
- package/dist/candlestick-CYCQXgky.cjs.map +0 -1
- package/dist/cartesian-CI2x6N7N.js.map +0 -1
- package/dist/cartesian-DV02PsBe.cjs.map +0 -1
- package/dist/chart-DWn9v6qw.js.map +0 -1
- package/dist/chart-e2VqomCI.cjs.map +0 -1
- package/dist/core-BKRQvPAT.js.map +0 -1
- package/dist/core-DIOC61up.cjs.map +0 -1
- package/dist/dom-CuceR8gt.js.map +0 -1
- package/dist/dom-D_g13XWY.cjs.map +0 -1
- package/dist/export-chart-83UYH48t.js.map +0 -1
- package/dist/export-chart-mYgEfK-L.cjs.map +0 -1
- package/dist/fade-DVTkhrFU.cjs.map +0 -1
- package/dist/fade-GGxcBdss.js.map +0 -1
- package/dist/features-BMxkqCyS.js.map +0 -1
- package/dist/features-DCXEvoya.cjs.map +0 -1
- package/dist/gauge-DXkjXNCD.cjs.map +0 -1
- package/dist/gauge-ts0kqN1-.js.map +0 -1
- package/dist/heatmap-19BGJTKF.js.map +0 -1
- package/dist/heatmap-CXhlrLTl.cjs.map +0 -1
- package/dist/layout-DmrrLjwN.js.map +0 -1
- package/dist/layout-JY2aR-yE.cjs.map +0 -1
- package/dist/line-DO66LtwH.js.map +0 -1
- package/dist/line-Dbt6KFRK.cjs.map +0 -1
- package/dist/others-DWdK7vKp.cjs.map +0 -1
- package/dist/others-J7NCAMA0.js.map +0 -1
- package/dist/parliament-Cru4IcuM.js.map +0 -1
- package/dist/parliament-x5hcFaQ3.cjs.map +0 -1
- package/dist/percentage-bar-B6tNOqNn.js.map +0 -1
- package/dist/percentage-bar-ybNS3goo.cjs.map +0 -1
- package/dist/pie-BpjvSPnz.cjs.map +0 -1
- package/dist/pie-CVsc-6qD.js.map +0 -1
- package/dist/point-shapes--_gmdTyK.cjs.map +0 -1
- package/dist/point-shapes-DD2Ektzm.js.map +0 -1
- package/dist/radar-BR-mumDd.js.map +0 -1
- package/dist/radar-HPDrIdzc.cjs.map +0 -1
- package/dist/sankey-D6JeZfK5.js.map +0 -1
- package/dist/sankey-fCoo1cpz.cjs.map +0 -1
- package/dist/scatter-C0TWjFpW.js.map +0 -1
- package/dist/scatter-DVqB_fP9.cjs.map +0 -1
- package/dist/sparkline-B39NA0Mi.cjs.map +0 -1
- package/dist/sparkline-XO_TqCNP.js.map +0 -1
- package/dist/treemap-BWpEUlDh.cjs.map +0 -1
- package/dist/treemap-CQdavQ9u.js.map +0 -1
- package/dist/value-labels-BBuSi4i0.js.map +0 -1
- package/dist/value-labels-BV9keAuL.cjs.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const require_features = require("./features-
|
|
1
|
+
const require_features = require("./features-DEDP5CEQ.cjs");
|
|
2
2
|
const require_format = require("./format-CAE5ruy6.cjs");
|
|
3
|
-
const require_layout = require("./layout-
|
|
3
|
+
const require_layout = require("./layout-Cfg9x1k2.cjs");
|
|
4
4
|
const require_sweep = require("./sweep-Dnp6LDBz.cjs");
|
|
5
5
|
const require_arc = require("./arc-CYhI62kO.cjs");
|
|
6
6
|
const require_vnode = require("./vnode-ClAiw28x.cjs");
|
|
7
7
|
const require_clean = require("./clean-Die2iCNc.cjs");
|
|
8
8
|
const require_named = require("./named-BBASc8dW.cjs");
|
|
9
|
-
const require_others = require("./others-
|
|
9
|
+
const require_others = require("./others-WfjCsjqT.cjs");
|
|
10
10
|
// src/charts/pie.ts
|
|
11
11
|
/** Angles of the visible slices, clockwise from `startAngle`. */
|
|
12
|
-
function layoutSlices(
|
|
13
|
-
const visible =
|
|
12
|
+
function layoutSlices(model, hidden) {
|
|
13
|
+
const visible = model.slices.filter((slice) => !hidden.has(require_named.keyOf(slice.data)));
|
|
14
14
|
const total = visible.reduce((sum, slice) => sum + slice.value, 0);
|
|
15
|
-
let angle = (
|
|
15
|
+
let angle = (model.startAngle ?? 0) * require_arc.DEG;
|
|
16
16
|
return {
|
|
17
17
|
slices: visible.map((slice) => {
|
|
18
18
|
const sweep = total > 0 ? slice.value / total * Math.PI * 2 : 0;
|
|
@@ -30,21 +30,31 @@ function layoutSlices(options, hidden) {
|
|
|
30
30
|
function renderPie(options, ctx, defaults) {
|
|
31
31
|
const { width, height, locale } = ctx;
|
|
32
32
|
const gap = options.gap ?? 2;
|
|
33
|
-
const area = require_layout.innerRect(width, height, require_layout.insets(options.padding, 0));
|
|
34
|
-
const outer = Math.max(0, Math.min(area.width, area.height) / 2 - 8);
|
|
35
|
-
const inner = outer * Math.min(.95, Math.max(0, options.innerRadius ?? defaults.inner));
|
|
36
|
-
const cornerRadius = options.cornerRadius ?? defaults.corner;
|
|
37
|
-
const cx = area.x + area.width / 2;
|
|
38
|
-
const cy = area.y + area.height / 2;
|
|
39
33
|
const { slices, total } = layoutSlices(options, ctx.hidden);
|
|
40
34
|
const drawn = slices.filter((slice) => slice.value > 0);
|
|
41
|
-
const strokeGap = inner === 0 && drawn.length > 1 ? gap : 0;
|
|
42
|
-
const padAngle = inner > 0 && drawn.length > 1 ? require_arc.padAngleForGap(gap, inner, outer) : 0;
|
|
43
35
|
const value = require_format.formatNumber(options.format, locale);
|
|
44
36
|
const share = require_format.getNumberFormat(locale, {
|
|
45
37
|
style: "percent",
|
|
46
38
|
maximumFractionDigits: 1
|
|
47
39
|
});
|
|
40
|
+
const frame = require_layout.innerRect(width, height, require_layout.insets(options.padding, 0));
|
|
41
|
+
const shown = options.labels === true ? "share" : options.labels ? options.labels.value : false;
|
|
42
|
+
const labelled = options.labels ? require_features.feature("slice-labels")(drawn.map((slice) => ({
|
|
43
|
+
key: require_named.keyOf(slice.data),
|
|
44
|
+
index: slice.index,
|
|
45
|
+
name: slice.data.name,
|
|
46
|
+
value: shown === false ? "" : shown === "value" ? value(slice.value) : share.format(slice.value / total),
|
|
47
|
+
angle: (slice.startAngle + slice.endAngle) / 2,
|
|
48
|
+
weight: slice.value
|
|
49
|
+
})), frame, ctx.fontSize) : null;
|
|
50
|
+
const area = labelled?.area ?? frame;
|
|
51
|
+
const outer = Math.max(0, Math.min(area.width, area.height) / 2 - 8);
|
|
52
|
+
const inner = outer * Math.min(.95, Math.max(0, options.innerRadius ?? defaults.inner));
|
|
53
|
+
const cornerRadius = options.cornerRadius ?? defaults.corner;
|
|
54
|
+
const cx = area.x + area.width / 2;
|
|
55
|
+
const cy = area.y + area.height / 2;
|
|
56
|
+
const strokeGap = inner === 0 && drawn.length > 1 ? gap : 0;
|
|
57
|
+
const padAngle = inner > 0 && drawn.length > 1 ? require_arc.padAngleForGap(gap, inner, outer) : 0;
|
|
48
58
|
const geometry = (slice, r0 = inner, r1 = outer) => ({
|
|
49
59
|
innerRadius: r0,
|
|
50
60
|
outerRadius: r1,
|
|
@@ -77,7 +87,8 @@ function renderPie(options, ctx, defaults) {
|
|
|
77
87
|
},
|
|
78
88
|
items: [item],
|
|
79
89
|
seriesIndex: slice.index,
|
|
80
|
-
|
|
90
|
+
highlight: {
|
|
91
|
+
kind: "halo",
|
|
81
92
|
d: require_arc.arcPathStable({
|
|
82
93
|
...geometry(slice, outer + 2, outer + 6),
|
|
83
94
|
cornerRadius: 2
|
|
@@ -106,42 +117,48 @@ function renderPie(options, ctx, defaults) {
|
|
|
106
117
|
return position === -1 ? null : hitFor(drawn[position], position);
|
|
107
118
|
}
|
|
108
119
|
};
|
|
109
|
-
ctx.onHitTest(interaction);
|
|
110
120
|
const groups = slices.map((slice) => require_vnode.h("g", require_named.groupAttrs(slice.data, slice.index), require_sweep.arcNode("tc-slice", geometry(slice))));
|
|
111
121
|
const center = options.center;
|
|
112
122
|
const showCenter = inner > 0 && center !== false;
|
|
113
123
|
const centerValue = showCenter ? center?.value ?? value(total) : "";
|
|
114
124
|
const centerLabel = showCenter ? center?.label : void 0;
|
|
115
|
-
return
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
125
|
+
return {
|
|
126
|
+
content: [
|
|
127
|
+
require_vnode.h("g", {
|
|
128
|
+
class: "tc-pie",
|
|
129
|
+
style: `transform:translate(${cx}px,${cy}px)`
|
|
130
|
+
}, total === 0 && require_vnode.h("path", {
|
|
131
|
+
class: "tc-pie-track",
|
|
132
|
+
d: require_arc.arcPathStable({
|
|
133
|
+
innerRadius: inner,
|
|
134
|
+
outerRadius: outer,
|
|
135
|
+
startAngle: 0,
|
|
136
|
+
endAngle: Math.PI * 2
|
|
137
|
+
})
|
|
138
|
+
}), require_vnode.h("g", {
|
|
139
|
+
class: "tc-pie-slices",
|
|
140
|
+
style: strokeGap > 0 ? `--tc-pie-gap:${strokeGap}px` : void 0
|
|
141
|
+
}, groups)),
|
|
142
|
+
labelled?.layer(cx, cy, outer),
|
|
143
|
+
showCenter && require_vnode.h("g", {
|
|
144
|
+
class: "tc-pie-center",
|
|
145
|
+
"aria-hidden": "true"
|
|
146
|
+
}, require_vnode.h("text", {
|
|
147
|
+
class: "tc-pie-value",
|
|
148
|
+
x: cx,
|
|
149
|
+
y: cy,
|
|
150
|
+
dy: centerLabel ? "0" : "0.35em",
|
|
151
|
+
"text-anchor": "middle"
|
|
152
|
+
}, centerValue), centerLabel && require_vnode.h("text", {
|
|
153
|
+
class: "tc-pie-label",
|
|
154
|
+
x: cx,
|
|
155
|
+
y: cy,
|
|
156
|
+
dy: "1.6em",
|
|
157
|
+
"text-anchor": "middle"
|
|
158
|
+
}, centerLabel))
|
|
159
|
+
],
|
|
160
|
+
interaction
|
|
161
|
+
};
|
|
145
162
|
}
|
|
146
163
|
function pieTable(options, ctx) {
|
|
147
164
|
const { slices, total } = layoutSlices(options, ctx.hidden);
|
|
@@ -167,11 +184,10 @@ function pieType(name, defaults) {
|
|
|
167
184
|
return {
|
|
168
185
|
name,
|
|
169
186
|
clean: require_clean.cleanData(require_clean.cleanItems),
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
legend: (options) => require_others.groupLegend(require_others.groupSlices(options.data, options.maxSlices, options.othersLabel)),
|
|
187
|
+
prepare: require_others.withSlices,
|
|
188
|
+
render: (options, ctx) => renderPie(options, ctx, defaults),
|
|
189
|
+
sweep: require_sweep.sweep,
|
|
190
|
+
legend: require_others.slicesLegend,
|
|
175
191
|
table: pieTable,
|
|
176
192
|
valueLabels: { marks: "slice" }
|
|
177
193
|
};
|
|
@@ -205,4 +221,4 @@ Object.defineProperty(exports, "pie", {
|
|
|
205
221
|
}
|
|
206
222
|
});
|
|
207
223
|
|
|
208
|
-
//# sourceMappingURL=pie-
|
|
224
|
+
//# sourceMappingURL=pie-Cll1OrVZ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pie-Cll1OrVZ.cjs","names":["keyOf","DEG","formatNumber","getNumberFormat","innerRect","insets","feature","padAngleForGap","arcCentroid","arcPathStable","h","groupAttrs","arcNode","cleanData","cleanItems","withSlices","sweep","slicesLegend"],"sources":["../src/charts/pie.ts"],"sourcesContent":["import type { DataTable } from '../a11y.ts'\nimport type { ChartType, RenderContext, RenderResult, TableContext } from '../chart.ts'\nimport { feature } from '../features.ts'\nimport { formatNumber, getNumberFormat, type NumberFormat } from '../format.ts'\nimport type { Hit, HitItem, Interaction } from '../interaction.ts'\nimport { type InsetsInput, innerRect, insets } from '../layout.ts'\nimport { arcNode, sweep } from '../render/sweep.ts'\nimport { arcCentroid, arcPathStable, DEG, HALO, padAngleForGap } from '../shapes/arc.ts'\nimport { type ClassValue, h } from '../vnode.ts'\nimport { cleanData, cleanItems } from './clean.ts'\nimport { groupAttrs, keyOf } from './named.ts'\nimport { type SliceGrouping, slicesLegend, type WithSlices, withSlices } from './others.ts'\nimport type { SliceLabelOptions } from './slice-labels.ts'\n\n/** One slice of a pie or donut. */\nexport interface PieSlice {\n name: string\n /** Non-negative value; negative values count as zero. */\n value: number\n /** Stable identity for keyed updates and legend toggles. Defaults to `name`. */\n id?: string\n /**\n * Custom color; overrides the palette slot via `--tc-series-color`.\n * Values that could inject CSS (`;`, quotes, `url()` …) are ignored, so colors from user data are safe.\n */\n color?: string\n /** Extra classes on the slice group. */\n class?: ClassValue\n /** Start hidden (toggle it back from the legend). */\n hidden?: boolean\n}\n\nexport interface PieOptions extends SliceGrouping {\n data: readonly PieSlice[]\n /** Hole size relative to the radius, `0…0.95`. Defaults to `0` (`0.62` for `donut`). */\n innerRadius?: number\n /** Gap between slices in pixels, drawn as surface. Defaults to `2`. */\n gap?: number\n /** Corner radius of the slices. Defaults to `0` (`4` for `donut`). */\n cornerRadius?: number\n /** Where the first slice starts, in degrees clockwise from 12 o'clock. Defaults to `0`. */\n startAngle?: number\n /** Format of the values (tooltip, table, donut total). */\n format?: NumberFormat\n /**\n * Text in the donut hole: the total by default; `false` hides it, or give\n * your own `value` / `label`.\n */\n center?: false | { value?: string; label?: string }\n /** Extra space around the pie, in pixels. */\n padding?: InsetsInput\n /**\n * Name every slice beside the chart, with its share, joined to the slice\n * by a line: `true`, or `{ value: 'value' }` for the values and\n * `{ value: false }` for the names alone. The pie gets smaller to leave the\n * labels room; a chart too small for them goes without. Needs\n * `@tabler/charts/slice-labels` on the core.\n */\n labels?: boolean | SliceLabelOptions\n}\n\n/** The chart model of a pie: its options, with the slices as drawn (the rest grouped). */\nexport type PieModel = WithSlices<PieOptions>\n\ninterface Slice {\n data: PieSlice\n index: number\n value: number\n startAngle: number\n endAngle: number\n}\n\n/** Angles of the visible slices, clockwise from `startAngle`. */\nfunction layoutSlices(\n model: PieModel,\n hidden: ReadonlySet<string>,\n): { slices: Slice[]; total: number } {\n const visible = model.slices.filter((slice) => !hidden.has(keyOf(slice.data)))\n const total = visible.reduce((sum, slice) => sum + slice.value, 0)\n let angle = (model.startAngle ?? 0) * DEG\n const slices = visible.map((slice) => {\n const sweep = total > 0 ? (slice.value / total) * Math.PI * 2 : 0\n const out: Slice = { ...slice, startAngle: angle, endAngle: angle + sweep }\n angle += sweep\n return out\n })\n return { slices, total }\n}\n\nfunction renderPie(\n options: PieModel,\n ctx: RenderContext,\n defaults: { inner: number; corner: number },\n) {\n const { width, height, locale } = ctx\n const gap = options.gap ?? 2\n const { slices, total } = layoutSlices(options, ctx.hidden)\n const drawn = slices.filter((slice) => slice.value > 0)\n const value = formatNumber(options.format, locale)\n const share = getNumberFormat(locale, { style: 'percent', maximumFractionDigits: 1 })\n const frame = innerRect(width, height, insets(options.padding, 0))\n const shown = options.labels === true ? 'share' : options.labels ? options.labels.value : false\n const labelled = options.labels\n ? feature('slice-labels')(\n drawn.map((slice) => ({\n key: keyOf(slice.data),\n index: slice.index,\n name: slice.data.name,\n value:\n shown === false\n ? ''\n : shown === 'value'\n ? value(slice.value)\n : share.format(slice.value / total),\n angle: (slice.startAngle + slice.endAngle) / 2,\n weight: slice.value,\n })),\n frame,\n ctx.fontSize,\n )\n : null\n const area = labelled?.area ?? frame\n const outer = Math.max(0, Math.min(area.width, area.height) / 2 - HALO)\n const ratio = Math.min(0.95, Math.max(0, options.innerRadius ?? defaults.inner))\n const inner = outer * ratio\n const cornerRadius = options.cornerRadius ?? defaults.corner\n const cx = area.x + area.width / 2\n const cy = area.y + area.height / 2\n // A single slice is a full ring: no gap to cut.\n // Rings get a pad angle, which keeps a constant gap width along the whole\n // edge. In a full pie every slice meets at the center, so a pad angle would\n // widen into a wedge: the gap is a surface-colored stroke instead.\n const strokeGap = inner === 0 && drawn.length > 1 ? gap : 0\n const padAngle = inner > 0 && drawn.length > 1 ? padAngleForGap(gap, inner, outer) : 0\n\n const geometry = (slice: Slice, r0 = inner, r1 = outer) => ({\n innerRadius: r0,\n outerRadius: r1,\n startAngle: slice.startAngle,\n endAngle: slice.endAngle,\n padAngle,\n cornerRadius,\n })\n\n const hitFor = (slice: Slice, position: number): Hit => {\n const [x, y] = arcCentroid(geometry(slice))\n const item: HitItem = {\n name: slice.data.name,\n seriesIndex: slice.index,\n value: slice.value,\n text: `${value(slice.value)} (${share.format(total > 0 ? slice.value / total : 0)})`,\n x: cx + x,\n y: cy + y,\n }\n if (slice.data.color) item.color = slice.data.color\n return {\n index: position,\n label: slice.data.name,\n title: '',\n x: cx + x,\n area: { x: cx - outer, y: cy - outer, width: outer * 2, height: outer * 2 },\n items: [item],\n seriesIndex: slice.index,\n // A thin halo just outside the slice.\n highlight: {\n kind: 'halo',\n d: arcPathStable({ ...geometry(slice, outer + 2, outer + 6), cornerRadius: 2 }),\n x: cx,\n y: cy,\n },\n }\n }\n\n const interaction: Interaction = {\n count: drawn.length,\n hitIndex: (position) => {\n const slice = drawn[position]\n return slice ? hitFor(slice, position) : null\n },\n hitTest(px, py) {\n const dx = px - cx\n const dy = py - cy\n const r = Math.hypot(dx, dy)\n if (r < inner - 2 || r > outer + HALO) return null\n const start = (options.startAngle ?? 0) * DEG\n const turn = Math.PI * 2\n // Clockwise angle from 12 o'clock, normalized into [start, start + turn).\n let angle = Math.atan2(dx, -dy)\n angle = start + ((((angle - start) % turn) + turn) % turn)\n const position = drawn.findIndex((s) => angle >= s.startAngle && angle < s.endAngle)\n return position === -1 ? null : hitFor(drawn[position] as Slice, position)\n },\n }\n\n const groups = slices.map((slice) =>\n h(\n 'g',\n groupAttrs(slice.data, slice.index),\n // The path keeps its arc, so new data sweeps slices around the center\n // (see `sweep`). An empty slice keeps its path, a line with no area in\n // the gap between its neighbors, to grow from there.\n arcNode('tc-slice', geometry(slice)),\n ),\n )\n\n const center = options.center\n const showCenter = inner > 0 && center !== false\n const centerValue = showCenter ? (center?.value ?? value(total)) : ''\n const centerLabel = showCenter ? center?.label : undefined\n\n const content = [\n h(\n 'g',\n { class: 'tc-pie', style: `transform:translate(${cx}px,${cy}px)` },\n total === 0 &&\n h('path', {\n class: 'tc-pie-track',\n d: arcPathStable({\n innerRadius: inner,\n outerRadius: outer,\n startAngle: 0,\n endAngle: Math.PI * 2,\n }),\n }),\n h(\n 'g',\n {\n class: 'tc-pie-slices',\n style: strokeGap > 0 ? `--tc-pie-gap:${strokeGap}px` : undefined,\n },\n groups,\n ),\n ),\n labelled?.layer(cx, cy, outer),\n showCenter &&\n h(\n 'g',\n { class: 'tc-pie-center', 'aria-hidden': 'true' },\n h(\n 'text',\n {\n class: 'tc-pie-value',\n x: cx,\n y: cy,\n dy: centerLabel ? '0' : '0.35em',\n 'text-anchor': 'middle',\n },\n centerValue,\n ),\n centerLabel &&\n h(\n 'text',\n { class: 'tc-pie-label', x: cx, y: cy, dy: '1.6em', 'text-anchor': 'middle' },\n centerLabel,\n ),\n ),\n ]\n return { content, interaction }\n}\n\nfunction pieTable(options: PieModel, ctx: TableContext): DataTable {\n const { slices, total } = layoutSlices(options, ctx.hidden)\n const value = formatNumber(options.format, ctx.locale)\n const share = getNumberFormat(ctx.locale, { style: 'percent', maximumFractionDigits: 1 })\n return {\n columns: ['', 'Value', 'Share'],\n rows: slices.map((slice) => [\n slice.data.name,\n value(slice.value),\n share.format(total > 0 ? slice.value / total : 0),\n ]),\n }\n}\n\nfunction pieType(\n name: string,\n defaults: { inner: number; corner: number },\n): ChartType<PieOptions, PieModel> {\n return {\n name,\n clean: cleanData(cleanItems),\n prepare: withSlices,\n render: (options, ctx): RenderResult => renderPie(options, ctx, defaults),\n sweep,\n legend: slicesLegend,\n table: pieTable,\n valueLabels: { marks: 'slice' },\n }\n}\n\n/**\n * Pie chart: parts of a whole as slices, in data order, clockwise from the top.\n *\n * ```ts\n * new Chart('#el', { type: pie, data: [{ name: 'Direct', value: 42 }, { name: 'Search', value: 31 }] })\n * ```\n */\nexport const pie: ChartType<PieOptions, PieModel> = pieType('pie', { inner: 0, corner: 0 })\n\n/** Donut chart: a pie with a hole showing the total (or your own `center`). */\nexport const donut: ChartType<PieOptions, PieModel> = pieType('donut', { inner: 0.62, corner: 4 })\n"],"mappings":";;;;;;;;;;;AAyEA,SAAS,aACP,OACA,QACoC;CACpC,MAAM,UAAU,MAAM,OAAO,QAAQ,UAAU,CAAC,OAAO,IAAIA,cAAAA,MAAM,MAAM,IAAI,CAAC,CAAC;CAC7E,MAAM,QAAQ,QAAQ,QAAQ,KAAK,UAAU,MAAM,MAAM,OAAO,CAAC;CACjE,IAAI,SAAS,MAAM,cAAc,KAAKC,YAAAA;CAOtC,OAAO;EAAE,QANM,QAAQ,KAAK,UAAU;GACpC,MAAM,QAAQ,QAAQ,IAAK,MAAM,QAAQ,QAAS,KAAK,KAAK,IAAI;GAChE,MAAM,MAAa;IAAE,GAAG;IAAO,YAAY;IAAO,UAAU,QAAQ;GAAM;GAC1E,SAAS;GACT,OAAO;EACT,CACc;EAAG;CAAM;AACzB;AAEA,SAAS,UACP,SACA,KACA,UACA;CACA,MAAM,EAAE,OAAO,QAAQ,WAAW;CAClC,MAAM,MAAM,QAAQ,OAAO;CAC3B,MAAM,EAAE,QAAQ,UAAU,aAAa,SAAS,IAAI,MAAM;CAC1D,MAAM,QAAQ,OAAO,QAAQ,UAAU,MAAM,QAAQ,CAAC;CACtD,MAAM,QAAQC,eAAAA,aAAa,QAAQ,QAAQ,MAAM;CACjD,MAAM,QAAQC,eAAAA,gBAAgB,QAAQ;EAAE,OAAO;EAAW,uBAAuB;CAAE,CAAC;CACpF,MAAM,QAAQC,eAAAA,UAAU,OAAO,QAAQC,eAAAA,OAAO,QAAQ,SAAS,CAAC,CAAC;CACjE,MAAM,QAAQ,QAAQ,WAAW,OAAO,UAAU,QAAQ,SAAS,QAAQ,OAAO,QAAQ;CAC1F,MAAM,WAAW,QAAQ,SACrBC,iBAAAA,QAAQ,cAAc,CAAC,CACrB,MAAM,KAAK,WAAW;EACpB,KAAKN,cAAAA,MAAM,MAAM,IAAI;EACrB,OAAO,MAAM;EACb,MAAM,MAAM,KAAK;EACjB,OACE,UAAU,QACN,KACA,UAAU,UACR,MAAM,MAAM,KAAK,IACjB,MAAM,OAAO,MAAM,QAAQ,KAAK;EACxC,QAAQ,MAAM,aAAa,MAAM,YAAY;EAC7C,QAAQ,MAAM;CAChB,EAAE,GACF,OACA,IAAI,QACN,IACA;CACJ,MAAM,OAAO,UAAU,QAAQ;CAC/B,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,OAAO,KAAK,MAAM,IAAI,IAAA,CAAQ;CAEtE,MAAM,QAAQ,QADA,KAAK,IAAI,KAAM,KAAK,IAAI,GAAG,QAAQ,eAAe,SAAS,KAAK,CACpD;CAC1B,MAAM,eAAe,QAAQ,gBAAgB,SAAS;CACtD,MAAM,KAAK,KAAK,IAAI,KAAK,QAAQ;CACjC,MAAM,KAAK,KAAK,IAAI,KAAK,SAAS;CAKlC,MAAM,YAAY,UAAU,KAAK,MAAM,SAAS,IAAI,MAAM;CAC1D,MAAM,WAAW,QAAQ,KAAK,MAAM,SAAS,IAAIO,YAAAA,eAAe,KAAK,OAAO,KAAK,IAAI;CAErF,MAAM,YAAY,OAAc,KAAK,OAAO,KAAK,WAAW;EAC1D,aAAa;EACb,aAAa;EACb,YAAY,MAAM;EAClB,UAAU,MAAM;EAChB;EACA;CACF;CAEA,MAAM,UAAU,OAAc,aAA0B;EACtD,MAAM,CAAC,GAAG,KAAKC,YAAAA,YAAY,SAAS,KAAK,CAAC;EAC1C,MAAM,OAAgB;GACpB,MAAM,MAAM,KAAK;GACjB,aAAa,MAAM;GACnB,OAAO,MAAM;GACb,MAAM,GAAG,MAAM,MAAM,KAAK,EAAE,IAAI,MAAM,OAAO,QAAQ,IAAI,MAAM,QAAQ,QAAQ,CAAC,EAAE;GAClF,GAAG,KAAK;GACR,GAAG,KAAK;EACV;EACA,IAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,MAAM,KAAK;EAC9C,OAAO;GACL,OAAO;GACP,OAAO,MAAM,KAAK;GAClB,OAAO;GACP,GAAG,KAAK;GACR,MAAM;IAAE,GAAG,KAAK;IAAO,GAAG,KAAK;IAAO,OAAO,QAAQ;IAAG,QAAQ,QAAQ;GAAE;GAC1E,OAAO,CAAC,IAAI;GACZ,aAAa,MAAM;GAEnB,WAAW;IACT,MAAM;IACN,GAAGC,YAAAA,cAAc;KAAE,GAAG,SAAS,OAAO,QAAQ,GAAG,QAAQ,CAAC;KAAG,cAAc;IAAE,CAAC;IAC9E,GAAG;IACH,GAAG;GACL;EACF;CACF;CAEA,MAAM,cAA2B;EAC/B,OAAO,MAAM;EACb,WAAW,aAAa;GACtB,MAAM,QAAQ,MAAM;GACpB,OAAO,QAAQ,OAAO,OAAO,QAAQ,IAAI;EAC3C;EACA,QAAQ,IAAI,IAAI;GACd,MAAM,KAAK,KAAK;GAChB,MAAM,KAAK,KAAK;GAChB,MAAM,IAAI,KAAK,MAAM,IAAI,EAAE;GAC3B,IAAI,IAAI,QAAQ,KAAK,IAAI,QAAA,GAAc,OAAO;GAC9C,MAAM,SAAS,QAAQ,cAAc,KAAKR,YAAAA;GAC1C,MAAM,OAAO,KAAK,KAAK;GAEvB,IAAI,QAAQ,KAAK,MAAM,IAAI,CAAC,EAAE;GAC9B,QAAQ,UAAY,QAAQ,SAAS,OAAQ,QAAQ;GACrD,MAAM,WAAW,MAAM,WAAW,MAAM,SAAS,EAAE,cAAc,QAAQ,EAAE,QAAQ;GACnF,OAAO,aAAa,KAAK,OAAO,OAAO,MAAM,WAAoB,QAAQ;EAC3E;CACF;CAEA,MAAM,SAAS,OAAO,KAAK,UACzBS,cAAAA,EACE,KACAC,cAAAA,WAAW,MAAM,MAAM,MAAM,KAAK,GAIlCC,cAAAA,QAAQ,YAAY,SAAS,KAAK,CAAC,CACrC,CACF;CAEA,MAAM,SAAS,QAAQ;CACvB,MAAM,aAAa,QAAQ,KAAK,WAAW;CAC3C,MAAM,cAAc,aAAc,QAAQ,SAAS,MAAM,KAAK,IAAK;CACnE,MAAM,cAAc,aAAa,QAAQ,QAAQ,KAAA;CAiDjD,OAAO;EAAE,SAAA;GA9CPF,cAAAA,EACE,KACA;IAAE,OAAO;IAAU,OAAO,uBAAuB,GAAG,KAAK,GAAG;GAAK,GACjE,UAAU,KACRA,cAAAA,EAAE,QAAQ;IACR,OAAO;IACP,GAAGD,YAAAA,cAAc;KACf,aAAa;KACb,aAAa;KACb,YAAY;KACZ,UAAU,KAAK,KAAK;IACtB,CAAC;GACH,CAAC,GACHC,cAAAA,EACE,KACA;IACE,OAAO;IACP,OAAO,YAAY,IAAI,gBAAgB,UAAU,MAAM,KAAA;GACzD,GACA,MACF,CACF;GACA,UAAU,MAAM,IAAI,IAAI,KAAK;GAC7B,cACEA,cAAAA,EACE,KACA;IAAE,OAAO;IAAiB,eAAe;GAAO,GAChDA,cAAAA,EACE,QACA;IACE,OAAO;IACP,GAAG;IACH,GAAG;IACH,IAAI,cAAc,MAAM;IACxB,eAAe;GACjB,GACA,WACF,GACA,eACEA,cAAAA,EACE,QACA;IAAE,OAAO;IAAgB,GAAG;IAAI,GAAG;IAAI,IAAI;IAAS,eAAe;GAAS,GAC5E,WACF,CACJ;EAEW;EAAG;CAAY;AAChC;AAEA,SAAS,SAAS,SAAmB,KAA8B;CACjE,MAAM,EAAE,QAAQ,UAAU,aAAa,SAAS,IAAI,MAAM;CAC1D,MAAM,QAAQR,eAAAA,aAAa,QAAQ,QAAQ,IAAI,MAAM;CACrD,MAAM,QAAQC,eAAAA,gBAAgB,IAAI,QAAQ;EAAE,OAAO;EAAW,uBAAuB;CAAE,CAAC;CACxF,OAAO;EACL,SAAS;GAAC;GAAI;GAAS;EAAO;EAC9B,MAAM,OAAO,KAAK,UAAU;GAC1B,MAAM,KAAK;GACX,MAAM,MAAM,KAAK;GACjB,MAAM,OAAO,QAAQ,IAAI,MAAM,QAAQ,QAAQ,CAAC;EAClD,CAAC;CACH;AACF;AAEA,SAAS,QACP,MACA,UACiC;CACjC,OAAO;EACL;EACA,OAAOU,cAAAA,UAAUC,cAAAA,UAAU;EAC3B,SAASC,eAAAA;EACT,SAAS,SAAS,QAAsB,UAAU,SAAS,KAAK,QAAQ;EACxEC,OAAAA,cAAAA;EACA,QAAQC,eAAAA;EACR,OAAO;EACP,aAAa,EAAE,OAAO,QAAQ;CAChC;AACF;;;;;;;;AASA,MAAa,MAAuC,QAAQ,OAAO;CAAE,OAAO;CAAG,QAAQ;AAAE,CAAC;;AAG1F,MAAa,QAAyC,QAAQ,SAAS;CAAE,OAAO;CAAM,QAAQ;AAAE,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as ChartType } from "./chart-CE9EVbfV.js";
|
|
2
2
|
import { c as NumberFormat } from "./time-DRIDgv2a.js";
|
|
3
|
-
import {
|
|
3
|
+
import { n as InsetsInput } from "./layout-CYerDebD.js";
|
|
4
4
|
import { a as ClassValue } from "./vnode-Du2cC8Fm.js";
|
|
5
|
+
import { n as WithSlices, t as SliceGrouping } from "./others-DBO4Kjwl.js";
|
|
6
|
+
import { t as SliceLabelOptions } from "./slice-labels-Cm5CyV7B.js";
|
|
5
7
|
/** One slice of a pie or donut. */
|
|
6
8
|
interface PieSlice {
|
|
7
9
|
name: string;
|
|
@@ -19,17 +21,8 @@ interface PieSlice {
|
|
|
19
21
|
/** Start hidden (toggle it back from the legend). */
|
|
20
22
|
hidden?: boolean;
|
|
21
23
|
}
|
|
22
|
-
interface PieOptions {
|
|
24
|
+
interface PieOptions extends SliceGrouping {
|
|
23
25
|
data: readonly PieSlice[];
|
|
24
|
-
/**
|
|
25
|
-
* The most slices drawn, the one for the rest included: with more entries
|
|
26
|
-
* than that, the largest `maxSlices - 1` keep a slice of their own and the
|
|
27
|
-
* others share one, named by `othersLabel`, after them. Defaults to `9`
|
|
28
|
-
* (the eight palette colors and the rest); `0` never groups.
|
|
29
|
-
*/
|
|
30
|
-
maxSlices?: number;
|
|
31
|
-
/** Name of the slice that groups the rest. Defaults to `'Others'`. */
|
|
32
|
-
othersLabel?: string;
|
|
33
26
|
/** Hole size relative to the radius, `0…0.95`. Defaults to `0` (`0.62` for `donut`). */
|
|
34
27
|
innerRadius?: number;
|
|
35
28
|
/** Gap between slices in pixels, drawn as surface. Defaults to `2`. */
|
|
@@ -50,7 +43,17 @@ interface PieOptions {
|
|
|
50
43
|
};
|
|
51
44
|
/** Extra space around the pie, in pixels. */
|
|
52
45
|
padding?: InsetsInput;
|
|
46
|
+
/**
|
|
47
|
+
* Name every slice beside the chart, with its share, joined to the slice
|
|
48
|
+
* by a line: `true`, or `{ value: 'value' }` for the values and
|
|
49
|
+
* `{ value: false }` for the names alone. The pie gets smaller to leave the
|
|
50
|
+
* labels room; a chart too small for them goes without. Needs
|
|
51
|
+
* `@tabler/charts/slice-labels` on the core.
|
|
52
|
+
*/
|
|
53
|
+
labels?: boolean | SliceLabelOptions;
|
|
53
54
|
}
|
|
55
|
+
/** The chart model of a pie: its options, with the slices as drawn (the rest grouped). */
|
|
56
|
+
type PieModel = WithSlices<PieOptions>;
|
|
54
57
|
/**
|
|
55
58
|
* Pie chart: parts of a whole as slices, in data order, clockwise from the top.
|
|
56
59
|
*
|
|
@@ -58,7 +61,7 @@ interface PieOptions {
|
|
|
58
61
|
* new Chart('#el', { type: pie, data: [{ name: 'Direct', value: 42 }, { name: 'Search', value: 31 }] })
|
|
59
62
|
* ```
|
|
60
63
|
*/
|
|
61
|
-
declare const pie: ChartType<PieOptions>;
|
|
64
|
+
declare const pie: ChartType<PieOptions, PieModel>;
|
|
62
65
|
/** Donut chart: a pie with a hole showing the total (or your own `center`). */
|
|
63
|
-
declare const donut: ChartType<PieOptions>;
|
|
66
|
+
declare const donut: ChartType<PieOptions, PieModel>;
|
|
64
67
|
export { pie as i, PieSlice as n, donut as r, PieOptions as t };
|
package/dist/pie.cjs
CHANGED
package/dist/pie.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Standalone entry: `import { pie, donut } from '@tabler/charts/pie'`. */
|
|
2
|
-
import { i as pie, n as PieSlice, r as donut, t as PieOptions } from "./pie-
|
|
2
|
+
import { i as pie, n as PieSlice, r as donut, t as PieOptions } from "./pie-AFedsDcF.cjs";
|
|
3
3
|
export { type PieOptions, type PieSlice, donut, pie };
|
package/dist/pie.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Standalone entry: `import { pie, donut } from '@tabler/charts/pie'`. */
|
|
2
|
-
import { i as pie, n as PieSlice, r as donut, t as PieOptions } from "./pie-
|
|
2
|
+
import { i as pie, n as PieSlice, r as donut, t as PieOptions } from "./pie-Cn2H3pz8.js";
|
|
3
3
|
export { type PieOptions, type PieSlice, donut, pie };
|
package/dist/pie.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as donut, n as pie } from "./pie-
|
|
1
|
+
export { t as donut, n as pie } from "./pie-Ch6Bx0ih.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_layout = require("./layout-
|
|
1
|
+
const require_layout = require("./layout-Cfg9x1k2.cjs");
|
|
2
2
|
// src/charts/point-shapes.ts
|
|
3
3
|
/**
|
|
4
4
|
* Outlines by color slot (0-based), as x, y pairs in units of the radius,
|
|
@@ -126,29 +126,30 @@ function markerPath(slot, x, y, r) {
|
|
|
126
126
|
for (let i = 0; i < shape.length; i += 2) d += `${i ? "L" : "M"}${require_layout.round(x + shape[i] * r)},${require_layout.round(y + shape[i + 1] * r)}`;
|
|
127
127
|
return `${d}Z`;
|
|
128
128
|
}
|
|
129
|
-
/**
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
tag: "path",
|
|
138
|
-
attrs: {
|
|
139
|
-
class: `${cls} tc-marker`,
|
|
140
|
-
d: markerPath(slot, +(attrs.cx ?? 0), +(attrs.cy ?? 0), +(attrs.r ?? 0))
|
|
141
|
-
},
|
|
142
|
-
children: [],
|
|
143
|
-
key: child.key
|
|
144
|
-
};
|
|
129
|
+
/**
|
|
130
|
+
* Inline style for the legend or tooltip swatch of slot `slot`: its marker as
|
|
131
|
+
* a CSS shape (`--tc-shape`, a `clip-path`) in a box without rounded corners;
|
|
132
|
+
* `undefined` for the slots that stay a circle.
|
|
133
|
+
*/
|
|
134
|
+
function markerClip(slot) {
|
|
135
|
+
if (!SHAPES[slot]?.length) return void 0;
|
|
136
|
+
const points = markerPath(slot, 50, 50, 35.7).slice(1, -1).replace(/,/g, "% ").replace(/L/g, "%,");
|
|
145
137
|
return {
|
|
146
|
-
|
|
147
|
-
|
|
138
|
+
"--tc-shape": slot === 1 ? "inset(10% round 1px)" : `polygon(${points}%)`,
|
|
139
|
+
"--tc-shape-radius": 0
|
|
148
140
|
};
|
|
149
141
|
}
|
|
150
|
-
/**
|
|
151
|
-
|
|
142
|
+
/**
|
|
143
|
+
* @deprecated Points are drawn in their shapes as the chart renders: this
|
|
144
|
+
* step leaves the content as it is. It will be removed in the next major.
|
|
145
|
+
*/
|
|
146
|
+
const shapesStep = (_config, content) => content;
|
|
147
|
+
Object.defineProperty(exports, "markerClip", {
|
|
148
|
+
enumerable: true,
|
|
149
|
+
get: function() {
|
|
150
|
+
return markerClip;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
152
153
|
Object.defineProperty(exports, "markerPath", {
|
|
153
154
|
enumerable: true,
|
|
154
155
|
get: function() {
|
|
@@ -162,4 +163,4 @@ Object.defineProperty(exports, "shapesStep", {
|
|
|
162
163
|
}
|
|
163
164
|
});
|
|
164
165
|
|
|
165
|
-
//# sourceMappingURL=point-shapes
|
|
166
|
+
//# sourceMappingURL=point-shapes-BRawRM78.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point-shapes-BRawRM78.cjs","names":["round"],"sources":["../src/charts/point-shapes.ts"],"sourcesContent":["/**\n * Marker shapes, so the points of series do not depend on color alone\n * (color vision deficiency, grayscale print): one shape per color slot,\n * for line, radar and scatter points and the active points of the hover.\n * On with `shapes: true`, and with `patterns: true` unless `shapes` says\n * otherwise. Legend and tooltip swatches take the same shapes (`markerClip`).\n */\nimport type { PostStep } from '../features.ts'\nimport { round } from '../layout.ts'\n\n/**\n * Outlines by color slot (0-based), as x, y pairs in units of the radius,\n * sized so the shapes weigh about the same as the circle of slot 0 (and of\n * slots 9 and up).\n */\nconst SHAPES: readonly (readonly number[])[] = [\n [],\n // Square.\n [-0.9, -0.9, 0.9, -0.9, 0.9, 0.9, -0.9, 0.9],\n // Triangle.\n [0, -1.3, 1.2, 0.9, -1.2, 0.9],\n // Diamond.\n [0, -1.3, 1.3, 0, 0, 1.3, -1.3, 0],\n // Triangle, pointing down.\n [-1.2, -0.9, 1.2, -0.9, 0, 1.3],\n // Plus.\n [\n -0.4, -1.2, 0.4, -1.2, 0.4, -0.4, 1.2, -0.4, 1.2, 0.4, 0.4, 0.4, 0.4, 1.2, -0.4, 1.2, -0.4, 0.4,\n -1.2, 0.4, -1.2, -0.4, -0.4, -0.4,\n ],\n // Cross.\n [\n -0.7, -1.2, 0, -0.5, 0.7, -1.2, 1.2, -0.7, 0.5, 0, 1.2, 0.7, 0.7, 1.2, 0, 0.5, -0.7, 1.2, -1.2,\n 0.7, -0.5, 0, -1.2, -0.7,\n ],\n // Star.\n [\n 0, -1.4, 0.32, -0.44, 1.33, -0.43, 0.52, 0.17, 0.82, 1.13, 0, 0.55, -0.82, 1.13, -0.52, 0.17,\n -1.33, -0.43, -0.32, -0.44,\n ],\n]\n\n/** The path of slot `slot`'s marker of radius `r` around (`x`, `y`). */\nexport function markerPath(slot: number, x: number, y: number, r: number): string {\n const shape = SHAPES[slot] ?? []\n if (!shape.length) {\n return `M${round(x - r)},${round(y)}a${r},${r},0,1,0,${2 * r},0a${r},${r},0,1,0,${-2 * r},0Z`\n }\n let d = ''\n for (let i = 0; i < shape.length; i += 2) {\n d += `${i ? 'L' : 'M'}${round(x + (shape[i] as number) * r)},${round(y + (shape[i + 1] as number) * r)}`\n }\n return `${d}Z`\n}\n\n/**\n * Inline style for the legend or tooltip swatch of slot `slot`: its marker as\n * a CSS shape (`--tc-shape`, a `clip-path`) in a box without rounded corners;\n * `undefined` for the slots that stay a circle.\n */\nexport function markerClip(slot: number): Record<string, string | number> | undefined {\n if (!SHAPES[slot]?.length) return undefined\n // In percent of the box: a radius of 35.7% keeps the largest shape (the star) inside.\n const points = markerPath(slot, 50, 50, 35.7).slice(1, -1).replace(/,/g, '% ').replace(/L/g, '%,')\n return {\n // The square is not cut from the swatch's box but set a little into it.\n '--tc-shape': slot === 1 ? 'inset(10% round 1px)' : `polygon(${points}%)`,\n '--tc-shape-radius': 0,\n }\n}\n\n/**\n * @deprecated Points are drawn in their shapes as the chart renders: this\n * step leaves the content as it is. It will be removed in the next major.\n */\nexport const shapesStep: PostStep = (_config, content) => content\n"],"mappings":";;;;;;;AAeA,MAAM,SAAyC;CAC7C,CAAC;CAED;EAAC;EAAM;EAAM;EAAK;EAAM;EAAK;EAAK;EAAM;CAAG;CAE3C;EAAC;EAAG;EAAM;EAAK;EAAK;EAAM;CAAG;CAE7B;EAAC;EAAG;EAAM;EAAK;EAAG;EAAG;EAAK;EAAM;CAAC;CAEjC;EAAC;EAAM;EAAM;EAAK;EAAM;EAAG;CAAG;CAE9B;EACE;EAAM;EAAM;EAAK;EAAM;EAAK;EAAM;EAAK;EAAM;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAM;EAAK;EAAM;EAC5F;EAAM;EAAK;EAAM;EAAM;EAAM;CAC/B;CAEA;EACE;EAAM;EAAM;EAAG;EAAM;EAAK;EAAM;EAAK;EAAM;EAAK;EAAG;EAAK;EAAK;EAAK;EAAK;EAAG;EAAK;EAAM;EAAK;EAC1F;EAAK;EAAM;EAAG;EAAM;CACtB;CAEA;EACE;EAAG;EAAM;EAAM;EAAO;EAAM;EAAO;EAAM;EAAM;EAAM;EAAM;EAAG;EAAM;EAAO;EAAM;EAAO;EACxF;EAAO;EAAO;EAAO;CACvB;AACF;;AAGA,SAAgB,WAAW,MAAc,GAAW,GAAW,GAAmB;CAChF,MAAM,QAAQ,OAAO,SAAS,CAAC;CAC/B,IAAI,CAAC,MAAM,QACT,OAAO,IAAIA,eAAAA,MAAM,IAAI,CAAC,EAAE,GAAGA,eAAAA,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,KAAK,EAAE;CAE3F,IAAI,IAAI;CACR,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,GACrC,KAAK,GAAG,IAAI,MAAM,MAAMA,eAAAA,MAAM,IAAK,MAAM,KAAgB,CAAC,EAAE,GAAGA,eAAAA,MAAM,IAAK,MAAM,IAAI,KAAgB,CAAC;CAEvG,OAAO,GAAG,EAAE;AACd;;;;;;AAOA,SAAgB,WAAW,MAA2D;CACpF,IAAI,CAAC,OAAO,KAAK,EAAE,QAAQ,OAAO,KAAA;CAElC,MAAM,SAAS,WAAW,MAAM,IAAI,IAAI,IAAI,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,QAAQ,MAAM,IAAI,CAAC,CAAC,QAAQ,MAAM,IAAI;CACjG,OAAO;EAEL,cAAc,SAAS,IAAI,yBAAyB,WAAW,OAAO;EACtE,qBAAqB;CACvB;AACF;;;;;AAMA,MAAa,cAAwB,SAAS,YAAY"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as round } from "./layout-DqAte3H8.js";
|
|
2
2
|
// src/charts/point-shapes.ts
|
|
3
3
|
/**
|
|
4
4
|
* Outlines by color slot (0-based), as x, y pairs in units of the radius,
|
|
@@ -126,29 +126,24 @@ function markerPath(slot, x, y, r) {
|
|
|
126
126
|
for (let i = 0; i < shape.length; i += 2) d += `${i ? "L" : "M"}${round(x + shape[i] * r)},${round(y + shape[i + 1] * r)}`;
|
|
127
127
|
return `${d}Z`;
|
|
128
128
|
}
|
|
129
|
-
/**
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
tag: "path",
|
|
138
|
-
attrs: {
|
|
139
|
-
class: `${cls} tc-marker`,
|
|
140
|
-
d: markerPath(slot, +(attrs.cx ?? 0), +(attrs.cy ?? 0), +(attrs.r ?? 0))
|
|
141
|
-
},
|
|
142
|
-
children: [],
|
|
143
|
-
key: child.key
|
|
144
|
-
};
|
|
129
|
+
/**
|
|
130
|
+
* Inline style for the legend or tooltip swatch of slot `slot`: its marker as
|
|
131
|
+
* a CSS shape (`--tc-shape`, a `clip-path`) in a box without rounded corners;
|
|
132
|
+
* `undefined` for the slots that stay a circle.
|
|
133
|
+
*/
|
|
134
|
+
function markerClip(slot) {
|
|
135
|
+
if (!SHAPES[slot]?.length) return void 0;
|
|
136
|
+
const points = markerPath(slot, 50, 50, 35.7).slice(1, -1).replace(/,/g, "% ").replace(/L/g, "%,");
|
|
145
137
|
return {
|
|
146
|
-
|
|
147
|
-
|
|
138
|
+
"--tc-shape": slot === 1 ? "inset(10% round 1px)" : `polygon(${points}%)`,
|
|
139
|
+
"--tc-shape-radius": 0
|
|
148
140
|
};
|
|
149
141
|
}
|
|
150
|
-
/**
|
|
151
|
-
|
|
152
|
-
|
|
142
|
+
/**
|
|
143
|
+
* @deprecated Points are drawn in their shapes as the chart renders: this
|
|
144
|
+
* step leaves the content as it is. It will be removed in the next major.
|
|
145
|
+
*/
|
|
146
|
+
const shapesStep = (_config, content) => content;
|
|
147
|
+
export { markerPath as n, shapesStep as r, markerClip as t };
|
|
153
148
|
|
|
154
|
-
//# sourceMappingURL=point-shapes-
|
|
149
|
+
//# sourceMappingURL=point-shapes-DI6GhcI7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point-shapes-DI6GhcI7.js","names":[],"sources":["../src/charts/point-shapes.ts"],"sourcesContent":["/**\n * Marker shapes, so the points of series do not depend on color alone\n * (color vision deficiency, grayscale print): one shape per color slot,\n * for line, radar and scatter points and the active points of the hover.\n * On with `shapes: true`, and with `patterns: true` unless `shapes` says\n * otherwise. Legend and tooltip swatches take the same shapes (`markerClip`).\n */\nimport type { PostStep } from '../features.ts'\nimport { round } from '../layout.ts'\n\n/**\n * Outlines by color slot (0-based), as x, y pairs in units of the radius,\n * sized so the shapes weigh about the same as the circle of slot 0 (and of\n * slots 9 and up).\n */\nconst SHAPES: readonly (readonly number[])[] = [\n [],\n // Square.\n [-0.9, -0.9, 0.9, -0.9, 0.9, 0.9, -0.9, 0.9],\n // Triangle.\n [0, -1.3, 1.2, 0.9, -1.2, 0.9],\n // Diamond.\n [0, -1.3, 1.3, 0, 0, 1.3, -1.3, 0],\n // Triangle, pointing down.\n [-1.2, -0.9, 1.2, -0.9, 0, 1.3],\n // Plus.\n [\n -0.4, -1.2, 0.4, -1.2, 0.4, -0.4, 1.2, -0.4, 1.2, 0.4, 0.4, 0.4, 0.4, 1.2, -0.4, 1.2, -0.4, 0.4,\n -1.2, 0.4, -1.2, -0.4, -0.4, -0.4,\n ],\n // Cross.\n [\n -0.7, -1.2, 0, -0.5, 0.7, -1.2, 1.2, -0.7, 0.5, 0, 1.2, 0.7, 0.7, 1.2, 0, 0.5, -0.7, 1.2, -1.2,\n 0.7, -0.5, 0, -1.2, -0.7,\n ],\n // Star.\n [\n 0, -1.4, 0.32, -0.44, 1.33, -0.43, 0.52, 0.17, 0.82, 1.13, 0, 0.55, -0.82, 1.13, -0.52, 0.17,\n -1.33, -0.43, -0.32, -0.44,\n ],\n]\n\n/** The path of slot `slot`'s marker of radius `r` around (`x`, `y`). */\nexport function markerPath(slot: number, x: number, y: number, r: number): string {\n const shape = SHAPES[slot] ?? []\n if (!shape.length) {\n return `M${round(x - r)},${round(y)}a${r},${r},0,1,0,${2 * r},0a${r},${r},0,1,0,${-2 * r},0Z`\n }\n let d = ''\n for (let i = 0; i < shape.length; i += 2) {\n d += `${i ? 'L' : 'M'}${round(x + (shape[i] as number) * r)},${round(y + (shape[i + 1] as number) * r)}`\n }\n return `${d}Z`\n}\n\n/**\n * Inline style for the legend or tooltip swatch of slot `slot`: its marker as\n * a CSS shape (`--tc-shape`, a `clip-path`) in a box without rounded corners;\n * `undefined` for the slots that stay a circle.\n */\nexport function markerClip(slot: number): Record<string, string | number> | undefined {\n if (!SHAPES[slot]?.length) return undefined\n // In percent of the box: a radius of 35.7% keeps the largest shape (the star) inside.\n const points = markerPath(slot, 50, 50, 35.7).slice(1, -1).replace(/,/g, '% ').replace(/L/g, '%,')\n return {\n // The square is not cut from the swatch's box but set a little into it.\n '--tc-shape': slot === 1 ? 'inset(10% round 1px)' : `polygon(${points}%)`,\n '--tc-shape-radius': 0,\n }\n}\n\n/**\n * @deprecated Points are drawn in their shapes as the chart renders: this\n * step leaves the content as it is. It will be removed in the next major.\n */\nexport const shapesStep: PostStep = (_config, content) => content\n"],"mappings":";;;;;;;AAeA,MAAM,SAAyC;CAC7C,CAAC;CAED;EAAC;EAAM;EAAM;EAAK;EAAM;EAAK;EAAK;EAAM;CAAG;CAE3C;EAAC;EAAG;EAAM;EAAK;EAAK;EAAM;CAAG;CAE7B;EAAC;EAAG;EAAM;EAAK;EAAG;EAAG;EAAK;EAAM;CAAC;CAEjC;EAAC;EAAM;EAAM;EAAK;EAAM;EAAG;CAAG;CAE9B;EACE;EAAM;EAAM;EAAK;EAAM;EAAK;EAAM;EAAK;EAAM;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAM;EAAK;EAAM;EAC5F;EAAM;EAAK;EAAM;EAAM;EAAM;CAC/B;CAEA;EACE;EAAM;EAAM;EAAG;EAAM;EAAK;EAAM;EAAK;EAAM;EAAK;EAAG;EAAK;EAAK;EAAK;EAAK;EAAG;EAAK;EAAM;EAAK;EAC1F;EAAK;EAAM;EAAG;EAAM;CACtB;CAEA;EACE;EAAG;EAAM;EAAM;EAAO;EAAM;EAAO;EAAM;EAAM;EAAM;EAAM;EAAG;EAAM;EAAO;EAAM;EAAO;EACxF;EAAO;EAAO;EAAO;CACvB;AACF;;AAGA,SAAgB,WAAW,MAAc,GAAW,GAAW,GAAmB;CAChF,MAAM,QAAQ,OAAO,SAAS,CAAC;CAC/B,IAAI,CAAC,MAAM,QACT,OAAO,IAAI,MAAM,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,KAAK,EAAE;CAE3F,IAAI,IAAI;CACR,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,GACrC,KAAK,GAAG,IAAI,MAAM,MAAM,MAAM,IAAK,MAAM,KAAgB,CAAC,EAAE,GAAG,MAAM,IAAK,MAAM,IAAI,KAAgB,CAAC;CAEvG,OAAO,GAAG,EAAE;AACd;;;;;;AAOA,SAAgB,WAAW,MAA2D;CACpF,IAAI,CAAC,OAAO,KAAK,EAAE,QAAQ,OAAO,KAAA;CAElC,MAAM,SAAS,WAAW,MAAM,IAAI,IAAI,IAAI,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,QAAQ,MAAM,IAAI,CAAC,CAAC,QAAQ,MAAM,IAAI;CACjG,OAAO;EAEL,cAAc,SAAS,IAAI,yBAAyB,WAAW,OAAO;EACtE,qBAAqB;CACvB;AACF;;;;;AAMA,MAAa,cAAwB,SAAS,YAAY"}
|
package/dist/point-shapes.cjs
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_point_shapes = require("./point-shapes
|
|
3
|
-
const require_features = require("./features-DCXEvoya.cjs");
|
|
2
|
+
const require_point_shapes = require("./point-shapes-BRawRM78.cjs");
|
|
4
3
|
// src/point-shapes.ts
|
|
5
4
|
/**
|
|
6
5
|
* Standalone entry: `import '@tabler/charts/point-shapes'` enables `shapes`
|
|
7
6
|
* (a point shape per series) on the core.
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
require("./features-DEDP5CEQ.cjs").register({
|
|
9
|
+
"point-shapes": require_point_shapes.markerPath,
|
|
10
|
+
swatch: require_point_shapes.markerClip
|
|
11
|
+
});
|
|
12
|
+
exports.markerClip = require_point_shapes.markerClip;
|
|
11
13
|
exports.markerPath = require_point_shapes.markerPath;
|
|
12
14
|
exports.shapesStep = require_point_shapes.shapesStep;
|
|
13
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point-shapes.cjs","names":["register","markerPath","
|
|
1
|
+
{"version":3,"file":"point-shapes.cjs","names":["register","markerPath","markerClip"],"sources":["../src/point-shapes.ts"],"sourcesContent":["/**\n * Standalone entry: `import '@tabler/charts/point-shapes'` enables `shapes`\n * (a point shape per series) on the core.\n */\nimport { markerClip, markerPath, shapesStep } from './charts/point-shapes.ts'\nimport { register } from './features.ts'\n\nregister({ 'point-shapes': markerPath, swatch: markerClip })\n\nexport { markerClip, markerPath, shapesStep }\n"],"mappings":";;;;;;;A,iCAOAA,CAAAA,CAAAA,SAAS;CAAE,gBAAgBC,qBAAAA;CAAY,QAAQC,qBAAAA;AAAW,CAAC"}
|
package/dist/point-shapes.d.cts
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Standalone entry: `import '@tabler/charts/point-shapes'` enables `shapes`
|
|
3
3
|
* (a point shape per series) on the core.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
export { markerPath, shapesStep };
|
|
5
|
+
import { it as shapesStep, nt as markerClip, rt as markerPath } from "./chart-Dz4geQZy.cjs";
|
|
6
|
+
export { markerClip, markerPath, shapesStep };
|
package/dist/point-shapes.d.ts
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Standalone entry: `import '@tabler/charts/point-shapes'` enables `shapes`
|
|
3
3
|
* (a point shape per series) on the core.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
export { markerPath, shapesStep };
|
|
5
|
+
import { $ as markerPath, Q as markerClip, et as shapesStep } from "./chart-CE9EVbfV.js";
|
|
6
|
+
export { markerClip, markerPath, shapesStep };
|
package/dist/point-shapes.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { n as shapesStep, t as
|
|
2
|
-
import { i as register
|
|
1
|
+
import { n as markerPath, r as shapesStep, t as markerClip } from "./point-shapes-DI6GhcI7.js";
|
|
2
|
+
import { i as register } from "./features-B55rwpQC.js";
|
|
3
3
|
// src/point-shapes.ts
|
|
4
4
|
/**
|
|
5
5
|
* Standalone entry: `import '@tabler/charts/point-shapes'` enables `shapes`
|
|
6
6
|
* (a point shape per series) on the core.
|
|
7
7
|
*/
|
|
8
|
-
register({
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
register({
|
|
9
|
+
"point-shapes": markerPath,
|
|
10
|
+
swatch: markerClip
|
|
11
|
+
});
|
|
12
|
+
export { markerClip, markerPath, shapesStep };
|
|
11
13
|
|
|
12
14
|
//# sourceMappingURL=point-shapes.js.map
|
package/dist/point-shapes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point-shapes.js","names":[],"sources":["../src/point-shapes.ts"],"sourcesContent":["/**\n * Standalone entry: `import '@tabler/charts/point-shapes'` enables `shapes`\n * (a point shape per series) on the core.\n */\nimport { markerPath, shapesStep } from './charts/point-shapes.ts'\nimport {
|
|
1
|
+
{"version":3,"file":"point-shapes.js","names":[],"sources":["../src/point-shapes.ts"],"sourcesContent":["/**\n * Standalone entry: `import '@tabler/charts/point-shapes'` enables `shapes`\n * (a point shape per series) on the core.\n */\nimport { markerClip, markerPath, shapesStep } from './charts/point-shapes.ts'\nimport { register } from './features.ts'\n\nregister({ 'point-shapes': markerPath, swatch: markerClip })\n\nexport { markerClip, markerPath, shapesStep }\n"],"mappings":";;;;;;;AAOA,SAAS;CAAE,gBAAgB;CAAY,QAAQ;AAAW,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as linearTicks } from "./axis-C5obgdJt.js";
|
|
2
2
|
import { n as formatDetail } from "./format-it1kepFG.js";
|
|
3
|
-
import { i as insets, n as estimateTextWidth,
|
|
3
|
+
import { i as insets, n as estimateTextWidth, r as innerRect, s as round, t as LINE_HEIGHT } from "./layout-DqAte3H8.js";
|
|
4
|
+
import { _ as seriesTable, d as resolveLabels, f as seriesAttrs, h as seriesLegend, m as seriesKey, o as labelKey, r as domainOf, s as markerShape, u as pointMark, v as tickCount, w as linear } from "./cartesian-COglz544.js";
|
|
4
5
|
import { t as h } from "./vnode-_EMUqysL.js";
|
|
5
6
|
import { r as cleanSeries, t as cleanData } from "./clean-CkoQobGv.js";
|
|
6
7
|
// src/charts/radar.ts
|
|
@@ -141,7 +142,8 @@ function renderRadar(options, ctx) {
|
|
|
141
142
|
height: radius * 2
|
|
142
143
|
},
|
|
143
144
|
items,
|
|
144
|
-
|
|
145
|
+
highlight: {
|
|
146
|
+
kind: "spoke",
|
|
145
147
|
x1: cx,
|
|
146
148
|
y1: cy,
|
|
147
149
|
x2,
|
|
@@ -164,7 +166,6 @@ function renderRadar(options, ctx) {
|
|
|
164
166
|
return hit;
|
|
165
167
|
}
|
|
166
168
|
};
|
|
167
|
-
ctx.onHitTest(interaction);
|
|
168
169
|
const grid = h("g", {
|
|
169
170
|
key: "grid",
|
|
170
171
|
class: "tc-radar-grid",
|
|
@@ -184,6 +185,7 @@ function renderRadar(options, ctx) {
|
|
|
184
185
|
y2: round(y2)
|
|
185
186
|
});
|
|
186
187
|
}));
|
|
188
|
+
const shape = markerShape(options);
|
|
187
189
|
const groups = series.map((s, index) => {
|
|
188
190
|
if (ctx.hidden.has(seriesKey(s))) return null;
|
|
189
191
|
const d = polygon(labels.map((_, i) => radiusOf(s.values[i])));
|
|
@@ -197,13 +199,7 @@ function renderRadar(options, ctx) {
|
|
|
197
199
|
const v = s.values[i];
|
|
198
200
|
if (v == null || !Number.isFinite(v)) return null;
|
|
199
201
|
const [x, y] = at(i, scale(v));
|
|
200
|
-
return
|
|
201
|
-
key: labelKey(label),
|
|
202
|
-
class: "tc-point",
|
|
203
|
-
cx: round(x),
|
|
204
|
-
cy: round(y),
|
|
205
|
-
r: pointRadius
|
|
206
|
-
});
|
|
202
|
+
return pointMark(shape, index, labelKey(label), "tc-point", round(x), round(y), pointRadius);
|
|
207
203
|
})));
|
|
208
204
|
});
|
|
209
205
|
const spokeLabels = h("g", {
|
|
@@ -242,16 +238,19 @@ function renderRadar(options, ctx) {
|
|
|
242
238
|
y: round(cy - tick.position),
|
|
243
239
|
dy: "0.35em"
|
|
244
240
|
}, tick.label)));
|
|
245
|
-
return
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
241
|
+
return {
|
|
242
|
+
content: [
|
|
243
|
+
grid,
|
|
244
|
+
h("g", {
|
|
245
|
+
key: "series",
|
|
246
|
+
class: "tc-series-list tc-radar-series",
|
|
247
|
+
style: `transform-origin:${round(cx)}px ${round(cy)}px`
|
|
248
|
+
}, groups),
|
|
249
|
+
spokeLabels,
|
|
250
|
+
valueLabels
|
|
251
|
+
],
|
|
252
|
+
interaction
|
|
253
|
+
};
|
|
255
254
|
}
|
|
256
255
|
/**
|
|
257
256
|
* Radar (spider) chart: one spoke per label, the values of each series
|
|
@@ -281,4 +280,4 @@ const radar = {
|
|
|
281
280
|
};
|
|
282
281
|
export { radar as t };
|
|
283
282
|
|
|
284
|
-
//# sourceMappingURL=radar-
|
|
283
|
+
//# sourceMappingURL=radar-Bg-IiIWB.js.map
|