posit-dev / great-tables

Make awesome display tables using Python.
https://posit-dev.github.io/great-tables/
MIT License
1.44k stars 50 forks source link

nanoplots: If `x_vals` is passed it silently overrides `line_type` curved to be straight #256

Open machow opened 3 months ago

machow commented 3 months ago

Currently, if you try to specify line_type curved, but also supply x_vals, we quietly set line_type back to straight.


_generate_nanoplot(
    y_vals=[1, 2, 3],
    x_vals=[2, 4, 6],
    show_data_line=True,
    plot_type="line",
    line_type="curved"
)

If we want to do this, then let's add a guard for x_vals at the very top, that does this one thing (warns user, and overrides their option). That way it will be very easy for us to spot, and users will know what's happening.

Currently, it happens pretty high up, but there's a little bit of extra processing that's going on in tandem.