Uh oh!
There was an error while loading. Please reload this page.
Bug fix. Account for multi_line=FALSE when facet rows/cols are missing. Closes #2341. - #2373
Bug fix. Account for multi_line=FALSE when facet rows/cols are missing. Closes #2341.#2373trekonom wants to merge 3 commits into
Conversation
trekonom
commented
Aug 24, 2024
And here is a more detailed description of the issue and the proposed fix: The underlying issue is that Lines 937 to 941 in 3cf17c0 although in this case plot$facets$params has no rows element and hence plot$facets$params$rows is NULL.This does not result in an issue as long as In case of library(plotly, warn=FALSE)
#> Loading required package: ggplot2g<- ggplot(mtcars, aes(mpg, wt)) +
geom_point() +
facet_grid(vs+am~.,
labeller=function(x) label_both(x, multi_line=FALSE)
)
ggplotly()Created on 2024-08-05 with reprex v2.1.0 To account for this case the PR adds an |
Uh oh!
There was an error while loading. Please reload this page.
| row_txt <- if (!length(names(plot$facet$params$rows)) == 0) { | ||
| paste( | ||
| plot$facet$params$labeller( | ||
| lay[names(plot$facet$params$rows)] | ||
| ), | ||
| collapse = br() | ||
| ) | ||
| } else { | ||
| "" | ||
| } |
There was a problem hiding this comment.
Similar recommendation as https://github.com/plotly/plotly.R/pull/2373/files#r1742335996
There was a problem hiding this comment.
Thx for the review and the suggestions. Just committed both suggestions.
cpsievert
commented
Sep 3, 2024
Thank you for the detailed explanation and contribution! This is looking very close to mergeable, I just had a couple stylistic suggestions |
kwilson62
commented
Sep 6, 2024
Looking forward to this getting fixed, currently experiencing the issue with "expression(list())" |
kwilson62
commented
Sep 6, 2024
@trekonom In addition to the bug you've fixed, there's also an issue where strip.position is not working in plotly. |
Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
trekonom
commented
Sep 6, 2024
@kwilson62 Will have a look if I find the time. But first let's finish this PR. (: |

This PR proposes a fix to account for
multi_line=FALSEin facet labeller functions, thereby closing #2341 .With the proposed fix, the reprex from #2341 renders correctly without the undesired, additional strip texts for the rows:
Created on 2024-08-24 with reprex v2.1.1