@tabler/charts 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -4
- package/dist/{annotations-Bp7HwtF5.d.ts → annotations-B02GR_KU.d.ts} +3 -8
- package/dist/{annotations-BszTTjf9.js → annotations-BQ8l-qHs.js} +6 -7
- package/dist/{annotations-BszTTjf9.js.map → annotations-BQ8l-qHs.js.map} +1 -1
- package/dist/{annotations-lyt0I3HU.d.cts → annotations-CHafaGd4.d.cts} +3 -8
- package/dist/{annotations-DpETO8dE.cjs → annotations-CpCWA29b.cjs} +6 -7
- package/dist/{annotations-DpETO8dE.cjs.map → annotations-CpCWA29b.cjs.map} +1 -1
- package/dist/annotations.cjs +3 -5
- package/dist/annotations.cjs.map +1 -1
- package/dist/annotations.d.cts +2 -1
- package/dist/annotations.d.ts +2 -1
- package/dist/annotations.js +3 -4
- package/dist/{arc-a1tRTEw7.js → arc-B3V5IR0w.js} +2 -3
- package/dist/{arc-a1tRTEw7.js.map → arc-B3V5IR0w.js.map} +1 -1
- package/dist/{arc-BXpLrt9b.cjs → arc-CYhI62kO.cjs} +2 -3
- package/dist/{arc-BXpLrt9b.cjs.map → arc-CYhI62kO.cjs.map} +1 -1
- package/dist/{area-CF__HOwL.d.ts → area-DEFQm_SQ.d.ts} +3 -6
- package/dist/{area-sHCE3pg5.cjs → area-DYdQ_sMV.cjs} +5 -6
- package/dist/{area-sHCE3pg5.cjs.map → area-DYdQ_sMV.cjs.map} +1 -1
- package/dist/{area-DQsLERhx.js → area-WdtfqvhX.js} +5 -6
- package/dist/{area-DQsLERhx.js.map → area-WdtfqvhX.js.map} +1 -1
- package/dist/{area-DIxaAbYZ.d.cts → area-h_FvieFb.d.cts} +3 -6
- package/dist/area.cjs +1 -1
- package/dist/area.d.cts +2 -1
- package/dist/area.d.ts +2 -1
- package/dist/area.js +1 -2
- package/dist/axis-MMaVoSWB.js +235 -0
- package/dist/axis-MMaVoSWB.js.map +1 -0
- package/dist/axis-YfAerNBA.cjs +300 -0
- package/dist/axis-YfAerNBA.cjs.map +1 -0
- package/dist/{band-DTcNDAFO.d.ts → band-CNKvdnTC.d.cts} +1 -4
- package/dist/{band-DTcNDAFO.d.cts → band-CNKvdnTC.d.ts} +1 -4
- package/dist/{bar-jZEoao74.js → bar-BOcRcArc.js} +80 -62
- package/dist/bar-BOcRcArc.js.map +1 -0
- package/dist/{bar-C-7zR2qp.cjs → bar-CVkOJ7WA.cjs} +82 -64
- package/dist/bar-CVkOJ7WA.cjs.map +1 -0
- package/dist/{bar-DM16NUvV.js → bar-CgpC2EpX.js} +3 -4
- package/dist/{bar-DM16NUvV.js.map → bar-CgpC2EpX.js.map} +1 -1
- package/dist/{bar-BBM8RhoL.d.ts → bar-D9B_arKf.d.ts} +4 -7
- package/dist/{bar-CRKLDg98.d.cts → bar-DZCQ-kyf.d.cts} +4 -7
- package/dist/{bar-DGuUN3nc.cjs → bar-wVykm1us.cjs} +3 -4
- package/dist/{bar-DGuUN3nc.cjs.map → bar-wVykm1us.cjs.map} +1 -1
- package/dist/bar.cjs +1 -1
- package/dist/bar.d.cts +2 -1
- package/dist/bar.d.ts +2 -1
- package/dist/bar.js +1 -2
- package/dist/calendar-BSvO8nRb.d.cts +106 -0
- package/dist/calendar-BXgIX5H1.js +502 -0
- package/dist/calendar-BXgIX5H1.js.map +1 -0
- package/dist/calendar-Bq3vFzPl.d.ts +106 -0
- package/dist/calendar-DAFXjV99.cjs +507 -0
- package/dist/calendar-DAFXjV99.cjs.map +1 -0
- package/dist/calendar.cjs +3 -0
- package/dist/calendar.d.cts +3 -0
- package/dist/calendar.d.ts +3 -0
- package/dist/calendar.js +1 -0
- package/dist/{candlestick-D_vV0_XZ.d.ts → candlestick-B3WcLzph.d.ts} +3 -6
- package/dist/{candlestick-__pXl_pV.d.cts → candlestick-BcomxeVG.d.cts} +3 -6
- package/dist/{candlestick-DuXwAFID.js → candlestick-BtT9glp9.js} +19 -18
- package/dist/{candlestick-DuXwAFID.js.map → candlestick-BtT9glp9.js.map} +1 -1
- package/dist/{candlestick-B5r1w3kc.cjs → candlestick-CSmRuZ4v.cjs} +19 -18
- package/dist/{candlestick-B5r1w3kc.cjs.map → candlestick-CSmRuZ4v.cjs.map} +1 -1
- package/dist/candlestick.cjs +4 -5
- package/dist/candlestick.d.cts +1 -1
- package/dist/candlestick.d.ts +1 -1
- package/dist/candlestick.js +4 -6
- package/dist/{cartesian-Cr0AF0nG.js → cartesian-BrPqb5Qn.js} +138 -264
- package/dist/cartesian-BrPqb5Qn.js.map +1 -0
- package/dist/{cartesian-BoDfgBCV.cjs → cartesian-DRSXHxWe.cjs} +162 -324
- package/dist/cartesian-DRSXHxWe.cjs.map +1 -0
- package/dist/{chart-BF2CK9I_.js → chart-B6TTY4Kr.js} +120 -77
- package/dist/chart-B6TTY4Kr.js.map +1 -0
- package/dist/{chart-DyN7bcx8.d.ts → chart-CYrrUCi3.d.ts} +222 -102
- package/dist/{chart-D7ooEFnk.d.cts → chart-CbPzP5Dp.d.cts} +248 -102
- package/dist/{chart-CowF_lWY.cjs → chart-D_lyOy-M.cjs} +132 -83
- package/dist/chart-D_lyOy-M.cjs.map +1 -0
- package/dist/{circle-BQMuAfls.cjs → circle-Bwxy5j7B.cjs} +2 -3
- package/dist/{circle-BQMuAfls.cjs.map → circle-Bwxy5j7B.cjs.map} +1 -1
- package/dist/{circle-Z7YfCoCM.js → circle-YRDaOBpk.js} +2 -3
- package/dist/{circle-Z7YfCoCM.js.map → circle-YRDaOBpk.js.map} +1 -1
- package/dist/{clean-o1vDEhFV.js → clean-CkoQobGv.js} +3 -4
- package/dist/{clean-o1vDEhFV.js.map → clean-CkoQobGv.js.map} +1 -1
- package/dist/{clean-Byl6kzf0.cjs → clean-Die2iCNc.cjs} +8 -3
- package/dist/{clean-Byl6kzf0.cjs.map → clean-Die2iCNc.cjs.map} +1 -1
- package/dist/{core-D1vO1LrC.d.cts → core-9BnLEW4K.d.cts} +31 -72
- package/dist/{core-DcbemzGf.d.ts → core-C3qEppSm.d.ts} +10 -46
- package/dist/{core-CegR_j55.js → core-CQ0FaJ4G.js} +138 -99
- package/dist/core-CQ0FaJ4G.js.map +1 -0
- package/dist/{core-RzS9IQO5.cjs → core-D2PSked3.cjs} +139 -100
- package/dist/core-D2PSked3.cjs.map +1 -0
- package/dist/core.cjs +47 -33
- package/dist/core.d.cts +26 -21
- package/dist/core.d.ts +26 -21
- package/dist/core.js +31 -25
- package/dist/{dates-CG-FvioW.js → dates-DLe2Ww64.js} +4 -5
- package/dist/{dates-CG-FvioW.js.map → dates-DLe2Ww64.js.map} +1 -1
- package/dist/{dates-Btm7Zm6W.cjs → dates-DerXTb1J.cjs} +4 -5
- package/dist/{dates-Btm7Zm6W.cjs.map → dates-DerXTb1J.cjs.map} +1 -1
- package/dist/{decimate-tLhDk1ys.cjs → decimate-BS3x8g-f.cjs} +2 -3
- package/dist/{decimate-tLhDk1ys.cjs.map → decimate-BS3x8g-f.cjs.map} +1 -1
- package/dist/{decimate-BGg9XgF0.d.ts → decimate-BxxYBJJk.d.cts} +2 -5
- package/dist/{decimate-C87cl_Sp.js → decimate-CapfgiDY.js} +2 -3
- package/dist/{decimate-C87cl_Sp.js.map → decimate-CapfgiDY.js.map} +1 -1
- package/dist/{decimate-CNSpgGa5.d.cts → decimate-Du87fMLG.d.ts} +2 -5
- package/dist/decimate.cjs +3 -4
- package/dist/decimate.d.cts +1 -1
- package/dist/decimate.d.ts +1 -1
- package/dist/decimate.js +3 -4
- package/dist/{dom-CLF868Qs.cjs → dom-C33zvtPo.cjs} +5 -11
- package/dist/dom-C33zvtPo.cjs.map +1 -0
- package/dist/{dom-vP3IcMak.js → dom-CTse6Rvd.js} +5 -11
- package/dist/dom-CTse6Rvd.js.map +1 -0
- package/dist/{export-chart-BhhYgksr.cjs → export-chart-CPtXmZvi.cjs} +18 -14
- package/dist/export-chart-CPtXmZvi.cjs.map +1 -0
- package/dist/{export-chart-9w8t3rjZ.js → export-chart-DoeiAyR2.js} +18 -14
- package/dist/export-chart-DoeiAyR2.js.map +1 -0
- package/dist/export.cjs +3 -5
- package/dist/export.cjs.map +1 -1
- package/dist/export.d.cts +8 -1
- package/dist/export.d.ts +8 -1
- package/dist/export.js +3 -4
- package/dist/{extent-BAMZo0Nq.js → extent-DOV8rs-6.js} +2 -3
- package/dist/{extent-BAMZo0Nq.js.map → extent-DOV8rs-6.js.map} +1 -1
- package/dist/{extent-DsFWvAHJ.cjs → extent-DuYDcvM9.cjs} +2 -3
- package/dist/{extent-DsFWvAHJ.cjs.map → extent-DuYDcvM9.cjs.map} +1 -1
- package/dist/{fade-D3NxH5Qg.js → fade-CDrQjnDz.js} +59 -83
- package/dist/fade-CDrQjnDz.js.map +1 -0
- package/dist/{fade-Cs74puQS.cjs → fade-CRqcKMWY.cjs} +59 -83
- package/dist/fade-CRqcKMWY.cjs.map +1 -0
- package/dist/{features-wASyHGic.js → features-B55rwpQC.js} +5 -4
- package/dist/features-B55rwpQC.js.map +1 -0
- package/dist/{features-BclHgg2W.cjs → features-DEDP5CEQ.cjs} +10 -3
- package/dist/features-DEDP5CEQ.cjs.map +1 -0
- package/dist/fit-BPyPRnsK.js +16 -0
- package/dist/fit-BPyPRnsK.js.map +1 -0
- package/dist/fit-D4MIIQQz.cjs +21 -0
- package/dist/fit-D4MIIQQz.cjs.map +1 -0
- package/dist/{format-B0yKXBTH.cjs → format-CAE5ruy6.cjs} +2 -3
- package/dist/{format-B0yKXBTH.cjs.map → format-CAE5ruy6.cjs.map} +1 -1
- package/dist/{format-lStwuc1L.js → format-it1kepFG.js} +2 -3
- package/dist/{format-lStwuc1L.js.map → format-it1kepFG.js.map} +1 -1
- package/dist/funnel-BdcfUkb5.d.ts +50 -0
- package/dist/funnel-CFEEulw_.cjs +244 -0
- package/dist/funnel-CFEEulw_.cjs.map +1 -0
- package/dist/funnel-CYCv8cq2.js +239 -0
- package/dist/funnel-CYCv8cq2.js.map +1 -0
- package/dist/funnel-CarOh8w_.d.cts +50 -0
- package/dist/funnel.cjs +3 -0
- package/dist/funnel.d.cts +3 -0
- package/dist/funnel.d.ts +3 -0
- package/dist/funnel.js +1 -0
- package/dist/{gauge-D-FYhuds.cjs → gauge-6HfDcLMJ.cjs} +35 -36
- package/dist/gauge-6HfDcLMJ.cjs.map +1 -0
- package/dist/{gauge-Dh423FHh.js → gauge-DiTk5aWO.js} +35 -36
- package/dist/gauge-DiTk5aWO.js.map +1 -0
- package/dist/{gauge-zpia05t2.d.ts → gauge-Ds9k1UV2.d.cts} +5 -8
- package/dist/{gauge-DP_EB2z3.d.cts → gauge-Zy25jfps.d.ts} +5 -8
- package/dist/gauge.cjs +1 -1
- package/dist/gauge.d.cts +2 -1
- package/dist/gauge.d.ts +2 -1
- package/dist/gauge.js +1 -2
- package/dist/{heatmap-DSZ2bVIa.js → heatmap-C1v8bwpq.js} +43 -43
- package/dist/heatmap-C1v8bwpq.js.map +1 -0
- package/dist/{heatmap-BectCEeE.d.ts → heatmap-CJ-0dfhJ.d.cts} +4 -7
- package/dist/{heatmap-BK18EBgJ.cjs → heatmap-Dcc_bsoQ.cjs} +47 -47
- package/dist/heatmap-Dcc_bsoQ.cjs.map +1 -0
- package/dist/{heatmap-CCso6m61.d.cts → heatmap-Jp5sHRTo.d.ts} +4 -7
- package/dist/heatmap.cjs +1 -1
- package/dist/heatmap.d.cts +2 -1
- package/dist/heatmap.d.ts +2 -1
- package/dist/heatmap.js +1 -2
- package/dist/{hydrate-DDNIHYv_.js → hydrate-BB3MlR36.js} +3 -4
- package/dist/{hydrate-DDNIHYv_.js.map → hydrate-BB3MlR36.js.map} +1 -1
- package/dist/{hydrate-CzfxLfTv.d.ts → hydrate-BtAZf_5K.d.cts} +2 -5
- package/dist/{hydrate-CTTmQy0x.d.cts → hydrate-OjM1pIUG.d.ts} +2 -5
- package/dist/{hydrate-CxwTXDqO.cjs → hydrate-m0I5m6ue.cjs} +3 -4
- package/dist/hydrate-m0I5m6ue.cjs.map +1 -0
- package/dist/hydrate.cjs +3 -4
- package/dist/hydrate.cjs.map +1 -1
- package/dist/hydrate.d.cts +1 -1
- package/dist/hydrate.d.ts +1 -1
- package/dist/hydrate.js +3 -4
- package/dist/index.cjs +72 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -28
- package/dist/index.d.ts +28 -28
- package/dist/index.js +52 -44
- package/dist/index.js.map +1 -1
- package/dist/interaction-DXYSjgnP.cjs +32 -0
- package/dist/interaction-DXYSjgnP.cjs.map +1 -0
- package/dist/interaction-En1KlwFO.js +21 -0
- package/dist/interaction-En1KlwFO.js.map +1 -0
- package/dist/{layout-CtMBhNd9.cjs → layout-Cfg9x1k2.cjs} +45 -3
- package/dist/layout-Cfg9x1k2.cjs.map +1 -0
- package/dist/{layout-B3hiqVEw.js → layout-DqAte3H8.js} +34 -4
- package/dist/layout-DqAte3H8.js.map +1 -0
- package/dist/{line-CN4uZ9ZX.d.ts → line-Bpr5uVLQ.d.ts} +4 -7
- package/dist/{line-B3Ed6u7j.js → line-CxR4tg1Q.js} +49 -38
- package/dist/line-CxR4tg1Q.js.map +1 -0
- package/dist/{line-fQbtP_jL.cjs → line-YiCuhVMI.cjs} +49 -38
- package/dist/line-YiCuhVMI.cjs.map +1 -0
- package/dist/{line-W7VD_qs1.d.cts → line-vyWO030v.d.cts} +4 -7
- package/dist/line.cjs +4 -5
- package/dist/line.cjs.map +1 -1
- package/dist/line.d.cts +1 -1
- package/dist/line.d.ts +1 -1
- package/dist/line.js +4 -6
- package/dist/{log-CaofN3-n.d.ts → log-CI41TmcU.d.cts} +1 -6
- package/dist/{log-CaofN3-n.d.cts → log-CI41TmcU.d.ts} +1 -6
- package/dist/{log-axis-83rSpvL5.cjs → log-axis-DdRNyAq8.cjs} +6 -8
- package/dist/{log-axis-83rSpvL5.cjs.map → log-axis-DdRNyAq8.cjs.map} +1 -1
- package/dist/{log-axis-B_uvvOFc.js → log-axis-DhthtHFk.js} +6 -8
- package/dist/{log-axis-B_uvvOFc.js.map → log-axis-DhthtHFk.js.map} +1 -1
- package/dist/log.cjs +3 -5
- package/dist/log.cjs.map +1 -1
- package/dist/log.d.cts +1 -1
- package/dist/log.d.ts +1 -1
- package/dist/log.js +3 -4
- package/dist/map-49FcfdmJ.d.cts +156 -0
- package/dist/map-BMC61J-P.d.ts +156 -0
- package/dist/map-BqrZ80vT.cjs +818 -0
- package/dist/map-BqrZ80vT.cjs.map +1 -0
- package/dist/map-C15NC7kW.js +807 -0
- package/dist/map-C15NC7kW.js.map +1 -0
- package/dist/map.cjs +4 -0
- package/dist/map.d.cts +3 -0
- package/dist/map.d.ts +3 -0
- package/dist/map.js +1 -0
- package/dist/maps/world.cjs +875 -0
- package/dist/maps/world.cjs.map +1 -0
- package/dist/maps/world.d.cts +2 -0
- package/dist/maps/world.d.ts +2 -0
- package/dist/maps/world.js +874 -0
- package/dist/maps/world.js.map +1 -0
- package/dist/{morph-CqYDu1bY.cjs → morph-3I1Nf_tR.cjs} +4 -5
- package/dist/morph-3I1Nf_tR.cjs.map +1 -0
- package/dist/{morph-BMxz3X2b.d.ts → morph-Dh7gJkV4.d.cts} +1 -4
- package/dist/{morph-BMxz3X2b.d.cts → morph-Dh7gJkV4.d.ts} +1 -4
- package/dist/{morph-Bgg-24l8.js → morph-GfBab-b3.js} +4 -5
- package/dist/{morph-Bgg-24l8.js.map → morph-GfBab-b3.js.map} +1 -1
- package/dist/morph.cjs +3 -4
- package/dist/morph.cjs.map +1 -1
- package/dist/morph.d.cts +1 -1
- package/dist/morph.d.ts +1 -1
- package/dist/morph.js +3 -4
- package/dist/{named-BWWb5LQJ.cjs → named-BBASc8dW.cjs} +2 -3
- package/dist/{named-BWWb5LQJ.cjs.map → named-BBASc8dW.cjs.map} +1 -1
- package/dist/{named-DE15TOgh.js → named-BOiBah6I.js} +2 -3
- package/dist/{named-DE15TOgh.js.map → named-BOiBah6I.js.map} +1 -1
- package/dist/others-DBIGE6jr.js +57 -0
- package/dist/others-DBIGE6jr.js.map +1 -0
- package/dist/others-DBO4Kjwl.d.ts +29 -0
- package/dist/others-WfjCsjqT.cjs +68 -0
- package/dist/others-WfjCsjqT.cjs.map +1 -0
- package/dist/others-ls5eKtZ4.d.cts +31 -0
- package/dist/{parliament-Dw0sOERi.js → parliament-BKN6ikBJ.js} +36 -36
- package/dist/parliament-BKN6ikBJ.js.map +1 -0
- package/dist/{parliament-1Zv2Xh0D.d.ts → parliament-C7V8UJj1.d.cts} +5 -8
- package/dist/{parliament-DdrLVZwt.d.cts → parliament-Cz9n_DoK.d.ts} +5 -8
- package/dist/{parliament-CpWnoEvG.cjs → parliament-DhxAaIZ3.cjs} +36 -36
- package/dist/parliament-DhxAaIZ3.cjs.map +1 -0
- package/dist/parliament.cjs +1 -1
- package/dist/parliament.d.cts +2 -1
- package/dist/parliament.d.ts +2 -1
- package/dist/parliament.js +1 -2
- package/dist/{path-CwB28da0.d.ts → path-YeUiOfG8.d.cts} +1 -4
- package/dist/{path-CwB28da0.d.cts → path-YeUiOfG8.d.ts} +1 -4
- package/dist/{patterns-DtgcnA8o.js → patterns-BMUINoka.js} +4 -5
- package/dist/{patterns-DtgcnA8o.js.map → patterns-BMUINoka.js.map} +1 -1
- package/dist/{patterns-LfcQAWCy.cjs → patterns-Dw7OMD_2.cjs} +4 -5
- package/dist/{patterns-LfcQAWCy.cjs.map → patterns-Dw7OMD_2.cjs.map} +1 -1
- package/dist/patterns.cjs +3 -5
- package/dist/patterns.cjs.map +1 -1
- package/dist/patterns.d.cts +5 -1
- package/dist/patterns.d.ts +5 -1
- package/dist/patterns.js +3 -4
- package/dist/percentage-bar-BChkTRoz.cjs +164 -0
- package/dist/percentage-bar-BChkTRoz.cjs.map +1 -0
- package/dist/percentage-bar-CaInxrL8.js +159 -0
- package/dist/percentage-bar-CaInxrL8.js.map +1 -0
- package/dist/percentage-bar-R1--2grK.d.cts +58 -0
- package/dist/percentage-bar-cSeiLdwU.d.ts +58 -0
- package/dist/percentage-bar.cjs +3 -0
- package/dist/percentage-bar.d.cts +3 -0
- package/dist/percentage-bar.d.ts +3 -0
- package/dist/percentage-bar.js +1 -0
- package/dist/{pie-BF9yI5mE.d.cts → pie-BQQkvy1N.d.ts} +11 -11
- package/dist/{pie-DzUXDTcn.js → pie-Bd8wyrtY.js} +52 -55
- package/dist/pie-Bd8wyrtY.js.map +1 -0
- package/dist/{pie-BxTZt6Go.cjs → pie-BseZlCgP.cjs} +52 -55
- package/dist/pie-BseZlCgP.cjs.map +1 -0
- package/dist/{pie-5z1fDdKO.d.ts → pie-vD5-g8je.d.cts} +11 -11
- package/dist/pie.cjs +1 -1
- package/dist/pie.d.cts +2 -1
- package/dist/pie.d.ts +2 -1
- package/dist/pie.js +1 -2
- package/dist/{point-shapes-CGl4dugc.cjs → point-shapes-BRawRM78.cjs} +24 -24
- package/dist/point-shapes-BRawRM78.cjs.map +1 -0
- package/dist/{point-shapes-DI84NNpI.js → point-shapes-DI6GhcI7.js} +19 -25
- package/dist/point-shapes-DI6GhcI7.js.map +1 -0
- package/dist/point-shapes.cjs +7 -6
- package/dist/point-shapes.cjs.map +1 -1
- package/dist/point-shapes.d.cts +6 -2
- package/dist/point-shapes.d.ts +6 -2
- package/dist/point-shapes.js +8 -7
- package/dist/point-shapes.js.map +1 -1
- package/dist/{radar-1-EryihA.d.ts → radar-7I6hsY_h.d.cts} +4 -7
- package/dist/{radar-CYPab_I4.js → radar-D6XqkFWQ.js} +25 -27
- package/dist/radar-D6XqkFWQ.js.map +1 -0
- package/dist/{radar-CoGUNNSb.cjs → radar-DjISDnSf.cjs} +26 -28
- package/dist/radar-DjISDnSf.cjs.map +1 -0
- package/dist/{radar-DBW4O0Vt.d.cts → radar-vLxilcr4.d.ts} +4 -7
- package/dist/radar.cjs +1 -1
- package/dist/radar.d.cts +2 -1
- package/dist/radar.d.ts +2 -1
- package/dist/radar.js +1 -2
- package/dist/rect-CZTNvMlf.js +11 -0
- package/dist/rect-CZTNvMlf.js.map +1 -0
- package/dist/rect-DPr9QRxl.cjs +16 -0
- package/dist/rect-DPr9QRxl.cjs.map +1 -0
- package/dist/{sankey-Bacx4fVe.cjs → sankey-0CSp_Er9.cjs} +100 -95
- package/dist/sankey-0CSp_Er9.cjs.map +1 -0
- package/dist/{sankey-OV_WoPrl.d.ts → sankey-7As41Fo4.d.ts} +4 -7
- package/dist/{sankey-B4PNKusJ.js → sankey-Dp4CuLVe.js} +100 -95
- package/dist/sankey-Dp4CuLVe.js.map +1 -0
- package/dist/{sankey-DuGI3Qc5.d.cts → sankey-DqiuxUx7.d.cts} +4 -7
- package/dist/sankey.cjs +1 -1
- package/dist/sankey.d.cts +2 -1
- package/dist/sankey.d.ts +2 -1
- package/dist/sankey.js +1 -2
- package/dist/{scatter-DbxLyZX0.d.cts → scatter-BXkXGgM_.d.ts} +14 -9
- package/dist/{scatter-DgMN9zRy.cjs → scatter-Bwkblr4L.cjs} +47 -42
- package/dist/scatter-Bwkblr4L.cjs.map +1 -0
- package/dist/{scatter-kgtgR318.js → scatter-DCMAtt5L.js} +45 -40
- package/dist/scatter-DCMAtt5L.js.map +1 -0
- package/dist/{scatter-BqzgJqdX.d.ts → scatter-DL0zAV09.d.cts} +14 -9
- package/dist/scatter.cjs +1 -1
- package/dist/scatter.d.cts +2 -1
- package/dist/scatter.d.ts +2 -1
- package/dist/scatter.js +1 -2
- package/dist/{sparkline-BfyO_oNM.d.ts → sparkline-BElUSd0r.d.ts} +5 -8
- package/dist/{sparkline-BS9-hltA.cjs → sparkline-BMSuEPHP.cjs} +22 -23
- package/dist/sparkline-BMSuEPHP.cjs.map +1 -0
- package/dist/{sparkline-BQzt27Fr.js → sparkline-NDmq90kP.js} +22 -23
- package/dist/sparkline-NDmq90kP.js.map +1 -0
- package/dist/{sparkline-CWlJDKyh.d.cts → sparkline-RYly7bR0.d.cts} +5 -8
- package/dist/sparkline.cjs +1 -1
- package/dist/sparkline.d.cts +2 -1
- package/dist/sparkline.d.ts +2 -1
- package/dist/sparkline.js +1 -2
- package/dist/{stack-DVhJWaki.cjs → stack-BO4624CY.cjs} +3 -4
- package/dist/{stack-DVhJWaki.cjs.map → stack-BO4624CY.cjs.map} +1 -1
- package/dist/{stack-CpR6RGKd.d.ts → stack-BTWYIwLO.d.cts} +2 -4
- package/dist/{stack-CpR6RGKd.d.cts → stack-DR0eQTsB.d.ts} +1 -4
- package/dist/{stack-DRbwTeF3.js → stack-jVKvg2x_.js} +3 -4
- package/dist/{stack-DRbwTeF3.js.map → stack-jVKvg2x_.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{sweep-CbfR7--d.js → sweep-BpRPlhs6.js} +5 -6
- package/dist/{sweep-CbfR7--d.js.map → sweep-BpRPlhs6.js.map} +1 -1
- package/dist/{sweep-DaTEDDuC.cjs → sweep-Dnp6LDBz.cjs} +5 -6
- package/dist/sweep-Dnp6LDBz.cjs.map +1 -0
- package/dist/{time-CNVnt-B2.d.cts → time-B4oxWHQI.d.cts} +2 -7
- package/dist/{time-CHjiY9Q4.d.ts → time-DRIDgv2a.d.ts} +2 -7
- package/dist/{time-axis-VSX34_Tb.cjs → time-axis-B3VekUfX.cjs} +11 -11
- package/dist/{time-axis-VSX34_Tb.cjs.map → time-axis-B3VekUfX.cjs.map} +1 -1
- package/dist/{time-axis-Bc9eHX1r.js → time-axis-CLjqOakA.js} +10 -10
- package/dist/{time-axis-Bc9eHX1r.js.map → time-axis-CLjqOakA.js.map} +1 -1
- package/dist/time.cjs +4 -6
- package/dist/time.cjs.map +1 -1
- package/dist/time.d.cts +1 -1
- package/dist/time.d.ts +1 -1
- package/dist/time.js +4 -5
- package/dist/treemap-25vHO_UK.d.cts +65 -0
- package/dist/treemap-BCXUbixd.d.ts +65 -0
- package/dist/treemap-C4glsx-g.js +293 -0
- package/dist/treemap-C4glsx-g.js.map +1 -0
- package/dist/treemap-CZk8kKFD.cjs +298 -0
- package/dist/treemap-CZk8kKFD.cjs.map +1 -0
- package/dist/treemap.cjs +3 -0
- package/dist/treemap.d.cts +3 -0
- package/dist/treemap.d.ts +3 -0
- package/dist/treemap.js +1 -0
- package/dist/{tween-BCYd0RTY.js → tween-BdQqUmmv.js} +2 -3
- package/dist/{tween-BCYd0RTY.js.map → tween-BdQqUmmv.js.map} +1 -1
- package/dist/{tween-CIGBlryn.cjs → tween-c3aOmfKE.cjs} +2 -3
- package/dist/{tween-CIGBlryn.cjs.map → tween-c3aOmfKE.cjs.map} +1 -1
- package/dist/{value-labels-IZIQPhfk.js → value-labels-C7GrhOXJ.js} +30 -10
- package/dist/value-labels-C7GrhOXJ.js.map +1 -0
- package/dist/{value-labels-B0WJoJ7x.cjs → value-labels-DzaKIWKp.cjs} +30 -10
- package/dist/value-labels-DzaKIWKp.cjs.map +1 -0
- package/dist/value-labels.cjs +3 -5
- package/dist/value-labels.cjs.map +1 -1
- package/dist/value-labels.d.cts +5 -1
- package/dist/value-labels.d.ts +5 -1
- package/dist/value-labels.js +3 -4
- package/dist/{vnode-CkQ27Cxe.cjs → vnode-ClAiw28x.cjs} +2 -3
- package/dist/{vnode-CkQ27Cxe.cjs.map → vnode-ClAiw28x.cjs.map} +1 -1
- package/dist/{vnode-BUflsBsa.d.ts → vnode-Du2cC8Fm.d.cts} +1 -4
- package/dist/{vnode-BUflsBsa.d.cts → vnode-Du2cC8Fm.d.ts} +1 -4
- package/dist/{vnode-tCWItoUH.js → vnode-_EMUqysL.js} +2 -3
- package/dist/{vnode-tCWItoUH.js.map → vnode-_EMUqysL.js.map} +1 -1
- package/package.json +94 -214
- package/dist/bar-C-7zR2qp.cjs.map +0 -1
- package/dist/bar-jZEoao74.js.map +0 -1
- package/dist/cartesian-BoDfgBCV.cjs.map +0 -1
- package/dist/cartesian-Cr0AF0nG.js.map +0 -1
- package/dist/chart-BF2CK9I_.js.map +0 -1
- package/dist/chart-CowF_lWY.cjs.map +0 -1
- package/dist/core-CegR_j55.js.map +0 -1
- package/dist/core-RzS9IQO5.cjs.map +0 -1
- package/dist/dom-CLF868Qs.cjs.map +0 -1
- package/dist/dom-vP3IcMak.js.map +0 -1
- package/dist/export-chart-9w8t3rjZ.js.map +0 -1
- package/dist/export-chart-BhhYgksr.cjs.map +0 -1
- package/dist/fade-Cs74puQS.cjs.map +0 -1
- package/dist/fade-D3NxH5Qg.js.map +0 -1
- package/dist/features-BclHgg2W.cjs.map +0 -1
- package/dist/features-wASyHGic.js.map +0 -1
- package/dist/gauge-D-FYhuds.cjs.map +0 -1
- package/dist/gauge-Dh423FHh.js.map +0 -1
- package/dist/heatmap-BK18EBgJ.cjs.map +0 -1
- package/dist/heatmap-DSZ2bVIa.js.map +0 -1
- package/dist/hydrate-CxwTXDqO.cjs.map +0 -1
- package/dist/layout-B3hiqVEw.js.map +0 -1
- package/dist/layout-CtMBhNd9.cjs.map +0 -1
- package/dist/line-B3Ed6u7j.js.map +0 -1
- package/dist/line-fQbtP_jL.cjs.map +0 -1
- package/dist/morph-CqYDu1bY.cjs.map +0 -1
- package/dist/parliament-CpWnoEvG.cjs.map +0 -1
- package/dist/parliament-Dw0sOERi.js.map +0 -1
- package/dist/pie-BxTZt6Go.cjs.map +0 -1
- package/dist/pie-DzUXDTcn.js.map +0 -1
- package/dist/point-shapes-CGl4dugc.cjs.map +0 -1
- package/dist/point-shapes-DI84NNpI.js.map +0 -1
- package/dist/radar-CYPab_I4.js.map +0 -1
- package/dist/radar-CoGUNNSb.cjs.map +0 -1
- package/dist/sankey-B4PNKusJ.js.map +0 -1
- package/dist/sankey-Bacx4fVe.cjs.map +0 -1
- package/dist/scatter-DgMN9zRy.cjs.map +0 -1
- package/dist/scatter-kgtgR318.js.map +0 -1
- package/dist/sparkline-BQzt27Fr.js.map +0 -1
- package/dist/sparkline-BS9-hltA.cjs.map +0 -1
- package/dist/sweep-DaTEDDuC.cjs.map +0 -1
- package/dist/value-labels-B0WJoJ7x.cjs.map +0 -1
- package/dist/value-labels-IZIQPhfk.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sankey-Dp4CuLVe.js","names":[],"sources":["../src/charts/sankey.ts"],"sourcesContent":["import type { DataTable } from '../a11y.ts'\nimport type { ChartType, RenderContext, RenderResult } from '../chart.ts'\nimport { formatDetail, type NumberFormat } from '../format.ts'\nimport type { Highlight, Hit, HitItem, Interaction } from '../interaction.ts'\nimport {\n estimateTextWidth,\n type InsetsInput,\n innerRect,\n insets,\n LINE_HEIGHT,\n mirrorSides,\n type Rect,\n round,\n} from '../layout.ts'\nimport type { LegendItem } from '../legend.ts'\nimport { h } from '../vnode.ts'\nimport { cleanData, finite, isRecord, named, records, text } from './clean.ts'\n\n/** A node of the flow; nodes left out are made from the links. */\nexport interface SankeyNode {\n name: string\n /**\n * Custom color; overrides the palette slot via `--tc-series-color`. Nodes\n * sharing a color form one legend entry, named after the first of them.\n * Values that could inject CSS (`;`, quotes, `url()` …) are ignored, so colors from user data are safe.\n */\n color?: string\n /** Start hidden (toggle it back from the legend, with every node of its color). */\n hidden?: boolean\n}\n\n/** A flow between two nodes, by name. */\nexport interface SankeyLink {\n from: string\n to: string\n /** Non-negative value; negative values count as zero. */\n value: number\n}\n\nexport interface SankeyData {\n /** Optional: sets the stacking order within a column, and colors. */\n nodes?: readonly SankeyNode[]\n links: readonly SankeyLink[]\n}\n\nexport interface SankeyOptions {\n data: SankeyData\n /** Width of the node bars in pixels. Defaults to `12`. */\n nodeWidth?: number\n /** Vertical gap between the nodes of a column in pixels. Defaults to `16`. */\n nodePadding?: number\n /** Format of the values (labels, tooltips and the table). */\n format?: NumberFormat\n /**\n * `'justify'` (default) puts every node without outgoing flows in the last\n * column; `'left'` leaves it in the column after its sources.\n */\n align?: 'justify' | 'left'\n /** Extra space around the diagram, in pixels. */\n padding?: InsetsInput\n}\n\ninterface Node {\n data: SankeyNode\n index: number\n /** Palette slot, 1-based: the node's position in its column. */\n slot: number\n column: number\n value: number\n x: number\n y: number\n height: number\n ins: Link[]\n outs: Link[]\n}\n\ninterface Link {\n data: SankeyLink\n index: number\n source: Node\n target: Node\n /** Top of the slice at the source and at the target. */\n sy: number\n ty: number\n width: number\n}\n\ninterface Layout {\n nodes: Node[]\n links: Link[]\n /** The columns' extent, between the label margins. */\n plot: Rect\n nodeWidth: number\n labels: NodeLabel[]\n}\n\n/** A node's label: the name and the value under it, cut to fit (empty when hidden). */\ninterface NodeLabel {\n side: 'left' | 'right'\n name: string\n value: string\n}\n\n/** Space between a node and its label. */\nconst LABEL_GAP = 8\n/** Largest share of the width one side's labels may take. */\nconst MAX_LABEL_SHARE = 0.3\n/** Pixels around a node that still count as hovering it. */\nconst HOVER_SLOP = 2\n\n/** `text`, cut short with an ellipsis to fit `width` pixels. */\nfunction truncate(text: string, width: number, fontSize: number): string {\n if (estimateTextWidth(text, fontSize) <= width) return text\n let end = text.length\n while (end > 0 && estimateTextWidth(`${text.slice(0, end)}…`, fontSize) > width) end--\n return end > 0 ? `${text.slice(0, end).trimEnd()}…` : ''\n}\n\n/** The color of a node for hover and tooltip swatches. */\nconst colorOf = (node: Node): string => node.data.color ?? `var(--tc-color-${node.slot})`\n\n/** The visible nodes and links, in data order, with their columns. */\nfunction graph(data: SankeyData, hidden: ReadonlySet<string>, justify: boolean) {\n const byName = new Map<string, Node>()\n const nodes: Node[] = []\n const node = (name: string, data?: SankeyNode): Node => {\n let found = byName.get(name)\n if (!found) {\n found = {\n data: data ?? { name },\n index: nodes.length,\n slot: 1,\n column: 0,\n value: 0,\n x: 0,\n y: 0,\n height: 0,\n ins: [],\n outs: [],\n }\n byName.set(name, found)\n nodes.push(found)\n }\n return found\n }\n const declared = new Map((data.nodes ?? []).map((n) => [n.name, n]))\n /** A legend key hides every node of its color, see `sankeyLegend`. */\n const isHidden = (name: string) => {\n const n = declared.get(name)\n return hidden.has(name) || (n?.color !== undefined && hidden.has(legendKey(data, n.color)))\n }\n const links: Link[] = []\n data.links.forEach((link, index) => {\n if (link.from === link.to || isHidden(link.from) || isHidden(link.to)) return\n const source = node(link.from, declared.get(link.from))\n const target = node(link.to, declared.get(link.to))\n const out: Link = { data: link, index, source, target, sy: 0, ty: 0, width: 0 }\n links.push(out)\n if (link.value <= 0) return\n source.outs.push(out)\n target.ins.push(out)\n })\n for (const n of nodes) {\n n.value = Math.max(\n n.outs.reduce((sum, l) => sum + l.data.value, 0),\n n.ins.reduce((sum, l) => sum + l.data.value, 0),\n )\n }\n // Column: the longest path from a source, passes bounded so cycles end.\n for (let pass = 0; pass < nodes.length; pass++) {\n let changed = false\n for (const link of links) {\n if (link.data.value > 0 && link.target.column <= link.source.column) {\n link.target.column = link.source.column + 1\n changed = true\n }\n }\n if (!changed) break\n }\n const last = nodes.reduce((max, n) => Math.max(max, n.column), 0)\n if (justify) for (const n of nodes) if (n.outs.length === 0) n.column = last\n // Stack order within a column: declared nodes first, then first appearance.\n const order = [...declared.keys()]\n nodes.sort((a, b) => {\n if (a.column !== b.column) return a.column - b.column\n const ia = order.indexOf(a.data.name)\n const ib = order.indexOf(b.data.name)\n if (ia !== -1 && ib !== -1) return ia - ib\n if (ia !== ib) return ia === -1 ? 1 : -1\n return a.index - b.index\n })\n const slots = new Map<number, number>()\n nodes.forEach((n, index) => {\n n.index = index\n const slot = (slots.get(n.column) ?? 0) + 1\n slots.set(n.column, slot)\n n.slot = ((slot - 1) % 8) + 1\n })\n return { nodes, links, columns: last + 1 }\n}\n\n/** Key of the legend entry of `color`: the first node that wears it. */\nconst legendKey = (data: SankeyData, color: string): string =>\n (data.nodes ?? []).find((n) => n.color === color)?.name ?? color\n\nfunction layout(options: SankeyOptions, ctx: RenderContext): Layout {\n const { width, height, fontSize, locale } = ctx\n const nodeWidth = Math.max(1, options.nodeWidth ?? 12)\n const nodePadding = Math.max(0, options.nodePadding ?? 16)\n // Right to left, the layout is worked out as its mirror image, then flipped.\n const { rtl } = ctx\n const area = innerRect(width, height, mirrorSides(insets(options.padding), rtl))\n const { nodes, links, columns } = graph(options.data, ctx.hidden, options.align !== 'left')\n const format = formatDetail(options.format, locale)\n\n // Labels take their room from the sides: the first column's to its left,\n // the last column's to its right, the rest to the right of their node.\n const texts = nodes.map((n) => [n.data.name, format(n.value)] as const)\n const widest = (match: (n: Node) => boolean) =>\n nodes.reduce((max, n, i) => {\n if (!match(n)) return max\n const [name, value] = texts[i] as readonly [string, string]\n return Math.max(max, estimateTextWidth(name, fontSize), estimateTextWidth(value, fontSize))\n }, 0)\n const cap = area.width * MAX_LABEL_SHARE\n const left =\n columns > 1\n ? Math.min(\n cap,\n widest((n) => n.column === 0),\n )\n : 0\n const right = Math.min(\n cap,\n widest((n) => n.column === columns - 1),\n )\n const plot: Rect = {\n x: area.x + (left ? left + LABEL_GAP : 0),\n y: area.y,\n width: Math.max(\n 0,\n area.width - (left ? left + LABEL_GAP : 0) - (right ? right + LABEL_GAP : 0),\n ),\n height: area.height,\n }\n const step = columns > 1 ? (plot.width - nodeWidth) / (columns - 1) : 0\n\n // Heights: one scale for every column, so values compare across them.\n const byColumn: Node[][] = Array.from({ length: columns }, () => [])\n for (const n of nodes) byColumn[n.column]?.push(n)\n const pad = byColumn.reduce(\n (min, col) => (col.length > 1 ? Math.min(min, plot.height / 2 / (col.length - 1)) : min),\n nodePadding,\n )\n let k = Number.POSITIVE_INFINITY\n for (const col of byColumn) {\n const sum = col.reduce((s, n) => s + n.value, 0)\n if (sum > 0) k = Math.min(k, (plot.height - (col.length - 1) * pad) / sum)\n }\n if (!Number.isFinite(k) || k < 0) k = 0\n byColumn.forEach((col, c) => {\n const total = col.reduce((s, n) => s + n.value * k, 0) + (col.length - 1) * pad\n let y = plot.y + (plot.height - total) / 2\n for (const n of col) {\n const x = plot.x + (columns > 1 ? c * step : (plot.width - nodeWidth) / 2)\n n.x = rtl ? width - x - nodeWidth : x\n n.y = y\n n.height = n.value * k\n y += n.height + pad\n }\n })\n // Slices: flows leave and enter in the order of the node at the other end.\n for (const n of nodes) {\n let y = n.y\n for (const link of [...n.outs].sort((a, b) => a.target.y - b.target.y)) {\n link.sy = y\n link.width = link.data.value * k\n y += link.width\n }\n y = n.y\n for (const link of [...n.ins].sort((a, b) => a.source.y - b.source.y)) {\n link.ty = y\n y += link.data.value * k\n }\n }\n\n const labels = nodes.map((n, i): NodeLabel => {\n const [name, value] = texts[i] as readonly [string, string]\n const side: 'left' | 'right' = n.column === 0 && columns > 1 ? 'left' : 'right'\n const room =\n side === 'left' ? left : n.column === columns - 1 ? right : step - nodeWidth - LABEL_GAP * 2\n // Crowded columns keep only the names: the value line would run into the next label.\n const col = byColumn[n.column] as Node[]\n const at = col.indexOf(n)\n const neighbours = [col[at - 1], col[at + 1]].filter((o): o is Node => !!o)\n const spacing = neighbours.reduce(\n (min, o) => Math.min(min, (n.height + o.height) / 2 + pad),\n Number.POSITIVE_INFINITY,\n )\n const showValue = spacing >= fontSize * (1 + LINE_HEIGHT)\n return {\n side,\n name: truncate(name, room, fontSize),\n value: showValue ? truncate(value, room, fontSize) : '',\n }\n })\n if (rtl) plot.x = width - plot.x - plot.width\n return { nodes, links, plot, nodeWidth, labels }\n}\n\n/** The x of a link's ends: the facing edges of its source and its target. */\nconst linkEnds = (link: Link, nodeWidth: number): [number, number] =>\n link.source.x > link.target.x\n ? [link.source.x, link.target.x + nodeWidth]\n : [link.source.x + nodeWidth, link.target.x]\n\n/** Path of a link: two cubic Béziers between the slices at its ends. */\nfunction linkPath(link: Link, nodeWidth: number): string {\n const [x0, x1] = linkEnds(link, nodeWidth)\n const xm = (x0 + x1) / 2\n const { sy, ty, width } = link\n const p = (...v: number[]) => v.map(round).join(',')\n return `M${p(x0, sy)}C${p(xm, sy, xm, ty, x1, ty)}L${p(x1, ty + width)}C${p(xm, ty + width, xm, sy + width, x0, sy + width)}Z`\n}\n\n/** A point on a cubic Bézier with control points `a`, `b`, `c`, `d`. */\nconst cubic = (a: number, b: number, c: number, d: number, t: number): number => {\n const u = 1 - t\n return u * u * u * a + 3 * u * u * t * b + 3 * u * t * t * c + t * t * t * d\n}\n\n/** Whether `(px, py)` lies inside the ribbon of `link`. */\nfunction inLink(link: Link, nodeWidth: number, px: number, py: number): boolean {\n const [x0, x1] = linkEnds(link, nodeWidth)\n if (px < Math.min(x0, x1) || px > Math.max(x0, x1) || x0 === x1) return false\n const xm = (x0 + x1) / 2\n // x(t) is monotone, so bisection finds the t under the pointer.\n let lo = 0\n let hi = 1\n for (let i = 0; i < 20; i++) {\n const mid = (lo + hi) / 2\n if (cubic(x0, xm, xm, x1, mid) < px === x1 > x0) lo = mid\n else hi = mid\n }\n const top = cubic(link.sy, link.sy, link.ty, link.ty, (lo + hi) / 2)\n return py >= top && py <= top + link.width\n}\n\nfunction renderSankey(options: SankeyOptions, ctx: RenderContext): RenderResult {\n const { nodes, links, plot, nodeWidth, labels } = layout(options, ctx)\n const drawn = links.filter((link) => link.data.value > 0)\n const formatValue = formatDetail(options.format, ctx.locale)\n\n const nodeMark = (n: Node): Highlight => ({\n kind: 'halo',\n d: `M0,0h${round(nodeWidth)}v${round(n.height)}h${round(-nodeWidth)}Z`,\n x: n.x,\n y: n.y,\n under: true,\n })\n // Marks go under the chart: over it, a hovered flow would cover the labels on it.\n const linkMark = (link: Link): Highlight => ({\n kind: 'halo',\n d: linkPath(link, nodeWidth),\n under: true,\n })\n const linkItem = (link: Link): HitItem => ({\n name: `${link.source.data.name} ${ctx.rtl ? '←' : '→'} ${link.target.data.name}`,\n seriesIndex: link.index,\n color: colorOf(link.source),\n value: link.data.value,\n text: formatValue(link.data.value),\n x: (link.source.x + nodeWidth + link.target.x) / 2,\n y: cubic(link.sy, link.sy, link.ty, link.ty, 0.5) + link.width / 2,\n })\n const hitNode = (n: Node, linkIndex?: number): Hit => {\n const own: HitItem = {\n name: n.data.name,\n seriesIndex: links.length + n.index,\n color: colorOf(n),\n value: n.value,\n text: formatValue(n.value),\n x: n.x + nodeWidth / 2,\n y: n.y + n.height / 2,\n }\n const flows = [...n.ins, ...n.outs].map(linkItem)\n const focused = flows.find((item) => item.seriesIndex === linkIndex)\n const link = focused && drawn.find((l) => l.index === linkIndex)\n return {\n index: n.index,\n label: n.data.name,\n title: '',\n x: own.x,\n area: plot,\n items: [own, ...flows],\n seriesIndex: focused ? linkIndex : own.seriesIndex,\n highlight: link ? linkMark(link) : nodeMark(n),\n }\n }\n const hitLink = (link: Link): Hit => {\n const item = linkItem(link)\n return {\n index: link.source.index,\n label: link.source.data.name,\n title: '',\n x: item.x,\n area: plot,\n items: [item],\n seriesIndex: link.index,\n highlight: linkMark(link),\n }\n }\n\n const interaction: Interaction = {\n count: nodes.length,\n hitTest(px, py) {\n const n = nodes.find(\n (n) =>\n px >= n.x - HOVER_SLOP &&\n px <= n.x + nodeWidth + HOVER_SLOP &&\n py >= n.y - HOVER_SLOP &&\n py <= n.y + n.height + HOVER_SLOP,\n )\n if (n) return hitNode(n)\n const link = drawn.find((l) => inLink(l, nodeWidth, px, py))\n return link ? hitLink(link) : null\n },\n hitIndex(index, seriesIndex) {\n const n = nodes[index]\n return n ? hitNode(n, seriesIndex) : null\n },\n }\n\n const content = [\n h(\n 'g',\n { key: 'links', class: 'tc-sankey-links' },\n drawn.map((link) =>\n h('path', {\n key: `${link.source.data.name}→${link.target.data.name}#${link.index}`,\n class: ['tc-series', `tc-series-${link.source.slot}`, 'tc-sankey-link'],\n style: { '--tc-series-color': link.source.data.color },\n d: linkPath(link, nodeWidth),\n }),\n ),\n ),\n h(\n 'g',\n { key: 'nodes', class: 'tc-sankey-nodes' },\n nodes.map((n) =>\n h(\n 'g',\n {\n key: n.data.name,\n class: ['tc-series', `tc-series-${n.slot}`],\n 'data-series': n.data.name,\n style: { '--tc-series-color': n.data.color },\n },\n h('rect', {\n class: 'tc-sankey-node',\n x: round(n.x),\n y: round(n.y),\n width: round(nodeWidth),\n height: round(n.height),\n }),\n ),\n ),\n ),\n h(\n 'g',\n { key: 'labels', class: 'tc-sankey-labels', 'aria-hidden': 'true' },\n nodes.map((n, i) => {\n const label = labels[i] as NodeLabel\n if (!label.name && !label.value) return null\n // The label's side is the one of the left-to-right layout: mirrored with it.\n const before = (label.side === 'left') !== (ctx.rtl === true)\n const x = round(before ? n.x - LABEL_GAP : n.x + nodeWidth + LABEL_GAP)\n const y = round(n.y + n.height / 2)\n const anchor = before ? 'end' : 'start'\n return h(\n 'g',\n { key: n.data.name, class: 'tc-sankey-label' },\n h(\n 'text',\n {\n class: 'tc-value-label tc-sankey-name',\n x,\n y,\n dy: label.value ? '-0.25em' : '0.35em',\n 'text-anchor': anchor,\n },\n label.name,\n ),\n label.value &&\n h(\n 'text',\n {\n class: 'tc-tick-label tc-sankey-value',\n x,\n y,\n dy: '0.95em',\n 'text-anchor': anchor,\n },\n label.value,\n ),\n )\n }),\n ),\n ]\n return { content, interaction }\n}\n\n/** One legend entry per custom color, named after the first node wearing it. */\nfunction sankeyLegend(options: SankeyOptions): LegendItem[] {\n const seen = new Map<string, LegendItem>()\n for (const n of options.data.nodes ?? []) {\n if (n.color && !seen.has(n.color)) {\n const item: LegendItem = { key: n.name, name: n.name, index: seen.size, color: n.color }\n if (n.hidden) item.hidden = true\n seen.set(n.color, item)\n }\n }\n return [...seen.values()]\n}\n\nfunction sankeyTable(options: SankeyOptions, ctx: RenderContext): DataTable {\n const { links } = graph(options.data, ctx.hidden, true)\n const value = formatDetail(options.format, ctx.locale)\n return {\n columns: ['From', 'To', 'Value'],\n rows: links.map((link) => [link.data.from, link.data.to, value(link.data.value)]),\n }\n}\n\n/** Nodes and links from users, APIs and JSON, in the shape the layout expects. */\nconst cleanSankey = (data: unknown): unknown => {\n const d = isRecord(data) ? data : {}\n return {\n ...d,\n nodes: Array.isArray(d.nodes) ? records(d.nodes, (r) => named(r)) : undefined,\n links: records(d.links, (r) => ({\n from: text(r.from),\n to: text(r.to),\n value: Math.max(0, finite(r.value) ?? 0),\n })),\n }\n}\n\n/**\n * Sankey diagram: flows between nodes, as ribbons whose width is their\n * value. Nodes are made from the links (or declared, to set their order and\n * colors) and placed in columns by the longest path from a source.\n *\n * ```ts\n * new Chart('#el', {\n * type: sankey,\n * data: {\n * links: [\n * { from: 'Wages', to: 'Income', value: 60 },\n * { from: 'Dividends', to: 'Income', value: 15 },\n * { from: 'Income', to: 'Rent', value: 30 },\n * { from: 'Income', to: 'Savings', value: 45 },\n * ],\n * },\n * })\n * ```\n */\nexport const sankey: ChartType<SankeyOptions> = {\n name: 'sankey',\n clean: cleanData(cleanSankey),\n render: renderSankey,\n legend: sankeyLegend,\n table: sankeyTable,\n}\n"],"mappings":";;;;;;AAwGA,MAAM,YAAY;;AAElB,MAAM,kBAAkB;;AAExB,MAAM,aAAa;;AAGnB,SAAS,SAAS,MAAc,OAAe,UAA0B;CACvE,IAAI,kBAAkB,MAAM,QAAQ,KAAK,OAAO,OAAO;CACvD,IAAI,MAAM,KAAK;CACf,OAAO,MAAM,KAAK,kBAAkB,GAAG,KAAK,MAAM,GAAG,GAAG,EAAE,IAAI,QAAQ,IAAI,OAAO;CACjF,OAAO,MAAM,IAAI,GAAG,KAAK,MAAM,GAAG,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK;AACxD;;AAGA,MAAM,WAAW,SAAuB,KAAK,KAAK,SAAS,kBAAkB,KAAK,KAAK;;AAGvF,SAAS,MAAM,MAAkB,QAA6B,SAAkB;CAC9E,MAAM,yBAAS,IAAI,IAAkB;CACrC,MAAM,QAAgB,CAAC;CACvB,MAAM,QAAQ,MAAc,SAA4B;EACtD,IAAI,QAAQ,OAAO,IAAI,IAAI;EAC3B,IAAI,CAAC,OAAO;GACV,QAAQ;IACN,MAAM,QAAQ,EAAE,KAAK;IACrB,OAAO,MAAM;IACb,MAAM;IACN,QAAQ;IACR,OAAO;IACP,GAAG;IACH,GAAG;IACH,QAAQ;IACR,KAAK,CAAC;IACN,MAAM,CAAC;GACT;GACA,OAAO,IAAI,MAAM,KAAK;GACtB,MAAM,KAAK,KAAK;EAClB;EACA,OAAO;CACT;CACA,MAAM,WAAW,IAAI,KAAK,KAAK,SAAS,CAAC,EAAA,CAAG,KAAK,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;;CAEnE,MAAM,YAAY,SAAiB;EACjC,MAAM,IAAI,SAA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AM,KAAK,KAAK,KAAK;EAAC,CAAC;CAClF;AACF;;AAGA,MAAM,eAAe,SAA2B;CAC9C,MAAM,IAAI,SAAS,IAAI,IAAI,OAAO,CAAC;CACnC,OAAO;EACL,GAAG;EACH,OAAO,MAAM,QAAQ,EAAE,KAAK,IAAI,QAAQ,EAAE,QAAQ,MAAM,MAAM,CAAC,CAAC,IAAI,KAAA;EACpE,OAAO,QAAQ,EAAE,QAAQ,OAAO;GAC9B,MAAM,KAAK,EAAE,IAAI;GACjB,IAAI,KAAK,EAAE,EAAE;GACb,OAAO,KAAK,IAAI,GAAG,OAAO,EAAE,KAAK,KAAK,CAAC;EACzC,EAAE;CACJ;AACF;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,SAAmC;CAC9C,MAAM;CACN,OAAO,UAAU,WAAW;CAC5B,QAAQ;CACR,QAAQ;CACR,OAAO;AACT"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
//#region src/charts/sankey.d.ts
|
|
1
|
+
import { o as ChartType } from "./chart-CbPzP5Dp.cjs";
|
|
2
|
+
import { c as NumberFormat } from "./time-B4oxWHQI.cjs";
|
|
3
|
+
import { a as InsetsInput } from "./annotations-CHafaGd4.cjs";
|
|
5
4
|
/** A node of the flow; nodes left out are made from the links. */
|
|
6
5
|
interface SankeyNode {
|
|
7
6
|
name: string;
|
|
@@ -62,6 +61,4 @@ interface SankeyOptions {
|
|
|
62
61
|
* ```
|
|
63
62
|
*/
|
|
64
63
|
declare const sankey: ChartType<SankeyOptions>;
|
|
65
|
-
|
|
66
|
-
export { sankey as a, SankeyOptions as i, SankeyLink as n, SankeyNode as r, SankeyData as t };
|
|
67
|
-
//# sourceMappingURL=sankey-DuGI3Qc5.d.cts.map
|
|
64
|
+
export { sankey as a, SankeyOptions as i, SankeyLink as n, SankeyNode as r, SankeyData as t };
|
package/dist/sankey.cjs
CHANGED
package/dist/sankey.d.cts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
/** Standalone entry: `import { sankey } from '@tabler/charts/sankey'`. */
|
|
2
|
+
import { a as sankey, i as SankeyOptions, n as SankeyLink, r as SankeyNode, t as SankeyData } from "./sankey-DqiuxUx7.cjs";
|
|
2
3
|
export { type SankeyData, type SankeyLink, type SankeyNode, type SankeyOptions, sankey };
|
package/dist/sankey.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
/** Standalone entry: `import { sankey } from '@tabler/charts/sankey'`. */
|
|
2
|
+
import { a as sankey, i as SankeyOptions, n as SankeyLink, r as SankeyNode, t as SankeyData } from "./sankey-7As41Fo4.js";
|
|
2
3
|
export { type SankeyData, type SankeyLink, type SankeyNode, type SankeyOptions, sankey };
|
package/dist/sankey.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { sankey };
|
|
1
|
+
export { t as sankey } from "./sankey-Dp4CuLVe.js";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { a as
|
|
4
|
-
//#region src/charts/scatter.d.ts
|
|
1
|
+
import { o as ChartType, ut as ValueAxisOptions } from "./chart-CYrrUCi3.js";
|
|
2
|
+
import { a as InsetsInput } from "./annotations-B02GR_KU.js";
|
|
3
|
+
import { a as ClassValue } from "./vnode-Du2cC8Fm.js";
|
|
5
4
|
/** A point of a scatter or bubble chart. */
|
|
6
5
|
interface ScatterPoint {
|
|
7
6
|
x: number;
|
|
@@ -25,13 +24,21 @@ interface ScatterSeries {
|
|
|
25
24
|
class?: ClassValue;
|
|
26
25
|
/** Start hidden (toggle it back from the legend). */
|
|
27
26
|
hidden?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Write values on this series' marks, whatever the chart's `valueLabels`
|
|
29
|
+
* says: `true` labels it even when the chart option is off, `false` leaves
|
|
30
|
+
* it out. Needs `@tabler/charts/value-labels` on the core.
|
|
31
|
+
*/
|
|
32
|
+
valueLabels?: boolean;
|
|
28
33
|
}
|
|
29
34
|
interface ScatterOptions {
|
|
30
35
|
data: {
|
|
31
36
|
series: readonly ScatterSeries[];
|
|
32
37
|
};
|
|
33
|
-
/** Horizontal value axis. */
|
|
34
|
-
x?: ValueAxisOptions
|
|
38
|
+
/** Horizontal value axis; `reverse` runs it from the right (the default with `rtl`). */
|
|
39
|
+
x?: ValueAxisOptions & {
|
|
40
|
+
reverse?: boolean;
|
|
41
|
+
};
|
|
35
42
|
/** Vertical value axis. */
|
|
36
43
|
y?: ValueAxisOptions;
|
|
37
44
|
/** Radius of points without a size, in pixels. Defaults to `4`. */
|
|
@@ -56,6 +63,4 @@ interface ScatterOptions {
|
|
|
56
63
|
* ```
|
|
57
64
|
*/
|
|
58
65
|
declare const scatter: ChartType<ScatterOptions>;
|
|
59
|
-
|
|
60
|
-
export { scatter as i, ScatterPoint as n, ScatterSeries as r, ScatterOptions as t };
|
|
61
|
-
//# sourceMappingURL=scatter-DbxLyZX0.d.cts.map
|
|
66
|
+
export { scatter as i, ScatterPoint as n, ScatterSeries as r, ScatterOptions as t };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const require_format = require("./format-
|
|
4
|
-
const
|
|
5
|
-
const require_extent = require("./extent-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
1
|
+
const require_axis = require("./axis-YfAerNBA.cjs");
|
|
2
|
+
const require_cartesian = require("./cartesian-DRSXHxWe.cjs");
|
|
3
|
+
const require_format = require("./format-CAE5ruy6.cjs");
|
|
4
|
+
const require_layout = require("./layout-Cfg9x1k2.cjs");
|
|
5
|
+
const require_extent = require("./extent-DuYDcvM9.cjs");
|
|
6
|
+
const require_circle = require("./circle-Bwxy5j7B.cjs");
|
|
7
|
+
const require_vnode = require("./vnode-ClAiw28x.cjs");
|
|
8
|
+
const require_clean = require("./clean-Die2iCNc.cjs");
|
|
9
|
+
const require_named = require("./named-BBASc8dW.cjs");
|
|
10
|
+
// src/charts/scatter.ts
|
|
10
11
|
/** Pointer distance (in pixels, beyond the radius) that still hits a point. */
|
|
11
12
|
const HIT_RADIUS = 24;
|
|
12
13
|
const EDGE = 8;
|
|
@@ -36,18 +37,18 @@ function renderScatter(options, ctx) {
|
|
|
36
37
|
const probeY = ticksOf(require_cartesian.valueScale(yDomain, [1, 0], yOptions), yOptions, countY);
|
|
37
38
|
const probeX = ticksOf(require_cartesian.valueScale(xDomain, [0, 1], xOptions), xOptions, countX);
|
|
38
39
|
const half = (tick) => showX && tick ? Math.ceil(require_layout.estimateTextWidth(tick.label, fontSize) / 2) : 0;
|
|
39
|
-
const
|
|
40
|
-
const
|
|
40
|
+
const reverse = xOptions.reverse ?? ctx.rtl === true;
|
|
41
|
+
const near = reverse === (ctx.rtl === true) ? 0 : probeX.length - 1;
|
|
42
|
+
const { area, side, range } = require_layout.plotFrame(ctx, options.padding, (pad) => ({
|
|
41
43
|
top: pad.top + Math.max(showY ? Math.ceil(fontSize * require_layout.LINE_HEIGHT / 2) : 0, overhang, EDGE / 2),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
const
|
|
47
|
-
const x = require_cartesian.valueScale(xDomain, [area.x, area.x + area.width], xOptions);
|
|
44
|
+
bottom: pad.bottom + Math.max((showX ? require_axis.axisSize("bottom", probeX, fontSize) : 0) + require_axis.axisTitleSize(xOptions.title, fontSize), overhang, EDGE / 2),
|
|
45
|
+
start: pad.start + Math.max((showY ? require_axis.axisSize("left", probeY, fontSize) : 0) + require_axis.axisTitleSize(yOptions.title, fontSize), half(probeX[near]), overhang),
|
|
46
|
+
end: pad.end + Math.max(half(probeX[probeX.length - 1 - near]), overhang, EDGE)
|
|
47
|
+
}));
|
|
48
|
+
const x = require_cartesian.valueScale(xDomain, range(reverse), xOptions);
|
|
48
49
|
const y = require_cartesian.valueScale(yDomain, [area.y + area.height, area.y], yOptions);
|
|
49
|
-
const xTicks =
|
|
50
|
-
const yTicks =
|
|
50
|
+
const xTicks = require_axis.thinTicks(ticksOf(x, xOptions, countX), "bottom", fontSize);
|
|
51
|
+
const yTicks = require_axis.thinTicks(ticksOf(y, yOptions, countY), "left", fontSize, 4);
|
|
51
52
|
const placed = [];
|
|
52
53
|
options.data.series.forEach((series, seriesIndex) => {
|
|
53
54
|
if (ctx.hidden.has(require_named.keyOf(series))) return;
|
|
@@ -88,7 +89,8 @@ function renderScatter(options, ctx) {
|
|
|
88
89
|
area,
|
|
89
90
|
items: [item],
|
|
90
91
|
seriesIndex: p.seriesIndex,
|
|
91
|
-
|
|
92
|
+
highlight: {
|
|
93
|
+
kind: "halo",
|
|
92
94
|
d: require_circle.circlePath(require_layout.round(p.r + 4)),
|
|
93
95
|
x: p.cx,
|
|
94
96
|
y: p.cy
|
|
@@ -124,7 +126,6 @@ function renderScatter(options, ctx) {
|
|
|
124
126
|
return best === -1 ? null : hitFor(placed[best], best);
|
|
125
127
|
}
|
|
126
128
|
};
|
|
127
|
-
ctx.onHitTest(interaction);
|
|
128
129
|
/** One path drawing a dot of `radius` at every point (two arcs each, or the series' shape). */
|
|
129
130
|
const shape = require_cartesian.markerShape(options);
|
|
130
131
|
const dotsPath = (dots, slot) => {
|
|
@@ -157,25 +158,30 @@ function renderScatter(options, ctx) {
|
|
|
157
158
|
cy: require_layout.round(y(point.y)),
|
|
158
159
|
r: require_layout.round(bubble(sizeOf(point)))
|
|
159
160
|
}))));
|
|
160
|
-
return
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
161
|
+
return {
|
|
162
|
+
content: [
|
|
163
|
+
require_vnode.h("defs", null, clip.def),
|
|
164
|
+
background,
|
|
165
|
+
require_vnode.h("g", {
|
|
166
|
+
key: "series",
|
|
167
|
+
class: "tc-series-list",
|
|
168
|
+
"clip-path": clip.url
|
|
169
|
+
}, groups),
|
|
170
|
+
showY && require_axis.axis({
|
|
171
|
+
position: side,
|
|
172
|
+
ticks: yTicks,
|
|
173
|
+
area
|
|
174
|
+
}),
|
|
175
|
+
showX && require_axis.axis({
|
|
176
|
+
position: "bottom",
|
|
177
|
+
ticks: xTicks,
|
|
178
|
+
area
|
|
179
|
+
}),
|
|
180
|
+
!!yOptions.title && require_axis.axisTitle(side, showY ? yTicks : [], area, yOptions.title, fontSize),
|
|
181
|
+
!!xOptions.title && require_axis.axisTitle("bottom", showX ? xTicks : [], area, xOptions.title, fontSize)
|
|
182
|
+
],
|
|
183
|
+
interaction
|
|
184
|
+
};
|
|
179
185
|
}
|
|
180
186
|
function scatterTable(options, ctx, limit = Number.POSITIVE_INFINITY) {
|
|
181
187
|
const fx = require_format.formatDetail(options.x?.format, ctx.locale);
|
|
@@ -239,7 +245,6 @@ const scatter = {
|
|
|
239
245
|
table: scatterTable,
|
|
240
246
|
valueLabels: { format: (options) => options.y?.format }
|
|
241
247
|
};
|
|
242
|
-
//#endregion
|
|
243
248
|
Object.defineProperty(exports, "scatter", {
|
|
244
249
|
enumerable: true,
|
|
245
250
|
get: function() {
|
|
@@ -247,4 +252,4 @@ Object.defineProperty(exports, "scatter", {
|
|
|
247
252
|
}
|
|
248
253
|
});
|
|
249
254
|
|
|
250
|
-
//# sourceMappingURL=scatter-
|
|
255
|
+
//# sourceMappingURL=scatter-Bwkblr4L.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scatter-Bwkblr4L.cjs","names":["keyOf","extent","tickCount","plottable","domainOf","valueTicks","valueScale","estimateTextWidth","plotFrame","LINE_HEIGHT","axisSize","axisTitleSize","thinTicks","formatDetail","formatNumber","circlePath","round","markerShape","h","grid","plotClip","groupAttrs","axis","axisTitle","cleanData","isRecord","records","named","finite","text","legendItems"],"sources":["../src/charts/scatter.ts"],"sourcesContent":["import type { DataTable } from '../a11y.ts'\nimport type { ChartType, RenderContext } from '../chart.ts'\nimport {\n axis,\n axisSize,\n axisTitle,\n axisTitleSize,\n type Tick,\n thinTicks,\n} from '../components/axis.ts'\nimport { grid } from '../components/grid.ts'\nimport { formatDetail, formatNumber } from '../format.ts'\nimport type { Hit, HitItem, Interaction } from '../interaction.ts'\nimport { estimateTextWidth, type InsetsInput, LINE_HEIGHT, plotFrame, round } from '../layout.ts'\nimport { extent } from '../scales/extent.ts'\nimport type { LinearScale } from '../scales/linear.ts'\nimport { circlePath } from '../shapes/circle.ts'\nimport { type ClassValue, h } from '../vnode.ts'\nimport {\n domainOf,\n markerShape,\n plotClip,\n plottable,\n tickCount,\n type ValueAxisOptions,\n valueScale,\n valueTicks,\n} from './cartesian.ts'\nimport { cleanData, finite, isRecord, named, records, text } from './clean.ts'\nimport { groupAttrs, keyOf, legendItems } from './named.ts'\n\n/** A point of a scatter or bubble chart. */\nexport interface ScatterPoint {\n x: number\n y: number\n /** Bubble size; the circle area is proportional to it. */\n size?: number\n /** Name shown in the tooltip and table (e.g. a country). */\n label?: string\n}\n\nexport interface ScatterSeries {\n name: string\n points: readonly ScatterPoint[]\n /** Stable identity for keyed updates and legend toggles. Defaults to `name`. */\n id?: string\n /**\n * Custom color; overrides the palette slot via `--tc-series-color`.\n * Values that could inject CSS (`;`, quotes, `url()` …) are ignored, so colors from user data are safe.\n */\n color?: string\n /** Extra classes on the series group. */\n class?: ClassValue\n /** Start hidden (toggle it back from the legend). */\n hidden?: boolean\n /**\n * Write values on this series' marks, whatever the chart's `valueLabels`\n * says: `true` labels it even when the chart option is off, `false` leaves\n * it out. Needs `@tabler/charts/value-labels` on the core.\n */\n valueLabels?: boolean\n}\n\nexport interface ScatterOptions {\n data: { series: readonly ScatterSeries[] }\n /** Horizontal value axis; `reverse` runs it from the right (the default with `rtl`). */\n x?: ValueAxisOptions & { reverse?: boolean }\n /** Vertical value axis. */\n y?: ValueAxisOptions\n /** Radius of points without a size, in pixels. Defaults to `4`. */\n radius?: number\n /** Radius range for bubbles (points with `size`). Defaults to `{ min: 4, max: 24 }`. */\n size?: { min?: number; max?: number }\n /** Extra space around the plot area, in pixels. */\n padding?: InsetsInput\n}\n\n/** Pointer distance (in pixels, beyond the radius) that still hits a point. */\nconst HIT_RADIUS = 24\nconst EDGE = 8\n\ninterface Placed {\n seriesIndex: number\n pointIndex: number\n point: ScatterPoint\n cx: number\n cy: number\n r: number\n}\n\n/** A point's bubble size, or `undefined` when it has none (or an invalid one). */\nconst sizeOf = (p: ScatterPoint): number | undefined =>\n p.size != null && Number.isFinite(p.size) && p.size > 0 ? p.size : undefined\n\nfunction renderScatter(options: ScatterOptions, ctx: RenderContext) {\n const { width, height, fontSize, locale } = ctx\n const xOptions = options.x ?? {}\n const yOptions = options.y ?? {}\n const radius = options.radius ?? 4\n const visible = options.data.series.filter((s) => !ctx.hidden.has(keyOf(s)))\n const points = visible.flatMap((s) => s.points)\n const sizes = points.map(sizeOf).filter((v): v is number => v !== undefined)\n const maxSize = extent(sizes)?.[1] ?? 0\n const rMin = options.size?.min ?? 4\n const rMax = options.size?.max ?? 24\n // Area-proportional bubbles: the radius grows with the square root of the size.\n const bubble = (size: number | undefined) =>\n size != null && size > 0 && maxSize > 0\n ? rMin + (rMax - rMin) * Math.sqrt(size / maxSize)\n : radius\n const overhang = Math.max(radius, sizes.length ? rMax : 0) + 2\n\n const countY = tickCount(yOptions, Math.max(2, Math.round(height / 60)))\n const countX = tickCount(xOptions, Math.max(2, Math.round(width / 80)))\n // Only points that can be plotted on both axes take part.\n const usable = (p: ScatterPoint) => plottable(p.x, xOptions) && plottable(p.y, yOptions)\n const shown = points.filter(usable)\n const xDomain = domainOf(\n shown.map((p) => p.x),\n xOptions,\n false,\n countX,\n )\n const yDomain = domainOf(\n shown.map((p) => p.y),\n yOptions,\n false,\n countY,\n )\n\n const showX = xOptions.show !== false\n const showY = yOptions.show !== false\n // Linear or logarithmic, as each axis asks (see valueScale).\n const ticksOf = (scale: LinearScale, axis: ValueAxisOptions, count: number) =>\n valueTicks(scale, axis, count, axis.format, locale)\n const probeY = ticksOf(valueScale(yDomain, [1, 0], yOptions), yOptions, countY)\n const probeX = ticksOf(valueScale(xDomain, [0, 1], xOptions), xOptions, countX)\n const half = (tick: Tick | undefined) =>\n showX && tick ? Math.ceil(estimateTextWidth(tick.label, fontSize) / 2) : 0\n const reverse = xOptions.reverse ?? ctx.rtl === true\n // The x tick on the start side of the plot, and the one on the end side.\n const near = reverse === (ctx.rtl === true) ? 0 : probeX.length - 1\n const { area, side, range } = plotFrame(ctx, options.padding, (pad) => ({\n top:\n pad.top + Math.max(showY ? Math.ceil((fontSize * LINE_HEIGHT) / 2) : 0, overhang, EDGE / 2),\n bottom:\n pad.bottom +\n Math.max(\n (showX ? axisSize('bottom', probeX, fontSize) : 0) +\n axisTitleSize(xOptions.title, fontSize),\n overhang,\n EDGE / 2,\n ),\n start:\n pad.start +\n Math.max(\n (showY ? axisSize('left', probeY, fontSize) : 0) + axisTitleSize(yOptions.title, fontSize),\n half(probeX[near]),\n overhang,\n ),\n end: pad.end + Math.max(half(probeX[probeX.length - 1 - near]), overhang, EDGE),\n }))\n const x = valueScale(xDomain, range(reverse), xOptions)\n const y = valueScale(yDomain, [area.y + area.height, area.y], yOptions)\n // Thinned like the ticks of the other charts: on a log axis they crowd at the end of each decade.\n const xTicks = thinTicks(ticksOf(x, xOptions, countX), 'bottom', fontSize)\n const yTicks = thinTicks(ticksOf(y, yOptions, countY), 'left', fontSize, 4)\n\n // Every visible point in pixels, sorted by x for fast nearest-point lookups.\n const placed: Placed[] = []\n options.data.series.forEach((series, seriesIndex) => {\n if (ctx.hidden.has(keyOf(series))) return\n series.points.forEach((point, pointIndex) => {\n if (!usable(point)) return\n placed.push({\n seriesIndex,\n pointIndex,\n point,\n cx: x(point.x),\n cy: y(point.y),\n r: bubble(sizeOf(point)),\n })\n })\n })\n placed.sort((a, b) => a.cx - b.cx)\n\n const fx = formatDetail(xOptions.format, locale)\n const fy = formatDetail(yOptions.format, locale)\n const fs = formatNumber(undefined, locale)\n const hitFor = (p: Placed, index: number): Hit => {\n const series = options.data.series[p.seriesIndex] as ScatterSeries\n const sz = sizeOf(p.point)\n const size = sz === undefined ? '' : ` · ${fs(sz)}`\n const item: HitItem = {\n name: series.name,\n seriesIndex: p.seriesIndex,\n value: p.point.y,\n text: `${fx(p.point.x)}, ${fy(p.point.y)}${size}`,\n x: p.cx,\n y: p.cy,\n }\n if (series.color) item.color = series.color\n return {\n index,\n label: p.point.label ?? series.name,\n title: p.point.label ?? '',\n x: p.cx,\n area,\n items: [item],\n seriesIndex: p.seriesIndex,\n highlight: { kind: 'halo', d: circlePath(round(p.r + 4)), x: p.cx, y: p.cy },\n }\n }\n\n const interaction: Interaction = {\n count: placed.length,\n hitIndex: (index) => {\n const p = placed[index]\n return p ? hitFor(p, index) : null\n },\n hitTest(px, py) {\n // Binary search the first point within reach on x, then scan the window.\n let lo = 0\n let hi = placed.length\n const reach = HIT_RADIUS + rMax\n while (lo < hi) {\n const mid = (lo + hi) >> 1\n if ((placed[mid] as Placed).cx < px - reach) lo = mid + 1\n else hi = mid\n }\n let best = -1\n let bestDistance = Number.POSITIVE_INFINITY\n for (let i = lo; i < placed.length; i++) {\n const p = placed[i] as Placed\n if (p.cx > px + reach) break\n const distance = Math.hypot(p.cx - px, p.cy - py) - p.r\n if (distance < bestDistance && distance <= HIT_RADIUS) {\n best = i\n bestDistance = distance\n }\n }\n return best === -1 ? null : hitFor(placed[best] as Placed, best)\n },\n }\n\n /** One path drawing a dot of `radius` at every point (two arcs each, or the series' shape). */\n const shape = markerShape(options)\n const dotsPath = (dots: readonly ScatterPoint[], slot: number) => {\n if (!dots.length) return null\n const r = round(radius)\n let d = ''\n for (const p of dots) {\n d += shape\n ? shape(slot, x(p.x), y(p.y), r)\n : `M${round(x(p.x) - radius)},${round(y(p.y))}a${r},${r},0,1,0,${2 * r},0a${r},${r},0,1,0,${-2 * r},0`\n }\n return h('path', { key: 'dots', class: ['tc-point tc-dots', shape && 'tc-marker'], d })\n }\n\n const background = []\n if (yOptions.grid !== false) background.push(grid({ direction: 'y', ticks: yTicks, area }))\n if (xOptions.grid) background.push(grid({ direction: 'x', ticks: xTicks, area }))\n\n // Dots may reach a little past the plot edges; bubbles are cut at them (like\n // Chart.js), as a big one there would cover the axis labels.\n const clip = plotClip(ctx, area, sizes.length ? 0 : overhang)\n const groups = options.data.series.map(\n (series, seriesIndex) =>\n !ctx.hidden.has(keyOf(series)) &&\n h(\n 'g',\n groupAttrs(series, seriesIndex),\n // Plain points share one path per series: thousands of circles would\n // each cost the browser style and layout work. The path keeps its\n // commands while the point count does, so new data morphs. Bubbles\n // stay circles: each is see-through over the others.\n dotsPath(\n series.points.filter((p) => usable(p) && sizeOf(p) === undefined),\n seriesIndex,\n ),\n series.points.map(\n (point, i) =>\n usable(point) &&\n sizeOf(point) !== undefined &&\n h('circle', {\n key: i,\n class: 'tc-point tc-bubble',\n cx: round(x(point.x)),\n cy: round(y(point.y)),\n r: round(bubble(sizeOf(point))),\n }),\n ),\n ),\n )\n\n const content = [\n h('defs', null, clip.def),\n background,\n h('g', { key: 'series', class: 'tc-series-list', 'clip-path': clip.url }, groups),\n showY && axis({ position: side, ticks: yTicks, area }),\n showX && axis({ position: 'bottom', ticks: xTicks, area }),\n !!yOptions.title && axisTitle(side, showY ? yTicks : [], area, yOptions.title, fontSize),\n !!xOptions.title && axisTitle('bottom', showX ? xTicks : [], area, xOptions.title, fontSize),\n ]\n return { content, interaction }\n}\n\nfunction scatterTable(\n options: ScatterOptions,\n ctx: RenderContext,\n limit: number = Number.POSITIVE_INFINITY,\n): DataTable {\n const fx = formatDetail(options.x?.format, ctx.locale)\n const fy = formatDetail(options.y?.format, ctx.locale)\n const fs = formatNumber(undefined, ctx.locale)\n const series = options.data.series.filter((s) => !ctx.hidden.has(keyOf(s)))\n const withSize = series.some((s) => s.points.some((p) => p.size != null))\n const withLabel = series.some((s) => s.points.some((p) => p.label != null))\n const total = series.reduce((sum, s) => sum + s.points.length, 0)\n let left = limit\n return {\n columns: ['', ...(withLabel ? ['Label'] : []), 'x', 'y', ...(withSize ? ['Size'] : [])],\n total,\n rows: series.flatMap((s) => {\n const take = s.points.slice(0, Math.max(0, left))\n left -= take.length\n return take.map((p) => [\n s.name,\n ...(withLabel ? [p.label ?? ''] : []),\n fx(p.x),\n fy(p.y),\n ...(withSize ? [sizeOf(p) === undefined ? '–' : fs(sizeOf(p) as number)] : []),\n ])\n }),\n }\n}\n\n/**\n * Scatter chart: points on two value axes; give points a `size` for a\n * bubble chart (area-proportional radii).\n *\n * ```ts\n * new Chart('#el', {\n * type: scatter,\n * data: { series: [{ name: 'Cities', points: [{ x: 12, y: 3.4 }, { x: 18, y: 5.1 }] }] },\n * })\n * ```\n */\nexport const scatter: ChartType<ScatterOptions> = {\n name: 'scatter',\n clean: cleanData((data) => ({\n ...(isRecord(data) ? data : {}),\n series: records(isRecord(data) && data.series, (s) => ({\n ...named(s),\n points: records(s.points, (p) => ({\n ...p,\n x: finite(p.x),\n y: finite(p.y),\n size: finite(p.size) ?? undefined,\n label: p.label == null ? undefined : text(p.label),\n })).filter((p) => p.x !== null && p.y !== null),\n })),\n })),\n render: renderScatter,\n legend: (options) => legendItems(options.data.series),\n table: scatterTable,\n valueLabels: { format: (options) => options.y?.format },\n}\n"],"mappings":";;;;;;;;;;;AA8EA,MAAM,aAAa;AACnB,MAAM,OAAO;;AAYb,MAAM,UAAU,MACd,EAAE,QAAQ,QAAQ,OAAO,SAAS,EAAE,IAAI,KAAK,EAAE,OAAO,IAAI,EAAE,OAAO,KAAA;AAErE,SAAS,cAAc,SAAyB,KAAoB;CAClE,MAAM,EAAE,OAAO,QAAQ,UAAU,WAAW;CAC5C,MAAM,WAAW,QAAQ,KAAK,CAAC;CAC/B,MAAM,WAAW,QAAQ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OAAO,KAAK,KAAK,MAAM;IACrB,EAAE;IACF,GAAI,YAAY,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC;IACnC,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,GAAI,WAAW,CAAC,OAAO,CAAC,MAAM,KAAA,IAAY,MAAM,GAAG,OAAO,CAAC,CAAW,CAAC,IAAI,CAAC;GAC9E,CAAC;EACH,CAAC;CACH;AACF;;;;;;;;;;;;AAaA,MAAa,UAAqC;CAChD,MAAM;CACN,OAAOwB,cAAAA,WAAW,UAAU;EAC1B,GAAIC,cAAAA,SAAS,IAAI,IAAI,OAAO,CAAC;EAC7B,QAAQC,cAAAA,QAAQD,cAAAA,SAAS,IAAI,KAAK,KAAK,SAAS,OAAO;GACrD,GAAGE,cAAAA,MAAM,CAAC;GACV,QAAQD,cAAAA,QAAQ,EAAE,SAAS,OAAO;IAChC,GAAG;IACH,GAAGE,cAAAA,OAAO,EAAE,CAAC;IACb,GAAGA,cAAAA,OAAO,EAAE,CAAC;IACb,MAAMA,cAAAA,OAAO,EAAE,IAAI,KAAK,KAAA;IACxB,OAAO,EAAE,SAAS,OAAO,KAAA,IAAYC,cAAAA,KAAK,EAAE,KAAK;GACnD,EAAE,CAAC,CAAC,QAAQ,MAAM,EAAE,MAAM,QAAQ,EAAE,MAAM,IAAI;EAChD,EAAE;CACJ,EAAE;CACF,QAAQ;CACR,SAAS,YAAYC,cAAAA,YAAY,QAAQ,KAAK,MAAM;CACpD,OAAO;CACP,aAAa,EAAE,SAAS,YAAY,QAAQ,GAAG,OAAO;AACxD"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as formatDetail, r as formatNumber } from "./format-
|
|
4
|
-
import {
|
|
5
|
-
import { t as extent } from "./extent-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
|
|
1
|
+
import { i as axisTitleSize, n as axisSize, r as axisTitle, s as thinTicks, t as axis } from "./axis-MMaVoSWB.js";
|
|
2
|
+
import { E as grid, S as valueTicks, c as plotClip, l as plottable, r as domainOf, s as markerShape, v as tickCount, x as valueScale } from "./cartesian-BrPqb5Qn.js";
|
|
3
|
+
import { n as formatDetail, r as formatNumber } from "./format-it1kepFG.js";
|
|
4
|
+
import { n as estimateTextWidth, o as plotFrame, s as round, t as LINE_HEIGHT } from "./layout-DqAte3H8.js";
|
|
5
|
+
import { t as extent } from "./extent-DOV8rs-6.js";
|
|
6
|
+
import { t as circlePath } from "./circle-YRDaOBpk.js";
|
|
7
|
+
import { t as h } from "./vnode-_EMUqysL.js";
|
|
8
|
+
import { a as isRecord, c as named, d as text, i as finite, t as cleanData, u as records } from "./clean-CkoQobGv.js";
|
|
9
|
+
import { n as keyOf, r as legendItems, t as groupAttrs } from "./named-BOiBah6I.js";
|
|
10
|
+
// src/charts/scatter.ts
|
|
10
11
|
/** Pointer distance (in pixels, beyond the radius) that still hits a point. */
|
|
11
12
|
const HIT_RADIUS = 24;
|
|
12
13
|
const EDGE = 8;
|
|
@@ -36,15 +37,15 @@ function renderScatter(options, ctx) {
|
|
|
36
37
|
const probeY = ticksOf(valueScale(yDomain, [1, 0], yOptions), yOptions, countY);
|
|
37
38
|
const probeX = ticksOf(valueScale(xDomain, [0, 1], xOptions), xOptions, countX);
|
|
38
39
|
const half = (tick) => showX && tick ? Math.ceil(estimateTextWidth(tick.label, fontSize) / 2) : 0;
|
|
39
|
-
const
|
|
40
|
-
const
|
|
40
|
+
const reverse = xOptions.reverse ?? ctx.rtl === true;
|
|
41
|
+
const near = reverse === (ctx.rtl === true) ? 0 : probeX.length - 1;
|
|
42
|
+
const { area, side, range } = plotFrame(ctx, options.padding, (pad) => ({
|
|
41
43
|
top: pad.top + Math.max(showY ? Math.ceil(fontSize * LINE_HEIGHT / 2) : 0, overhang, EDGE / 2),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
const
|
|
47
|
-
const x = valueScale(xDomain, [area.x, area.x + area.width], xOptions);
|
|
44
|
+
bottom: pad.bottom + Math.max((showX ? axisSize("bottom", probeX, fontSize) : 0) + axisTitleSize(xOptions.title, fontSize), overhang, EDGE / 2),
|
|
45
|
+
start: pad.start + Math.max((showY ? axisSize("left", probeY, fontSize) : 0) + axisTitleSize(yOptions.title, fontSize), half(probeX[near]), overhang),
|
|
46
|
+
end: pad.end + Math.max(half(probeX[probeX.length - 1 - near]), overhang, EDGE)
|
|
47
|
+
}));
|
|
48
|
+
const x = valueScale(xDomain, range(reverse), xOptions);
|
|
48
49
|
const y = valueScale(yDomain, [area.y + area.height, area.y], yOptions);
|
|
49
50
|
const xTicks = thinTicks(ticksOf(x, xOptions, countX), "bottom", fontSize);
|
|
50
51
|
const yTicks = thinTicks(ticksOf(y, yOptions, countY), "left", fontSize, 4);
|
|
@@ -88,7 +89,8 @@ function renderScatter(options, ctx) {
|
|
|
88
89
|
area,
|
|
89
90
|
items: [item],
|
|
90
91
|
seriesIndex: p.seriesIndex,
|
|
91
|
-
|
|
92
|
+
highlight: {
|
|
93
|
+
kind: "halo",
|
|
92
94
|
d: circlePath(round(p.r + 4)),
|
|
93
95
|
x: p.cx,
|
|
94
96
|
y: p.cy
|
|
@@ -124,7 +126,6 @@ function renderScatter(options, ctx) {
|
|
|
124
126
|
return best === -1 ? null : hitFor(placed[best], best);
|
|
125
127
|
}
|
|
126
128
|
};
|
|
127
|
-
ctx.onHitTest(interaction);
|
|
128
129
|
/** One path drawing a dot of `radius` at every point (two arcs each, or the series' shape). */
|
|
129
130
|
const shape = markerShape(options);
|
|
130
131
|
const dotsPath = (dots, slot) => {
|
|
@@ -157,25 +158,30 @@ function renderScatter(options, ctx) {
|
|
|
157
158
|
cy: round(y(point.y)),
|
|
158
159
|
r: round(bubble(sizeOf(point)))
|
|
159
160
|
}))));
|
|
160
|
-
return
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
161
|
+
return {
|
|
162
|
+
content: [
|
|
163
|
+
h("defs", null, clip.def),
|
|
164
|
+
background,
|
|
165
|
+
h("g", {
|
|
166
|
+
key: "series",
|
|
167
|
+
class: "tc-series-list",
|
|
168
|
+
"clip-path": clip.url
|
|
169
|
+
}, groups),
|
|
170
|
+
showY && axis({
|
|
171
|
+
position: side,
|
|
172
|
+
ticks: yTicks,
|
|
173
|
+
area
|
|
174
|
+
}),
|
|
175
|
+
showX && axis({
|
|
176
|
+
position: "bottom",
|
|
177
|
+
ticks: xTicks,
|
|
178
|
+
area
|
|
179
|
+
}),
|
|
180
|
+
!!yOptions.title && axisTitle(side, showY ? yTicks : [], area, yOptions.title, fontSize),
|
|
181
|
+
!!xOptions.title && axisTitle("bottom", showX ? xTicks : [], area, xOptions.title, fontSize)
|
|
182
|
+
],
|
|
183
|
+
interaction
|
|
184
|
+
};
|
|
179
185
|
}
|
|
180
186
|
function scatterTable(options, ctx, limit = Number.POSITIVE_INFINITY) {
|
|
181
187
|
const fx = formatDetail(options.x?.format, ctx.locale);
|
|
@@ -239,7 +245,6 @@ const scatter = {
|
|
|
239
245
|
table: scatterTable,
|
|
240
246
|
valueLabels: { format: (options) => options.y?.format }
|
|
241
247
|
};
|
|
242
|
-
//#endregion
|
|
243
248
|
export { scatter as t };
|
|
244
249
|
|
|
245
|
-
//# sourceMappingURL=scatter-
|
|
250
|
+
//# sourceMappingURL=scatter-DCMAtt5L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scatter-DCMAtt5L.js","names":[],"sources":["../src/charts/scatter.ts"],"sourcesContent":["import type { DataTable } from '../a11y.ts'\nimport type { ChartType, RenderContext } from '../chart.ts'\nimport {\n axis,\n axisSize,\n axisTitle,\n axisTitleSize,\n type Tick,\n thinTicks,\n} from '../components/axis.ts'\nimport { grid } from '../components/grid.ts'\nimport { formatDetail, formatNumber } from '../format.ts'\nimport type { Hit, HitItem, Interaction } from '../interaction.ts'\nimport { estimateTextWidth, type InsetsInput, LINE_HEIGHT, plotFrame, round } from '../layout.ts'\nimport { extent } from '../scales/extent.ts'\nimport type { LinearScale } from '../scales/linear.ts'\nimport { circlePath } from '../shapes/circle.ts'\nimport { type ClassValue, h } from '../vnode.ts'\nimport {\n domainOf,\n markerShape,\n plotClip,\n plottable,\n tickCount,\n type ValueAxisOptions,\n valueScale,\n valueTicks,\n} from './cartesian.ts'\nimport { cleanData, finite, isRecord, named, records, text } from './clean.ts'\nimport { groupAttrs, keyOf, legendItems } from './named.ts'\n\n/** A point of a scatter or bubble chart. */\nexport interface ScatterPoint {\n x: number\n y: number\n /** Bubble size; the circle area is proportional to it. */\n size?: number\n /** Name shown in the tooltip and table (e.g. a country). */\n label?: string\n}\n\nexport interface ScatterSeries {\n name: string\n points: readonly ScatterPoint[]\n /** Stable identity for keyed updates and legend toggles. Defaults to `name`. */\n id?: string\n /**\n * Custom color; overrides the palette slot via `--tc-series-color`.\n * Values that could inject CSS (`;`, quotes, `url()` …) are ignored, so colors from user data are safe.\n */\n color?: string\n /** Extra classes on the series group. */\n class?: ClassValue\n /** Start hidden (toggle it back from the legend). */\n hidden?: boolean\n /**\n * Write values on this series' marks, whatever the chart's `valueLabels`\n * says: `true` labels it even when the chart option is off, `false` leaves\n * it out. Needs `@tabler/charts/value-labels` on the core.\n */\n valueLabels?: boolean\n}\n\nexport interface ScatterOptions {\n data: { series: readonly ScatterSeries[] }\n /** Horizontal value axis; `reverse` runs it from the right (the default with `rtl`). */\n x?: ValueAxisOptions & { reverse?: boolean }\n /** Vertical value axis. */\n y?: ValueAxisOptions\n /** Radius of points without a size, in pixels. Defaults to `4`. */\n radius?: number\n /** Radius range for bubbles (points with `size`). Defaults to `{ min: 4, max: 24 }`. */\n size?: { min?: number; max?: number }\n /** Extra space around the plot area, in pixels. */\n padding?: InsetsInput\n}\n\n/** Pointer distance (in pixels, beyond the radius) that still hits a point. */\nconst HIT_RADIUS = 24\nconst EDGE = 8\n\ninterface Placed {\n seriesIndex: number\n pointIndex: number\n point: ScatterPoint\n cx: number\n cy: number\n r: number\n}\n\n/** A point's bubble size, or `undefined` when it has none (or an invalid one). */\nconst sizeOf = (p: ScatterPoint): number | undefined =>\n p.size != null && Number.isFinite(p.size) && p.size > 0 ? p.size : undefined\n\nfunction renderScatter(options: ScatterOptions, ctx: RenderContext) {\n const { width, height, fontSize, locale } = ctx\n const xOptions = options.x ?? {}\n const yOptions = options.y ?? {}\n const radius = options.radius ?? 4\n const visible = options.data.series.filter((s) => !ctx.hidden.has(keyOf(s)))\n const points = visible.flatMap((s) => s.points)\n const sizes = points.map(sizeOf).filter((v): v is number => v !== undefined)\n const maxSize = extent(sizes)?.[1] ?? 0\n const rMin = options.size?.min ?? 4\n const rMax = options.size?.max ?? 24\n // Area-proportional bubbles: the radius grows with the square root of the size.\n const bubble = (size: number | undefined) =>\n size != null && size > 0 && maxSize > 0\n ? rMin + (rMax - rMin) * Math.sqrt(size / maxSize)\n : radius\n const overhang = Math.max(radius, sizes.length ? rMax : 0) + 2\n\n const countY = tickCount(yOptions, Math.max(2, Math.round(height / 60)))\n const countX = tickCount(xOptions, Math.max(2, Math.round(width / 80)))\n // Only points that can be plotted on both axes take part.\n const usable = (p: ScatterPoint) => plottable(p.x, xOptions) && plottable(p.y, yOptions)\n const shown = points.filter(usable)\n const xDomain = domainOf(\n shown.map((p) => p.x),\n xOptions,\n false,\n countX,\n )\n const yDomain = domainOf(\n shown.map((p) => p.y),\n yOptions,\n false,\n countY,\n )\n\n const showX = xOptions.show !== false\n const showY = yOptions.show !== false\n // Linear or logarithmic, as each axis asks (see valueScale).\n const ticksOf = (scale: LinearScale, axis: ValueAxisOptions, count: number) =>\n valueTicks(scale, axis, count, axis.format, locale)\n const probeY = ticksOf(valueScale(yDomain, [1, 0], yOptions), yOptions, countY)\n const probeX = ticksOf(valueScale(xDomain, [0, 1], xOptions), xOptions, countX)\n const half = (tick: Tick | undefined) =>\n showX && tick ? Math.ceil(estimateTextWidth(tick.label, fontSize) / 2) : 0\n const reverse = xOptions.reverse ?? ctx.rtl === true\n // The x tick on the start side of the plot, and the one on the end side.\n const near = reverse === (ctx.rtl === true) ? 0 : probeX.length - 1\n const { area, side, range } = plotFrame(ctx, options.padding, (pad) => ({\n top:\n pad.top + Math.max(showY ? Math.ceil((fontSize * LINE_HEIGHT) / 2) : 0, overhang, EDGE / 2),\n bottom:\n pad.bottom +\n Math.max(\n (showX ? axisSize('bottom', probeX, fontSize) : 0) +\n axisTitleSize(xOptions.title, fontSize),\n overhang,\n EDGE / 2,\n ),\n start:\n pad.start +\n Math.max(\n (showY ? axisSize('left', probeY, fontSize) : 0) + axisTitleSize(yOptions.title, fontSize),\n half(probeX[near]),\n overhang,\n ),\n end: pad.end + Math.max(half(probeX[probeX.length - 1 - near]), overhang, EDGE),\n }))\n const x = valueScale(xDomain, range(reverse), xOptions)\n const y = valueScale(yDomain, [area.y + area.height, area.y], yOptions)\n // Thinned like the ticks of the other charts: on a log axis they crowd at the end of each decade.\n const xTicks = thinTicks(ticksOf(x, xOptions, countX), 'bottom', fontSize)\n const yTicks = thinTicks(ticksOf(y, yOptions, countY), 'left', fontSize, 4)\n\n // Every visible point in pixels, sorted by x for fast nearest-point lookups.\n const placed: Placed[] = []\n options.data.series.forEach((series, seriesIndex) => {\n if (ctx.hidden.has(keyOf(series))) return\n series.points.forEach((point, pointIndex) => {\n if (!usable(point)) return\n placed.push({\n seriesIndex,\n pointIndex,\n point,\n cx: x(point.x),\n cy: y(point.y),\n r: bubble(sizeOf(point)),\n })\n })\n })\n placed.sort((a, b) => a.cx - b.cx)\n\n const fx = formatDetail(xOptions.format, locale)\n const fy = formatDetail(yOptions.format, locale)\n const fs = formatNumber(undefined, locale)\n const hitFor = (p: Placed, index: number): Hit => {\n const series = options.data.series[p.seriesIndex] as ScatterSeries\n const sz = sizeOf(p.point)\n const size = sz === undefined ? '' : ` · ${fs(sz)}`\n const item: HitItem = {\n name: series.name,\n seriesIndex: p.seriesIndex,\n value: p.point.y,\n text: `${fx(p.point.x)}, ${fy(p.point.y)}${size}`,\n x: p.cx,\n y: p.cy,\n }\n if (series.color) item.color = series.color\n return {\n index,\n label: p.point.label ?? series.name,\n title: p.point.label ?? '',\n x: p.cx,\n area,\n items: [item],\n seriesIndex: p.seriesIndex,\n highlight: { kind: 'halo', d: circlePath(round(p.r + 4)), x: p.cx, y: p.cy },\n }\n }\n\n const interaction: Interaction = {\n count: placed.length,\n hitIndex: (index) => {\n const p = placed[index]\n return p ? hitFor(p, index) : null\n },\n hitTest(px, py) {\n // Binary search the first point within reach on x, then scan the window.\n let lo = 0\n let hi = placed.length\n const reach = HIT_RADIUS + rMax\n while (lo < hi) {\n const mid = (lo + hi) >> 1\n if ((placed[mid] as Placed).cx < px - reach) lo = mid + 1\n else hi = mid\n }\n let best = -1\n let bestDistance = Number.POSITIVE_INFINITY\n for (let i = lo; i < placed.length; i++) {\n const p = placed[i] as Placed\n if (p.cx > px + reach) break\n const distance = Math.hypot(p.cx - px, p.cy - py) - p.r\n if (distance < bestDistance && distance <= HIT_RADIUS) {\n best = i\n bestDistance = distance\n }\n }\n return best === -1 ? null : hitFor(placed[best] as Placed, best)\n },\n }\n\n /** One path drawing a dot of `radius` at every point (two arcs each, or the series' shape). */\n const shape = markerShape(options)\n const dotsPath = (dots: readonly ScatterPoint[], slot: number) => {\n if (!dots.length) return null\n const r = round(radius)\n let d = ''\n for (const p of dots) {\n d += shape\n ? shape(slot, x(p.x), y(p.y), r)\n : `M${round(x(p.x) - radius)},${round(y(p.y))}a${r},${r},0,1,0,${2 * r},0a${r},${r},0,1,0,${-2 * r},0`\n }\n return h('path', { key: 'dots', class: ['tc-point tc-dots', shape && 'tc-marker'], d })\n }\n\n const background = []\n if (yOptions.grid !== false) background.push(grid({ direction: 'y', ticks: yTicks, area }))\n if (xOptions.grid) background.push(grid({ direction: 'x', ticks: xTicks, area }))\n\n // Dots may reach a little past the plot edges; bubbles are cut at them (like\n // Chart.js), as a big one there would cover the axis labels.\n const clip = plotClip(ctx, area, sizes.length ? 0 : overhang)\n const groups = options.data.series.map(\n (series, seriesIndex) =>\n !ctx.hidden.has(keyOf(series)) &&\n h(\n 'g',\n groupAttrs(series, seriesIndex),\n // Plain points share one path per series: thousands of circles would\n // each cost the browser style and layout work. The path keeps its\n // commands while the point count does, so new data morphs. Bubbles\n // stay circles: each is see-through over the others.\n dotsPath(\n series.points.filter((p) => usable(p) && sizeOf(p) === undefined),\n seriesIndex,\n ),\n series.points.map(\n (point, i) =>\n usable(point) &&\n sizeOf(point) !== undefined &&\n h('circle', {\n key: i,\n class: 'tc-point tc-bubble',\n cx: round(x(point.x)),\n cy: round(y(point.y)),\n r: round(bubble(sizeOf(point))),\n }),\n ),\n ),\n )\n\n const content = [\n h('defs', null, clip.def),\n background,\n h('g', { key: 'series', class: 'tc-series-list', 'clip-path': clip.url }, groups),\n showY && axis({ position: side, ticks: yTicks, area }),\n showX && axis({ position: 'bottom', ticks: xTicks, area }),\n !!yOptions.title && axisTitle(side, showY ? yTicks : [], area, yOptions.title, fontSize),\n !!xOptions.title && axisTitle('bottom', showX ? xTicks : [], area, xOptions.title, fontSize),\n ]\n return { content, interaction }\n}\n\nfunction scatterTable(\n options: ScatterOptions,\n ctx: RenderContext,\n limit: number = Number.POSITIVE_INFINITY,\n): DataTable {\n const fx = formatDetail(options.x?.format, ctx.locale)\n const fy = formatDetail(options.y?.format, ctx.locale)\n const fs = formatNumber(undefined, ctx.locale)\n const series = options.data.series.filter((s) => !ctx.hidden.has(keyOf(s)))\n const withSize = series.some((s) => s.points.some((p) => p.size != null))\n const withLabel = series.some((s) => s.points.some((p) => p.label != null))\n const total = series.reduce((sum, s) => sum + s.points.length, 0)\n let left = limit\n return {\n columns: ['', ...(withLabel ? ['Label'] : []), 'x', 'y', ...(withSize ? ['Size'] : [])],\n total,\n rows: series.flatMap((s) => {\n const take = s.points.slice(0, Math.max(0, left))\n left -= take.length\n return take.map((p) => [\n s.name,\n ...(withLabel ? [p.label ?? ''] : []),\n fx(p.x),\n fy(p.y),\n ...(withSize ? [sizeOf(p) === undefined ? '–' : fs(sizeOf(p) as number)] : []),\n ])\n }),\n }\n}\n\n/**\n * Scatter chart: points on two value axes; give points a `size` for a\n * bubble chart (area-proportional radii).\n *\n * ```ts\n * new Chart('#el', {\n * type: scatter,\n * data: { series: [{ name: 'Cities', points: [{ x: 12, y: 3.4 }, { x: 18, y: 5.1 }] }] },\n * })\n * ```\n */\nexport const scatter: ChartType<ScatterOptions> = {\n name: 'scatter',\n clean: cleanData((data) => ({\n ...(isRecord(data) ? data : {}),\n series: records(isRecord(data) && data.series, (s) => ({\n ...named(s),\n points: records(s.points, (p) => ({\n ...p,\n x: finite(p.x),\n y: finite(p.y),\n size: finite(p.size) ?? undefined,\n label: p.label == null ? undefined : text(p.label),\n })).filter((p) => p.x !== null && p.y !== null),\n })),\n })),\n render: renderScatter,\n legend: (options) => legendItems(options.data.series),\n table: scatterTable,\n valueLabels: { format: (options) => options.y?.format },\n}\n"],"mappings":";;;;;;;;;;;AA8EA,MAAM,aAAa;AACnB,MAAM,OAAO;;AAYb,MAAM,UAAU,MACd,EAAE,QAAQ,QAAQ,OAAO,SAAS,EAAE,IAAI,KAAK,EAAE,OAAO,IAAI,EAAE,OAAO,KAAA;AAErE,SAAS,cAAc,SAAyB,KAAoB;CAClE,MAAM,EAAE,OAAO,QAAQ,UAAU,WAAW;CAC5C,MAAM,WAAW,QAAQ,KAAK,CAAC;CAC/B,MAAM,WAAW,QAAQ,KAAK,CAAC;CAC/B,MAAM,SAAS,QAAQ,UAAU;CAEjC,MAAM,SADU,QAAQ,KAAK,OAAO,QAAQ,MAAM,CAAC,IAAI,OAAO,IAAI,MAAM,CAAC,CAAC,CACrD,CAAC,CAAC,SA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A;IACxB,OAAO,EAAE,SAAS,OAAO,KAAA,IAAY,KAAK,EAAE,KAAK;GACnD,EAAE,CAAC,CAAC,QAAQ,MAAM,EAAE,MAAM,QAAQ,EAAE,MAAM,IAAI;EAChD,EAAE;CACJ,EAAE;CACF,QAAQ;CACR,SAAS,YAAY,YAAY,QAAQ,KAAK,MAAM;CACpD,OAAO;CACP,aAAa,EAAE,SAAS,YAAY,QAAQ,GAAG,OAAO;AACxD"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { a as
|
|
4
|
-
//#region src/charts/scatter.d.ts
|
|
1
|
+
import { mt as ValueAxisOptions, o as ChartType } from "./chart-CbPzP5Dp.cjs";
|
|
2
|
+
import { a as InsetsInput } from "./annotations-CHafaGd4.cjs";
|
|
3
|
+
import { a as ClassValue } from "./vnode-Du2cC8Fm.cjs";
|
|
5
4
|
/** A point of a scatter or bubble chart. */
|
|
6
5
|
interface ScatterPoint {
|
|
7
6
|
x: number;
|
|
@@ -25,13 +24,21 @@ interface ScatterSeries {
|
|
|
25
24
|
class?: ClassValue;
|
|
26
25
|
/** Start hidden (toggle it back from the legend). */
|
|
27
26
|
hidden?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Write values on this series' marks, whatever the chart's `valueLabels`
|
|
29
|
+
* says: `true` labels it even when the chart option is off, `false` leaves
|
|
30
|
+
* it out. Needs `@tabler/charts/value-labels` on the core.
|
|
31
|
+
*/
|
|
32
|
+
valueLabels?: boolean;
|
|
28
33
|
}
|
|
29
34
|
interface ScatterOptions {
|
|
30
35
|
data: {
|
|
31
36
|
series: readonly ScatterSeries[];
|
|
32
37
|
};
|
|
33
|
-
/** Horizontal value axis. */
|
|
34
|
-
x?: ValueAxisOptions
|
|
38
|
+
/** Horizontal value axis; `reverse` runs it from the right (the default with `rtl`). */
|
|
39
|
+
x?: ValueAxisOptions & {
|
|
40
|
+
reverse?: boolean;
|
|
41
|
+
};
|
|
35
42
|
/** Vertical value axis. */
|
|
36
43
|
y?: ValueAxisOptions;
|
|
37
44
|
/** Radius of points without a size, in pixels. Defaults to `4`. */
|
|
@@ -56,6 +63,4 @@ interface ScatterOptions {
|
|
|
56
63
|
* ```
|
|
57
64
|
*/
|
|
58
65
|
declare const scatter: ChartType<ScatterOptions>;
|
|
59
|
-
|
|
60
|
-
export { scatter as i, ScatterPoint as n, ScatterSeries as r, ScatterOptions as t };
|
|
61
|
-
//# sourceMappingURL=scatter-BqzgJqdX.d.ts.map
|
|
66
|
+
export { scatter as i, ScatterPoint as n, ScatterSeries as r, ScatterOptions as t };
|
package/dist/scatter.cjs
CHANGED
package/dist/scatter.d.cts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
/** Standalone entry: `import { scatter } from '@tabler/charts/scatter'`. */
|
|
2
|
+
import { i as scatter, n as ScatterPoint, r as ScatterSeries, t as ScatterOptions } from "./scatter-DL0zAV09.cjs";
|
|
2
3
|
export { type ScatterOptions, type ScatterPoint, type ScatterSeries, scatter };
|
package/dist/scatter.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
/** Standalone entry: `import { scatter } from '@tabler/charts/scatter'`. */
|
|
2
|
+
import { i as scatter, n as ScatterPoint, r as ScatterSeries, t as ScatterOptions } from "./scatter-BXkXGgM_.js";
|
|
2
3
|
export { type ScatterOptions, type ScatterPoint, type ScatterSeries, scatter };
|
package/dist/scatter.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { scatter };
|
|
1
|
+
export { t as scatter } from "./scatter-DCMAtt5L.js";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as Curve } from "./path-
|
|
5
|
-
//#region src/charts/sparkline.d.ts
|
|
1
|
+
import { ct as Label, o as ChartType } from "./chart-CYrrUCi3.js";
|
|
2
|
+
import { c as NumberFormat } from "./time-DRIDgv2a.js";
|
|
3
|
+
import { a as InsetsInput } from "./annotations-B02GR_KU.js";
|
|
4
|
+
import { t as Curve } from "./path-YeUiOfG8.js";
|
|
6
5
|
interface SparklineOptions {
|
|
7
6
|
/** The values; `null` leaves a gap. */
|
|
8
7
|
data: readonly (number | null | undefined)[];
|
|
@@ -38,6 +37,4 @@ interface SparklineOptions {
|
|
|
38
37
|
* ```
|
|
39
38
|
*/
|
|
40
39
|
declare const sparkline: ChartType<SparklineOptions>;
|
|
41
|
-
|
|
42
|
-
export { sparkline as n, SparklineOptions as t };
|
|
43
|
-
//# sourceMappingURL=sparkline-BfyO_oNM.d.ts.map
|
|
40
|
+
export { sparkline as n, SparklineOptions as t };
|