-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial build-out of facet wrapping #1838
Conversation
nicolaskruchten
commented
Oct 21, 2019
- Closes Facet wrapping plotly_express#2
- Closes Passing data frame column to facet_col raises exception #1836
The Percy diffs are because this code generates |
Ah I found it: https://github.com/plotly/plotly.py/blob/master/packages/python/plotly/plotly/subplots.py#L529 Basically I'm now passing a length-0 element to OK so I'm fine with these Percy diffs. Ready for review! I guess I need some tests. |
It was not introduced by this PR, but the behaviour when there is a very large number of cols/rows is weird. For example
or
give errors like
which is not very helpful as an error message. Should we either introduce a limit in the number of cols/rows, or try to catch this and output a better message? |
Thank you for fixing the bug of #1836. |
@@ -147,6 +147,11 @@ | |||
colref, | |||
"Values from this column or array_like are used to assign marks to facetted subplots in the horizontal direction.", | |||
], | |||
facet_col_wrap=[ | |||
"int", | |||
"Wrap the column variable at this width, so that the column facets span multiple rows.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say "number of columns. Facets are wrapped at this number to span multiple rows". Maybe it's just me, but since I'm not familiar with this kind of representation I had a hard time understanding what this was before I actually tried it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
ok, I just left a doc suggestion which you might or might not implement. My comment about the large number of cols/rows is not specific to this PR and can go to an issue. 💃 |
81e1de4
to
be875be
Compare
Nice catch on the "many columns" thing, here's the issue I broke it off into: #1839 |
OK I've added percy tests for the two tricky cases of facet wrapping, and a test locking down the fix for #1836 |
The |