You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This makes for kind of awkward usage. Because width comes before *args, it can never be named when the function is called (assuming you are passing in some *args, which you would always want to do). For example:
# These two don't worklayout_column_wrap(width="200px", "Hello", "world")
layout_column_wrap("Hello", "world", width="200px")
# This workslayout_column_wrap("200px", "Hello", "world")
On the other hand, heightmust always be named, and come after the *args. So if you want to specify both the width and height, you'd have to do this, which is awkward:
Your timing on bringing this up is great. I was just looking at updating the CSS used by layout_column_wrap() in such a way that width would not be required. The idea would be to use an auto-fit grid layout set such that width defines the minimum space required to create a new column in a row and we otherwise allow grid to choose the number of rows and columns. (I created a placeholder PR with the core idea here, but won't get back to this until after conf.)
With this change, it would make a lot of sense to move width out of the first argument position on the R side too, which sounds like an improvement for both languages. My proposal for R is that width default to something like "200px", as an optional named argument, with all the same behavior if the user chooses to customize the argument.
This would be a breaking change on the R side, so now would be a great time for any additional feedback or collaboration around this function.
The signature for
layout_column_wrap
is this:This makes for kind of awkward usage. Because
width
comes before*args
, it can never be named when the function is called (assuming you are passing in some*args
, which you would always want to do). For example:On the other hand,
height
must always be named, and come after the*args
. So if you want to specify both the width and height, you'd have to do this, which is awkward:Another awkward thing is that if you want to set
width
toNone
, you must call the function like this:The text was updated successfully, but these errors were encountered: