@tabler/charts 0.3.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 +94 -16
- package/dist/{annotations-CpCWA29b.cjs → annotations--m-HzMBM.cjs} +86 -10
- 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-BQ8l-qHs.js → annotations-DGITy6th.js} +86 -10
- package/dist/annotations-DGITy6th.js.map +1 -0
- package/dist/annotations.cjs +1 -1
- package/dist/annotations.d.cts +1 -1
- package/dist/annotations.d.ts +1 -1
- package/dist/annotations.js +1 -1
- package/dist/{area-WdtfqvhX.js → area-BN0uE9R0.js} +4 -3
- package/dist/area-BN0uE9R0.js.map +1 -0
- package/dist/{area-h_FvieFb.d.cts → area-D6LNLk3r.d.cts} +2 -2
- package/dist/{area-DEFQm_SQ.d.ts → area-DEFL-Yun.d.ts} +2 -2
- package/dist/{area-DYdQ_sMV.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-YfAerNBA.cjs → axis-BzBkkC5X.cjs} +12 -7
- package/dist/axis-BzBkkC5X.cjs.map +1 -0
- package/dist/{axis-MMaVoSWB.js → axis-C5obgdJt.js} +12 -7
- package/dist/axis-C5obgdJt.js.map +1 -0
- package/dist/{bar-CVkOJ7WA.cjs → bar-BrmfXugT.cjs} +5 -4
- package/dist/bar-BrmfXugT.cjs.map +1 -0
- package/dist/{bar-D9B_arKf.d.ts → bar-Bs_rPqgR.d.ts} +1 -1
- package/dist/{bar-DZCQ-kyf.d.cts → bar-CEt8YRxf.d.cts} +2 -2
- package/dist/{bar-BOcRcArc.js → bar-D_KKd2fL.js} +5 -4
- package/dist/bar-D_KKd2fL.js.map +1 -0
- package/dist/bar.cjs +1 -1
- package/dist/bar.d.cts +1 -1
- package/dist/bar.d.ts +1 -1
- package/dist/bar.js +1 -1
- package/dist/{calendar-BSvO8nRb.d.cts → calendar-B7843sQu.d.cts} +2 -2
- package/dist/{calendar-DAFXjV99.cjs → calendar-BG_q_NC_.cjs} +2 -2
- package/dist/{calendar-DAFXjV99.cjs.map → calendar-BG_q_NC_.cjs.map} +1 -1
- package/dist/{calendar-BXgIX5H1.js → calendar-CF3gfDQk.js} +2 -2
- package/dist/{calendar-BXgIX5H1.js.map → calendar-CF3gfDQk.js.map} +1 -1
- package/dist/{calendar-Bq3vFzPl.d.ts → calendar-D10_ki1S.d.ts} +2 -2
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.cts +1 -1
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +1 -1
- package/dist/{candlestick-BtT9glp9.js → candlestick-B1onjo1o.js} +3 -2
- package/dist/candlestick-B1onjo1o.js.map +1 -0
- package/dist/{candlestick-BcomxeVG.d.cts → candlestick-B7YXUVVh.d.cts} +4 -3
- package/dist/{candlestick-CSmRuZ4v.cjs → candlestick-BwrFKak_.cjs} +3 -2
- package/dist/candlestick-BwrFKak_.cjs.map +1 -0
- package/dist/{candlestick-B3WcLzph.d.ts → candlestick-XpqJvarq.d.ts} +4 -3
- package/dist/candlestick.cjs +2 -2
- package/dist/candlestick.d.cts +1 -1
- package/dist/candlestick.d.ts +1 -1
- package/dist/candlestick.js +2 -2
- package/dist/{cartesian-DRSXHxWe.cjs → cartesian-B9CrasFJ.cjs} +49 -7
- package/dist/cartesian-B9CrasFJ.cjs.map +1 -0
- package/dist/{cartesian-BrPqb5Qn.js → cartesian-COglz544.js} +45 -9
- package/dist/cartesian-COglz544.js.map +1 -0
- package/dist/{chart-B6TTY4Kr.js → chart-B97FBRCd.js} +22 -12
- package/dist/chart-B97FBRCd.js.map +1 -0
- package/dist/{chart-CYrrUCi3.d.ts → chart-CE9EVbfV.d.ts} +240 -62
- package/dist/{chart-CbPzP5Dp.d.cts → chart-Dz4geQZy.d.cts} +240 -62
- package/dist/{chart-D_lyOy-M.cjs → chart-GUmmjJ7S.cjs} +27 -11
- package/dist/chart-GUmmjJ7S.cjs.map +1 -0
- package/dist/{core-CQ0FaJ4G.js → core-7fgM3su0.js} +84 -16
- package/dist/core-7fgM3su0.js.map +1 -0
- package/dist/{core-C3qEppSm.d.ts → core-BUQzLsRJ.d.ts} +21 -6
- package/dist/{core-D2PSked3.cjs → core-BZTrsPxc.cjs} +93 -13
- package/dist/core-BZTrsPxc.cjs.map +1 -0
- package/dist/{core-9BnLEW4K.d.cts → core-Ck5uHcW8.d.cts} +40 -23
- package/dist/core.cjs +20 -16
- package/dist/core.d.cts +23 -21
- package/dist/core.d.ts +23 -21
- package/dist/core.js +18 -17
- package/dist/{dates-DerXTb1J.cjs → dates-0YNY49KQ.cjs} +2 -2
- package/dist/{dates-DerXTb1J.cjs.map → dates-0YNY49KQ.cjs.map} +1 -1
- package/dist/{dates-DLe2Ww64.js → dates-CKDRgpin.js} +2 -2
- package/dist/{dates-DLe2Ww64.js.map → dates-CKDRgpin.js.map} +1 -1
- 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-DoeiAyR2.js → export-chart-BOH_nfcH.js} +76 -4
- package/dist/export-chart-BOH_nfcH.js.map +1 -0
- package/dist/{export-chart-CPtXmZvi.cjs → export-chart-Be4T9J3m.cjs} +81 -3
- package/dist/export-chart-Be4T9J3m.cjs.map +1 -0
- package/dist/export.cjs +4 -2
- 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 +4 -3
- package/dist/export.js.map +1 -1
- package/dist/features-B55rwpQC.js.map +1 -1
- package/dist/features-DEDP5CEQ.cjs.map +1 -1
- package/dist/{funnel-CarOh8w_.d.cts → funnel-B9ridzNx.d.cts} +2 -2
- package/dist/{funnel-BdcfUkb5.d.ts → funnel-FogM8flk.d.ts} +2 -2
- package/dist/funnel.d.cts +1 -1
- package/dist/funnel.d.ts +1 -1
- package/dist/{gauge-Ds9k1UV2.d.cts → gauge-BScJ7U6O.d.cts} +2 -2
- package/dist/{gauge-Zy25jfps.d.ts → gauge-D78oq1Lx.d.ts} +2 -2
- package/dist/gauge.d.cts +1 -1
- package/dist/gauge.d.ts +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-Dcc_bsoQ.cjs → heatmap-Dyzrd4Fd.cjs} +3 -3
- package/dist/{heatmap-Dcc_bsoQ.cjs.map → heatmap-Dyzrd4Fd.cjs.map} +1 -1
- package/dist/{heatmap-C1v8bwpq.js → heatmap-J7fxG7MM.js} +3 -3
- package/dist/{heatmap-C1v8bwpq.js.map → heatmap-J7fxG7MM.js.map} +1 -1
- package/dist/{heatmap-CJ-0dfhJ.d.cts → heatmap-Jvwo7iFW.d.cts} +2 -2
- package/dist/{heatmap-Jp5sHRTo.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/index.cjs +37 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -21
- package/dist/index.d.ts +23 -21
- package/dist/index.js +34 -27
- package/dist/index.js.map +1 -1
- package/dist/interaction-DXYSjgnP.cjs.map +1 -1
- package/dist/interaction-En1KlwFO.js.map +1 -1
- package/dist/layout-CYerDebD.d.cts +29 -0
- package/dist/layout-CYerDebD.d.ts +29 -0
- package/dist/{line-CxR4tg1Q.js → line-CXH0L10d.js} +43 -8
- package/dist/line-CXH0L10d.js.map +1 -0
- package/dist/{line-vyWO030v.d.cts → line-Cu9ctpbv.d.cts} +9 -2
- package/dist/{line-YiCuhVMI.cjs → line-DHbYCQy4.cjs} +43 -8
- package/dist/line-DHbYCQy4.cjs.map +1 -0
- package/dist/{line-Bpr5uVLQ.d.ts → line-TkzA7wMK.d.ts} +8 -1
- package/dist/line.cjs +1 -1
- package/dist/line.d.cts +1 -1
- package/dist/line.d.ts +1 -1
- package/dist/line.js +1 -1
- package/dist/{map-49FcfdmJ.d.cts → map-BirylCmT.d.cts} +2 -2
- package/dist/{map-C15NC7kW.js → map-CYp6x-uS.js} +3 -26
- package/dist/map-CYp6x-uS.js.map +1 -0
- package/dist/{map-BqrZ80vT.cjs → map-ChwSgooH.cjs} +4 -27
- package/dist/map-ChwSgooH.cjs.map +1 -0
- package/dist/{map-BMC61J-P.d.ts → map-DNqog2Xs.d.ts} +2 -2
- package/dist/map.cjs +1 -1
- package/dist/map.d.cts +1 -1
- package/dist/map.d.ts +1 -1
- package/dist/map.js +1 -1
- package/dist/maps/world.d.cts +1 -1
- package/dist/maps/world.d.ts +1 -1
- package/dist/{others-ls5eKtZ4.d.cts → others-CuNdpvjd.d.cts} +1 -1
- package/dist/{parliament-Cz9n_DoK.d.ts → parliament-CHdf13XU.d.ts} +2 -2
- package/dist/{parliament-C7V8UJj1.d.cts → parliament-CsYgh4N2.d.cts} +2 -2
- package/dist/parliament.d.cts +1 -1
- package/dist/parliament.d.ts +1 -1
- package/dist/{patterns-Dw7OMD_2.cjs → patterns-BPN1c9qe.cjs} +2 -2
- package/dist/{patterns-Dw7OMD_2.cjs.map → patterns-BPN1c9qe.cjs.map} +1 -1
- package/dist/{patterns-BMUINoka.js → patterns-CVrLrJXg.js} +2 -2
- package/dist/{patterns-BMUINoka.js.map → patterns-CVrLrJXg.js.map} +1 -1
- package/dist/patterns.cjs +1 -1
- package/dist/patterns.d.cts +1 -1
- package/dist/patterns.d.ts +1 -1
- package/dist/patterns.js +1 -1
- package/dist/{percentage-bar-cSeiLdwU.d.ts → percentage-bar-CSAbzDOn.d.ts} +2 -2
- package/dist/{percentage-bar-R1--2grK.d.cts → percentage-bar-UZHCRvlK.d.cts} +3 -3
- package/dist/percentage-bar.d.cts +1 -1
- package/dist/percentage-bar.d.ts +1 -1
- package/dist/{pie-vD5-g8je.d.cts → pie-AFedsDcF.d.cts} +12 -3
- package/dist/{pie-Bd8wyrtY.js → pie-Ch6Bx0ih.js} +54 -39
- package/dist/pie-Ch6Bx0ih.js.map +1 -0
- package/dist/{pie-BseZlCgP.cjs → pie-Cll1OrVZ.cjs} +54 -39
- package/dist/pie-Cll1OrVZ.cjs.map +1 -0
- package/dist/{pie-BQQkvy1N.d.ts → pie-Cn2H3pz8.d.ts} +11 -2
- 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.d.cts +1 -1
- package/dist/point-shapes.d.ts +1 -1
- package/dist/{radar-D6XqkFWQ.js → radar-Bg-IiIWB.js} +3 -3
- package/dist/{radar-D6XqkFWQ.js.map → radar-Bg-IiIWB.js.map} +1 -1
- package/dist/{radar-vLxilcr4.d.ts → radar-DEer2jjd.d.ts} +2 -2
- package/dist/{radar-7I6hsY_h.d.cts → radar-DxmjXhMc.d.cts} +2 -2
- package/dist/{radar-DjISDnSf.cjs → radar-wDyX17S3.cjs} +3 -3
- package/dist/{radar-DjISDnSf.cjs.map → radar-wDyX17S3.cjs.map} +1 -1
- package/dist/radar.cjs +1 -1
- package/dist/radar.d.cts +1 -1
- package/dist/radar.d.ts +1 -1
- package/dist/radar.js +1 -1
- package/dist/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/{sankey-DqiuxUx7.d.cts → sankey-D-8ATwBT.d.cts} +2 -2
- package/dist/{sankey-7As41Fo4.d.ts → sankey-DpYJsOI4.d.ts} +2 -2
- package/dist/sankey.d.cts +1 -1
- package/dist/sankey.d.ts +1 -1
- package/dist/{scatter-DCMAtt5L.js → scatter-0Z7K_YUz.js} +65 -19
- package/dist/scatter-0Z7K_YUz.js.map +1 -0
- package/dist/{scatter-BXkXGgM_.d.ts → scatter-BAL5K9_4.d.ts} +22 -9
- package/dist/{scatter-DL0zAV09.d.cts → scatter-BUGbnRzM.d.cts} +22 -9
- package/dist/{scatter-Bwkblr4L.cjs → scatter-CZ8do3Up.cjs} +65 -19
- 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-BElUSd0r.d.ts → sparkline-CtoBJe-a.d.ts} +2 -2
- package/dist/{sparkline-BMSuEPHP.cjs → sparkline-DjR-V6BI.cjs} +2 -2
- package/dist/{sparkline-BMSuEPHP.cjs.map → sparkline-DjR-V6BI.cjs.map} +1 -1
- package/dist/{sparkline-RYly7bR0.d.cts → sparkline-DwHJfeZz.d.cts} +2 -2
- package/dist/{sparkline-NDmq90kP.js → sparkline-_dxwtdli.js} +2 -2
- package/dist/{sparkline-NDmq90kP.js.map → sparkline-_dxwtdli.js.map} +1 -1
- package/dist/sparkline.cjs +1 -1
- package/dist/sparkline.d.cts +1 -1
- package/dist/sparkline.d.ts +1 -1
- package/dist/sparkline.js +1 -1
- package/dist/{stack-BTWYIwLO.d.cts → stack-CcmyALx0.d.cts} +1 -1
- package/dist/{stack-jVKvg2x_.js → stack-CyVlS7Fr.js} +2 -2
- package/dist/{stack-jVKvg2x_.js.map → stack-CyVlS7Fr.js.map} +1 -1
- package/dist/{stack-BO4624CY.cjs → stack-DBhmYNat.cjs} +2 -2
- package/dist/{stack-BO4624CY.cjs.map → stack-DBhmYNat.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{time-axis-B3VekUfX.cjs → time-axis-CVKjQKSS.cjs} +3 -3
- package/dist/{time-axis-B3VekUfX.cjs.map → time-axis-CVKjQKSS.cjs.map} +1 -1
- package/dist/{time-axis-CLjqOakA.js → time-axis-CkmbAw4Z.js} +3 -3
- package/dist/{time-axis-CLjqOakA.js.map → time-axis-CkmbAw4Z.js.map} +1 -1
- package/dist/time.cjs +2 -2
- package/dist/time.js +2 -2
- package/dist/{treemap-25vHO_UK.d.cts → treemap-C2maqerU.d.cts} +26 -4
- package/dist/{treemap-BCXUbixd.d.ts → treemap-D_zbubo3.d.ts} +26 -4
- package/dist/{treemap-CZk8kKFD.cjs → treemap-PulGXZv0.cjs} +38 -8
- package/dist/treemap-PulGXZv0.cjs.map +1 -0
- package/dist/{treemap-C4glsx-g.js → treemap-lbYxb-7h.js} +38 -8
- 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-C7GrhOXJ.js → value-labels-B0VeheyE.js} +5 -4
- package/dist/value-labels-B0VeheyE.js.map +1 -0
- package/dist/{value-labels-DzaKIWKp.cjs → value-labels-Dcyk3GIY.cjs} +5 -4
- package/dist/value-labels-Dcyk3GIY.cjs.map +1 -0
- package/dist/value-labels.cjs +1 -1
- package/dist/value-labels.d.cts +1 -1
- package/dist/value-labels.d.ts +1 -1
- package/dist/value-labels.js +1 -1
- 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 +27 -2
- package/dist/annotations-BQ8l-qHs.js.map +0 -1
- package/dist/annotations-CpCWA29b.cjs.map +0 -1
- package/dist/area-DYdQ_sMV.cjs.map +0 -1
- package/dist/area-WdtfqvhX.js.map +0 -1
- package/dist/axis-MMaVoSWB.js.map +0 -1
- package/dist/axis-YfAerNBA.cjs.map +0 -1
- package/dist/bar-BOcRcArc.js.map +0 -1
- package/dist/bar-CVkOJ7WA.cjs.map +0 -1
- package/dist/candlestick-BtT9glp9.js.map +0 -1
- package/dist/candlestick-CSmRuZ4v.cjs.map +0 -1
- package/dist/cartesian-BrPqb5Qn.js.map +0 -1
- package/dist/cartesian-DRSXHxWe.cjs.map +0 -1
- package/dist/chart-B6TTY4Kr.js.map +0 -1
- package/dist/chart-D_lyOy-M.cjs.map +0 -1
- package/dist/core-CQ0FaJ4G.js.map +0 -1
- package/dist/core-D2PSked3.cjs.map +0 -1
- package/dist/export-chart-CPtXmZvi.cjs.map +0 -1
- package/dist/export-chart-DoeiAyR2.js.map +0 -1
- package/dist/line-CxR4tg1Q.js.map +0 -1
- package/dist/line-YiCuhVMI.cjs.map +0 -1
- package/dist/map-BqrZ80vT.cjs.map +0 -1
- package/dist/map-C15NC7kW.js.map +0 -1
- package/dist/pie-Bd8wyrtY.js.map +0 -1
- package/dist/pie-BseZlCgP.cjs.map +0 -1
- package/dist/scatter-Bwkblr4L.cjs.map +0 -1
- package/dist/scatter-DCMAtt5L.js.map +0 -1
- package/dist/treemap-C4glsx-g.js.map +0 -1
- package/dist/treemap-CZk8kKFD.cjs.map +0 -1
- package/dist/value-labels-C7GrhOXJ.js.map +0 -1
- package/dist/value-labels-DzaKIWKp.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-DHbYCQy4.cjs","names":["resolveLabels","seriesAxes","seriesKey","stackSeries","feature","cartesianLayout","stackBounds","seriesScale","categoryInteraction","plottable","h","seriesAttrs","areaPath","markerShape","labelKey","linePath","round","pointMark","fadeMask","cleanData","cleanSeries","windowed","seriesLegend","seriesTable"],"sources":["../src/charts/line.ts"],"sourcesContent":["import type { ChartType, RenderContext, RenderResult } from '../chart.ts'\nimport { fadeMask } from '../components/fade.ts'\nimport { feature } from '../features.ts'\nimport { round } from '../layout.ts'\nimport { areaPath, type Curve, linePath, type Point } from '../shapes/path.ts'\nimport { h, type VNode } from '../vnode.ts'\nimport {\n type CartesianOptions,\n cartesianLayout,\n categoryInteraction,\n labelKey,\n markerShape,\n plottable,\n pointMark,\n resolveLabels,\n type Series,\n seriesAttrs,\n seriesAxes,\n seriesKey,\n seriesLegend,\n seriesScale,\n seriesTable,\n windowed,\n} from './cartesian.ts'\nimport { cleanData, cleanSeries } from './clean.ts'\nimport type { EndLabelOptions } from './end-labels.ts'\nimport { type StackMode, stackBounds, stackSeries } from './stack.ts'\n\nexport interface LineOptions extends CartesianOptions {\n /** Interpolation between points. Defaults to `'monotone'`. */\n curve?: Curve\n /** Draw dots on every point, only on the last one, or none. Defaults to `'none'`. */\n points?: 'none' | 'last' | 'all'\n /** Dot radius in pixels. Defaults to `4`. */\n pointRadius?: number\n /** Bridge `null` values instead of leaving gaps. Defaults to `false`. */\n connectNulls?: boolean\n /** Fill the area under each line. Defaults to `false` (`true` for `area`). */\n area?: boolean\n /**\n * Area fill style: a vertical fade (strength set by `--tc-area-gradient-start`\n * / `--tc-area-gradient-end`) or a flat wash (`--tc-area-opacity`).\n * Defaults to `'gradient'`, or `'solid'` for stacked areas.\n */\n fill?: 'gradient' | 'solid'\n /**\n * Stack series on top of each other (each line draws the running total);\n * `'percent'` shows every category as 100%. Missing values count as zero.\n */\n stacked?: StackMode\n /**\n * Draw long series with at most this many points, chosen by LTTB\n * downsampling so peaks and valleys survive. Tooltips and keyboard\n * navigation still use every value. Off by default.\n */\n decimate?: number\n /**\n * Name each line at its end: the series name and its last value beside the\n * last point, past the edge of the plot, moved apart where lines end close\n * together (a thin line then joins a label to its point). Needs\n * `@tabler/charts/end-labels` on the core. Defaults to `false`.\n */\n endLabels?: boolean | EndLabelOptions\n}\n\n/** Points in pixels for a series; `null` for missing values. */\nfunction seriesPoints(\n series: Series,\n count: number,\n x: (i: number) => number,\n y: (v: number) => number,\n connectNulls: boolean,\n valid: (v: number | null | undefined) => v is number,\n): Point[] {\n const points: Point[] = []\n for (let i = 0; i < count; i++) {\n const v = series.values[i]\n if (!valid(v)) {\n if (!connectNulls) points.push(null)\n } else {\n points.push([x(i), y(v)])\n }\n }\n return points\n}\n\n/** Render line (and optionally area) series; shared by `line` and `area`. */\nexport function renderLines(options: LineOptions, ctx: RenderContext, fill: boolean): RenderResult {\n const {\n curve = 'monotone',\n points = 'none',\n pointRadius = 4,\n connectNulls = false,\n area: filled = fill,\n stacked = false,\n decimate,\n // Faded layers would show light seams between stacked areas, so stacks default to solid.\n fill: fillStyle = stacked ? 'solid' : 'gradient',\n } = options\n const overhang = points === 'none' ? 2 : pointRadius + 2\n const { series } = options.data\n const count = resolveLabels(options.data).length\n const axisOf = seriesAxes(options)\n // Series on the second axis keep out of the stacks.\n const seconds = series.filter((s) => axisOf(s).second).map(seriesKey)\n const stacks = stacked\n ? stackSeries(series, count, {\n percent: stacked === 'percent',\n nullAsZero: true,\n hidden: seconds.length ? new Set([...ctx.hidden, ...seconds]) : ctx.hidden,\n })\n : null\n // End labels stand past the end of the lines: the plot leaves them room there.\n const ends = options.endLabels ? feature('end-labels')(options, ctx, overhang) : null\n const layout = cartesianLayout(ends?.options ?? options, ctx, {\n scale: 'point',\n zero: filled || stacks !== null,\n zero2: filled,\n overhang,\n ...(stacks ? { values: stackBounds(stacks) } : {}),\n ...(stacked === 'percent' ? { tickFormat: { style: 'percent' } } : {}),\n })\n const { x, labels } = layout\n const scaleOf = (index: number) => seriesScale(layout, series[index])\n // Areas grow from zero, or from the bottom of the plot when zero is out of view.\n const baselineOf = (index: number) => {\n const y = scaleOf(index)\n return y(Math.min(Math.max(0, y.domain[0]), y.domain[1]))\n }\n // (series left out of the stacks have empty rows there)\n const stackOf = (index: number) => (!axisOf(series[index]).second && stacks?.[index]) || null\n const interaction = categoryInteraction(layout, options, ctx, (seriesIndex, i, v) => {\n const stack = stackOf(seriesIndex)\n return { x: x.at(i), y: scaleOf(seriesIndex)(stack ? (stack[i]?.y1 ?? 0) : v) }\n })\n const gradient = filled && fillStyle === 'gradient'\n const fadeId = `${ctx.id}-fade`\n\n // Hidden series keep their index (and color slot) but draw nothing.\n const visible = (s: Series) => !ctx.hidden.has(seriesKey(s))\n const all = series.map((s, index) => {\n if (!visible(s)) return []\n const y = scaleOf(index)\n // Stacked series draw their running total.\n const stack = stackOf(index)\n if (stack) return stack.map((seg, i): Point => (seg ? [x.at(i), y(seg.y1)] : null))\n const axis = axisOf(s).axis\n return seriesPoints(\n s,\n labels.length,\n (i) => x.at(i),\n y,\n connectNulls,\n (v) => plottable(v, axis),\n )\n })\n /** Indices drawn per series: a downsampled subset when `decimate` is set. */\n const kept = all.map((pts) =>\n decimate !== undefined && pts.length > decimate ? feature('decimate')(pts, decimate) : null,\n )\n const drawn = (index: number): Point[] => {\n const pts = all[index] as Point[]\n const keep = kept[index]\n return keep ? keep.map((i) => pts[i] as Point) : pts\n }\n /** Area bottom: zero, or the top of the layer below for stacks (downsampled alike). */\n const bottom = (index: number): number | (number | null)[] => {\n const stack = stackOf(index)\n if (!stack) return baselineOf(index)\n const y = scaleOf(index)\n const bottoms = stack.map((seg) => (seg ? y(seg.y0) : null))\n const keep = kept[index]\n return keep ? keep.map((i) => bottoms[i] ?? null) : bottoms\n }\n\n // All areas go below all lines, so a filled series never covers another line.\n const areas =\n filled &&\n h(\n 'g',\n { class: 'tc-areas' },\n options.data.series.map(\n (s, index) =>\n visible(s) &&\n h(\n 'g',\n seriesAttrs(s, index),\n h('path', {\n class: ['tc-area', gradient && 'tc-area-gradient'],\n d: areaPath(drawn(index), bottom(index), { curve }),\n mask: gradient ? `url(#${fadeId})` : undefined,\n }),\n ),\n ),\n )\n\n const shape = markerShape(options)\n const keys = labels.map(labelKey)\n /** Clip paths that cut the lines with `dashFrom` in two. */\n const cuts: VNode[] = []\n const lines = options.data.series.map((s, index) => {\n if (!visible(s)) return null\n const pts = drawn(index)\n const valid = pts.filter((p): p is readonly [number, number] => p != null)\n const dots = points === 'all' ? valid : points === 'last' ? valid.slice(-1) : []\n const d = linePath(pts, { curve })\n // The same path twice, each clipped to its side of the label: the curve stays whole.\n const from = s.dashFrom == null ? -1 : keys.indexOf(labelKey(s.dashFrom))\n const cut = from > 0 && from < keys.length - 1\n const { dash = '5 4' } = s\n if (cut) {\n const at = round(x.at(from))\n // Everything on one side of the label, far beyond the plot.\n const side = (part: string, before: boolean) =>\n h(\n 'clipPath',\n { key: `${part}-${seriesKey(s)}`, id: `${ctx.id}-${part}-${index}` },\n h('rect', { x: before ? at - 1e5 : at, y: -1e5, width: 1e5, height: 2e5 }),\n )\n const forward = x.at(0) <= at\n cuts.push(side('solid', forward), side('dashed', !forward))\n }\n return h(\n 'g',\n seriesAttrs(cut ? { ...s, dash: undefined } : s, index),\n h('path', {\n key: 'line',\n class: 'tc-line',\n d,\n 'clip-path': cut ? `url(#${ctx.id}-solid-${index})` : undefined,\n }),\n cut &&\n h('path', {\n key: 'dashed',\n class: 'tc-line tc-line-dashed',\n d,\n 'clip-path': `url(#${ctx.id}-dashed-${index})`,\n // A map, so values from data cannot inject CSS (see normalizeStyle).\n style: { '--tc-series-dash': Number.isFinite(dash) ? `${dash}px` : dash },\n }),\n dots.length > 0 &&\n h(\n 'g',\n { class: 'tc-points' },\n dots.map(([cx, cy]) =>\n pointMark(shape, index, cx, 'tc-point', round(cx), round(cy), pointRadius),\n ),\n ),\n )\n })\n\n const content = [\n h('defs', { key: 'defs' }, layout.clip.def, gradient && fadeMask(fadeId), cuts),\n layout.background,\n // Layers are keyed: an annotation band or a grid that comes and goes must not\n // shift the series list onto another node (that would recreate every series).\n h('g', { key: 'series', class: 'tc-series-list', 'clip-path': layout.clip.url }, areas, lines),\n layout.foreground,\n // Where each line ends: its last point (the running total in a stack).\n ends?.layer(all, layout.area),\n ]\n return { content, interaction }\n}\n\n/**\n * Line chart: one line per series over category labels.\n *\n * ```ts\n * new Chart('#el', {\n * type: line,\n * data: { labels: ['Jan', 'Feb', 'Mar'], series: [{ name: 'Sales', values: [3, 5, 4] }] },\n * })\n * ```\n */\nexport const line: ChartType<LineOptions> = {\n name: 'line',\n clean: cleanData(cleanSeries),\n prepare: windowed,\n render: (options, ctx) => renderLines(options, ctx, false),\n legend: (options) => seriesLegend(options.data),\n table: (options, ctx, limit) => seriesTable(options, ctx, limit),\n}\n"],"mappings":";;;;;;;;;AAkEA,SAAS,aACP,QACA,OACA,GACA,GACA,cACA,OACS;CACT,MAAM,SAAkB,CAAC;CACzB,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,KAAK;EAC9B,MAAM,IAAI,OAAO,OAAO;EACxB,IAAI,CAAC,MAAM,CAAC,GACN;OAAA,CAAC,cAAc,OAAO,KAAK,IAAI;EAAA,OAEnC,OAAO,KAAK,CAAC,EAAE,CAAC,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,OAAO,GAAG,OAAO,KAAK,KAAK,YAAYQ,aAAAA,SAAS,MAAM,GAAG,IAAI;GAC9E,OAAO;GAGPR,cAAAA,EAAE,KAAK;IAAE,KAAK;IAAU,OAAO;IAAkB,aAAa,OAAO,KAAK;GAAI,GAAG,OAAO,KAAK;GAC7F,OAAO;GAEP,MAAM,MAAM,KAAK,OAAO,IAAI;EAEf;EAAG;CAAY;AAChC;;;;;;;;;;;AAYA,MAAa,OAA+B;CAC1C,MAAM;CACN,OAAOS,cAAAA,UAAUC,cAAAA,WAAW;CAC5B,SAASC,kBAAAA;CACT,SAAS,SAAS,QAAQ,YAAY,SAAS,KAAK,KAAK;CACzD,SAAS,YAAYC,kBAAAA,aAAa,QAAQ,IAAI;CAC9C,QAAQ,SAAS,KAAK,UAAUC,kBAAAA,YAAY,SAAS,KAAK,KAAK;AACjE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ct as EndLabelOptions, dt as CartesianOptions, o as ChartType } from "./chart-CE9EVbfV.js";
|
|
2
2
|
import { t as Curve } from "./path-YeUiOfG8.js";
|
|
3
3
|
import { t as StackMode } from "./stack-DR0eQTsB.js";
|
|
4
4
|
interface LineOptions extends CartesianOptions {
|
|
@@ -29,6 +29,13 @@ interface LineOptions extends CartesianOptions {
|
|
|
29
29
|
* navigation still use every value. Off by default.
|
|
30
30
|
*/
|
|
31
31
|
decimate?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Name each line at its end: the series name and its last value beside the
|
|
34
|
+
* last point, past the edge of the plot, moved apart where lines end close
|
|
35
|
+
* together (a thin line then joins a label to its point). Needs
|
|
36
|
+
* `@tabler/charts/end-labels` on the core. Defaults to `false`.
|
|
37
|
+
*/
|
|
38
|
+
endLabels?: boolean | EndLabelOptions;
|
|
32
39
|
}
|
|
33
40
|
/**
|
|
34
41
|
* Line chart: one line per series over category labels.
|
package/dist/line.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_features = require("./features-DEDP5CEQ.cjs");
|
|
3
3
|
const require_fade = require("./fade-CRqcKMWY.cjs");
|
|
4
|
-
const require_line = require("./line-
|
|
4
|
+
const require_line = require("./line-DHbYCQy4.cjs");
|
|
5
5
|
// src/line.ts
|
|
6
6
|
/** Standalone entry: `import { line } from '@tabler/charts/line'`. */
|
|
7
7
|
require_features.register({ line: {
|
package/dist/line.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as line, t as LineOptions } from "./line-
|
|
1
|
+
import { n as line, t as LineOptions } from "./line-Cu9ctpbv.cjs";
|
|
2
2
|
export { type LineOptions, line };
|
package/dist/line.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as line, t as LineOptions } from "./line-
|
|
1
|
+
import { n as line, t as LineOptions } from "./line-TkzA7wMK.js";
|
|
2
2
|
export { type LineOptions, line };
|
package/dist/line.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as register } from "./features-B55rwpQC.js";
|
|
2
2
|
import { n as areaPath, r as linePath } from "./fade-CDrQjnDz.js";
|
|
3
|
-
export { t as line } from "./line-
|
|
3
|
+
export { t as line } from "./line-CXH0L10d.js";
|
|
4
4
|
// src/line.ts
|
|
5
5
|
/** Standalone entry: `import { line } from '@tabler/charts/line'`. */
|
|
6
6
|
register({ line: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ut as Hit, o as ChartType } from "./chart-Dz4geQZy.cjs";
|
|
2
2
|
import { c as NumberFormat } from "./time-B4oxWHQI.cjs";
|
|
3
|
-
import {
|
|
3
|
+
import { n as InsetsInput } from "./layout-CYerDebD.cjs";
|
|
4
4
|
/** The part of a map in sight. */
|
|
5
5
|
interface MapView {
|
|
6
6
|
/** The top left corner, in the coordinates of the map file. */
|
|
@@ -3,6 +3,7 @@ import { i as insets, n as estimateTextWidth, r as innerRect, s as round, t as L
|
|
|
3
3
|
import { a as isRecord, d as text, i as finite, s as list, u as records } from "./clean-CkoQobGv.js";
|
|
4
4
|
import { n as toChartPoint } from "./interaction-En1KlwFO.js";
|
|
5
5
|
import { t as h } from "./vnode-_EMUqysL.js";
|
|
6
|
+
import { n as heatScale, t as EMPTY } from "./heat-Bsqq4zw9.js";
|
|
6
7
|
// src/charts/map-view.ts
|
|
7
8
|
/**
|
|
8
9
|
* A view kept inside the zoom range and the map itself, so the map can never
|
|
@@ -314,7 +315,6 @@ function mapInteraction() {
|
|
|
314
315
|
const selectedOf = (options) => options.select === "multiple" ? options.selected ?? [] : options.select === "single" ? (options.selected ?? []).slice(0, 1) : [];
|
|
315
316
|
/** Share of the full color at the minimum, so the lowest value still stands out from a region without one. */
|
|
316
317
|
const FLOOR = .1;
|
|
317
|
-
const EMPTY = "var(--tc-heat-empty,var(--tc-grid-color))";
|
|
318
318
|
const MARKER = "var(--tc-map-marker-color,var(--tc-color-1))";
|
|
319
319
|
/** Slices of the scale's bar: enough to read as one smooth gradient. */
|
|
320
320
|
const SCALE_STEPS = 24;
|
|
@@ -464,30 +464,7 @@ function renderMap(options, ctx) {
|
|
|
464
464
|
const hi = finite(options.max) ?? (valued ? dataMax : 1);
|
|
465
465
|
const stops = options.colors && options.colors.length >= 2 ? options.colors : void 0;
|
|
466
466
|
const mid = finite(options.mid);
|
|
467
|
-
|
|
468
|
-
const position = (v) => {
|
|
469
|
-
const t = stops && mid !== null && lo < mid && mid < hi ? v <= mid ? (v - lo) / (mid - lo) * .5 : .5 + (v - mid) / (hi - mid) * .5 : hi > lo ? (v - lo) / (hi - lo) : v > lo ? 1 : 0;
|
|
470
|
-
return Math.min(1, Math.max(0, t));
|
|
471
|
-
};
|
|
472
|
-
/** How a region at position `t` of the scale is painted: its style and the tooltip swatch. */
|
|
473
|
-
const paint = (t) => {
|
|
474
|
-
if (stops) {
|
|
475
|
-
const at = t * (stops.length - 1);
|
|
476
|
-
const k = Math.min(stops.length - 2, Math.floor(at));
|
|
477
|
-
const u = round((at - k) * 100);
|
|
478
|
-
const from = stops[k];
|
|
479
|
-
const color = u <= 0 ? from : u >= 100 ? stops[k + 1] : `color-mix(in oklab,${stops[k + 1]} ${u}%,${from})`;
|
|
480
|
-
return {
|
|
481
|
-
style: { "--tc-cell-fill": color },
|
|
482
|
-
color
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
const pct = round((FLOOR + .9 * t) * 100);
|
|
486
|
-
return {
|
|
487
|
-
style: `--tc-heat:${pct}%`,
|
|
488
|
-
color: `color-mix(in oklab,var(--tc-heat-color,var(--tc-color-1)) ${pct}%,${EMPTY})`
|
|
489
|
-
};
|
|
490
|
-
};
|
|
467
|
+
const { position, paint } = heatScale(lo, hi, mid, stops, FLOOR);
|
|
491
468
|
const pad = insets(options.padding, 0);
|
|
492
469
|
const scale = options.scale !== false && valued > 0;
|
|
493
470
|
const scaleHeight = scale ? Math.ceil(fontSize * LINE_HEIGHT) + 8 : 0;
|
|
@@ -804,4 +781,4 @@ const map = {
|
|
|
804
781
|
};
|
|
805
782
|
export { map as n, addMap as t };
|
|
806
783
|
|
|
807
|
-
//# sourceMappingURL=map-
|
|
784
|
+
//# sourceMappingURL=map-CYp6x-uS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-CYp6x-uS.js","names":[],"sources":["../src/charts/map-view.ts","../src/plugins/map.ts","../src/charts/map.ts"],"sourcesContent":["import { finite } from './clean.ts'\n\n/** The part of a map in sight. */\nexport interface MapView {\n /** The top left corner, in the coordinates of the map file. */\n x: number\n y: number\n /** How many times the map is magnified; `1` shows all of it. */\n scale: number\n}\n\n/** Where the last render put the map, for the zoom to work from. */\nexport interface MapLayout {\n /** The room of the map in chart pixels. */\n x: number\n y: number\n width: number\n height: number\n /** Pixels per unit of the map when all of it is in sight. */\n k: number\n /** Size of the map file. */\n mapWidth: number\n mapHeight: number\n /** The most the map can be magnified. */\n max: number\n}\n\n/**\n * A view kept inside the zoom range and the map itself, so the map can never\n * be dragged out of sight; along a side where all of the map fits, it is centered.\n */\nexport function fitView(view: Partial<MapView> | undefined, layout: MapLayout): MapView {\n const scale = Math.min(layout.max, Math.max(1, finite(view?.scale) ?? 1))\n const unit = layout.k * scale\n const fit = (at: number | null, size: number, room: number): number => {\n const span = room / unit\n return span >= size ? (size - span) / 2 : Math.min(size - span, Math.max(0, at ?? 0))\n }\n return unit > 0\n ? {\n x: fit(finite(view?.x), layout.mapWidth, layout.width),\n y: fit(finite(view?.y), layout.mapHeight, layout.height),\n scale,\n }\n : { x: 0, y: 0, scale }\n}\n","import type { MapHit, MapInteraction, MapOptions } from '../charts/map.ts'\nimport { fitView, type MapView } from '../charts/map-view.ts'\nimport { toChartPoint } from '../interaction.ts'\nimport type { ChartPlugin } from '../plugin.ts'\n\ntype Point = [number, number]\n\n/** One step of a button, a key or a double click. */\nconst ZOOM_STEP = 2\nconst ZOOM_DURATION = 200\n/**\n * How much one unit of wheel movement magnifies. A pinch on a trackpad comes\n * as a wheel event with `ctrlKey` and much smaller numbers.\n */\nconst WHEEL_SPEED = 0.002\nconst WHEEL_SPEED_PINCH = 0.01\n/** How far a pointer has to move, in pixels, before a press becomes a drag and stops being a click. */\nconst DRAG_THRESHOLD = 4\nconst SVG_NS = 'http://www.w3.org/2000/svg'\nconst ICONS = ['M12 5v14M5 12h14', 'M5 12h14']\n\n/**\n * What makes a map more than a picture: with `zoom` it is magnified with its\n * buttons, the wheel, a double click, a pinch or the `+`, `-` and `0` keys,\n * and dragged around; with `select` a click (or Enter) selects a region. The\n * `map` chart type brings it along, so it needs no import of its own; it\n * keeps no state, the view and the selection live in the options.\n */\nexport function mapInteraction(): ChartPlugin {\n return {\n name: 'map',\n install(chart) {\n const host = chart.element\n if (typeof host.addEventListener !== 'function') return {}\n const doc = host.ownerDocument\n const win = doc.defaultView\n const options = () => chart.config as unknown as MapOptions & { animate?: boolean }\n const isMap = () => chart.config.type.name === 'map'\n const zoomOn = () => isMap() && !!options().zoom\n const layout = () => (chart.interaction as Partial<MapInteraction> | undefined)?.map\n const svg = () => host.querySelector(':scope > svg.tc-chart')\n /** Whether an event happened on the drawing, not on a control over it. */\n const onMap = (event: Event) =>\n (event.target as Element | null)?.closest?.('svg.tc-chart') === svg() && !!svg()\n\n let frame = 0\n /** Pointers that are down on the map, with where each was last seen. */\n const pointers = new Map<number, Point>()\n /** Whether the pointers that are down have moved the map: the click that ends a drag selects nothing. */\n let dragged = false\n let controls: HTMLElement | undefined\n const addedClass = !host.classList.contains('tc-container')\n\n const stop = () => win?.cancelAnimationFrame(frame)\n const current = (): MapView | undefined => {\n const l = layout()\n return l && fitView(options().view, l)\n }\n const setView = (view: MapView) => {\n const l = layout()\n if (l) chart.update({ view: fitView(view, l) } as never)\n }\n\n /** A point of the screen in chart pixels. */\n const toChart = (x: number, y: number): Point => {\n const el = svg()\n const { width, height } = chart.size\n const p = el ? toChartPoint(el, x, y, width, height) : { x: 0, y: 0 }\n return [p.x, p.y]\n }\n /** A point of the screen in the coordinates of the map. */\n const toMapPoint = (x: number, y: number): Point | null => {\n const l = layout()\n const view = current()\n if (!l || !view) return null\n const unit = l.k * view.scale\n const [cx, cy] = toChart(x, y)\n return [view.x + (cx - l.x) / unit, view.y + (cy - l.y) / unit]\n }\n\n /**\n * Moves to a view over a few frames. The corner and the size of the\n * view change at the same pace, which keeps the point being zoomed at in place.\n */\n const animateTo = (to: MapView) => {\n stop()\n const l = layout()\n const from = current()\n if (!l || !from) return\n const target = fitView(to, l)\n const still =\n options().animate === false ||\n !win?.requestAnimationFrame ||\n win.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n if (still) {\n setView(target)\n return\n }\n const start = performance.now()\n const step = (now: number) => {\n const t = Math.min((now - start) / ZOOM_DURATION, 1)\n const eased = 1 - (1 - t) ** 3\n const at = (a: number, b: number) => a + (b - a) * eased\n setView({\n x: at(from.x, target.x),\n y: at(from.y, target.y),\n scale: 1 / at(1 / from.scale, 1 / target.scale),\n })\n if (t < 1) frame = win.requestAnimationFrame(step)\n }\n frame = win.requestAnimationFrame(step)\n }\n\n /**\n * Magnifies by a factor around a point of the map, which stays where it\n * is on the screen. Without a point, around the middle of the view.\n */\n const zoomBy = (factor: number, anchor: Point | null, animate = false) => {\n const l = layout()\n const view = current()\n if (!l || !view || !(l.k > 0)) return\n const next = Math.min(l.max, Math.max(1, view.scale * factor))\n const unit = l.k * view.scale\n const [ax, ay] = anchor ?? [view.x + l.width / unit / 2, view.y + l.height / unit / 2]\n const target = {\n x: ax - ((ax - view.x) * view.scale) / next,\n y: ay - ((ay - view.y) * view.scale) / next,\n scale: next,\n }\n if (animate) animateTo(target)\n else {\n stop()\n setView(target)\n }\n }\n\n /** Selects the region of a hit, or takes it out when it is selected. */\n const select = (hit: MapHit | null) => {\n const o = options()\n const code = hit?.region\n if (!isMap() || !o.select || !code) return\n const selected = [...(o.selected ?? [])]\n const rest = selected.filter((other) => other !== code)\n const next =\n rest.length < selected.length\n ? rest\n : o.select === 'multiple'\n ? [...selected, code]\n : [code]\n chart.update({ selected: next } as never)\n o.onSelect?.(next, code)\n }\n\n const onPointerEnd = (event: PointerEvent) => {\n pointers.delete(event.pointerId)\n if (pointers.size === 0) {\n doc.removeEventListener('pointerup', onPointerEnd)\n doc.removeEventListener('pointercancel', onPointerEnd)\n // The cursor of a drag goes with the next render.\n if (dragged) chart.update({})\n }\n }\n const onPointerDown = (event: PointerEvent) => {\n if (!zoomOn() || !onMap(event) || (event.pointerType === 'mouse' && event.button !== 0))\n return\n if (pointers.size === 0) dragged = false\n pointers.set(event.pointerId, [event.clientX, event.clientY])\n stop()\n doc.addEventListener('pointerup', onPointerEnd)\n doc.addEventListener('pointercancel', onPointerEnd)\n }\n /** One pointer drags the map, two pinch it. */\n const onPointerMove = (event: PointerEvent) => {\n const previous = pointers.get(event.pointerId)\n const view = current()\n const l = layout()\n if (!previous || !view || !l) return\n const now: Point = [event.clientX, event.clientY]\n // A press that barely moves is a click, not a drag: until the pointer\n // has moved far enough the map stays put, and the click reaches the region.\n if (!dragged) {\n if (\n pointers.size === 1 &&\n Math.hypot(now[0] - previous[0], now[1] - previous[1]) < DRAG_THRESHOLD\n )\n return\n dragged = true\n // The map keeps getting the moves of this pointer when it leaves the\n // map. Capturing throws for a pointer the browser does not know,\n // which is what an event made in a script has.\n try {\n svg()?.setPointerCapture(event.pointerId)\n } catch {\n // The drag still works while the pointer stays over the map.\n }\n }\n // The highlight and the tooltip stay out of a drag.\n event.stopPropagation()\n chart.clearHighlight()\n pointers.set(event.pointerId, now)\n if (pointers.size === 1) {\n const unit = l.k * view.scale\n const [x0, y0] = toChart(previous[0], previous[1])\n const [x1, y1] = toChart(now[0], now[1])\n setView({ x: view.x - (x1 - x0) / unit, y: view.y - (y1 - y0) / unit, scale: view.scale })\n return\n }\n const other = [...pointers].find(([id]) => id !== event.pointerId)?.[1]\n if (!other) return\n const before = Math.hypot(previous[0] - other[0], previous[1] - other[1])\n const after = Math.hypot(now[0] - other[0], now[1] - other[1])\n if (before > 0 && after > 0)\n zoomBy(after / before, toMapPoint((now[0] + other[0]) / 2, (now[1] + other[1]) / 2))\n }\n const onWheel = (event: WheelEvent) => {\n const { zoom } = options()\n if (!zoomOn() || (typeof zoom === 'object' && zoom.wheel === false) || !onMap(event)) return\n // The page must not scroll while the wheel zooms the map.\n event.preventDefault()\n zoomBy(\n Math.exp(-event.deltaY * (event.ctrlKey ? WHEEL_SPEED_PINCH : WHEEL_SPEED)),\n toMapPoint(event.clientX, event.clientY),\n )\n }\n const onDoubleClick = (event: MouseEvent) => {\n if (zoomOn() && onMap(event))\n zoomBy(ZOOM_STEP, toMapPoint(event.clientX, event.clientY), true)\n }\n /** The click that ends a drag is not a click on the map. */\n const onClickCapture = (event: MouseEvent) => {\n if (dragged) event.stopPropagation()\n dragged = false\n }\n const onKey = (event: KeyboardEvent) => {\n if (event.target !== svg() || !isMap()) return\n const { key } = event\n if (zoomOn() && (key === '+' || key === '=')) zoomBy(ZOOM_STEP, null, true)\n else if (zoomOn() && key === '-') zoomBy(1 / ZOOM_STEP, null, true)\n else if (zoomOn() && key === '0') animateTo({ x: 0, y: 0, scale: 1 })\n else if (options().select && (key === 'Enter' || key === ' ') && chart.active)\n select(chart.active)\n else return\n event.preventDefault()\n }\n const onControl = (event: MouseEvent) => {\n const button = (event.target as Element).closest('button')\n if (button) zoomBy(button.value === 'in' ? ZOOM_STEP : 1 / ZOOM_STEP, null, true)\n }\n\n // Moves are taken on their way down, so a drag never reaches the highlight.\n host.addEventListener('pointermove', onPointerMove, true)\n host.addEventListener('click', onClickCapture, true)\n host.addEventListener('pointerdown', onPointerDown)\n // (Not passive: the wheel must be kept from scrolling the page.)\n host.addEventListener('wheel', onWheel, { passive: false })\n host.addEventListener('dblclick', onDoubleClick)\n host.addEventListener('keydown', onKey)\n const off = chart.on('click', ({ hit }) => select(hit))\n\n /** The zoom buttons, laid over a corner of the map. */\n const renderControls = () => {\n if (!zoomOn()) {\n controls?.remove()\n controls = undefined\n return\n }\n if (!controls) {\n controls = doc.createElement('div')\n controls.className = 'tc-map-zoom'\n for (const [i, d] of ICONS.entries()) {\n const button = doc.createElement('button')\n button.type = 'button'\n button.className = 'tc-download-toggle'\n button.value = i ? 'out' : 'in'\n const icon = doc.createElementNS(SVG_NS, 'svg')\n icon.setAttribute('viewBox', '0 0 24 24')\n icon.setAttribute('width', '16')\n icon.setAttribute('height', '16')\n icon.setAttribute('aria-hidden', 'true')\n const path = doc.createElementNS(SVG_NS, 'path')\n path.setAttribute('d', d)\n icon.append(path)\n button.append(icon)\n controls.append(button)\n }\n controls.addEventListener('click', onControl)\n host.classList.add('tc-container')\n }\n if (!controls.isConnected) host.append(controls)\n const { zoom } = options()\n const labels = typeof zoom === 'object' ? zoom.labels : undefined\n const view = current()\n const max = layout()?.max ?? 1\n const [zoomIn, zoomOut] = controls.querySelectorAll('button')\n if (zoomIn && zoomOut && view) {\n zoomIn.setAttribute('aria-label', labels?.in ?? 'Zoom in')\n zoomOut.setAttribute('aria-label', labels?.out ?? 'Zoom out')\n zoomIn.disabled = view.scale >= max\n zoomOut.disabled = view.scale <= 1\n }\n }\n\n return {\n // The stylesheet takes drags and pinches for a map that can be\n // magnified, so the page does not scroll or zoom under the finger.\n svgAttrs: () =>\n zoomOn() ? { 'data-zoom': dragged && pointers.size ? 'drag' : '' } : undefined,\n afterRender: renderControls,\n destroy() {\n stop()\n off()\n host.removeEventListener('pointermove', onPointerMove, true)\n host.removeEventListener('click', onClickCapture, true)\n host.removeEventListener('pointerdown', onPointerDown)\n host.removeEventListener('wheel', onWheel)\n host.removeEventListener('dblclick', onDoubleClick)\n host.removeEventListener('keydown', onKey)\n doc.removeEventListener('pointerup', onPointerEnd)\n doc.removeEventListener('pointercancel', onPointerEnd)\n controls?.remove()\n if (controls && addedClass) host.classList.remove('tc-container')\n },\n }\n },\n }\n}\n","import type { ChartType, DataTable, RenderContext, RenderResult, TableContext } from '../chart.ts'\nimport { formatNumber, type NumberFormat } from '../format.ts'\nimport type { Hit, Interaction } from '../interaction.ts'\nimport {\n estimateTextWidth,\n type InsetsInput,\n innerRect,\n insets,\n LINE_HEIGHT,\n round,\n} from '../layout.ts'\nimport { mapInteraction } from '../plugins/map.ts'\nimport { h, type VNode } from '../vnode.ts'\nimport { finite, isRecord, list, records, text } from './clean.ts'\nimport { EMPTY, heatScale } from './heat.ts'\nimport { fitView, type MapLayout, type MapView } from './map-view.ts'\n\nexport type { MapLayout, MapView }\n\n/** One region of a map (a country, a state …). */\nexport interface MapRegion {\n name: string\n /**\n * SVG path data in the coordinates of the map (`M`, `L`, `H`, `V` and `Z`,\n * absolute or relative; curves are drawn but not hit by the pointer).\n */\n path: string\n /** Too small for a shape at the scale of the map: `path` is a single point, drawn as a dot when it has a value. */\n point?: boolean\n}\n\n/** A map: shapes already projected into a `width` × `height` box, as the files in `@tabler/charts/maps/*` are. */\nexport interface MapData {\n width: number\n height: number\n /** How the shapes were projected, to place a marker by its coordinates. */\n projection?: { type: 'miller'; scale: number; translate: readonly number[] }\n /** Regions by their code, e.g. ISO 3166-1 alpha-2 for countries. */\n regions: Readonly<Record<string, MapRegion>>\n}\n\n/** A place on the map, by its coordinates. */\nexport interface MapMarker {\n /** Shown in the tooltip, and what a line refers to. */\n name?: string\n /** Latitude and longitude in degrees. */\n lat: number\n lng: number\n}\n\n/** A curve between two markers, by their names. */\nexport interface MapLine {\n from: string\n to: string\n}\n\nexport interface MapOptions {\n /** The map: a map file (`import { world } from '@tabler/charts/maps/world'`), or the name it was given with `addMap()`. */\n map: MapData | string\n /** A value per region code, e.g. `{ PL: 80, DE: 45 }`. Regions without one keep the empty shade. */\n data: Readonly<Record<string, number | null>>\n /** Value shown with the lightest shade (or the first color). Defaults to the smaller of `0` and the data minimum. */\n min?: number\n /** Value shown with the full color (or the last color). Defaults to the data maximum. */\n max?: number\n /**\n * A continuous scale through two or more colors (any CSS color, including\n * `var(--tc-…)`), from `min` to `max`, instead of one hue (`--tc-heat-color`).\n * Values that could inject CSS are ignored, as for series colors.\n */\n colors?: readonly string[]\n /** Value placed on the middle color of `colors` (e.g. `0` for changes). Defaults to halfway. */\n mid?: number\n /** Places drawn as dots over the map. */\n markers?: readonly MapMarker[]\n /** Dashed curves between markers. */\n lines?: readonly MapLine[]\n /** Radius of the markers and of the regions drawn as a dot, in pixels. Defaults to `4`. */\n markerRadius?: number\n /** Format of the values (tooltip, scale, table). */\n format?: NumberFormat\n /**\n * The bar below the map with the lowest and the highest value: `false`\n * hides it, an object names its ends instead of the values.\n */\n scale?: boolean | { low?: string; high?: string }\n /** Extra space around the map, in pixels. */\n padding?: InsetsInput\n /**\n * Let the map be magnified with its buttons, the wheel, a double click, a\n * pinch or the `+` and `-` keys, and dragged around. An object sets the\n * most it magnifies (`max`, `8` by default), turns the wheel off\n * (`wheel: false`) and names the buttons (`labels`).\n */\n zoom?: boolean | { max?: number; wheel?: boolean; labels?: { in?: string; out?: string } }\n /**\n * The part of the map in sight. Zooming and dragging write it; set it\n * yourself to start on a part of the map, leave it out for the whole map.\n */\n view?: Partial<MapView>\n /**\n * Let regions be selected with a click (or Enter on the region the\n * keyboard is on): one at a time, or any number of them. A click on a\n * selected region takes it out again.\n */\n select?: 'single' | 'multiple'\n /** Codes of the selected regions. Selecting writes it; `onSelect` hears of it. */\n selected?: readonly string[]\n /** Called when a click or a key changes the selection, with the codes now selected and the one that changed. */\n onSelect?: (selected: string[], code: string) => void\n}\n\n/** A hit of a map: what it is on. */\nexport interface MapHit extends Hit {\n /** Code of the region, for a hit on a region. */\n region?: string\n /** Name of the marker, for a hit on a marker. */\n marker?: string\n}\n\n/** The interaction of a map, with where the map was drawn. */\nexport interface MapInteraction extends Interaction {\n map: MapLayout\n}\n\n/** The selected regions of the options that are allowed: one when only one can be selected. */\nexport const selectedOf = (options: MapOptions): readonly string[] =>\n options.select === 'multiple'\n ? (options.selected ?? [])\n : options.select === 'single'\n ? (options.selected ?? []).slice(0, 1)\n : []\n\n/** Share of the full color at the minimum, so the lowest value still stands out from a region without one. */\nconst FLOOR = 0.1\nconst MARKER = 'var(--tc-map-marker-color,var(--tc-color-1))'\n/** Slices of the scale's bar: enough to read as one smooth gradient. */\nconst SCALE_STEPS = 24\nconst SCALE_STEP = 5\nconst SCALE_HEIGHT = 8\n/** How far a line bends away from the straight one, as a share of its length. */\nconst LINE_CURVE = 0.2\nconst RADIANS = Math.PI / 180\n\nconst maps: Record<string, MapData> = {}\n\n/** Register a map under a name, so `map: 'world'` finds it (configs from JSON, `<tabler-chart>`, the data API). */\nexport function addMap(name: string, data: MapData): void {\n maps[name] = data\n}\n\nconst isMap = (v: unknown): v is MapData =>\n isRecord(v) && isRecord(v.regions) && (finite(v.width) ?? 0) > 0 && (finite(v.height) ?? 0) > 0\n\n/** A region ready to draw and to hit: its rings as flat `x, y` lists in map coordinates. */\ninterface Shape {\n code: string\n name: string\n path: string\n point: boolean\n rings: number[][]\n /** Bounds of the shape: left, top, right, bottom. */\n box: [number, number, number, number]\n /** Middle of the largest ring (the mainland), where the keyboard's tooltip sits. */\n x: number\n y: number\n}\n\n/** Rings of path data made of moves and straight lines. */\nfunction parsePath(d: string): number[][] {\n const rings: number[][] = []\n let ring: number[] = []\n let x = 0\n let y = 0\n for (const [, command = '', args = ''] of d.matchAll(/([MLHVZ])([^MLHVZ]*)/gi)) {\n const n = (args.match(/-?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[-+]?\\d+)?/gi) ?? []).map(Number)\n const relative = command >= 'a'\n const type = command.toUpperCase()\n if (type === 'Z') {\n if (ring.length) {\n x = ring[0] as number\n y = ring[1] as number\n }\n continue\n }\n const step = type === 'H' || type === 'V' ? 1 : 2\n for (let i = 0; i + step <= n.length; i += step) {\n const a = n[i] as number\n const b = n[i + 1] as number\n if (type === 'H') x = relative ? x + a : a\n else if (type === 'V') y = relative ? y + a : a\n else {\n x = relative ? x + a : a\n y = relative ? y + b : b\n }\n // A move starts a ring; the pairs after its first are lines.\n if (type === 'M' && i === 0) {\n ring = []\n rings.push(ring)\n }\n ring.push(x, y)\n }\n }\n return rings\n}\n\nconst parsed = new WeakMap<MapData, Map<string, Shape>>()\n\n/** The regions of a map, parsed once per map file. */\nfunction shapesOf(map: MapData): Map<string, Shape> {\n let shapes = parsed.get(map)\n if (shapes) return shapes\n shapes = new Map()\n for (const [code, region] of Object.entries(map.regions)) {\n if (!isRecord(region) || typeof region.path !== 'string') continue\n const rings = parsePath(region.path).filter((ring) => ring.every(Number.isFinite))\n const box: Shape['box'] = [\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n ]\n let x = 0\n let y = 0\n let largest = -1\n for (const ring of rings) {\n let x0 = Number.POSITIVE_INFINITY\n let y0 = Number.POSITIVE_INFINITY\n let x1 = Number.NEGATIVE_INFINITY\n let y1 = Number.NEGATIVE_INFINITY\n for (let i = 0; i < ring.length; i += 2) {\n x0 = Math.min(x0, ring[i] as number)\n x1 = Math.max(x1, ring[i] as number)\n y0 = Math.min(y0, ring[i + 1] as number)\n y1 = Math.max(y1, ring[i + 1] as number)\n }\n box[0] = Math.min(box[0], x0)\n box[1] = Math.min(box[1], y0)\n box[2] = Math.max(box[2], x1)\n box[3] = Math.max(box[3], y1)\n const size = (x1 - x0) * (y1 - y0)\n if (size > largest) {\n largest = size\n x = (x0 + x1) / 2\n y = (y0 + y1) / 2\n }\n }\n if (largest < 0) continue\n shapes.set(code, {\n code,\n name: text(region.name) || code,\n path: region.path,\n point: region.point === true,\n rings,\n box,\n x,\n y,\n })\n }\n parsed.set(map, shapes)\n return shapes\n}\n\n/** Whether a point lies inside the rings (even-odd, so a hole is outside). */\nfunction inside(rings: readonly number[][], x: number, y: number): boolean {\n let hit = false\n for (const ring of rings) {\n for (let i = 0, j = ring.length - 2; i < ring.length; j = i, i += 2) {\n const xi = ring[i] as number\n const yi = ring[i + 1] as number\n const xj = ring[j] as number\n const yj = ring[j + 1] as number\n if (yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi) hit = !hit\n }\n }\n return hit\n}\n\n/** Path of a circle, for the ring around a hovered dot. */\nconst circlePath = (x: number, y: number, r: number): string =>\n `M${round(x - r)} ${round(y)}a${r} ${r} 0 1 0 ${r * 2} 0a${r} ${r} 0 1 0 ${-r * 2} 0Z`\n\n/** What the pointer and the keyboard can land on. */\ninterface Entry {\n shape?: Shape\n marker?: { name: string; x: number; y: number }\n value: number | null\n}\n\nfunction renderMap(options: MapOptions, ctx: RenderContext): RenderResult {\n const { width, height, fontSize, locale } = ctx\n if (typeof options.map === 'string' && !maps[options.map]) {\n throw new Error(\n `[tabler-charts] Map \"${options.map}\" is not registered. Import it (e.g. from '@tabler/charts/maps/world') and call addMap('${options.map}', data).`,\n )\n }\n const map = typeof options.map === 'string' ? maps[options.map] : options.map\n if (!isMap(map)) return { content: null }\n const shapes = shapesOf(map)\n const data = options.data ?? {}\n const value = formatNumber(options.format, locale)\n const radius = Math.max(0, finite(options.markerRadius) ?? 4)\n\n // Regions with a value, in the order of the data (the order the keyboard walks).\n const entries: Entry[] = []\n const indexOf = new Map<Shape, number>()\n let dataMin = Number.POSITIVE_INFINITY\n let dataMax = Number.NEGATIVE_INFINITY\n for (const code of Object.keys(data)) {\n const shape = shapes.get(code)\n const v = finite(data[code])\n if (!shape || v === null) continue\n indexOf.set(shape, entries.length)\n entries.push({ shape, value: v })\n if (v < dataMin) dataMin = v\n if (v > dataMax) dataMax = v\n }\n const valued = entries.length\n\n // Color domain and the scale of colors.\n const lo = finite(options.min) ?? (valued ? Math.min(0, dataMin) : 0)\n const hi = finite(options.max) ?? (valued ? dataMax : 1)\n const stops = options.colors && options.colors.length >= 2 ? options.colors : undefined\n const mid = finite(options.mid)\n const { position, paint } = heatScale(lo, hi, mid, stops, FLOOR)\n\n // The map keeps its proportions, centered in the room above the scale.\n const pad = insets(options.padding, 0)\n const scale = options.scale !== false && valued > 0\n const scaleHeight = scale ? Math.ceil(fontSize * LINE_HEIGHT) + 8 : 0\n const area = innerRect(width, height, { ...pad, bottom: pad.bottom + scaleHeight })\n const zoom = typeof options.zoom === 'object' ? options.zoom : {}\n const layout: MapLayout = {\n ...area,\n k: Math.max(0, Math.min(area.width / map.width, area.height / map.height)),\n mapWidth: map.width,\n mapHeight: map.height,\n max: Math.max(1, finite(zoom.max) ?? 8),\n }\n const view = fitView(options.view, layout)\n // (`k` is pixels per unit of the map as it is drawn, magnified by the view.)\n const k = Math.round(layout.k * view.scale * 1e4) / 1e4\n const tx = round(area.x - view.x * k)\n const ty = round(area.y - view.y * k)\n const px = (x: number) => tx + x * k\n const py = (y: number) => ty + y * k\n // A magnified map is cut at the edges of its room.\n const clipped = view.scale > 1\n const selected = new Set(selectedOf(options))\n\n // Markers, placed with the projection the map file was made with.\n const { projection } = map\n const project =\n isRecord(projection) &&\n finite(projection.scale) !== null &&\n Array.isArray(projection.translate) &&\n projection.translate.slice(0, 2).every((n) => finite(n) !== null)\n ? (lng: number, lat: number): [number, number] => [\n px(lng * RADIANS * projection.scale + (projection.translate[0] as number)),\n py(\n (projection.translate[1] as number) -\n 1.25 * Math.log(Math.tan(Math.PI / 4 + 0.4 * lat * RADIANS)) * projection.scale,\n ),\n ]\n : undefined\n const markers: NonNullable<Entry['marker']>[] = []\n if (project && k > 0) {\n for (const marker of options.markers ?? []) {\n const [x, y] = project(marker.lng, marker.lat)\n if (Number.isFinite(x) && Number.isFinite(y)) markers.push({ name: marker.name ?? '', x, y })\n }\n }\n const firstMarker = entries.length\n for (const marker of markers) entries.push({ marker, value: null })\n // Regions without a value are not walked by the keyboard, but still name themselves on hover.\n const count = entries.length\n for (const shape of shapes.values()) {\n if (shape.point || indexOf.has(shape)) continue\n indexOf.set(shape, entries.length)\n entries.push({ shape, value: null })\n }\n\n const hitAt = (i: number): MapHit | null => {\n const entry = entries[i]\n if (!entry) return null\n const { shape, marker } = entry\n const dot = marker ?? (shape?.point ? { x: px(shape.x), y: py(shape.y) } : undefined)\n const x = dot?.x ?? px(shape?.x ?? 0)\n const y = dot?.y ?? py(shape?.y ?? 0)\n const name = marker?.name ?? shape?.name ?? ''\n const v = entry.value\n return {\n index: i,\n label: shape?.code ?? name,\n ...(shape ? { region: shape.code } : { marker: name }),\n // One row, \"■ Poland 80\": a region without a value and a marker only name themselves.\n title: '',\n x,\n area,\n items: [\n {\n name,\n seriesIndex: 0,\n value: v,\n text: v === null ? '' : value(v),\n x,\n y,\n color: marker ? MARKER : v === null ? EMPTY : paint(position(v)).color,\n },\n ],\n highlight: {\n kind: 'halo',\n d: dot\n ? circlePath(dot.x, dot.y, radius + 3)\n : (shape?.rings ?? [])\n .map((ring) => {\n let d = ''\n for (let p = 0; p < ring.length; p += 2)\n d += `${p ? 'L' : 'M'}${Math.round(px(ring[p] as number) * 10) / 10} ${Math.round(py(ring[p + 1] as number) * 10) / 10}`\n return `${d}Z`\n })\n .join(''),\n },\n }\n }\n\n const interaction: MapInteraction = {\n count,\n map: layout,\n hitIndex: hitAt,\n hitTest(x, y) {\n if (!(k > 0)) return null\n if (x < area.x || x > area.x + area.width || y < area.y || y > area.y + area.height)\n return null\n const near = (dot: { x: number; y: number }) => Math.hypot(dot.x - x, dot.y - y) <= radius + 4\n // What is drawn on top is hit first: markers, then dots, then shapes.\n for (let i = count - 1; i >= firstMarker; i--)\n if (near(entries[i]?.marker as { x: number; y: number })) return hitAt(i)\n for (let i = 0; i < valued; i++) {\n const shape = entries[i]?.shape as Shape\n if (shape.point && near({ x: px(shape.x), y: py(shape.y) })) return hitAt(i)\n }\n const mx = (x - tx) / k\n const my = (y - ty) / k\n for (const [shape, i] of indexOf) {\n const [x0, y0, x1, y1] = shape.box\n if (shape.point || mx < x0 || mx > x1 || my < y0 || my > y1) continue\n if (inside(shape.rings, mx, my)) return hitAt(i)\n }\n return null\n },\n }\n const regions: VNode[] = []\n // A selected shape goes in after the others, where nothing covers its outline.\n const raised: VNode[] = []\n const points: VNode[] = []\n for (const shape of shapes.values()) {\n const i = indexOf.get(shape)\n const v = i === undefined ? null : (entries[i]?.value ?? null)\n const style = v === null ? undefined : paint(position(v)).style\n const chosen = selected.has(shape.code) && 'tc-region-selected'\n if (!shape.point) {\n ;(chosen ? raised : regions).push(\n h('path', {\n key: shape.code,\n class: ['tc-region', v === null ? 'tc-region-empty' : 'tc-cell', chosen],\n 'data-region': shape.code,\n d: shape.path,\n style,\n }),\n )\n } else if (v !== null) {\n // A country too small for a shape says nothing without a value, so only then is it drawn.\n points.push(\n h('circle', {\n key: shape.code,\n class: ['tc-region tc-region-point tc-cell', chosen],\n 'data-region': shape.code,\n cx: round(px(shape.x)),\n cy: round(py(shape.y)),\n r: radius,\n style,\n }),\n )\n }\n }\n\n // Lines go in before the markers, so the markers sit on top of their ends.\n const byName = new Map(markers.map((marker) => [marker.name, marker]))\n const lines = (options.lines ?? []).flatMap((line, i) => {\n const from = byName.get(line.from)\n const to = byName.get(line.to)\n if (!from || !to) return []\n // A curve through a point pushed sideways from the middle of the line.\n const cx = (from.x + to.x) / 2 + (to.y - from.y) * LINE_CURVE\n const cy = (from.y + to.y) / 2 - (to.x - from.x) * LINE_CURVE\n return h('path', {\n key: `${line.from}›${line.to}›${i}`,\n class: 'tc-map-line',\n d: `M${round(from.x)} ${round(from.y)}Q${round(cx)} ${round(cy)} ${round(to.x)} ${round(to.y)}`,\n })\n })\n\n // The scale, centered below the map: the lowest value, a bar of the colors, the highest.\n const scaleText = typeof options.scale === 'object' ? options.scale : {}\n const low = scaleText.low ?? value(lo)\n const high = scaleText.high ?? value(hi)\n const lowWidth = estimateTextWidth(low, fontSize)\n const barWidth = SCALE_STEPS * SCALE_STEP\n const scaleWidth = lowWidth + 8 + barWidth + 8 + estimateTextWidth(high, fontSize)\n const scaleX = Math.round(area.x + Math.max(0, (area.width - scaleWidth) / 2))\n const barX = Math.round(scaleX + lowWidth + 8)\n const scaleY = area.y + area.height + 8 + (scaleHeight - 8) / 2\n\n const selectable = options.select === 'single' || options.select === 'multiple'\n const clip = `${ctx.id}-map`\n\n const content = [\n clipped &&\n h(\n 'clipPath',\n { key: 'clip', id: clip },\n h('rect', { x: area.x, y: area.y, width: area.width, height: area.height }),\n ),\n h(\n 'g',\n {\n key: 'map',\n class: ['tc-map', selectable && 'tc-map-selectable'],\n 'clip-path': clipped ? `url(#${clip})` : undefined,\n },\n k > 0 &&\n h(\n 'g',\n {\n key: 'regions',\n class: 'tc-map-regions',\n transform: `translate(${tx} ${ty}) scale(${k})`,\n },\n regions,\n raised,\n ),\n h('g', { key: 'points', class: 'tc-map-points' }, points),\n h('g', { key: 'lines', class: 'tc-map-lines' }, lines),\n h(\n 'g',\n { key: 'markers', class: 'tc-map-markers' },\n markers.map((marker, i) =>\n h('circle', {\n key: `${marker.name}›${i}`,\n class: 'tc-map-marker',\n 'data-marker': marker.name,\n cx: round(marker.x),\n cy: round(marker.y),\n r: radius,\n }),\n ),\n ),\n ),\n scale &&\n h(\n 'g',\n // (Crisp edges: the slices of the bar meet without a seam.)\n {\n key: 'scale',\n class: 'tc-map-scale',\n 'aria-hidden': 'true',\n 'shape-rendering': 'crispEdges',\n },\n h('text', { class: 'tc-tick-label', x: scaleX, y: round(scaleY), dy: '0.32em' }, low),\n Array.from({ length: SCALE_STEPS }, (_, s) =>\n h('rect', {\n key: s,\n class: 'tc-cell',\n x: barX + s * SCALE_STEP,\n y: round(scaleY - SCALE_HEIGHT / 2),\n width: SCALE_STEP,\n height: SCALE_HEIGHT,\n style: paint(s / (SCALE_STEPS - 1)).style,\n }),\n ),\n h(\n 'text',\n { class: 'tc-tick-label', x: barX + barWidth + 8, y: round(scaleY), dy: '0.32em' },\n high,\n ),\n ),\n ]\n return { content, interaction }\n}\n\n/** Table: one row per region with a value, in the order of the data. */\nfunction mapTable(options: MapOptions, ctx: TableContext, limit: number): DataTable {\n const map = typeof options.map === 'string' ? maps[options.map] : options.map\n const shapes = isMap(map) ? shapesOf(map) : undefined\n const value = formatNumber(options.format, ctx.locale)\n const rows: string[][] = []\n for (const [code, raw] of Object.entries(options.data ?? {})) {\n const v = finite(raw)\n const shape = shapes?.get(code)\n if (shape && v !== null) rows.push([shape.name, value(v)])\n }\n return { columns: ['', 'Value'], total: rows.length, rows: rows.slice(0, limit) }\n}\n\n/** Width to height of the map with its scale at a usual size, so the map fills the chart. */\nfunction ratioOf(options: MapOptions): number | undefined {\n const map = typeof options.map === 'string' ? maps[options.map] : options.map\n if (!isMap(map)) return undefined\n const scale = options.scale !== false && Object.keys(options.data ?? {}).length > 0\n return round(600 / ((600 * map.height) / map.width + (scale ? 23 : 0)))\n}\n\n/** Values that are finite numbers, markers with real coordinates, lines and colors that are text. */\nconst cleanMap = (options: MapOptions): MapOptions => {\n const o = options as unknown as Record<string, unknown>\n const data: Record<string, number> = {}\n if (isRecord(o.data))\n for (const [code, v] of Object.entries(o.data)) {\n const n = finite(v)\n if (n !== null) data[code] = n\n }\n return {\n ...options,\n map: typeof o.map === 'string' || isMap(o.map) ? o.map : (undefined as never),\n data,\n colors: list(o.colors).filter((c): c is string => typeof c === 'string' && c.trim() !== ''),\n markers: records(o.markers, (m) => ({\n lat: finite(m.lat) as number,\n lng: finite(m.lng) as number,\n ...(typeof m.name === 'string' ? { name: m.name } : {}),\n })).filter((m) => m.lat !== null && m.lng !== null),\n lines: records(o.lines, (l) => ({ from: text(l.from), to: text(l.to) })),\n select: o.select === 'single' || o.select === 'multiple' ? o.select : undefined,\n selected: list(o.selected).filter((code): code is string => typeof code === 'string'),\n view: isRecord(o.view) ? (o.view as Partial<MapView>) : undefined,\n onSelect: typeof o.onSelect === 'function' ? (o.onSelect as MapOptions['onSelect']) : undefined,\n }\n}\n\n/**\n * Map: the regions of a map file as SVG shapes, shaded by value from the\n * empty shade to the full color (`--tc-heat-color`, the cells of the\n * heatmap) or through a scale of `colors`, with markers placed by their\n * coordinates, lines between them and a bar of the scale. The shapes come\n * projected from the map file, so no geo library ships to the browser.\n *\n * ```ts\n * import { world } from '@tabler/charts/maps/world'\n *\n * new Chart('#el', {\n * type: map,\n * map: world,\n * data: { PL: 80, DE: 45, US: 100 },\n * })\n * ```\n */\nexport const map: ChartType<MapOptions> = {\n name: 'map',\n // (The options come with the whole config: its proportions are defaulted here.)\n clean: (options) => {\n const config = cleanMap(options) as MapOptions & {\n aspectRatio?: number\n autoRatio?: number\n }\n // The ratio set here follows the map; one of your own is kept.\n if (config.aspectRatio !== undefined && config.aspectRatio !== config.autoRatio) return config\n const autoRatio = ratioOf(config)\n return { ...config, aspectRatio: autoRatio, autoRatio }\n },\n render: renderMap,\n table: mapTable,\n // Zoom, drag and selection: at work only with `zoom` or `select`.\n plugins: [mapInteraction()],\n}\n"],"mappings":";;;;;;;;;;;AA+BA,SAAgB,QAAQ,MAAoC,QAA4B;CACtF,MAAM,QAAQ,KAAK,IAAI,OAAO,KAAK,KAAK,IAAI,GAAG,OAAO,MAAM,KAAK,KAAK,CAAC,CAAC;CACxE,MAAM,OAAO,OAAO,IAAI;CACxB,MAAM,OAAO,IAAmB,MAAc,SAAyB;EACrE,MAAM,O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OAAO,EAAE,GAAG;GACjB,GAAI,OAAO,EAAE,SAAS,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;EACvD,EAAE,CAAC,CAAC,QAAQ,MAAM,EAAE,QAAQ,QAAQ,EAAE,QAAQ,IAAI;EAClD,OAAO,QAAQ,EAAE,QAAQ,OAAO;GAAE,MAAM,KAAK,EAAE,IAAI;GAAG,IAAI,KAAK,EAAE,EAAE;EAAE,EAAE;EACvE,QAAQ,EAAE,WAAW,YAAY,EAAE,WAAW,aAAa,EAAE,SAAS,KAAA;EACtE,UAAU,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,SAAyB,OAAO,SAAS,QAAQ;EACpF,MAAM,SAAS,EAAE,IAAI,IAAK,EAAE,OAA4B,KAAA;EACxD,UAAU,OAAO,EAAE,aAAa,aAAc,EAAE,WAAsC,KAAA;CACxF;AACF;;;;;;;;;;;;;;;;;;AAmBA,MAAa,MAA6B;CACxC,MAAM;CAEN,QAAQ,YAAY;EAClB,MAAM,SAAS,SAAS,OAAO;EAK/B,IAAI,OAAO,gBAAgB,KAAA,KAAa,OAAO,gBAAgB,OAAO,WAAW,OAAO;EACxF,MAAM,YAAY,QAAQ,MAAM;EAChC,OAAO;GAAE,GAAG;GAAQ,aAAa;GAAW;EAAU;CACxD;CACA,QAAQ;CACR,OAAO;CAEP,SAAS,CAAC,eAAe,CAAC;AAC5B"}
|
|
@@ -3,6 +3,7 @@ const require_layout = require("./layout-Cfg9x1k2.cjs");
|
|
|
3
3
|
const require_clean = require("./clean-Die2iCNc.cjs");
|
|
4
4
|
const require_interaction = require("./interaction-DXYSjgnP.cjs");
|
|
5
5
|
const require_vnode = require("./vnode-ClAiw28x.cjs");
|
|
6
|
+
const require_heat = require("./heat-DYsivvDq.cjs");
|
|
6
7
|
// src/charts/map-view.ts
|
|
7
8
|
/**
|
|
8
9
|
* A view kept inside the zoom range and the map itself, so the map can never
|
|
@@ -314,7 +315,6 @@ function mapInteraction() {
|
|
|
314
315
|
const selectedOf = (options) => options.select === "multiple" ? options.selected ?? [] : options.select === "single" ? (options.selected ?? []).slice(0, 1) : [];
|
|
315
316
|
/** Share of the full color at the minimum, so the lowest value still stands out from a region without one. */
|
|
316
317
|
const FLOOR = .1;
|
|
317
|
-
const EMPTY = "var(--tc-heat-empty,var(--tc-grid-color))";
|
|
318
318
|
const MARKER = "var(--tc-map-marker-color,var(--tc-color-1))";
|
|
319
319
|
/** Slices of the scale's bar: enough to read as one smooth gradient. */
|
|
320
320
|
const SCALE_STEPS = 24;
|
|
@@ -464,30 +464,7 @@ function renderMap(options, ctx) {
|
|
|
464
464
|
const hi = require_clean.finite(options.max) ?? (valued ? dataMax : 1);
|
|
465
465
|
const stops = options.colors && options.colors.length >= 2 ? options.colors : void 0;
|
|
466
466
|
const mid = require_clean.finite(options.mid);
|
|
467
|
-
|
|
468
|
-
const position = (v) => {
|
|
469
|
-
const t = stops && mid !== null && lo < mid && mid < hi ? v <= mid ? (v - lo) / (mid - lo) * .5 : .5 + (v - mid) / (hi - mid) * .5 : hi > lo ? (v - lo) / (hi - lo) : v > lo ? 1 : 0;
|
|
470
|
-
return Math.min(1, Math.max(0, t));
|
|
471
|
-
};
|
|
472
|
-
/** How a region at position `t` of the scale is painted: its style and the tooltip swatch. */
|
|
473
|
-
const paint = (t) => {
|
|
474
|
-
if (stops) {
|
|
475
|
-
const at = t * (stops.length - 1);
|
|
476
|
-
const k = Math.min(stops.length - 2, Math.floor(at));
|
|
477
|
-
const u = require_layout.round((at - k) * 100);
|
|
478
|
-
const from = stops[k];
|
|
479
|
-
const color = u <= 0 ? from : u >= 100 ? stops[k + 1] : `color-mix(in oklab,${stops[k + 1]} ${u}%,${from})`;
|
|
480
|
-
return {
|
|
481
|
-
style: { "--tc-cell-fill": color },
|
|
482
|
-
color
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
const pct = require_layout.round((FLOOR + .9 * t) * 100);
|
|
486
|
-
return {
|
|
487
|
-
style: `--tc-heat:${pct}%`,
|
|
488
|
-
color: `color-mix(in oklab,var(--tc-heat-color,var(--tc-color-1)) ${pct}%,${EMPTY})`
|
|
489
|
-
};
|
|
490
|
-
};
|
|
467
|
+
const { position, paint } = require_heat.heatScale(lo, hi, mid, stops, FLOOR);
|
|
491
468
|
const pad = require_layout.insets(options.padding, 0);
|
|
492
469
|
const scale = options.scale !== false && valued > 0;
|
|
493
470
|
const scaleHeight = scale ? Math.ceil(fontSize * require_layout.LINE_HEIGHT) + 8 : 0;
|
|
@@ -562,7 +539,7 @@ function renderMap(options, ctx) {
|
|
|
562
539
|
text: v === null ? "" : value(v),
|
|
563
540
|
x,
|
|
564
541
|
y,
|
|
565
|
-
color: marker ? MARKER : v === null ? EMPTY : paint(position(v)).color
|
|
542
|
+
color: marker ? MARKER : v === null ? require_heat.EMPTY : paint(position(v)).color
|
|
566
543
|
}],
|
|
567
544
|
highlight: {
|
|
568
545
|
kind: "halo",
|
|
@@ -815,4 +792,4 @@ Object.defineProperty(exports, "map", {
|
|
|
815
792
|
}
|
|
816
793
|
});
|
|
817
794
|
|
|
818
|
-
//# sourceMappingURL=map-
|
|
795
|
+
//# sourceMappingURL=map-ChwSgooH.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-ChwSgooH.cjs","names":["finite","toChartPoint","isRecord","finite","text","round","formatNumber","heatScale","insets","LINE_HEIGHT","innerRect","EMPTY","h","estimateTextWidth","list","records"],"sources":["../src/charts/map-view.ts","../src/plugins/map.ts","../src/charts/map.ts"],"sourcesContent":["import { finite } from './clean.ts'\n\n/** The part of a map in sight. */\nexport interface MapView {\n /** The top left corner, in the coordinates of the map file. */\n x: number\n y: number\n /** How many times the map is magnified; `1` shows all of it. */\n scale: number\n}\n\n/** Where the last render put the map, for the zoom to work from. */\nexport interface MapLayout {\n /** The room of the map in chart pixels. */\n x: number\n y: number\n width: number\n height: number\n /** Pixels per unit of the map when all of it is in sight. */\n k: number\n /** Size of the map file. */\n mapWidth: number\n mapHeight: number\n /** The most the map can be magnified. */\n max: number\n}\n\n/**\n * A view kept inside the zoom range and the map itself, so the map can never\n * be dragged out of sight; along a side where all of the map fits, it is centered.\n */\nexport function fitView(view: Partial<MapView> | undefined, layout: MapLayout): MapView {\n const scale = Math.min(layout.max, Math.max(1, finite(view?.scale) ?? 1))\n const unit = layout.k * scale\n const fit = (at: number | null, size: number, room: number): number => {\n const span = room / unit\n return span >= size ? (size - span) / 2 : Math.min(size - span, Math.max(0, at ?? 0))\n }\n return unit > 0\n ? {\n x: fit(finite(view?.x), layout.mapWidth, layout.width),\n y: fit(finite(view?.y), layout.mapHeight, layout.height),\n scale,\n }\n : { x: 0, y: 0, scale }\n}\n","import type { MapHit, MapInteraction, MapOptions } from '../charts/map.ts'\nimport { fitView, type MapView } from '../charts/map-view.ts'\nimport { toChartPoint } from '../interaction.ts'\nimport type { ChartPlugin } from '../plugin.ts'\n\ntype Point = [number, number]\n\n/** One step of a button, a key or a double click. */\nconst ZOOM_STEP = 2\nconst ZOOM_DURATION = 200\n/**\n * How much one unit of wheel movement magnifies. A pinch on a trackpad comes\n * as a wheel event with `ctrlKey` and much smaller numbers.\n */\nconst WHEEL_SPEED = 0.002\nconst WHEEL_SPEED_PINCH = 0.01\n/** How far a pointer has to move, in pixels, before a press becomes a drag and stops being a click. */\nconst DRAG_THRESHOLD = 4\nconst SVG_NS = 'http://www.w3.org/2000/svg'\nconst ICONS = ['M12 5v14M5 12h14', 'M5 12h14']\n\n/**\n * What makes a map more than a picture: with `zoom` it is magnified with its\n * buttons, the wheel, a double click, a pinch or the `+`, `-` and `0` keys,\n * and dragged around; with `select` a click (or Enter) selects a region. The\n * `map` chart type brings it along, so it needs no import of its own; it\n * keeps no state, the view and the selection live in the options.\n */\nexport function mapInteraction(): ChartPlugin {\n return {\n name: 'map',\n install(chart) {\n const host = chart.element\n if (typeof host.addEventListener !== 'function') return {}\n const doc = host.ownerDocument\n const win = doc.defaultView\n const options = () => chart.config as unknown as MapOptions & { animate?: boolean }\n const isMap = () => chart.config.type.name === 'map'\n const zoomOn = () => isMap() && !!options().zoom\n const layout = () => (chart.interaction as Partial<MapInteraction> | undefined)?.map\n const svg = () => host.querySelector(':scope > svg.tc-chart')\n /** Whether an event happened on the drawing, not on a control over it. */\n const onMap = (event: Event) =>\n (event.target as Element | null)?.closest?.('svg.tc-chart') === svg() && !!svg()\n\n let frame = 0\n /** Pointers that are down on the map, with where each was last seen. */\n const pointers = new Map<number, Point>()\n /** Whether the pointers that are down have moved the map: the click that ends a drag selects nothing. */\n let dragged = false\n let controls: HTMLElement | undefined\n const addedClass = !host.classList.contains('tc-container')\n\n const stop = () => win?.cancelAnimationFrame(frame)\n const current = (): MapView | undefined => {\n const l = layout()\n return l && fitView(options().view, l)\n }\n const setView = (view: MapView) => {\n const l = layout()\n if (l) chart.update({ view: fitView(view, l) } as never)\n }\n\n /** A point of the screen in chart pixels. */\n const toChart = (x: number, y: number): Point => {\n const el = svg()\n const { width, height } = chart.size\n const p = el ? toChartPoint(el, x, y, width, height) : { x: 0, y: 0 }\n return [p.x, p.y]\n }\n /** A point of the screen in the coordinates of the map. */\n const toMapPoint = (x: number, y: number): Point | null => {\n const l = layout()\n const view = current()\n if (!l || !view) return null\n const unit = l.k * view.scale\n const [cx, cy] = toChart(x, y)\n return [view.x + (cx - l.x) / unit, view.y + (cy - l.y) / unit]\n }\n\n /**\n * Moves to a view over a few frames. The corner and the size of the\n * view change at the same pace, which keeps the point being zoomed at in place.\n */\n const animateTo = (to: MapView) => {\n stop()\n const l = layout()\n const from = current()\n if (!l || !from) return\n const target = fitView(to, l)\n const still =\n options().animate === false ||\n !win?.requestAnimationFrame ||\n win.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n if (still) {\n setView(target)\n return\n }\n const start = performance.now()\n const step = (now: number) => {\n const t = Math.min((now - start) / ZOOM_DURATION, 1)\n const eased = 1 - (1 - t) ** 3\n const at = (a: number, b: number) => a + (b - a) * eased\n setView({\n x: at(from.x, target.x),\n y: at(from.y, target.y),\n scale: 1 / at(1 / from.scale, 1 / target.scale),\n })\n if (t < 1) frame = win.requestAnimationFrame(step)\n }\n frame = win.requestAnimationFrame(step)\n }\n\n /**\n * Magnifies by a factor around a point of the map, which stays where it\n * is on the screen. Without a point, around the middle of the view.\n */\n const zoomBy = (factor: number, anchor: Point | null, animate = false) => {\n const l = layout()\n const view = current()\n if (!l || !view || !(l.k > 0)) return\n const next = Math.min(l.max, Math.max(1, view.scale * factor))\n const unit = l.k * view.scale\n const [ax, ay] = anchor ?? [view.x + l.width / unit / 2, view.y + l.height / unit / 2]\n const target = {\n x: ax - ((ax - view.x) * view.scale) / next,\n y: ay - ((ay - view.y) * view.scale) / next,\n scale: next,\n }\n if (animate) animateTo(target)\n else {\n stop()\n setView(target)\n }\n }\n\n /** Selects the region of a hit, or takes it out when it is selected. */\n const select = (hit: MapHit | null) => {\n const o = options()\n const code = hit?.region\n if (!isMap() || !o.select || !code) return\n const selected = [...(o.selected ?? [])]\n const rest = selected.filter((other) => other !== code)\n const next =\n rest.length < selected.length\n ? rest\n : o.select === 'multiple'\n ? [...selected, code]\n : [code]\n chart.update({ selected: next } as never)\n o.onSelect?.(next, code)\n }\n\n const onPointerEnd = (event: PointerEvent) => {\n pointers.delete(event.pointerId)\n if (pointers.size === 0) {\n doc.removeEventListener('pointerup', onPointerEnd)\n doc.removeEventListener('pointercancel', onPointerEnd)\n // The cursor of a drag goes with the next render.\n if (dragged) chart.update({})\n }\n }\n const onPointerDown = (event: PointerEvent) => {\n if (!zoomOn() || !onMap(event) || (event.pointerType === 'mouse' && event.button !== 0))\n return\n if (pointers.size === 0) dragged = false\n pointers.set(event.pointerId, [event.clientX, event.clientY])\n stop()\n doc.addEventListener('pointerup', onPointerEnd)\n doc.addEventListener('pointercancel', onPointerEnd)\n }\n /** One pointer drags the map, two pinch it. */\n const onPointerMove = (event: PointerEvent) => {\n const previous = pointers.get(event.pointerId)\n const view = current()\n const l = layout()\n if (!previous || !view || !l) return\n const now: Point = [event.clientX, event.clientY]\n // A press that barely moves is a click, not a drag: until the pointer\n // has moved far enough the map stays put, and the click reaches the region.\n if (!dragged) {\n if (\n pointers.size === 1 &&\n Math.hypot(now[0] - previous[0], now[1] - previous[1]) < DRAG_THRESHOLD\n )\n return\n dragged = true\n // The map keeps getting the moves of this pointer when it leaves the\n // map. Capturing throws for a pointer the browser does not know,\n // which is what an event made in a script has.\n try {\n svg()?.setPointerCapture(event.pointerId)\n } catch {\n // The drag still works while the pointer stays over the map.\n }\n }\n // The highlight and the tooltip stay out of a drag.\n event.stopPropagation()\n chart.clearHighlight()\n pointers.set(event.pointerId, now)\n if (pointers.size === 1) {\n const unit = l.k * view.scale\n const [x0, y0] = toChart(previous[0], previous[1])\n const [x1, y1] = toChart(now[0], now[1])\n setView({ x: view.x - (x1 - x0) / unit, y: view.y - (y1 - y0) / unit, scale: view.scale })\n return\n }\n const other = [...pointers].find(([id]) => id !== event.pointerId)?.[1]\n if (!other) return\n const before = Math.hypot(previous[0] - other[0], previous[1] - other[1])\n const after = Math.hypot(now[0] - other[0], now[1] - other[1])\n if (before > 0 && after > 0)\n zoomBy(after / before, toMapPoint((now[0] + other[0]) / 2, (now[1] + other[1]) / 2))\n }\n const onWheel = (event: WheelEvent) => {\n const { zoom } = options()\n if (!zoomOn() || (typeof zoom === 'object' && zoom.wheel === false) || !onMap(event)) return\n // The page must not scroll while the wheel zooms the map.\n event.preventDefault()\n zoomBy(\n Math.exp(-event.deltaY * (event.ctrlKey ? WHEEL_SPEED_PINCH : WHEEL_SPEED)),\n toMapPoint(event.clientX, event.clientY),\n )\n }\n const onDoubleClick = (event: MouseEvent) => {\n if (zoomOn() && onMap(event))\n zoomBy(ZOOM_STEP, toMapPoint(event.clientX, event.clientY), true)\n }\n /** The click that ends a drag is not a click on the map. */\n const onClickCapture = (event: MouseEvent) => {\n if (dragged) event.stopPropagation()\n dragged = false\n }\n const onKey = (event: KeyboardEvent) => {\n if (event.target !== svg() || !isMap()) return\n const { key } = event\n if (zoomOn() && (key === '+' || key === '=')) zoomBy(ZOOM_STEP, null, true)\n else if (zoomOn() && key === '-') zoomBy(1 / ZOOM_STEP, null, true)\n else if (zoomOn() && key === '0') animateTo({ x: 0, y: 0, scale: 1 })\n else if (options().select && (key === 'Enter' || key === ' ') && chart.active)\n select(chart.active)\n else return\n event.preventDefault()\n }\n const onControl = (event: MouseEvent) => {\n const button = (event.target as Element).closest('button')\n if (button) zoomBy(button.value === 'in' ? ZOOM_STEP : 1 / ZOOM_STEP, null, true)\n }\n\n // Moves are taken on their way down, so a drag never reaches the highlight.\n host.addEventListener('pointermove', onPointerMove, true)\n host.addEventListener('click', onClickCapture, true)\n host.addEventListener('pointerdown', onPointerDown)\n // (Not passive: the wheel must be kept from scrolling the page.)\n host.addEventListener('wheel', onWheel, { passive: false })\n host.addEventListener('dblclick', onDoubleClick)\n host.addEventListener('keydown', onKey)\n const off = chart.on('click', ({ hit }) => select(hit))\n\n /** The zoom buttons, laid over a corner of the map. */\n const renderControls = () => {\n if (!zoomOn()) {\n controls?.remove()\n controls = undefined\n return\n }\n if (!controls) {\n controls = doc.createElement('div')\n controls.className = 'tc-map-zoom'\n for (const [i, d] of ICONS.entries()) {\n const button = doc.createElement('button')\n button.type = 'button'\n button.className = 'tc-download-toggle'\n button.value = i ? 'out' : 'in'\n const icon = doc.createElementNS(SVG_NS, 'svg')\n icon.setAttribute('viewBox', '0 0 24 24')\n icon.setAttribute('width', '16')\n icon.setAttribute('height', '16')\n icon.setAttribute('aria-hidden', 'true')\n const path = doc.createElementNS(SVG_NS, 'path')\n path.setAttribute('d', d)\n icon.append(path)\n button.append(icon)\n controls.append(button)\n }\n controls.addEventListener('click', onControl)\n host.classList.add('tc-container')\n }\n if (!controls.isConnected) host.append(controls)\n const { zoom } = options()\n const labels = typeof zoom === 'object' ? zoom.labels : undefined\n const view = current()\n const max = layout()?.max ?? 1\n const [zoomIn, zoomOut] = controls.querySelectorAll('button')\n if (zoomIn && zoomOut && view) {\n zoomIn.setAttribute('aria-label', labels?.in ?? 'Zoom in')\n zoomOut.setAttribute('aria-label', labels?.out ?? 'Zoom out')\n zoomIn.disabled = view.scale >= max\n zoomOut.disabled = view.scale <= 1\n }\n }\n\n return {\n // The stylesheet takes drags and pinches for a map that can be\n // magnified, so the page does not scroll or zoom under the finger.\n svgAttrs: () =>\n zoomOn() ? { 'data-zoom': dragged && pointers.size ? 'drag' : '' } : undefined,\n afterRender: renderControls,\n destroy() {\n stop()\n off()\n host.removeEventListener('pointermove', onPointerMove, true)\n host.removeEventListener('click', onClickCapture, true)\n host.removeEventListener('pointerdown', onPointerDown)\n host.removeEventListener('wheel', onWheel)\n host.removeEventListener('dblclick', onDoubleClick)\n host.removeEventListener('keydown', onKey)\n doc.removeEventListener('pointerup', onPointerEnd)\n doc.removeEventListener('pointercancel', onPointerEnd)\n controls?.remove()\n if (controls && addedClass) host.classList.remove('tc-container')\n },\n }\n },\n }\n}\n","import type { ChartType, DataTable, RenderContext, RenderResult, TableContext } from '../chart.ts'\nimport { formatNumber, type NumberFormat } from '../format.ts'\nimport type { Hit, Interaction } from '../interaction.ts'\nimport {\n estimateTextWidth,\n type InsetsInput,\n innerRect,\n insets,\n LINE_HEIGHT,\n round,\n} from '../layout.ts'\nimport { mapInteraction } from '../plugins/map.ts'\nimport { h, type VNode } from '../vnode.ts'\nimport { finite, isRecord, list, records, text } from './clean.ts'\nimport { EMPTY, heatScale } from './heat.ts'\nimport { fitView, type MapLayout, type MapView } from './map-view.ts'\n\nexport type { MapLayout, MapView }\n\n/** One region of a map (a country, a state …). */\nexport interface MapRegion {\n name: string\n /**\n * SVG path data in the coordinates of the map (`M`, `L`, `H`, `V` and `Z`,\n * absolute or relative; curves are drawn but not hit by the pointer).\n */\n path: string\n /** Too small for a shape at the scale of the map: `path` is a single point, drawn as a dot when it has a value. */\n point?: boolean\n}\n\n/** A map: shapes already projected into a `width` × `height` box, as the files in `@tabler/charts/maps/*` are. */\nexport interface MapData {\n width: number\n height: number\n /** How the shapes were projected, to place a marker by its coordinates. */\n projection?: { type: 'miller'; scale: number; translate: readonly number[] }\n /** Regions by their code, e.g. ISO 3166-1 alpha-2 for countries. */\n regions: Readonly<Record<string, MapRegion>>\n}\n\n/** A place on the map, by its coordinates. */\nexport interface MapMarker {\n /** Shown in the tooltip, and what a line refers to. */\n name?: string\n /** Latitude and longitude in degrees. */\n lat: number\n lng: number\n}\n\n/** A curve between two markers, by their names. */\nexport interface MapLine {\n from: string\n to: string\n}\n\nexport interface MapOptions {\n /** The map: a map file (`import { world } from '@tabler/charts/maps/world'`), or the name it was given with `addMap()`. */\n map: MapData | string\n /** A value per region code, e.g. `{ PL: 80, DE: 45 }`. Regions without one keep the empty shade. */\n data: Readonly<Record<string, number | null>>\n /** Value shown with the lightest shade (or the first color). Defaults to the smaller of `0` and the data minimum. */\n min?: number\n /** Value shown with the full color (or the last color). Defaults to the data maximum. */\n max?: number\n /**\n * A continuous scale through two or more colors (any CSS color, including\n * `var(--tc-…)`), from `min` to `max`, instead of one hue (`--tc-heat-color`).\n * Values that could inject CSS are ignored, as for series colors.\n */\n colors?: readonly string[]\n /** Value placed on the middle color of `colors` (e.g. `0` for changes). Defaults to halfway. */\n mid?: number\n /** Places drawn as dots over the map. */\n markers?: readonly MapMarker[]\n /** Dashed curves between markers. */\n lines?: readonly MapLine[]\n /** Radius of the markers and of the regions drawn as a dot, in pixels. Defaults to `4`. */\n markerRadius?: number\n /** Format of the values (tooltip, scale, table). */\n format?: NumberFormat\n /**\n * The bar below the map with the lowest and the highest value: `false`\n * hides it, an object names its ends instead of the values.\n */\n scale?: boolean | { low?: string; high?: string }\n /** Extra space around the map, in pixels. */\n padding?: InsetsInput\n /**\n * Let the map be magnified with its buttons, the wheel, a double click, a\n * pinch or the `+` and `-` keys, and dragged around. An object sets the\n * most it magnifies (`max`, `8` by default), turns the wheel off\n * (`wheel: false`) and names the buttons (`labels`).\n */\n zoom?: boolean | { max?: number; wheel?: boolean; labels?: { in?: string; out?: string } }\n /**\n * The part of the map in sight. Zooming and dragging write it; set it\n * yourself to start on a part of the map, leave it out for the whole map.\n */\n view?: Partial<MapView>\n /**\n * Let regions be selected with a click (or Enter on the region the\n * keyboard is on): one at a time, or any number of them. A click on a\n * selected region takes it out again.\n */\n select?: 'single' | 'multiple'\n /** Codes of the selected regions. Selecting writes it; `onSelect` hears of it. */\n selected?: readonly string[]\n /** Called when a click or a key changes the selection, with the codes now selected and the one that changed. */\n onSelect?: (selected: string[], code: string) => void\n}\n\n/** A hit of a map: what it is on. */\nexport interface MapHit extends Hit {\n /** Code of the region, for a hit on a region. */\n region?: string\n /** Name of the marker, for a hit on a marker. */\n marker?: string\n}\n\n/** The interaction of a map, with where the map was drawn. */\nexport interface MapInteraction extends Interaction {\n map: MapLayout\n}\n\n/** The selected regions of the options that are allowed: one when only one can be selected. */\nexport const selectedOf = (options: MapOptions): readonly string[] =>\n options.select === 'multiple'\n ? (options.selected ?? [])\n : options.select === 'single'\n ? (options.selected ?? []).slice(0, 1)\n : []\n\n/** Share of the full color at the minimum, so the lowest value still stands out from a region without one. */\nconst FLOOR = 0.1\nconst MARKER = 'var(--tc-map-marker-color,var(--tc-color-1))'\n/** Slices of the scale's bar: enough to read as one smooth gradient. */\nconst SCALE_STEPS = 24\nconst SCALE_STEP = 5\nconst SCALE_HEIGHT = 8\n/** How far a line bends away from the straight one, as a share of its length. */\nconst LINE_CURVE = 0.2\nconst RADIANS = Math.PI / 180\n\nconst maps: Record<string, MapData> = {}\n\n/** Register a map under a name, so `map: 'world'` finds it (configs from JSON, `<tabler-chart>`, the data API). */\nexport function addMap(name: string, data: MapData): void {\n maps[name] = data\n}\n\nconst isMap = (v: unknown): v is MapData =>\n isRecord(v) && isRecord(v.regions) && (finite(v.width) ?? 0) > 0 && (finite(v.height) ?? 0) > 0\n\n/** A region ready to draw and to hit: its rings as flat `x, y` lists in map coordinates. */\ninterface Shape {\n code: string\n name: string\n path: string\n point: boolean\n rings: number[][]\n /** Bounds of the shape: left, top, right, bottom. */\n box: [number, number, number, number]\n /** Middle of the largest ring (the mainland), where the keyboard's tooltip sits. */\n x: number\n y: number\n}\n\n/** Rings of path data made of moves and straight lines. */\nfunction parsePath(d: string): number[][] {\n const rings: number[][] = []\n let ring: number[] = []\n let x = 0\n let y = 0\n for (const [, command = '', args = ''] of d.matchAll(/([MLHVZ])([^MLHVZ]*)/gi)) {\n const n = (args.match(/-?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[-+]?\\d+)?/gi) ?? []).map(Number)\n const relative = command >= 'a'\n const type = command.toUpperCase()\n if (type === 'Z') {\n if (ring.length) {\n x = ring[0] as number\n y = ring[1] as number\n }\n continue\n }\n const step = type === 'H' || type === 'V' ? 1 : 2\n for (let i = 0; i + step <= n.length; i += step) {\n const a = n[i] as number\n const b = n[i + 1] as number\n if (type === 'H') x = relative ? x + a : a\n else if (type === 'V') y = relative ? y + a : a\n else {\n x = relative ? x + a : a\n y = relative ? y + b : b\n }\n // A move starts a ring; the pairs after its first are lines.\n if (type === 'M' && i === 0) {\n ring = []\n rings.push(ring)\n }\n ring.push(x, y)\n }\n }\n return rings\n}\n\nconst parsed = new WeakMap<MapData, Map<string, Shape>>()\n\n/** The regions of a map, parsed once per map file. */\nfunction shapesOf(map: MapData): Map<string, Shape> {\n let shapes = parsed.get(map)\n if (shapes) return shapes\n shapes = new Map()\n for (const [code, region] of Object.entries(map.regions)) {\n if (!isRecord(region) || typeof region.path !== 'string') continue\n const rings = parsePath(region.path).filter((ring) => ring.every(Number.isFinite))\n const box: Shape['box'] = [\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n ]\n let x = 0\n let y = 0\n let largest = -1\n for (const ring of rings) {\n let x0 = Number.POSITIVE_INFINITY\n let y0 = Number.POSITIVE_INFINITY\n let x1 = Number.NEGATIVE_INFINITY\n let y1 = Number.NEGATIVE_INFINITY\n for (let i = 0; i < ring.length; i += 2) {\n x0 = Math.min(x0, ring[i] as number)\n x1 = Math.max(x1, ring[i] as number)\n y0 = Math.min(y0, ring[i + 1] as number)\n y1 = Math.max(y1, ring[i + 1] as number)\n }\n box[0] = Math.min(box[0], x0)\n box[1] = Math.min(box[1], y0)\n box[2] = Math.max(box[2], x1)\n box[3] = Math.max(box[3], y1)\n const size = (x1 - x0) * (y1 - y0)\n if (size > largest) {\n largest = size\n x = (x0 + x1) / 2\n y = (y0 + y1) / 2\n }\n }\n if (largest < 0) continue\n shapes.set(code, {\n code,\n name: text(region.name) || code,\n path: region.path,\n point: region.point === true,\n rings,\n box,\n x,\n y,\n })\n }\n parsed.set(map, shapes)\n return shapes\n}\n\n/** Whether a point lies inside the rings (even-odd, so a hole is outside). */\nfunction inside(rings: readonly number[][], x: number, y: number): boolean {\n let hit = false\n for (const ring of rings) {\n for (let i = 0, j = ring.length - 2; i < ring.length; j = i, i += 2) {\n const xi = ring[i] as number\n const yi = ring[i + 1] as number\n const xj = ring[j] as number\n const yj = ring[j + 1] as number\n if (yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi) hit = !hit\n }\n }\n return hit\n}\n\n/** Path of a circle, for the ring around a hovered dot. */\nconst circlePath = (x: number, y: number, r: number): string =>\n `M${round(x - r)} ${round(y)}a${r} ${r} 0 1 0 ${r * 2} 0a${r} ${r} 0 1 0 ${-r * 2} 0Z`\n\n/** What the pointer and the keyboard can land on. */\ninterface Entry {\n shape?: Shape\n marker?: { name: string; x: number; y: number }\n value: number | null\n}\n\nfunction renderMap(options: MapOptions, ctx: RenderContext): RenderResult {\n const { width, height, fontSize, locale } = ctx\n if (typeof options.map === 'string' && !maps[options.map]) {\n throw new Error(\n `[tabler-charts] Map \"${options.map}\" is not registered. Import it (e.g. from '@tabler/charts/maps/world') and call addMap('${options.map}', data).`,\n )\n }\n const map = typeof options.map === 'string' ? maps[options.map] : options.map\n if (!isMap(map)) return { content: null }\n const shapes = shapesOf(map)\n const data = options.data ?? {}\n const value = formatNumber(options.format, locale)\n const radius = Math.max(0, finite(options.markerRadius) ?? 4)\n\n // Regions with a value, in the order of the data (the order the keyboard walks).\n const entries: Entry[] = []\n const indexOf = new Map<Shape, number>()\n let dataMin = Number.POSITIVE_INFINITY\n let dataMax = Number.NEGATIVE_INFINITY\n for (const code of Object.keys(data)) {\n const shape = shapes.get(code)\n const v = finite(data[code])\n if (!shape || v === null) continue\n indexOf.set(shape, entries.length)\n entries.push({ shape, value: v })\n if (v < dataMin) dataMin = v\n if (v > dataMax) dataMax = v\n }\n const valued = entries.length\n\n // Color domain and the scale of colors.\n const lo = finite(options.min) ?? (valued ? Math.min(0, dataMin) : 0)\n const hi = finite(options.max) ?? (valued ? dataMax : 1)\n const stops = options.colors && options.colors.length >= 2 ? options.colors : undefined\n const mid = finite(options.mid)\n const { position, paint } = heatScale(lo, hi, mid, stops, FLOOR)\n\n // The map keeps its proportions, centered in the room above the scale.\n const pad = insets(options.padding, 0)\n const scale = options.scale !== false && valued > 0\n const scaleHeight = scale ? Math.ceil(fontSize * LINE_HEIGHT) + 8 : 0\n const area = innerRect(width, height, { ...pad, bottom: pad.bottom + scaleHeight })\n const zoom = typeof options.zoom === 'object' ? options.zoom : {}\n const layout: MapLayout = {\n ...area,\n k: Math.max(0, Math.min(area.width / map.width, area.height / map.height)),\n mapWidth: map.width,\n mapHeight: map.height,\n max: Math.max(1, finite(zoom.max) ?? 8),\n }\n const view = fitView(options.view, layout)\n // (`k` is pixels per unit of the map as it is drawn, magnified by the view.)\n const k = Math.round(layout.k * view.scale * 1e4) / 1e4\n const tx = round(area.x - view.x * k)\n const ty = round(area.y - view.y * k)\n const px = (x: number) => tx + x * k\n const py = (y: number) => ty + y * k\n // A magnified map is cut at the edges of its room.\n const clipped = view.scale > 1\n const selected = new Set(selectedOf(options))\n\n // Markers, placed with the projection the map file was made with.\n const { projection } = map\n const project =\n isRecord(projection) &&\n finite(projection.scale) !== null &&\n Array.isArray(projection.translate) &&\n projection.translate.slice(0, 2).every((n) => finite(n) !== null)\n ? (lng: number, lat: number): [number, number] => [\n px(lng * RADIANS * projection.scale + (projection.translate[0] as number)),\n py(\n (projection.translate[1] as number) -\n 1.25 * Math.log(Math.tan(Math.PI / 4 + 0.4 * lat * RADIANS)) * projection.scale,\n ),\n ]\n : undefined\n const markers: NonNullable<Entry['marker']>[] = []\n if (project && k > 0) {\n for (const marker of options.markers ?? []) {\n const [x, y] = project(marker.lng, marker.lat)\n if (Number.isFinite(x) && Number.isFinite(y)) markers.push({ name: marker.name ?? '', x, y })\n }\n }\n const firstMarker = entries.length\n for (const marker of markers) entries.push({ marker, value: null })\n // Regions without a value are not walked by the keyboard, but still name themselves on hover.\n const count = entries.length\n for (const shape of shapes.values()) {\n if (shape.point || indexOf.has(shape)) continue\n indexOf.set(shape, entries.length)\n entries.push({ shape, value: null })\n }\n\n const hitAt = (i: number): MapHit | null => {\n const entry = entries[i]\n if (!entry) return null\n const { shape, marker } = entry\n const dot = marker ?? (shape?.point ? { x: px(shape.x), y: py(shape.y) } : undefined)\n const x = dot?.x ?? px(shape?.x ?? 0)\n const y = dot?.y ?? py(shape?.y ?? 0)\n const name = marker?.name ?? shape?.name ?? ''\n const v = entry.value\n return {\n index: i,\n label: shape?.code ?? name,\n ...(shape ? { region: shape.code } : { marker: name }),\n // One row, \"■ Poland 80\": a region without a value and a marker only name themselves.\n title: '',\n x,\n area,\n items: [\n {\n name,\n seriesIndex: 0,\n value: v,\n text: v === null ? '' : value(v),\n x,\n y,\n color: marker ? MARKER : v === null ? EMPTY : paint(position(v)).color,\n },\n ],\n highlight: {\n kind: 'halo',\n d: dot\n ? circlePath(dot.x, dot.y, radius + 3)\n : (shape?.rings ?? [])\n .map((ring) => {\n let d = ''\n for (let p = 0; p < ring.length; p += 2)\n d += `${p ? 'L' : 'M'}${Math.round(px(ring[p] as number) * 10) / 10} ${Math.round(py(ring[p + 1] as number) * 10) / 10}`\n return `${d}Z`\n })\n .join(''),\n },\n }\n }\n\n const interaction: MapInteraction = {\n count,\n map: layout,\n hitIndex: hitAt,\n hitTest(x, y) {\n if (!(k > 0)) return null\n if (x < area.x || x > area.x + area.width || y < area.y || y > area.y + area.height)\n return null\n const near = (dot: { x: number; y: number }) => Math.hypot(dot.x - x, dot.y - y) <= radius + 4\n // What is drawn on top is hit first: markers, then dots, then shapes.\n for (let i = count - 1; i >= firstMarker; i--)\n if (near(entries[i]?.marker as { x: number; y: number })) return hitAt(i)\n for (let i = 0; i < valued; i++) {\n const shape = entries[i]?.shape as Shape\n if (shape.point && near({ x: px(shape.x), y: py(shape.y) })) return hitAt(i)\n }\n const mx = (x - tx) / k\n const my = (y - ty) / k\n for (const [shape, i] of indexOf) {\n const [x0, y0, x1, y1] = shape.box\n if (shape.point || mx < x0 || mx > x1 || my < y0 || my > y1) continue\n if (inside(shape.rings, mx, my)) return hitAt(i)\n }\n return null\n },\n }\n const regions: VNode[] = []\n // A selected shape goes in after the others, where nothing covers its outline.\n const raised: VNode[] = []\n const points: VNode[] = []\n for (const shape of shapes.values()) {\n const i = indexOf.get(shape)\n const v = i === undefined ? null : (entries[i]?.value ?? null)\n const style = v === null ? undefined : paint(position(v)).style\n const chosen = selected.has(shape.code) && 'tc-region-selected'\n if (!shape.point) {\n ;(chosen ? raised : regions).push(\n h('path', {\n key: shape.code,\n class: ['tc-region', v === null ? 'tc-region-empty' : 'tc-cell', chosen],\n 'data-region': shape.code,\n d: shape.path,\n style,\n }),\n )\n } else if (v !== null) {\n // A country too small for a shape says nothing without a value, so only then is it drawn.\n points.push(\n h('circle', {\n key: shape.code,\n class: ['tc-region tc-region-point tc-cell', chosen],\n 'data-region': shape.code,\n cx: round(px(shape.x)),\n cy: round(py(shape.y)),\n r: radius,\n style,\n }),\n )\n }\n }\n\n // Lines go in before the markers, so the markers sit on top of their ends.\n const byName = new Map(markers.map((marker) => [marker.name, marker]))\n const lines = (options.lines ?? []).flatMap((line, i) => {\n const from = byName.get(line.from)\n const to = byName.get(line.to)\n if (!from || !to) return []\n // A curve through a point pushed sideways from the middle of the line.\n const cx = (from.x + to.x) / 2 + (to.y - from.y) * LINE_CURVE\n const cy = (from.y + to.y) / 2 - (to.x - from.x) * LINE_CURVE\n return h('path', {\n key: `${line.from}›${line.to}›${i}`,\n class: 'tc-map-line',\n d: `M${round(from.x)} ${round(from.y)}Q${round(cx)} ${round(cy)} ${round(to.x)} ${round(to.y)}`,\n })\n })\n\n // The scale, centered below the map: the lowest value, a bar of the colors, the highest.\n const scaleText = typeof options.scale === 'object' ? options.scale : {}\n const low = scaleText.low ?? value(lo)\n const high = scaleText.high ?? value(hi)\n const lowWidth = estimateTextWidth(low, fontSize)\n const barWidth = SCALE_STEPS * SCALE_STEP\n const scaleWidth = lowWidth + 8 + barWidth + 8 + estimateTextWidth(high, fontSize)\n const scaleX = Math.round(area.x + Math.max(0, (area.width - scaleWidth) / 2))\n const barX = Math.round(scaleX + lowWidth + 8)\n const scaleY = area.y + area.height + 8 + (scaleHeight - 8) / 2\n\n const selectable = options.select === 'single' || options.select === 'multiple'\n const clip = `${ctx.id}-map`\n\n const content = [\n clipped &&\n h(\n 'clipPath',\n { key: 'clip', id: clip },\n h('rect', { x: area.x, y: area.y, width: area.width, height: area.height }),\n ),\n h(\n 'g',\n {\n key: 'map',\n class: ['tc-map', selectable && 'tc-map-selectable'],\n 'clip-path': clipped ? `url(#${clip})` : undefined,\n },\n k > 0 &&\n h(\n 'g',\n {\n key: 'regions',\n class: 'tc-map-regions',\n transform: `translate(${tx} ${ty}) scale(${k})`,\n },\n regions,\n raised,\n ),\n h('g', { key: 'points', class: 'tc-map-points' }, points),\n h('g', { key: 'lines', class: 'tc-map-lines' }, lines),\n h(\n 'g',\n { key: 'markers', class: 'tc-map-markers' },\n markers.map((marker, i) =>\n h('circle', {\n key: `${marker.name}›${i}`,\n class: 'tc-map-marker',\n 'data-marker': marker.name,\n cx: round(marker.x),\n cy: round(marker.y),\n r: radius,\n }),\n ),\n ),\n ),\n scale &&\n h(\n 'g',\n // (Crisp edges: the slices of the bar meet without a seam.)\n {\n key: 'scale',\n class: 'tc-map-scale',\n 'aria-hidden': 'true',\n 'shape-rendering': 'crispEdges',\n },\n h('text', { class: 'tc-tick-label', x: scaleX, y: round(scaleY), dy: '0.32em' }, low),\n Array.from({ length: SCALE_STEPS }, (_, s) =>\n h('rect', {\n key: s,\n class: 'tc-cell',\n x: barX + s * SCALE_STEP,\n y: round(scaleY - SCALE_HEIGHT / 2),\n width: SCALE_STEP,\n height: SCALE_HEIGHT,\n style: paint(s / (SCALE_STEPS - 1)).style,\n }),\n ),\n h(\n 'text',\n { class: 'tc-tick-label', x: barX + barWidth + 8, y: round(scaleY), dy: '0.32em' },\n high,\n ),\n ),\n ]\n return { content, interaction }\n}\n\n/** Table: one row per region with a value, in the order of the data. */\nfunction mapTable(options: MapOptions, ctx: TableContext, limit: number): DataTable {\n const map = typeof options.map === 'string' ? maps[options.map] : options.map\n const shapes = isMap(map) ? shapesOf(map) : undefined\n const value = formatNumber(options.format, ctx.locale)\n const rows: string[][] = []\n for (const [code, raw] of Object.entries(options.data ?? {})) {\n const v = finite(raw)\n const shape = shapes?.get(code)\n if (shape && v !== null) rows.push([shape.name, value(v)])\n }\n return { columns: ['', 'Value'], total: rows.length, rows: rows.slice(0, limit) }\n}\n\n/** Width to height of the map with its scale at a usual size, so the map fills the chart. */\nfunction ratioOf(options: MapOptions): number | undefined {\n const map = typeof options.map === 'string' ? maps[options.map] : options.map\n if (!isMap(map)) return undefined\n const scale = options.scale !== false && Object.keys(options.data ?? {}).length > 0\n return round(600 / ((600 * map.height) / map.width + (scale ? 23 : 0)))\n}\n\n/** Values that are finite numbers, markers with real coordinates, lines and colors that are text. */\nconst cleanMap = (options: MapOptions): MapOptions => {\n const o = options as unknown as Record<string, unknown>\n const data: Record<string, number> = {}\n if (isRecord(o.data))\n for (const [code, v] of Object.entries(o.data)) {\n const n = finite(v)\n if (n !== null) data[code] = n\n }\n return {\n ...options,\n map: typeof o.map === 'string' || isMap(o.map) ? o.map : (undefined as never),\n data,\n colors: list(o.colors).filter((c): c is string => typeof c === 'string' && c.trim() !== ''),\n markers: records(o.markers, (m) => ({\n lat: finite(m.lat) as number,\n lng: finite(m.lng) as number,\n ...(typeof m.name === 'string' ? { name: m.name } : {}),\n })).filter((m) => m.lat !== null && m.lng !== null),\n lines: records(o.lines, (l) => ({ from: text(l.from), to: text(l.to) })),\n select: o.select === 'single' || o.select === 'multiple' ? o.select : undefined,\n selected: list(o.selected).filter((code): code is string => typeof code === 'string'),\n view: isRecord(o.view) ? (o.view as Partial<MapView>) : undefined,\n onSelect: typeof o.onSelect === 'function' ? (o.onSelect as MapOptions['onSelect']) : undefined,\n }\n}\n\n/**\n * Map: the regions of a map file as SVG shapes, shaded by value from the\n * empty shade to the full color (`--tc-heat-color`, the cells of the\n * heatmap) or through a scale of `colors`, with markers placed by their\n * coordinates, lines between them and a bar of the scale. The shapes come\n * projected from the map file, so no geo library ships to the browser.\n *\n * ```ts\n * import { world } from '@tabler/charts/maps/world'\n *\n * new Chart('#el', {\n * type: map,\n * map: world,\n * data: { PL: 80, DE: 45, US: 100 },\n * })\n * ```\n */\nexport const map: ChartType<MapOptions> = {\n name: 'map',\n // (The options come with the whole config: its proportions are defaulted here.)\n clean: (options) => {\n const config = cleanMap(options) as MapOptions & {\n aspectRatio?: number\n autoRatio?: number\n }\n // The ratio set here follows the map; one of your own is kept.\n if (config.aspectRatio !== undefined && config.aspectRatio !== config.autoRatio) return config\n const autoRatio = ratioOf(config)\n return { ...config, aspectRatio: autoRatio, autoRatio }\n },\n render: renderMap,\n table: mapTable,\n // Zoom, drag and selection: at work only with `zoom` or `select`.\n plugins: [mapInteraction()],\n}\n"],"mappings":";;;;;;;;;;;AA+BA,SAAgB,QAAQ,MAAoC,QAA4B;CACtF,MAAM,QAAQ,KAAK,IAAI,OAAO,KAAK,KAAK,IAAI,GAAGA,cAAAA,OAAO,MAAM,KAAK,KAAK,CAAC,CAAC;CACxE,MAAM,OAAO,OAAO,IAAI;CACxB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B;CACxC,MAAM;CAEN,QAAQ,YAAY;EAClB,MAAM,SAAS,SAAS,OAAO;EAK/B,IAAI,OAAO,gBAAgB,KAAA,KAAa,OAAO,gBAAgB,OAAO,WAAW,OAAO;EACxF,MAAM,YAAY,QAAQ,MAAM;EAChC,OAAO;GAAE,GAAG;GAAQ,aAAa;GAAW;EAAU;CACxD;CACA,QAAQ;CACR,OAAO;CAEP,SAAS,CAAC,eAAe,CAAC;AAC5B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as ChartType, zt as Hit } 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
|
/** The part of a map in sight. */
|
|
5
5
|
interface MapView {
|
|
6
6
|
/** The top left corner, in the coordinates of the map file. */
|
package/dist/map.cjs
CHANGED
package/dist/map.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Standalone entry: `import { map } from '@tabler/charts/map'`. */
|
|
2
|
-
import { a as MapOptions, c as map, i as MapMarker, l as MapLayout, n as MapHit, o as MapRegion, r as MapLine, s as addMap, t as MapData, u as MapView } from "./map-
|
|
2
|
+
import { a as MapOptions, c as map, i as MapMarker, l as MapLayout, n as MapHit, o as MapRegion, r as MapLine, s as addMap, t as MapData, u as MapView } from "./map-BirylCmT.cjs";
|
|
3
3
|
export { type MapData, type MapHit, type MapLayout, type MapLine, type MapMarker, type MapOptions, type MapRegion, type MapView, addMap, map };
|
package/dist/map.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Standalone entry: `import { map } from '@tabler/charts/map'`. */
|
|
2
|
-
import { a as MapOptions, c as map, i as MapMarker, l as MapLayout, n as MapHit, o as MapRegion, r as MapLine, s as addMap, t as MapData, u as MapView } from "./map-
|
|
2
|
+
import { a as MapOptions, c as map, i as MapMarker, l as MapLayout, n as MapHit, o as MapRegion, r as MapLine, s as addMap, t as MapData, u as MapView } from "./map-DNqog2Xs.js";
|
|
3
3
|
export { type MapData, type MapHit, type MapLayout, type MapLine, type MapMarker, type MapOptions, type MapRegion, type MapView, addMap, map };
|
package/dist/map.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as addMap, n as map } from "./map-
|
|
1
|
+
export { t as addMap, n as map } from "./map-CYp6x-uS.js";
|
package/dist/maps/world.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as MapData } from "../map-
|
|
1
|
+
import { t as MapData } from "../map-BirylCmT.cjs";
|
|
2
2
|
export declare const world: MapData;
|
package/dist/maps/world.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as MapData } from "../map-
|
|
1
|
+
import { t as MapData } from "../map-DNqog2Xs.js";
|
|
2
2
|
export declare const world: MapData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as ChartType } from "./chart-
|
|
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
5
|
/** One party (or group) of a parliament. */
|
|
6
6
|
interface ParliamentParty {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as ChartType } from "./chart-
|
|
1
|
+
import { o as ChartType } from "./chart-Dz4geQZy.cjs";
|
|
2
2
|
import { c as NumberFormat } from "./time-B4oxWHQI.cjs";
|
|
3
|
-
import {
|
|
3
|
+
import { n as InsetsInput } from "./layout-CYerDebD.cjs";
|
|
4
4
|
import { a as ClassValue } from "./vnode-Du2cC8Fm.cjs";
|
|
5
5
|
/** One party (or group) of a parliament. */
|
|
6
6
|
interface ParliamentParty {
|
package/dist/parliament.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Standalone entry: `import { parliament } from '@tabler/charts/parliament'`. */
|
|
2
|
-
import { n as ParliamentParty, r as parliament, t as ParliamentOptions } from "./parliament-
|
|
2
|
+
import { n as ParliamentParty, r as parliament, t as ParliamentOptions } from "./parliament-CsYgh4N2.cjs";
|
|
3
3
|
export { type ParliamentOptions, type ParliamentParty, parliament };
|