@tabler/charts 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +165 -17
- package/dist/{annotations-DdRdeBUB.cjs → annotations--m-HzMBM.cjs} +87 -11
- package/dist/annotations--m-HzMBM.cjs.map +1 -0
- package/dist/{annotations-B02GR_KU.d.ts → annotations-CCDUC1lW.d.ts} +16 -30
- package/dist/{annotations-CHafaGd4.d.cts → annotations-CqZM1z9R.d.cts} +16 -30
- package/dist/{annotations-D0YQ0IoA.js → annotations-DGITy6th.js} +87 -11
- package/dist/annotations-DGITy6th.js.map +1 -0
- package/dist/annotations.cjs +2 -2
- package/dist/annotations.d.cts +1 -1
- package/dist/annotations.d.ts +1 -1
- package/dist/annotations.js +2 -2
- package/dist/{area-0-L1bG9B.js → area-BN0uE9R0.js} +4 -3
- package/dist/area-BN0uE9R0.js.map +1 -0
- package/dist/{area-CJX9219z.d.cts → area-D6LNLk3r.d.cts} +2 -2
- package/dist/{area-d11XePuw.d.ts → area-DEFL-Yun.d.ts} +2 -2
- package/dist/{area-4eRs3c0K.cjs → area-D_N8b4Ng.cjs} +4 -3
- package/dist/area-D_N8b4Ng.cjs.map +1 -0
- package/dist/area.cjs +1 -1
- package/dist/area.d.cts +1 -1
- package/dist/area.d.ts +1 -1
- package/dist/area.js +1 -1
- package/dist/axis-BzBkkC5X.cjs +305 -0
- package/dist/axis-BzBkkC5X.cjs.map +1 -0
- package/dist/axis-C5obgdJt.js +240 -0
- package/dist/axis-C5obgdJt.js.map +1 -0
- package/dist/{bar-Da6dE_nI.cjs → bar-BrmfXugT.cjs} +77 -58
- package/dist/bar-BrmfXugT.cjs.map +1 -0
- package/dist/{bar-XwzM6Pb0.d.ts → bar-Bs_rPqgR.d.ts} +1 -1
- package/dist/{bar-BDLR4p9c.d.cts → bar-CEt8YRxf.d.cts} +2 -2
- package/dist/{bar-B5n2oq9-.js → bar-CgpC2EpX.js} +2 -2
- package/dist/{bar-B5n2oq9-.js.map → bar-CgpC2EpX.js.map} +1 -1
- package/dist/{bar-BNZ3GhIw.js → bar-D_KKd2fL.js} +75 -56
- package/dist/bar-D_KKd2fL.js.map +1 -0
- package/dist/{bar-LYIF8MEz.cjs → bar-wVykm1us.cjs} +2 -2
- package/dist/{bar-LYIF8MEz.cjs.map → bar-wVykm1us.cjs.map} +1 -1
- package/dist/bar.cjs +1 -1
- package/dist/bar.d.cts +1 -1
- package/dist/bar.d.ts +1 -1
- package/dist/bar.js +1 -1
- package/dist/calendar-B7843sQu.d.cts +106 -0
- package/dist/calendar-BG_q_NC_.cjs +507 -0
- package/dist/calendar-BG_q_NC_.cjs.map +1 -0
- package/dist/calendar-CF3gfDQk.js +502 -0
- package/dist/calendar-CF3gfDQk.js.map +1 -0
- package/dist/calendar-D10_ki1S.d.ts +106 -0
- package/dist/calendar.cjs +3 -0
- package/dist/calendar.d.cts +3 -0
- package/dist/calendar.d.ts +3 -0
- package/dist/calendar.js +1 -0
- package/dist/{candlestick-BHQkQfxH.js → candlestick-B1onjo1o.js} +17 -14
- package/dist/candlestick-B1onjo1o.js.map +1 -0
- package/dist/{candlestick-Dq7qp-F0.d.cts → candlestick-B7YXUVVh.d.cts} +4 -3
- package/dist/{candlestick-CYCQXgky.cjs → candlestick-BwrFKak_.cjs} +17 -14
- package/dist/candlestick-BwrFKak_.cjs.map +1 -0
- package/dist/{candlestick-D0xKkdqd.d.ts → candlestick-XpqJvarq.d.ts} +4 -3
- package/dist/candlestick.cjs +3 -3
- package/dist/candlestick.d.cts +1 -1
- package/dist/candlestick.d.ts +1 -1
- package/dist/candlestick.js +3 -3
- package/dist/{cartesian-DV02PsBe.cjs → cartesian-B9CrasFJ.cjs} +190 -310
- package/dist/cartesian-B9CrasFJ.cjs.map +1 -0
- package/dist/{cartesian-CI2x6N7N.js → cartesian-COglz544.js} +161 -251
- package/dist/cartesian-COglz544.js.map +1 -0
- package/dist/{chart-DWn9v6qw.js → chart-B97FBRCd.js} +114 -72
- package/dist/chart-B97FBRCd.js.map +1 -0
- package/dist/{chart-QilhWP8Z.d.ts → chart-CE9EVbfV.d.ts} +427 -112
- package/dist/{chart-kqFMEwDo.d.cts → chart-Dz4geQZy.d.cts} +427 -112
- package/dist/{chart-e2VqomCI.cjs → chart-GUmmjJ7S.cjs} +132 -78
- package/dist/chart-GUmmjJ7S.cjs.map +1 -0
- package/dist/{core-BKRQvPAT.js → core-7fgM3su0.js} +188 -73
- package/dist/core-7fgM3su0.js.map +1 -0
- package/dist/{core-DRUCk67j.d.ts → core-BUQzLsRJ.d.ts} +26 -10
- package/dist/{core-DIOC61up.cjs → core-BZTrsPxc.cjs} +200 -73
- package/dist/core-BZTrsPxc.cjs.map +1 -0
- package/dist/{core-PAX5ogLk.d.cts → core-Ck5uHcW8.d.cts} +45 -24
- package/dist/core.cjs +45 -31
- package/dist/core.d.cts +23 -18
- package/dist/core.d.ts +23 -18
- package/dist/core.js +28 -23
- package/dist/{dates-DurEr9WT.cjs → dates-0YNY49KQ.cjs} +2 -2
- package/dist/{dates-DurEr9WT.cjs.map → dates-0YNY49KQ.cjs.map} +1 -1
- package/dist/{dates-C2RzY3rE.js → dates-CKDRgpin.js} +2 -2
- package/dist/{dates-C2RzY3rE.js.map → dates-CKDRgpin.js.map} +1 -1
- package/dist/decimate.cjs +1 -1
- package/dist/decimate.js +1 -1
- package/dist/{dom-D_g13XWY.cjs → dom-C33zvtPo.cjs} +3 -7
- package/dist/dom-C33zvtPo.cjs.map +1 -0
- package/dist/{dom-CuceR8gt.js → dom-CTse6Rvd.js} +3 -7
- package/dist/dom-CTse6Rvd.js.map +1 -0
- package/dist/end-labels-B3oRvjxw.js +114 -0
- package/dist/end-labels-B3oRvjxw.js.map +1 -0
- package/dist/end-labels-CS-fnpp-.cjs +119 -0
- package/dist/end-labels-CS-fnpp-.cjs.map +1 -0
- package/dist/end-labels.cjs +11 -0
- package/dist/end-labels.cjs.map +1 -0
- package/dist/end-labels.d.cts +6 -0
- package/dist/end-labels.d.ts +6 -0
- package/dist/end-labels.js +11 -0
- package/dist/end-labels.js.map +1 -0
- package/dist/{export-chart-83UYH48t.js → export-chart-BOH_nfcH.js} +92 -15
- package/dist/export-chart-BOH_nfcH.js.map +1 -0
- package/dist/{export-chart-mYgEfK-L.cjs → export-chart-Be4T9J3m.cjs} +97 -14
- package/dist/export-chart-Be4T9J3m.cjs.map +1 -0
- package/dist/export.cjs +5 -3
- package/dist/export.cjs.map +1 -1
- package/dist/export.d.cts +4 -3
- package/dist/export.d.ts +4 -3
- package/dist/export.js +5 -4
- package/dist/export.js.map +1 -1
- package/dist/{fade-GGxcBdss.js → fade-CDrQjnDz.js} +56 -78
- package/dist/fade-CDrQjnDz.js.map +1 -0
- package/dist/{fade-DVTkhrFU.cjs → fade-CRqcKMWY.cjs} +56 -78
- package/dist/fade-CRqcKMWY.cjs.map +1 -0
- package/dist/{features-BMxkqCyS.js → features-B55rwpQC.js} +4 -2
- package/dist/features-B55rwpQC.js.map +1 -0
- package/dist/{features-DCXEvoya.cjs → features-DEDP5CEQ.cjs} +9 -1
- package/dist/features-DEDP5CEQ.cjs.map +1 -0
- package/dist/fit-BPyPRnsK.js +16 -0
- package/dist/fit-BPyPRnsK.js.map +1 -0
- package/dist/fit-D4MIIQQz.cjs +21 -0
- package/dist/fit-D4MIIQQz.cjs.map +1 -0
- package/dist/funnel-B9ridzNx.d.cts +50 -0
- package/dist/funnel-CFEEulw_.cjs +244 -0
- package/dist/funnel-CFEEulw_.cjs.map +1 -0
- package/dist/funnel-CYCv8cq2.js +239 -0
- package/dist/funnel-CYCv8cq2.js.map +1 -0
- package/dist/funnel-FogM8flk.d.ts +50 -0
- package/dist/funnel.cjs +3 -0
- package/dist/funnel.d.cts +3 -0
- package/dist/funnel.d.ts +3 -0
- package/dist/funnel.js +1 -0
- package/dist/{gauge-DXkjXNCD.cjs → gauge-6HfDcLMJ.cjs} +28 -28
- package/dist/gauge-6HfDcLMJ.cjs.map +1 -0
- package/dist/{gauge-BSist7My.d.cts → gauge-BScJ7U6O.d.cts} +2 -2
- package/dist/{gauge-0VJuAHWF.d.ts → gauge-D78oq1Lx.d.ts} +2 -2
- package/dist/{gauge-ts0kqN1-.js → gauge-DiTk5aWO.js} +28 -28
- package/dist/gauge-DiTk5aWO.js.map +1 -0
- package/dist/gauge.cjs +1 -1
- package/dist/gauge.d.cts +1 -1
- package/dist/gauge.d.ts +1 -1
- package/dist/gauge.js +1 -1
- package/dist/heat-Bsqq4zw9.js +38 -0
- package/dist/heat-Bsqq4zw9.js.map +1 -0
- package/dist/heat-DYsivvDq.cjs +49 -0
- package/dist/heat-DYsivvDq.cjs.map +1 -0
- package/dist/{heatmap-CXhlrLTl.cjs → heatmap-Dyzrd4Fd.cjs} +39 -37
- package/dist/heatmap-Dyzrd4Fd.cjs.map +1 -0
- package/dist/{heatmap-19BGJTKF.js → heatmap-J7fxG7MM.js} +35 -33
- package/dist/heatmap-J7fxG7MM.js.map +1 -0
- package/dist/{heatmap-Dp_oyEe0.d.cts → heatmap-Jvwo7iFW.d.cts} +2 -2
- package/dist/{heatmap-59lmClj9.d.ts → heatmap-mFCnP6aB.d.ts} +2 -2
- package/dist/heatmap.cjs +1 -1
- package/dist/heatmap.d.cts +1 -1
- package/dist/heatmap.d.ts +1 -1
- package/dist/heatmap.js +1 -1
- package/dist/{hydrate-OA6R2_Pn.js → hydrate-BB3MlR36.js} +2 -2
- package/dist/{hydrate-OA6R2_Pn.js.map → hydrate-BB3MlR36.js.map} +1 -1
- package/dist/{hydrate-CmN1k8Mo.cjs → hydrate-m0I5m6ue.cjs} +2 -2
- package/dist/{hydrate-CmN1k8Mo.cjs.map → hydrate-m0I5m6ue.cjs.map} +1 -1
- package/dist/hydrate.cjs +2 -2
- package/dist/hydrate.js +2 -2
- package/dist/index.cjs +69 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -19
- package/dist/index.d.ts +24 -19
- package/dist/index.js +51 -37
- package/dist/index.js.map +1 -1
- package/dist/interaction-DXYSjgnP.cjs +32 -0
- package/dist/interaction-DXYSjgnP.cjs.map +1 -0
- package/dist/interaction-En1KlwFO.js +21 -0
- package/dist/interaction-En1KlwFO.js.map +1 -0
- package/dist/layout-CYerDebD.d.cts +29 -0
- package/dist/layout-CYerDebD.d.ts +29 -0
- package/dist/{layout-JY2aR-yE.cjs → layout-Cfg9x1k2.cjs} +32 -1
- package/dist/layout-Cfg9x1k2.cjs.map +1 -0
- package/dist/{layout-DmrrLjwN.js → layout-DqAte3H8.js} +27 -2
- package/dist/layout-DqAte3H8.js.map +1 -0
- package/dist/{line-DO66LtwH.js → line-CXH0L10d.js} +84 -37
- package/dist/line-CXH0L10d.js.map +1 -0
- package/dist/{line-_rNdeKmS.d.cts → line-Cu9ctpbv.d.cts} +9 -3
- package/dist/{line-Dbt6KFRK.cjs → line-DHbYCQy4.cjs} +84 -37
- package/dist/line-DHbYCQy4.cjs.map +1 -0
- package/dist/{line-DtSh7HQU.d.ts → line-TkzA7wMK.d.ts} +8 -1
- package/dist/line.cjs +3 -3
- package/dist/line.d.cts +1 -1
- package/dist/line.d.ts +1 -1
- package/dist/line.js +3 -3
- package/dist/log.cjs +1 -1
- package/dist/log.js +1 -1
- package/dist/map-BirylCmT.d.cts +156 -0
- package/dist/map-CYp6x-uS.js +784 -0
- package/dist/map-CYp6x-uS.js.map +1 -0
- package/dist/map-ChwSgooH.cjs +795 -0
- package/dist/map-ChwSgooH.cjs.map +1 -0
- package/dist/map-DNqog2Xs.d.ts +156 -0
- package/dist/map.cjs +4 -0
- package/dist/map.d.cts +3 -0
- package/dist/map.d.ts +3 -0
- package/dist/map.js +1 -0
- package/dist/maps/world.cjs +875 -0
- package/dist/maps/world.cjs.map +1 -0
- package/dist/maps/world.d.cts +2 -0
- package/dist/maps/world.d.ts +2 -0
- package/dist/maps/world.js +874 -0
- package/dist/maps/world.js.map +1 -0
- package/dist/{morph-9_LJL0ra.cjs → morph-3I1Nf_tR.cjs} +2 -2
- package/dist/{morph-9_LJL0ra.cjs.map → morph-3I1Nf_tR.cjs.map} +1 -1
- package/dist/{morph-DnRxuwR-.js → morph-GfBab-b3.js} +2 -2
- package/dist/{morph-DnRxuwR-.js.map → morph-GfBab-b3.js.map} +1 -1
- package/dist/morph.cjs +2 -2
- package/dist/morph.js +2 -2
- package/dist/others-CuNdpvjd.d.cts +31 -0
- package/dist/{others-J7NCAMA0.js → others-DBIGE6jr.js} +11 -3
- package/dist/others-DBIGE6jr.js.map +1 -0
- package/dist/others-DBO4Kjwl.d.ts +29 -0
- package/dist/{others-DWdK7vKp.cjs → others-WfjCsjqT.cjs} +14 -6
- package/dist/others-WfjCsjqT.cjs.map +1 -0
- package/dist/{parliament-Cru4IcuM.js → parliament-BKN6ikBJ.js} +30 -29
- package/dist/parliament-BKN6ikBJ.js.map +1 -0
- package/dist/{parliament-CLCI7tUO.d.ts → parliament-CHdf13XU.d.ts} +2 -2
- package/dist/{parliament-CgsVnWEe.d.cts → parliament-CsYgh4N2.d.cts} +2 -2
- package/dist/{parliament-x5hcFaQ3.cjs → parliament-DhxAaIZ3.cjs} +30 -29
- package/dist/parliament-DhxAaIZ3.cjs.map +1 -0
- package/dist/parliament.cjs +1 -1
- package/dist/parliament.d.cts +1 -1
- package/dist/parliament.d.ts +1 -1
- package/dist/parliament.js +1 -1
- package/dist/{patterns-D3-wQagb.cjs → patterns-BPN1c9qe.cjs} +2 -2
- package/dist/{patterns-D3-wQagb.cjs.map → patterns-BPN1c9qe.cjs.map} +1 -1
- package/dist/{patterns-CufKZYhm.js → patterns-CVrLrJXg.js} +2 -2
- package/dist/{patterns-CufKZYhm.js.map → patterns-CVrLrJXg.js.map} +1 -1
- package/dist/patterns.cjs +2 -2
- package/dist/patterns.d.cts +1 -1
- package/dist/patterns.d.ts +1 -1
- package/dist/patterns.js +2 -2
- package/dist/{percentage-bar-ybNS3goo.cjs → percentage-bar-BChkTRoz.cjs} +37 -35
- package/dist/percentage-bar-BChkTRoz.cjs.map +1 -0
- package/dist/{percentage-bar-nhTeakD_.d.ts → percentage-bar-CSAbzDOn.d.ts} +11 -15
- package/dist/{percentage-bar-B6tNOqNn.js → percentage-bar-CaInxrL8.js} +37 -35
- package/dist/percentage-bar-CaInxrL8.js.map +1 -0
- package/dist/{percentage-bar-tepMr7Hd.d.cts → percentage-bar-UZHCRvlK.d.cts} +11 -15
- package/dist/percentage-bar.cjs +1 -1
- package/dist/percentage-bar.d.cts +1 -1
- package/dist/percentage-bar.d.ts +1 -1
- package/dist/percentage-bar.js +1 -1
- package/dist/{pie-BXg2gNpb.d.cts → pie-AFedsDcF.d.cts} +17 -14
- package/dist/{pie-CVsc-6qD.js → pie-Ch6Bx0ih.js} +68 -52
- package/dist/pie-Ch6Bx0ih.js.map +1 -0
- package/dist/{pie-BpjvSPnz.cjs → pie-Cll1OrVZ.cjs} +68 -52
- package/dist/pie-Cll1OrVZ.cjs.map +1 -0
- package/dist/{pie-CFptILSm.d.ts → pie-Cn2H3pz8.d.ts} +17 -14
- package/dist/pie.cjs +1 -1
- package/dist/pie.d.cts +1 -1
- package/dist/pie.d.ts +1 -1
- package/dist/pie.js +1 -1
- package/dist/{point-shapes--_gmdTyK.cjs → point-shapes-BRawRM78.cjs} +23 -22
- package/dist/point-shapes-BRawRM78.cjs.map +1 -0
- package/dist/{point-shapes-DD2Ektzm.js → point-shapes-DI6GhcI7.js} +18 -23
- package/dist/point-shapes-DI6GhcI7.js.map +1 -0
- package/dist/point-shapes.cjs +6 -4
- package/dist/point-shapes.cjs.map +1 -1
- package/dist/point-shapes.d.cts +2 -2
- package/dist/point-shapes.d.ts +2 -2
- package/dist/point-shapes.js +7 -5
- package/dist/point-shapes.js.map +1 -1
- package/dist/{radar-BR-mumDd.js → radar-Bg-IiIWB.js} +21 -22
- package/dist/radar-Bg-IiIWB.js.map +1 -0
- package/dist/{radar-BC9Skgpj.d.ts → radar-DEer2jjd.d.ts} +2 -2
- package/dist/{radar-D1-lItDy.d.cts → radar-DxmjXhMc.d.cts} +2 -2
- package/dist/{radar-HPDrIdzc.cjs → radar-wDyX17S3.cjs} +22 -23
- package/dist/radar-wDyX17S3.cjs.map +1 -0
- package/dist/radar.cjs +1 -1
- package/dist/radar.d.cts +1 -1
- package/dist/radar.d.ts +1 -1
- package/dist/radar.js +1 -1
- package/dist/range-bar-BnKjJP89.cjs +348 -0
- package/dist/range-bar-BnKjJP89.cjs.map +1 -0
- package/dist/range-bar-C4cRaaQE.d.ts +123 -0
- package/dist/range-bar-D32dIQOY.d.cts +123 -0
- package/dist/range-bar-Dx6ce0J1.js +343 -0
- package/dist/range-bar-Dx6ce0J1.js.map +1 -0
- package/dist/range-bar.cjs +3 -0
- package/dist/range-bar.d.cts +3 -0
- package/dist/range-bar.d.ts +3 -0
- package/dist/range-bar.js +1 -0
- package/dist/{rect-DSVmUZrD.js → rect-CZTNvMlf.js} +2 -2
- package/dist/{rect-DSVmUZrD.js.map → rect-CZTNvMlf.js.map} +1 -1
- package/dist/{rect-D6VhynBM.cjs → rect-DPr9QRxl.cjs} +2 -2
- package/dist/{rect-D6VhynBM.cjs.map → rect-DPr9QRxl.cjs.map} +1 -1
- package/dist/{sankey-fCoo1cpz.cjs → sankey-0CSp_Er9.cjs} +72 -71
- package/dist/sankey-0CSp_Er9.cjs.map +1 -0
- package/dist/{sankey-Dk7jUt8x.d.cts → sankey-D-8ATwBT.d.cts} +2 -2
- package/dist/{sankey-D6JeZfK5.js → sankey-Dp4CuLVe.js} +72 -71
- package/dist/sankey-Dp4CuLVe.js.map +1 -0
- package/dist/{sankey-D_v7KxnJ.d.ts → sankey-DpYJsOI4.d.ts} +2 -2
- package/dist/sankey.cjs +1 -1
- package/dist/sankey.d.cts +1 -1
- package/dist/sankey.d.ts +1 -1
- package/dist/sankey.js +1 -1
- package/dist/{scatter-C0TWjFpW.js → scatter-0Z7K_YUz.js} +94 -46
- package/dist/scatter-0Z7K_YUz.js.map +1 -0
- package/dist/{scatter-CXEsioOJ.d.ts → scatter-BAL5K9_4.d.ts} +28 -9
- package/dist/{scatter-DZeEIfyo.d.cts → scatter-BUGbnRzM.d.cts} +28 -9
- package/dist/{scatter-DVqB_fP9.cjs → scatter-CZ8do3Up.cjs} +95 -47
- package/dist/scatter-CZ8do3Up.cjs.map +1 -0
- package/dist/scatter.cjs +1 -1
- package/dist/scatter.d.cts +2 -2
- package/dist/scatter.d.ts +2 -2
- package/dist/scatter.js +1 -1
- package/dist/slice-labels-1TBq7p3q.d.cts +28 -0
- package/dist/slice-labels-C9ucsBVW.js +88 -0
- package/dist/slice-labels-C9ucsBVW.js.map +1 -0
- package/dist/slice-labels-CbFiy46l.cjs +93 -0
- package/dist/slice-labels-CbFiy46l.cjs.map +1 -0
- package/dist/slice-labels-Cm5CyV7B.d.ts +28 -0
- package/dist/slice-labels.cjs +11 -0
- package/dist/slice-labels.cjs.map +1 -0
- package/dist/slice-labels.d.cts +6 -0
- package/dist/slice-labels.d.ts +6 -0
- package/dist/slice-labels.js +11 -0
- package/dist/slice-labels.js.map +1 -0
- package/dist/{sparkline-cbvRkWqS.d.ts → sparkline-CtoBJe-a.d.ts} +2 -2
- package/dist/{sparkline-B39NA0Mi.cjs → sparkline-DjR-V6BI.cjs} +13 -15
- package/dist/sparkline-DjR-V6BI.cjs.map +1 -0
- package/dist/{sparkline-DAP6jtzw.d.cts → sparkline-DwHJfeZz.d.cts} +2 -2
- package/dist/{sparkline-XO_TqCNP.js → sparkline-_dxwtdli.js} +13 -15
- package/dist/sparkline-_dxwtdli.js.map +1 -0
- package/dist/sparkline.cjs +1 -1
- package/dist/sparkline.d.cts +1 -1
- package/dist/sparkline.d.ts +1 -1
- package/dist/sparkline.js +1 -1
- package/dist/{stack-Dagxq7l2.d.cts → stack-CcmyALx0.d.cts} +1 -1
- package/dist/{stack-2H2Gfs1Q.js → stack-CyVlS7Fr.js} +2 -2
- package/dist/{stack-2H2Gfs1Q.js.map → stack-CyVlS7Fr.js.map} +1 -1
- package/dist/{stack-BgPzoQmv.cjs → stack-DBhmYNat.cjs} +2 -2
- package/dist/{stack-BgPzoQmv.cjs.map → stack-DBhmYNat.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{time-axis-BjZ1bYTK.cjs → time-axis-CVKjQKSS.cjs} +4 -3
- package/dist/{time-axis-BjZ1bYTK.cjs.map → time-axis-CVKjQKSS.cjs.map} +1 -1
- package/dist/{time-axis-FLONo54E.js → time-axis-CkmbAw4Z.js} +3 -2
- package/dist/{time-axis-FLONo54E.js.map → time-axis-CkmbAw4Z.js.map} +1 -1
- package/dist/time.cjs +3 -3
- package/dist/time.js +3 -3
- package/dist/{treemap-BAkhmVQc.d.cts → treemap-C2maqerU.d.cts} +37 -5
- package/dist/{treemap-BNpxFBao.d.ts → treemap-D_zbubo3.d.ts} +37 -5
- package/dist/{treemap-BWpEUlDh.cjs → treemap-PulGXZv0.cjs} +58 -33
- package/dist/treemap-PulGXZv0.cjs.map +1 -0
- package/dist/{treemap-CQdavQ9u.js → treemap-lbYxb-7h.js} +57 -32
- package/dist/treemap-lbYxb-7h.js.map +1 -0
- package/dist/treemap.cjs +1 -1
- package/dist/treemap.d.cts +1 -1
- package/dist/treemap.d.ts +1 -1
- package/dist/treemap.js +1 -1
- package/dist/{value-labels-BBuSi4i0.js → value-labels-B0VeheyE.js} +29 -8
- package/dist/value-labels-B0VeheyE.js.map +1 -0
- package/dist/{value-labels-BV9keAuL.cjs → value-labels-Dcyk3GIY.cjs} +29 -8
- package/dist/value-labels-Dcyk3GIY.cjs.map +1 -0
- package/dist/value-labels.cjs +2 -2
- package/dist/value-labels.d.cts +1 -1
- package/dist/value-labels.d.ts +1 -1
- package/dist/value-labels.js +2 -2
- package/dist/zoom.cjs +810 -0
- package/dist/zoom.cjs.map +1 -0
- package/dist/zoom.d.cts +34 -0
- package/dist/zoom.d.ts +34 -0
- package/dist/zoom.js +806 -0
- package/dist/zoom.js.map +1 -0
- package/package.json +120 -235
- package/dist/annotations-D0YQ0IoA.js.map +0 -1
- package/dist/annotations-DdRdeBUB.cjs.map +0 -1
- package/dist/area-0-L1bG9B.js.map +0 -1
- package/dist/area-4eRs3c0K.cjs.map +0 -1
- package/dist/bar-BNZ3GhIw.js.map +0 -1
- package/dist/bar-Da6dE_nI.cjs.map +0 -1
- package/dist/candlestick-BHQkQfxH.js.map +0 -1
- package/dist/candlestick-CYCQXgky.cjs.map +0 -1
- package/dist/cartesian-CI2x6N7N.js.map +0 -1
- package/dist/cartesian-DV02PsBe.cjs.map +0 -1
- package/dist/chart-DWn9v6qw.js.map +0 -1
- package/dist/chart-e2VqomCI.cjs.map +0 -1
- package/dist/core-BKRQvPAT.js.map +0 -1
- package/dist/core-DIOC61up.cjs.map +0 -1
- package/dist/dom-CuceR8gt.js.map +0 -1
- package/dist/dom-D_g13XWY.cjs.map +0 -1
- package/dist/export-chart-83UYH48t.js.map +0 -1
- package/dist/export-chart-mYgEfK-L.cjs.map +0 -1
- package/dist/fade-DVTkhrFU.cjs.map +0 -1
- package/dist/fade-GGxcBdss.js.map +0 -1
- package/dist/features-BMxkqCyS.js.map +0 -1
- package/dist/features-DCXEvoya.cjs.map +0 -1
- package/dist/gauge-DXkjXNCD.cjs.map +0 -1
- package/dist/gauge-ts0kqN1-.js.map +0 -1
- package/dist/heatmap-19BGJTKF.js.map +0 -1
- package/dist/heatmap-CXhlrLTl.cjs.map +0 -1
- package/dist/layout-DmrrLjwN.js.map +0 -1
- package/dist/layout-JY2aR-yE.cjs.map +0 -1
- package/dist/line-DO66LtwH.js.map +0 -1
- package/dist/line-Dbt6KFRK.cjs.map +0 -1
- package/dist/others-DWdK7vKp.cjs.map +0 -1
- package/dist/others-J7NCAMA0.js.map +0 -1
- package/dist/parliament-Cru4IcuM.js.map +0 -1
- package/dist/parliament-x5hcFaQ3.cjs.map +0 -1
- package/dist/percentage-bar-B6tNOqNn.js.map +0 -1
- package/dist/percentage-bar-ybNS3goo.cjs.map +0 -1
- package/dist/pie-BpjvSPnz.cjs.map +0 -1
- package/dist/pie-CVsc-6qD.js.map +0 -1
- package/dist/point-shapes--_gmdTyK.cjs.map +0 -1
- package/dist/point-shapes-DD2Ektzm.js.map +0 -1
- package/dist/radar-BR-mumDd.js.map +0 -1
- package/dist/radar-HPDrIdzc.cjs.map +0 -1
- package/dist/sankey-D6JeZfK5.js.map +0 -1
- package/dist/sankey-fCoo1cpz.cjs.map +0 -1
- package/dist/scatter-C0TWjFpW.js.map +0 -1
- package/dist/scatter-DVqB_fP9.cjs.map +0 -1
- package/dist/sparkline-B39NA0Mi.cjs.map +0 -1
- package/dist/sparkline-XO_TqCNP.js.map +0 -1
- package/dist/treemap-BWpEUlDh.cjs.map +0 -1
- package/dist/treemap-CQdavQ9u.js.map +0 -1
- package/dist/value-labels-BBuSi4i0.js.map +0 -1
- package/dist/value-labels-BV9keAuL.cjs.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as axisTitleSize, n as axisSize, r as axisTitle, s as thinTicks, t as axis } from "./axis-C5obgdJt.js";
|
|
2
|
+
import { D as grid, S as valueTicks, c as plotClip, l as plottable, r as domainOf, s as markerShape, v as tickCount, x as valueScale } from "./cartesian-COglz544.js";
|
|
2
3
|
import { n as formatDetail, r as formatNumber } from "./format-it1kepFG.js";
|
|
3
|
-
import {
|
|
4
|
+
import { n as estimateTextWidth, o as plotFrame, s as round, t as LINE_HEIGHT } from "./layout-DqAte3H8.js";
|
|
4
5
|
import { t as extent } from "./extent-DOV8rs-6.js";
|
|
5
6
|
import { t as circlePath } from "./circle-YRDaOBpk.js";
|
|
6
7
|
import { t as h } from "./vnode-_EMUqysL.js";
|
|
@@ -10,8 +11,23 @@ import { n as keyOf, r as legendItems, t as groupAttrs } from "./named-BOiBah6I.
|
|
|
10
11
|
/** Pointer distance (in pixels, beyond the radius) that still hits a point. */
|
|
11
12
|
const HIT_RADIUS = 24;
|
|
12
13
|
const EDGE = 8;
|
|
14
|
+
/**
|
|
15
|
+
* The categories of the x axis, or `null` when it is a value axis: `data.labels`,
|
|
16
|
+
* else every `x` in order of appearance once any of them is text.
|
|
17
|
+
*/
|
|
18
|
+
function categories(data) {
|
|
19
|
+
if (data.labels) return data.labels.map(String);
|
|
20
|
+
if (!data.series.some((s) => s.points.some((p) => typeof p.x === "string"))) return null;
|
|
21
|
+
return [...new Set(data.series.flatMap((s) => s.points.map((p) => String(p.x))))];
|
|
22
|
+
}
|
|
13
23
|
/** A point's bubble size, or `undefined` when it has none (or an invalid one). */
|
|
14
24
|
const sizeOf = (p) => p.size != null && Number.isFinite(p.size) && p.size > 0 ? p.size : void 0;
|
|
25
|
+
/** An `x` as text for the tooltip and the table: the category's name, or the formatted number. */
|
|
26
|
+
function xText(options, locale) {
|
|
27
|
+
const format = formatDetail(options.x?.format, locale);
|
|
28
|
+
const named = !!categories(options.data);
|
|
29
|
+
return (value) => named || typeof value === "string" ? String(value) : format(value);
|
|
30
|
+
}
|
|
15
31
|
function renderScatter(options, ctx) {
|
|
16
32
|
const { width, height, fontSize, locale } = ctx;
|
|
17
33
|
const xOptions = options.x ?? {};
|
|
@@ -26,31 +42,56 @@ function renderScatter(options, ctx) {
|
|
|
26
42
|
const overhang = Math.max(radius, sizes.length ? rMax : 0) + 2;
|
|
27
43
|
const countY = tickCount(yOptions, Math.max(2, Math.round(height / 60)));
|
|
28
44
|
const countX = tickCount(xOptions, Math.max(2, Math.round(width / 80)));
|
|
29
|
-
const
|
|
45
|
+
const labels = categories(options.data);
|
|
46
|
+
const index = new Map((labels ?? []).map((label, i) => [label, i]).reverse());
|
|
47
|
+
const usable = (p) => (labels ? index.has(String(p.x)) : typeof p.x === "number" && plottable(p.x, xOptions)) && plottable(p.y, yOptions);
|
|
30
48
|
const shown = points.filter(usable);
|
|
31
|
-
const xDomain = domainOf(shown.map((p) => p.x), xOptions, false, countX);
|
|
49
|
+
const xDomain = domainOf(labels ? [] : shown.map((p) => p.x), xOptions, false, countX);
|
|
32
50
|
const yDomain = domainOf(shown.map((p) => p.y), yOptions, false, countY);
|
|
33
51
|
const showX = xOptions.show !== false;
|
|
34
52
|
const showY = yOptions.show !== false;
|
|
35
53
|
const ticksOf = (scale, axis, count) => valueTicks(scale, axis, count, axis.format, locale);
|
|
36
54
|
const probeY = ticksOf(valueScale(yDomain, [1, 0], yOptions), yOptions, countY);
|
|
37
|
-
const probeX =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
const probeX = labels ? labels.map((label) => ({
|
|
56
|
+
value: label,
|
|
57
|
+
position: 0,
|
|
58
|
+
label
|
|
59
|
+
})) : ticksOf(valueScale(xDomain, [0, 1], xOptions), xOptions, countX);
|
|
60
|
+
const half = (tick, halfBand = 0) => showX && tick ? Math.max(0, Math.ceil(estimateTextWidth(tick.label, fontSize) / 2 - halfBand)) : 0;
|
|
61
|
+
const reverse = xOptions.reverse ?? ctx.rtl === true;
|
|
62
|
+
const near = reverse === (ctx.rtl === true) ? 0 : probeX.length - 1;
|
|
63
|
+
const valueWidth = (showY ? axisSize("left", probeY, fontSize) : 0) + axisTitleSize(yOptions.title, fontSize);
|
|
64
|
+
const { area, side, range } = plotFrame(ctx, options.padding, (pad) => {
|
|
65
|
+
const sides = (halfBand) => ({
|
|
66
|
+
start: pad.start + Math.max(valueWidth, half(probeX[near], halfBand), overhang),
|
|
67
|
+
end: pad.end + Math.max(half(probeX[probeX.length - 1 - near], halfBand), overhang, EDGE)
|
|
68
|
+
});
|
|
69
|
+
let both = sides(0);
|
|
70
|
+
if (labels?.length) both = sides((width - both.start - both.end) / (labels.length * 2));
|
|
71
|
+
return {
|
|
72
|
+
top: pad.top + Math.max(showY ? Math.ceil(fontSize * LINE_HEIGHT / 2) : 0, overhang, EDGE / 2),
|
|
73
|
+
bottom: pad.bottom + Math.max((showX ? axisSize("bottom", probeX, fontSize) : 0) + axisTitleSize(xOptions.title, fontSize), overhang, EDGE / 2),
|
|
74
|
+
...both
|
|
75
|
+
};
|
|
76
|
+
});
|
|
52
77
|
const y = valueScale(yDomain, [area.y + area.height, area.y], yOptions);
|
|
53
|
-
|
|
78
|
+
let x;
|
|
79
|
+
let allX;
|
|
80
|
+
if (labels) {
|
|
81
|
+
const [from, to] = range(reverse);
|
|
82
|
+
const at = (i) => from + (to - from) * (i + .5) / labels.length;
|
|
83
|
+
x = (value) => at(index.get(String(value)));
|
|
84
|
+
allX = labels.map((label, i) => ({
|
|
85
|
+
value: label,
|
|
86
|
+
position: at(i),
|
|
87
|
+
label
|
|
88
|
+
}));
|
|
89
|
+
} else {
|
|
90
|
+
const scale = valueScale(xDomain, range(reverse), xOptions);
|
|
91
|
+
x = (value) => scale(value);
|
|
92
|
+
allX = ticksOf(scale, xOptions, countX);
|
|
93
|
+
}
|
|
94
|
+
const xTicks = thinTicks(allX, "bottom", fontSize);
|
|
54
95
|
const yTicks = thinTicks(ticksOf(y, yOptions, countY), "left", fontSize, 4);
|
|
55
96
|
const placed = [];
|
|
56
97
|
options.data.series.forEach((series, seriesIndex) => {
|
|
@@ -68,7 +109,7 @@ function renderScatter(options, ctx) {
|
|
|
68
109
|
});
|
|
69
110
|
});
|
|
70
111
|
placed.sort((a, b) => a.cx - b.cx);
|
|
71
|
-
const fx =
|
|
112
|
+
const fx = xText(options, locale);
|
|
72
113
|
const fy = formatDetail(yOptions.format, locale);
|
|
73
114
|
const fs = formatNumber(void 0, locale);
|
|
74
115
|
const hitFor = (p, index) => {
|
|
@@ -92,7 +133,8 @@ function renderScatter(options, ctx) {
|
|
|
92
133
|
area,
|
|
93
134
|
items: [item],
|
|
94
135
|
seriesIndex: p.seriesIndex,
|
|
95
|
-
|
|
136
|
+
highlight: {
|
|
137
|
+
kind: "halo",
|
|
96
138
|
d: circlePath(round(p.r + 4)),
|
|
97
139
|
x: p.cx,
|
|
98
140
|
y: p.cy
|
|
@@ -128,7 +170,6 @@ function renderScatter(options, ctx) {
|
|
|
128
170
|
return best === -1 ? null : hitFor(placed[best], best);
|
|
129
171
|
}
|
|
130
172
|
};
|
|
131
|
-
ctx.onHitTest(interaction);
|
|
132
173
|
/** One path drawing a dot of `radius` at every point (two arcs each, or the series' shape). */
|
|
133
174
|
const shape = markerShape(options);
|
|
134
175
|
const dotsPath = (dots, slot) => {
|
|
@@ -161,28 +202,33 @@ function renderScatter(options, ctx) {
|
|
|
161
202
|
cy: round(y(point.y)),
|
|
162
203
|
r: round(bubble(sizeOf(point)))
|
|
163
204
|
}))));
|
|
164
|
-
return
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
205
|
+
return {
|
|
206
|
+
content: [
|
|
207
|
+
h("defs", null, clip.def),
|
|
208
|
+
background,
|
|
209
|
+
h("g", {
|
|
210
|
+
key: "series",
|
|
211
|
+
class: "tc-series-list",
|
|
212
|
+
"clip-path": clip.url
|
|
213
|
+
}, groups),
|
|
214
|
+
showY && axis({
|
|
215
|
+
position: side,
|
|
216
|
+
ticks: yTicks,
|
|
217
|
+
area
|
|
218
|
+
}),
|
|
219
|
+
showX && axis({
|
|
220
|
+
position: "bottom",
|
|
221
|
+
ticks: xTicks,
|
|
222
|
+
area
|
|
223
|
+
}),
|
|
224
|
+
!!yOptions.title && axisTitle(side, showY ? yTicks : [], area, yOptions.title, fontSize),
|
|
225
|
+
!!xOptions.title && axisTitle("bottom", showX ? xTicks : [], area, xOptions.title, fontSize)
|
|
226
|
+
],
|
|
227
|
+
interaction
|
|
228
|
+
};
|
|
183
229
|
}
|
|
184
230
|
function scatterTable(options, ctx, limit = Number.POSITIVE_INFINITY) {
|
|
185
|
-
const fx =
|
|
231
|
+
const fx = xText(options, ctx.locale);
|
|
186
232
|
const fy = formatDetail(options.y?.format, ctx.locale);
|
|
187
233
|
const fs = formatNumber(void 0, ctx.locale);
|
|
188
234
|
const series = options.data.series.filter((s) => !ctx.hidden.has(keyOf(s)));
|
|
@@ -214,7 +260,8 @@ function scatterTable(options, ctx, limit = Number.POSITIVE_INFINITY) {
|
|
|
214
260
|
}
|
|
215
261
|
/**
|
|
216
262
|
* Scatter chart: points on two value axes; give points a `size` for a
|
|
217
|
-
* bubble chart (area-proportional radii).
|
|
263
|
+
* bubble chart (area-proportional radii). With `data.labels` (or a text `x`)
|
|
264
|
+
* the points stand over named categories instead.
|
|
218
265
|
*
|
|
219
266
|
* ```ts
|
|
220
267
|
* new Chart('#el', {
|
|
@@ -227,11 +274,12 @@ const scatter = {
|
|
|
227
274
|
name: "scatter",
|
|
228
275
|
clean: cleanData((data) => ({
|
|
229
276
|
...isRecord(data) ? data : {},
|
|
277
|
+
labels: isRecord(data) && Array.isArray(data.labels) ? data.labels.map(text) : void 0,
|
|
230
278
|
series: records(isRecord(data) && data.series, (s) => ({
|
|
231
279
|
...named(s),
|
|
232
280
|
points: records(s.points, (p) => ({
|
|
233
281
|
...p,
|
|
234
|
-
x: finite(p.x),
|
|
282
|
+
x: typeof p.x === "string" ? p.x : finite(p.x),
|
|
235
283
|
y: finite(p.y),
|
|
236
284
|
size: finite(p.size) ?? void 0,
|
|
237
285
|
label: p.label == null ? void 0 : text(p.label)
|
|
@@ -245,4 +293,4 @@ const scatter = {
|
|
|
245
293
|
};
|
|
246
294
|
export { scatter as t };
|
|
247
295
|
|
|
248
|
-
//# sourceMappingURL=scatter-
|
|
296
|
+
//# sourceMappingURL=scatter-0Z7K_YUz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scatter-0Z7K_YUz.js","names":[],"sources":["../src/charts/scatter.ts"],"sourcesContent":["import type { DataTable } from '../a11y.ts'\nimport type { ChartType, RenderContext } from '../chart.ts'\nimport {\n axis,\n axisSize,\n axisTitle,\n axisTitleSize,\n type Tick,\n thinTicks,\n} from '../components/axis.ts'\nimport { grid } from '../components/grid.ts'\nimport { formatDetail, formatNumber } from '../format.ts'\nimport type { Hit, HitItem, Interaction } from '../interaction.ts'\nimport { estimateTextWidth, type InsetsInput, LINE_HEIGHT, plotFrame, round } from '../layout.ts'\nimport { extent } from '../scales/extent.ts'\nimport type { LinearScale } from '../scales/linear.ts'\nimport { circlePath } from '../shapes/circle.ts'\nimport { type ClassValue, h } from '../vnode.ts'\nimport {\n domainOf,\n markerShape,\n plotClip,\n plottable,\n tickCount,\n type ValueAxisOptions,\n valueScale,\n valueTicks,\n} from './cartesian.ts'\nimport { cleanData, finite, isRecord, named, records, text } from './clean.ts'\nimport { groupAttrs, keyOf, legendItems } from './named.ts'\n\n/** A point of a scatter or bubble chart. */\nexport interface ScatterPoint {\n /** A number on a value axis; on a category axis, the label the point stands at. */\n x: number | string\n y: number\n /** Bubble size; the circle area is proportional to it. */\n size?: number\n /** Name shown in the tooltip and table (e.g. a country). */\n label?: string\n}\n\nexport interface ScatterSeries {\n name: string\n points: readonly ScatterPoint[]\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 series group. */\n class?: ClassValue\n /** Start hidden (toggle it back from the legend). */\n hidden?: boolean\n /**\n * Write values on this series' marks, whatever the chart's `valueLabels`\n * says: `true` labels it even when the chart option is off, `false` leaves\n * it out. Needs `@tabler/charts/value-labels` on the core.\n */\n valueLabels?: boolean\n}\n\nexport interface ScatterData {\n /**\n * Categories along x, in their order: the x axis then shows these names and\n * each point stands at the label its `x` names (points naming none are left\n * out). Without `labels`, points with a text `x` make the categories\n * themselves, in order of appearance.\n */\n labels?: readonly (string | number)[]\n series: readonly ScatterSeries[]\n}\n\nexport interface ScatterOptions {\n data: ScatterData\n /**\n * Horizontal value axis; `reverse` runs it from the right (the default with\n * `rtl`). Over categories only `show`, `title`, `grid` and `reverse` apply.\n */\n x?: ValueAxisOptions & { reverse?: boolean }\n /** Vertical value axis. */\n y?: ValueAxisOptions\n /** Radius of points without a size, in pixels. Defaults to `4`. */\n radius?: number\n /** Radius range for bubbles (points with `size`). Defaults to `{ min: 4, max: 24 }`. */\n size?: { min?: number; max?: number }\n /** Extra space around the plot area, in pixels. */\n padding?: InsetsInput\n}\n\n/** Pointer distance (in pixels, beyond the radius) that still hits a point. */\nconst HIT_RADIUS = 24\nconst EDGE = 8\n\ninterface Placed {\n seriesIndex: number\n pointIndex: number\n point: ScatterPoint\n cx: number\n cy: number\n r: number\n}\n\n/**\n * The categories of the x axis, or `null` when it is a value axis: `data.labels`,\n * else every `x` in order of appearance once any of them is text.\n */\nfunction categories(data: ScatterData): string[] | null {\n if (data.labels) return data.labels.map(String)\n if (!data.series.some((s) => s.points.some((p) => typeof p.x === 'string'))) return null\n return [...new Set(data.series.flatMap((s) => s.points.map((p) => String(p.x))))]\n}\n\n/** A point's bubble size, or `undefined` when it has none (or an invalid one). */\nconst sizeOf = (p: ScatterPoint): number | undefined =>\n p.size != null && Number.isFinite(p.size) && p.size > 0 ? p.size : undefined\n\n/** An `x` as text for the tooltip and the table: the category's name, or the formatted number. */\nfunction xText(options: ScatterOptions, locale: RenderContext['locale']) {\n const format = formatDetail(options.x?.format, locale)\n const named = !!categories(options.data)\n return (value: number | string) =>\n named || typeof value === 'string' ? String(value) : format(value)\n}\n\nfunction renderScatter(options: ScatterOptions, ctx: RenderContext) {\n const { width, height, fontSize, locale } = ctx\n const xOptions = options.x ?? {}\n const yOptions = options.y ?? {}\n const radius = options.radius ?? 4\n const visible = options.data.series.filter((s) => !ctx.hidden.has(keyOf(s)))\n const points = visible.flatMap((s) => s.points)\n const sizes = points.map(sizeOf).filter((v): v is number => v !== undefined)\n const maxSize = extent(sizes)?.[1] ?? 0\n const rMin = options.size?.min ?? 4\n const rMax = options.size?.max ?? 24\n // Area-proportional bubbles: the radius grows with the square root of the size.\n const bubble = (size: number | undefined) =>\n size != null && size > 0 && maxSize > 0\n ? rMin + (rMax - rMin) * Math.sqrt(size / maxSize)\n : radius\n const overhang = Math.max(radius, sizes.length ? rMax : 0) + 2\n\n const countY = tickCount(yOptions, Math.max(2, Math.round(height / 60)))\n const countX = tickCount(xOptions, Math.max(2, Math.round(width / 80)))\n const labels = categories(options.data)\n // Where each category stands (the first of two with one name).\n const index = new Map((labels ?? []).map((label, i) => [label, i] as const).reverse())\n // Only points that can be plotted on both axes take part.\n const usable = (p: ScatterPoint) =>\n (labels ? index.has(String(p.x)) : typeof p.x === 'number' && plottable(p.x, xOptions)) &&\n plottable(p.y, yOptions)\n const shown = points.filter(usable)\n const xDomain = domainOf(labels ? [] : shown.map((p) => p.x as number), xOptions, false, countX)\n const yDomain = domainOf(\n shown.map((p) => p.y),\n yOptions,\n false,\n countY,\n )\n\n const showX = xOptions.show !== false\n const showY = yOptions.show !== false\n // Linear or logarithmic, as each axis asks (see valueScale).\n const ticksOf = (scale: LinearScale, axis: ValueAxisOptions, count: number) =>\n valueTicks(scale, axis, count, axis.format, locale)\n const probeY = ticksOf(valueScale(yDomain, [1, 0], yOptions), yOptions, countY)\n const probeX: Tick[] = labels\n ? labels.map((label) => ({ value: label, position: 0, label }))\n : ticksOf(valueScale(xDomain, [0, 1], xOptions), xOptions, countX)\n // What an edge label needs beside the plot: half of it on a value axis, where\n // it is centered on the edge; over categories it has half a band of room first.\n const half = (tick: Tick | undefined, halfBand = 0) =>\n showX && tick\n ? Math.max(0, Math.ceil(estimateTextWidth(tick.label, fontSize) / 2 - halfBand))\n : 0\n const reverse = xOptions.reverse ?? ctx.rtl === true\n // The x tick on the start side of the plot, and the one on the end side.\n const near = reverse === (ctx.rtl === true) ? 0 : probeX.length - 1\n const valueWidth =\n (showY ? axisSize('left', probeY, fontSize) : 0) + axisTitleSize(yOptions.title, fontSize)\n const { area, side, range } = plotFrame(ctx, options.padding, (pad) => {\n const sides = (halfBand: number) => ({\n start: pad.start + Math.max(valueWidth, half(probeX[near], halfBand), overhang),\n end: pad.end + Math.max(half(probeX[probeX.length - 1 - near], halfBand), overhang, EDGE),\n })\n let both = sides(0)\n // The band depends on the margins, so they are worked out twice.\n if (labels?.length) both = sides((width - both.start - both.end) / (labels.length * 2))\n return {\n top:\n pad.top + Math.max(showY ? Math.ceil((fontSize * LINE_HEIGHT) / 2) : 0, overhang, EDGE / 2),\n bottom:\n pad.bottom +\n Math.max(\n (showX ? axisSize('bottom', probeX, fontSize) : 0) +\n axisTitleSize(xOptions.title, fontSize),\n overhang,\n EDGE / 2,\n ),\n ...both,\n }\n })\n const y = valueScale(yDomain, [area.y + area.height, area.y], yOptions)\n // Pixel of an `x`, and the ticks of its axis: a point stands in the middle of its category.\n let x: (value: number | string) => number\n let allX: Tick[]\n if (labels) {\n // Equal bands along the range (it runs backwards when reversed).\n const [from, to] = range(reverse)\n const at = (i: number) => from + ((to - from) * (i + 0.5)) / labels.length\n x = (value) => at(index.get(String(value)) as number)\n allX = labels.map((label, i) => ({ value: label, position: at(i), label }))\n } else {\n const scale = valueScale(xDomain, range(reverse), xOptions)\n x = (value) => scale(value as number)\n allX = ticksOf(scale, xOptions, countX)\n }\n // Thinned like the ticks of the other charts: on a log axis they crowd at the end of each decade.\n const xTicks = thinTicks(allX, 'bottom', fontSize)\n const yTicks = thinTicks(ticksOf(y, yOptions, countY), 'left', fontSize, 4)\n\n // Every visible point in pixels, sorted by x for fast nearest-point lookups.\n const placed: Placed[] = []\n options.data.series.forEach((series, seriesIndex) => {\n if (ctx.hidden.has(keyOf(series))) return\n series.points.forEach((point, pointIndex) => {\n if (!usable(point)) return\n placed.push({\n seriesIndex,\n pointIndex,\n point,\n cx: x(point.x),\n cy: y(point.y),\n r: bubble(sizeOf(point)),\n })\n })\n })\n placed.sort((a, b) => a.cx - b.cx)\n\n const fx = xText(options, locale)\n const fy = formatDetail(yOptions.format, locale)\n const fs = formatNumber(undefined, locale)\n const hitFor = (p: Placed, index: number): Hit => {\n const series = options.data.series[p.seriesIndex] as ScatterSeries\n const sz = sizeOf(p.point)\n const size = sz === undefined ? '' : ` · ${fs(sz)}`\n const item: HitItem = {\n name: series.name,\n seriesIndex: p.seriesIndex,\n value: p.point.y,\n text: `${fx(p.point.x)}, ${fy(p.point.y)}${size}`,\n x: p.cx,\n y: p.cy,\n }\n if (series.color) item.color = series.color\n return {\n index,\n label: p.point.label ?? series.name,\n title: p.point.label ?? '',\n x: p.cx,\n area,\n items: [item],\n seriesIndex: p.seriesIndex,\n highlight: { kind: 'halo', d: circlePath(round(p.r + 4)), x: p.cx, y: p.cy },\n }\n }\n\n const interaction: Interaction = {\n count: placed.length,\n hitIndex: (index) => {\n const p = placed[index]\n return p ? hitFor(p, index) : null\n },\n hitTest(px, py) {\n // Binary search the first point within reach on x, then scan the window.\n let lo = 0\n let hi = placed.length\n const reach = HIT_RADIUS + rMax\n while (lo < hi) {\n const mid = (lo + hi) >> 1\n if ((placed[mid] as Placed).cx < px - reach) lo = mid + 1\n else hi = mid\n }\n let best = -1\n let bestDistance = Number.POSITIVE_INFINITY\n for (let i = lo; i < placed.length; i++) {\n const p = placed[i] as Placed\n if (p.cx > px + reach) break\n const distance = Math.hypot(p.cx - px, p.cy - py) - p.r\n if (distance < bestDistance && distance <= HIT_RADIUS) {\n best = i\n bestDistance = distance\n }\n }\n return best === -1 ? null : hitFor(placed[best] as Placed, best)\n },\n }\n\n /** One path drawing a dot of `radius` at every point (two arcs each, or the series' shape). */\n const shape = markerShape(options)\n const dotsPath = (dots: readonly ScatterPoint[], slot: number) => {\n if (!dots.length) return null\n const r = round(radius)\n let d = ''\n for (const p of dots) {\n d += shape\n ? shape(slot, x(p.x), y(p.y), r)\n : `M${round(x(p.x) - radius)},${round(y(p.y))}a${r},${r},0,1,0,${2 * r},0a${r},${r},0,1,0,${-2 * r},0`\n }\n return h('path', { key: 'dots', class: ['tc-point tc-dots', shape && 'tc-marker'], d })\n }\n\n const background = []\n if (yOptions.grid !== false) background.push(grid({ direction: 'y', ticks: yTicks, area }))\n if (xOptions.grid) background.push(grid({ direction: 'x', ticks: xTicks, area }))\n\n // Dots may reach a little past the plot edges; bubbles are cut at them (like\n // Chart.js), as a big one there would cover the axis labels.\n const clip = plotClip(ctx, area, sizes.length ? 0 : overhang)\n const groups = options.data.series.map(\n (series, seriesIndex) =>\n !ctx.hidden.has(keyOf(series)) &&\n h(\n 'g',\n groupAttrs(series, seriesIndex),\n // Plain points share one path per series: thousands of circles would\n // each cost the browser style and layout work. The path keeps its\n // commands while the point count does, so new data morphs. Bubbles\n // stay circles: each is see-through over the others.\n dotsPath(\n series.points.filter((p) => usable(p) && sizeOf(p) === undefined),\n seriesIndex,\n ),\n series.points.map(\n (point, i) =>\n usable(point) &&\n sizeOf(point) !== undefined &&\n h('circle', {\n key: i,\n class: 'tc-point tc-bubble',\n cx: round(x(point.x)),\n cy: round(y(point.y)),\n r: round(bubble(sizeOf(point))),\n }),\n ),\n ),\n )\n\n const content = [\n h('defs', null, clip.def),\n background,\n h('g', { key: 'series', class: 'tc-series-list', 'clip-path': clip.url }, groups),\n showY && axis({ position: side, ticks: yTicks, area }),\n showX && axis({ position: 'bottom', ticks: xTicks, area }),\n !!yOptions.title && axisTitle(side, showY ? yTicks : [], area, yOptions.title, fontSize),\n !!xOptions.title && axisTitle('bottom', showX ? xTicks : [], area, xOptions.title, fontSize),\n ]\n return { content, interaction }\n}\n\nfunction scatterTable(\n options: ScatterOptions,\n ctx: RenderContext,\n limit: number = Number.POSITIVE_INFINITY,\n): DataTable {\n const fx = xText(options, ctx.locale)\n const fy = formatDetail(options.y?.format, ctx.locale)\n const fs = formatNumber(undefined, ctx.locale)\n const series = options.data.series.filter((s) => !ctx.hidden.has(keyOf(s)))\n const withSize = series.some((s) => s.points.some((p) => p.size != null))\n const withLabel = series.some((s) => s.points.some((p) => p.label != null))\n const total = series.reduce((sum, s) => sum + s.points.length, 0)\n let left = limit\n return {\n columns: ['', ...(withLabel ? ['Label'] : []), 'x', 'y', ...(withSize ? ['Size'] : [])],\n total,\n rows: series.flatMap((s) => {\n const take = s.points.slice(0, Math.max(0, left))\n left -= take.length\n return take.map((p) => [\n s.name,\n ...(withLabel ? [p.label ?? ''] : []),\n fx(p.x),\n fy(p.y),\n ...(withSize ? [sizeOf(p) === undefined ? '–' : fs(sizeOf(p) as number)] : []),\n ])\n }),\n }\n}\n\n/**\n * Scatter chart: points on two value axes; give points a `size` for a\n * bubble chart (area-proportional radii). With `data.labels` (or a text `x`)\n * the points stand over named categories instead.\n *\n * ```ts\n * new Chart('#el', {\n * type: scatter,\n * data: { series: [{ name: 'Cities', points: [{ x: 12, y: 3.4 }, { x: 18, y: 5.1 }] }] },\n * })\n * ```\n */\nexport const scatter: ChartType<ScatterOptions> = {\n name: 'scatter',\n clean: cleanData((data) => ({\n ...(isRecord(data) ? data : {}),\n labels: isRecord(data) && Array.isArray(data.labels) ? data.labels.map(text) : undefined,\n series: records(isRecord(data) && data.series, (s) => ({\n ...named(s),\n points: records(s.points, (p) => ({\n ...p,\n x: typeof p.x === 'string' ? p.x : finite(p.x),\n y: finite(p.y),\n size: finite(p.size) ?? undefined,\n label: p.label == null ? undefined : text(p.label),\n })).filter((p) => p.x !== null && p.y !== null),\n })),\n })),\n render: renderScatter,\n legend: (options) => legendItems(options.data.series),\n table: scatterTable,\n valueLabels: { format: (options) => options.y?.format },\n}\n"],"mappings":";;;;;;;;;;;AA6FA,MAAM,aAAa;AACnB,MAAM,OAAO;;;;;AAeb,SAAS,WAAW,MAAoC;CACtD,IAAI,KAAK,QAAQ,OAAO,KAAK,OAAO,IAAI,MAAM;CAC9C,IAAI,CAAC,KAAK,OAAO,MAAM,MAAM,EAAE,OAAO,MAAM,MAAM,OAAO,EAAE,MAAM,QAAQ,CAAC,GAAG,OAAO;CACpF,OAAO,CAAC,GAAG,IAAI,IAAI,KAAK,OAAO,SAAS,MAAM,EAAE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AAC,IAAI,CAAC;GAC9E,CAAC;EACH,CAAC;CACH;AACF;;;;;;;;;;;;;AAcA,MAAa,UAAqC;CAChD,MAAM;CACN,OAAO,WAAW,UAAU;EAC1B,GAAI,SAAS,IAAI,IAAI,OAAO,CAAC;EAC7B,QAAQ,SAAS,IAAI,KAAK,MAAM,QAAQ,KAAK,MAAM,IAAI,KAAK,OAAO,IAAI,IAAI,IAAI,KAAA;EAC/E,QAAQ,QAAQ,SAAS,IAAI,KAAK,KAAK,SAAS,OAAO;GACrD,GAAG,MAAM,CAAC;GACV,QAAQ,QAAQ,EAAE,SAAS,OAAO;IAChC,GAAG;IACH,GAAG,OAAO,EAAE,MAAM,WAAW,EAAE,IAAI,OAAO,EAAE,CAAC;IAC7C,GAAG,OAAO,EAAE,CAAC;IACb,MAAM,OAAO,EAAE,IAAI,KAAK,KAAA;IACxB,OAAO,EAAE,SAAS,OAAO,KAAA,IAAY,KAAK,EAAE,KAAK;GACnD,EAAE,CAAC,CAAC,QAAQ,MAAM,EAAE,MAAM,QAAQ,EAAE,MAAM,IAAI;EAChD,EAAE;CACJ,EAAE;CACF,QAAQ;CACR,SAAS,YAAY,YAAY,QAAQ,KAAK,MAAM;CACpD,OAAO;CACP,aAAa,EAAE,SAAS,YAAY,QAAQ,GAAG,OAAO;AACxD"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ht as ValueAxisOptions, o as ChartType } from "./chart-CE9EVbfV.js";
|
|
2
|
+
import { n as InsetsInput } from "./layout-CYerDebD.js";
|
|
3
3
|
import { a as ClassValue } from "./vnode-Du2cC8Fm.js";
|
|
4
4
|
/** A point of a scatter or bubble chart. */
|
|
5
5
|
interface ScatterPoint {
|
|
6
|
-
|
|
6
|
+
/** A number on a value axis; on a category axis, the label the point stands at. */
|
|
7
|
+
x: number | string;
|
|
7
8
|
y: number;
|
|
8
9
|
/** Bubble size; the circle area is proportional to it. */
|
|
9
10
|
size?: number;
|
|
@@ -24,12 +25,29 @@ interface ScatterSeries {
|
|
|
24
25
|
class?: ClassValue;
|
|
25
26
|
/** Start hidden (toggle it back from the legend). */
|
|
26
27
|
hidden?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Write values on this series' marks, whatever the chart's `valueLabels`
|
|
30
|
+
* says: `true` labels it even when the chart option is off, `false` leaves
|
|
31
|
+
* it out. Needs `@tabler/charts/value-labels` on the core.
|
|
32
|
+
*/
|
|
33
|
+
valueLabels?: boolean;
|
|
34
|
+
}
|
|
35
|
+
interface ScatterData {
|
|
36
|
+
/**
|
|
37
|
+
* Categories along x, in their order: the x axis then shows these names and
|
|
38
|
+
* each point stands at the label its `x` names (points naming none are left
|
|
39
|
+
* out). Without `labels`, points with a text `x` make the categories
|
|
40
|
+
* themselves, in order of appearance.
|
|
41
|
+
*/
|
|
42
|
+
labels?: readonly (string | number)[];
|
|
43
|
+
series: readonly ScatterSeries[];
|
|
27
44
|
}
|
|
28
45
|
interface ScatterOptions {
|
|
29
|
-
data:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
46
|
+
data: ScatterData;
|
|
47
|
+
/**
|
|
48
|
+
* Horizontal value axis; `reverse` runs it from the right (the default with
|
|
49
|
+
* `rtl`). Over categories only `show`, `title`, `grid` and `reverse` apply.
|
|
50
|
+
*/
|
|
33
51
|
x?: ValueAxisOptions & {
|
|
34
52
|
reverse?: boolean;
|
|
35
53
|
};
|
|
@@ -47,7 +65,8 @@ interface ScatterOptions {
|
|
|
47
65
|
}
|
|
48
66
|
/**
|
|
49
67
|
* Scatter chart: points on two value axes; give points a `size` for a
|
|
50
|
-
* bubble chart (area-proportional radii).
|
|
68
|
+
* bubble chart (area-proportional radii). With `data.labels` (or a text `x`)
|
|
69
|
+
* the points stand over named categories instead.
|
|
51
70
|
*
|
|
52
71
|
* ```ts
|
|
53
72
|
* new Chart('#el', {
|
|
@@ -57,4 +76,4 @@ interface ScatterOptions {
|
|
|
57
76
|
* ```
|
|
58
77
|
*/
|
|
59
78
|
declare const scatter: ChartType<ScatterOptions>;
|
|
60
|
-
export { scatter as i,
|
|
79
|
+
export { scatter as a, ScatterSeries as i, ScatterOptions as n, ScatterPoint as r, ScatterData as t };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { o as ChartType, yt as ValueAxisOptions } from "./chart-Dz4geQZy.cjs";
|
|
2
|
+
import { n as InsetsInput } from "./layout-CYerDebD.cjs";
|
|
3
3
|
import { a as ClassValue } from "./vnode-Du2cC8Fm.cjs";
|
|
4
4
|
/** A point of a scatter or bubble chart. */
|
|
5
5
|
interface ScatterPoint {
|
|
6
|
-
|
|
6
|
+
/** A number on a value axis; on a category axis, the label the point stands at. */
|
|
7
|
+
x: number | string;
|
|
7
8
|
y: number;
|
|
8
9
|
/** Bubble size; the circle area is proportional to it. */
|
|
9
10
|
size?: number;
|
|
@@ -24,12 +25,29 @@ interface ScatterSeries {
|
|
|
24
25
|
class?: ClassValue;
|
|
25
26
|
/** Start hidden (toggle it back from the legend). */
|
|
26
27
|
hidden?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Write values on this series' marks, whatever the chart's `valueLabels`
|
|
30
|
+
* says: `true` labels it even when the chart option is off, `false` leaves
|
|
31
|
+
* it out. Needs `@tabler/charts/value-labels` on the core.
|
|
32
|
+
*/
|
|
33
|
+
valueLabels?: boolean;
|
|
34
|
+
}
|
|
35
|
+
interface ScatterData {
|
|
36
|
+
/**
|
|
37
|
+
* Categories along x, in their order: the x axis then shows these names and
|
|
38
|
+
* each point stands at the label its `x` names (points naming none are left
|
|
39
|
+
* out). Without `labels`, points with a text `x` make the categories
|
|
40
|
+
* themselves, in order of appearance.
|
|
41
|
+
*/
|
|
42
|
+
labels?: readonly (string | number)[];
|
|
43
|
+
series: readonly ScatterSeries[];
|
|
27
44
|
}
|
|
28
45
|
interface ScatterOptions {
|
|
29
|
-
data:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
46
|
+
data: ScatterData;
|
|
47
|
+
/**
|
|
48
|
+
* Horizontal value axis; `reverse` runs it from the right (the default with
|
|
49
|
+
* `rtl`). Over categories only `show`, `title`, `grid` and `reverse` apply.
|
|
50
|
+
*/
|
|
33
51
|
x?: ValueAxisOptions & {
|
|
34
52
|
reverse?: boolean;
|
|
35
53
|
};
|
|
@@ -47,7 +65,8 @@ interface ScatterOptions {
|
|
|
47
65
|
}
|
|
48
66
|
/**
|
|
49
67
|
* Scatter chart: points on two value axes; give points a `size` for a
|
|
50
|
-
* bubble chart (area-proportional radii).
|
|
68
|
+
* bubble chart (area-proportional radii). With `data.labels` (or a text `x`)
|
|
69
|
+
* the points stand over named categories instead.
|
|
51
70
|
*
|
|
52
71
|
* ```ts
|
|
53
72
|
* new Chart('#el', {
|
|
@@ -57,4 +76,4 @@ interface ScatterOptions {
|
|
|
57
76
|
* ```
|
|
58
77
|
*/
|
|
59
78
|
declare const scatter: ChartType<ScatterOptions>;
|
|
60
|
-
export { scatter as i,
|
|
79
|
+
export { scatter as a, ScatterSeries as i, ScatterOptions as n, ScatterPoint as r, ScatterData as t };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_axis = require("./axis-BzBkkC5X.cjs");
|
|
2
|
+
const require_cartesian = require("./cartesian-B9CrasFJ.cjs");
|
|
2
3
|
const require_format = require("./format-CAE5ruy6.cjs");
|
|
3
|
-
const require_layout = require("./layout-
|
|
4
|
+
const require_layout = require("./layout-Cfg9x1k2.cjs");
|
|
4
5
|
const require_extent = require("./extent-DuYDcvM9.cjs");
|
|
5
6
|
const require_circle = require("./circle-Bwxy5j7B.cjs");
|
|
6
7
|
const require_vnode = require("./vnode-ClAiw28x.cjs");
|
|
@@ -10,8 +11,23 @@ const require_named = require("./named-BBASc8dW.cjs");
|
|
|
10
11
|
/** Pointer distance (in pixels, beyond the radius) that still hits a point. */
|
|
11
12
|
const HIT_RADIUS = 24;
|
|
12
13
|
const EDGE = 8;
|
|
14
|
+
/**
|
|
15
|
+
* The categories of the x axis, or `null` when it is a value axis: `data.labels`,
|
|
16
|
+
* else every `x` in order of appearance once any of them is text.
|
|
17
|
+
*/
|
|
18
|
+
function categories(data) {
|
|
19
|
+
if (data.labels) return data.labels.map(String);
|
|
20
|
+
if (!data.series.some((s) => s.points.some((p) => typeof p.x === "string"))) return null;
|
|
21
|
+
return [...new Set(data.series.flatMap((s) => s.points.map((p) => String(p.x))))];
|
|
22
|
+
}
|
|
13
23
|
/** A point's bubble size, or `undefined` when it has none (or an invalid one). */
|
|
14
24
|
const sizeOf = (p) => p.size != null && Number.isFinite(p.size) && p.size > 0 ? p.size : void 0;
|
|
25
|
+
/** An `x` as text for the tooltip and the table: the category's name, or the formatted number. */
|
|
26
|
+
function xText(options, locale) {
|
|
27
|
+
const format = require_format.formatDetail(options.x?.format, locale);
|
|
28
|
+
const named = !!categories(options.data);
|
|
29
|
+
return (value) => named || typeof value === "string" ? String(value) : format(value);
|
|
30
|
+
}
|
|
15
31
|
function renderScatter(options, ctx) {
|
|
16
32
|
const { width, height, fontSize, locale } = ctx;
|
|
17
33
|
const xOptions = options.x ?? {};
|
|
@@ -26,32 +42,57 @@ function renderScatter(options, ctx) {
|
|
|
26
42
|
const overhang = Math.max(radius, sizes.length ? rMax : 0) + 2;
|
|
27
43
|
const countY = require_cartesian.tickCount(yOptions, Math.max(2, Math.round(height / 60)));
|
|
28
44
|
const countX = require_cartesian.tickCount(xOptions, Math.max(2, Math.round(width / 80)));
|
|
29
|
-
const
|
|
45
|
+
const labels = categories(options.data);
|
|
46
|
+
const index = new Map((labels ?? []).map((label, i) => [label, i]).reverse());
|
|
47
|
+
const usable = (p) => (labels ? index.has(String(p.x)) : typeof p.x === "number" && require_cartesian.plottable(p.x, xOptions)) && require_cartesian.plottable(p.y, yOptions);
|
|
30
48
|
const shown = points.filter(usable);
|
|
31
|
-
const xDomain = require_cartesian.domainOf(shown.map((p) => p.x), xOptions, false, countX);
|
|
49
|
+
const xDomain = require_cartesian.domainOf(labels ? [] : shown.map((p) => p.x), xOptions, false, countX);
|
|
32
50
|
const yDomain = require_cartesian.domainOf(shown.map((p) => p.y), yOptions, false, countY);
|
|
33
51
|
const showX = xOptions.show !== false;
|
|
34
52
|
const showY = yOptions.show !== false;
|
|
35
53
|
const ticksOf = (scale, axis, count) => require_cartesian.valueTicks(scale, axis, count, axis.format, locale);
|
|
36
54
|
const probeY = ticksOf(require_cartesian.valueScale(yDomain, [1, 0], yOptions), yOptions, countY);
|
|
37
|
-
const probeX =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
const probeX = labels ? labels.map((label) => ({
|
|
56
|
+
value: label,
|
|
57
|
+
position: 0,
|
|
58
|
+
label
|
|
59
|
+
})) : ticksOf(require_cartesian.valueScale(xDomain, [0, 1], xOptions), xOptions, countX);
|
|
60
|
+
const half = (tick, halfBand = 0) => showX && tick ? Math.max(0, Math.ceil(require_layout.estimateTextWidth(tick.label, fontSize) / 2 - halfBand)) : 0;
|
|
61
|
+
const reverse = xOptions.reverse ?? ctx.rtl === true;
|
|
62
|
+
const near = reverse === (ctx.rtl === true) ? 0 : probeX.length - 1;
|
|
63
|
+
const valueWidth = (showY ? require_axis.axisSize("left", probeY, fontSize) : 0) + require_axis.axisTitleSize(yOptions.title, fontSize);
|
|
64
|
+
const { area, side, range } = require_layout.plotFrame(ctx, options.padding, (pad) => {
|
|
65
|
+
const sides = (halfBand) => ({
|
|
66
|
+
start: pad.start + Math.max(valueWidth, half(probeX[near], halfBand), overhang),
|
|
67
|
+
end: pad.end + Math.max(half(probeX[probeX.length - 1 - near], halfBand), overhang, EDGE)
|
|
68
|
+
});
|
|
69
|
+
let both = sides(0);
|
|
70
|
+
if (labels?.length) both = sides((width - both.start - both.end) / (labels.length * 2));
|
|
71
|
+
return {
|
|
72
|
+
top: pad.top + Math.max(showY ? Math.ceil(fontSize * require_layout.LINE_HEIGHT / 2) : 0, overhang, EDGE / 2),
|
|
73
|
+
bottom: pad.bottom + Math.max((showX ? require_axis.axisSize("bottom", probeX, fontSize) : 0) + require_axis.axisTitleSize(xOptions.title, fontSize), overhang, EDGE / 2),
|
|
74
|
+
...both
|
|
75
|
+
};
|
|
76
|
+
});
|
|
52
77
|
const y = require_cartesian.valueScale(yDomain, [area.y + area.height, area.y], yOptions);
|
|
53
|
-
|
|
54
|
-
|
|
78
|
+
let x;
|
|
79
|
+
let allX;
|
|
80
|
+
if (labels) {
|
|
81
|
+
const [from, to] = range(reverse);
|
|
82
|
+
const at = (i) => from + (to - from) * (i + .5) / labels.length;
|
|
83
|
+
x = (value) => at(index.get(String(value)));
|
|
84
|
+
allX = labels.map((label, i) => ({
|
|
85
|
+
value: label,
|
|
86
|
+
position: at(i),
|
|
87
|
+
label
|
|
88
|
+
}));
|
|
89
|
+
} else {
|
|
90
|
+
const scale = require_cartesian.valueScale(xDomain, range(reverse), xOptions);
|
|
91
|
+
x = (value) => scale(value);
|
|
92
|
+
allX = ticksOf(scale, xOptions, countX);
|
|
93
|
+
}
|
|
94
|
+
const xTicks = require_axis.thinTicks(allX, "bottom", fontSize);
|
|
95
|
+
const yTicks = require_axis.thinTicks(ticksOf(y, yOptions, countY), "left", fontSize, 4);
|
|
55
96
|
const placed = [];
|
|
56
97
|
options.data.series.forEach((series, seriesIndex) => {
|
|
57
98
|
if (ctx.hidden.has(require_named.keyOf(series))) return;
|
|
@@ -68,7 +109,7 @@ function renderScatter(options, ctx) {
|
|
|
68
109
|
});
|
|
69
110
|
});
|
|
70
111
|
placed.sort((a, b) => a.cx - b.cx);
|
|
71
|
-
const fx =
|
|
112
|
+
const fx = xText(options, locale);
|
|
72
113
|
const fy = require_format.formatDetail(yOptions.format, locale);
|
|
73
114
|
const fs = require_format.formatNumber(void 0, locale);
|
|
74
115
|
const hitFor = (p, index) => {
|
|
@@ -92,7 +133,8 @@ function renderScatter(options, ctx) {
|
|
|
92
133
|
area,
|
|
93
134
|
items: [item],
|
|
94
135
|
seriesIndex: p.seriesIndex,
|
|
95
|
-
|
|
136
|
+
highlight: {
|
|
137
|
+
kind: "halo",
|
|
96
138
|
d: require_circle.circlePath(require_layout.round(p.r + 4)),
|
|
97
139
|
x: p.cx,
|
|
98
140
|
y: p.cy
|
|
@@ -128,7 +170,6 @@ function renderScatter(options, ctx) {
|
|
|
128
170
|
return best === -1 ? null : hitFor(placed[best], best);
|
|
129
171
|
}
|
|
130
172
|
};
|
|
131
|
-
ctx.onHitTest(interaction);
|
|
132
173
|
/** One path drawing a dot of `radius` at every point (two arcs each, or the series' shape). */
|
|
133
174
|
const shape = require_cartesian.markerShape(options);
|
|
134
175
|
const dotsPath = (dots, slot) => {
|
|
@@ -161,28 +202,33 @@ function renderScatter(options, ctx) {
|
|
|
161
202
|
cy: require_layout.round(y(point.y)),
|
|
162
203
|
r: require_layout.round(bubble(sizeOf(point)))
|
|
163
204
|
}))));
|
|
164
|
-
return
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
205
|
+
return {
|
|
206
|
+
content: [
|
|
207
|
+
require_vnode.h("defs", null, clip.def),
|
|
208
|
+
background,
|
|
209
|
+
require_vnode.h("g", {
|
|
210
|
+
key: "series",
|
|
211
|
+
class: "tc-series-list",
|
|
212
|
+
"clip-path": clip.url
|
|
213
|
+
}, groups),
|
|
214
|
+
showY && require_axis.axis({
|
|
215
|
+
position: side,
|
|
216
|
+
ticks: yTicks,
|
|
217
|
+
area
|
|
218
|
+
}),
|
|
219
|
+
showX && require_axis.axis({
|
|
220
|
+
position: "bottom",
|
|
221
|
+
ticks: xTicks,
|
|
222
|
+
area
|
|
223
|
+
}),
|
|
224
|
+
!!yOptions.title && require_axis.axisTitle(side, showY ? yTicks : [], area, yOptions.title, fontSize),
|
|
225
|
+
!!xOptions.title && require_axis.axisTitle("bottom", showX ? xTicks : [], area, xOptions.title, fontSize)
|
|
226
|
+
],
|
|
227
|
+
interaction
|
|
228
|
+
};
|
|
183
229
|
}
|
|
184
230
|
function scatterTable(options, ctx, limit = Number.POSITIVE_INFINITY) {
|
|
185
|
-
const fx =
|
|
231
|
+
const fx = xText(options, ctx.locale);
|
|
186
232
|
const fy = require_format.formatDetail(options.y?.format, ctx.locale);
|
|
187
233
|
const fs = require_format.formatNumber(void 0, ctx.locale);
|
|
188
234
|
const series = options.data.series.filter((s) => !ctx.hidden.has(require_named.keyOf(s)));
|
|
@@ -214,7 +260,8 @@ function scatterTable(options, ctx, limit = Number.POSITIVE_INFINITY) {
|
|
|
214
260
|
}
|
|
215
261
|
/**
|
|
216
262
|
* Scatter chart: points on two value axes; give points a `size` for a
|
|
217
|
-
* bubble chart (area-proportional radii).
|
|
263
|
+
* bubble chart (area-proportional radii). With `data.labels` (or a text `x`)
|
|
264
|
+
* the points stand over named categories instead.
|
|
218
265
|
*
|
|
219
266
|
* ```ts
|
|
220
267
|
* new Chart('#el', {
|
|
@@ -227,11 +274,12 @@ const scatter = {
|
|
|
227
274
|
name: "scatter",
|
|
228
275
|
clean: require_clean.cleanData((data) => ({
|
|
229
276
|
...require_clean.isRecord(data) ? data : {},
|
|
277
|
+
labels: require_clean.isRecord(data) && Array.isArray(data.labels) ? data.labels.map(require_clean.text) : void 0,
|
|
230
278
|
series: require_clean.records(require_clean.isRecord(data) && data.series, (s) => ({
|
|
231
279
|
...require_clean.named(s),
|
|
232
280
|
points: require_clean.records(s.points, (p) => ({
|
|
233
281
|
...p,
|
|
234
|
-
x: require_clean.finite(p.x),
|
|
282
|
+
x: typeof p.x === "string" ? p.x : require_clean.finite(p.x),
|
|
235
283
|
y: require_clean.finite(p.y),
|
|
236
284
|
size: require_clean.finite(p.size) ?? void 0,
|
|
237
285
|
label: p.label == null ? void 0 : require_clean.text(p.label)
|
|
@@ -250,4 +298,4 @@ Object.defineProperty(exports, "scatter", {
|
|
|
250
298
|
}
|
|
251
299
|
});
|
|
252
300
|
|
|
253
|
-
//# sourceMappingURL=scatter-
|
|
301
|
+
//# sourceMappingURL=scatter-CZ8do3Up.cjs.map
|