Skip to content

Commit 805193b

Browse files
trekonomcpsievert
andauthored
Apply suggestions from code review
Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
1 parent 9352fd4 commit 805193b

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

R/ggplotly.R

+6-9
Original file line numberDiff line numberDiff line change
@@ -917,15 +917,12 @@ gg2list <- function(p, width = NULL, height = NULL,
917917
# facet strips -> plotly annotations
918918
if (has_facet(plot)) {
919919
col_vars <- ifelse(inherits(plot$facet, "FacetWrap"), "facets", "cols")
920-
col_txt <- if (!length(names(plot$facet$params[[col_vars]])) == 0) {
921-
paste(
922-
plot$facet$params$labeller(
923-
lay[names(plot$facet$params[[col_vars]])]
924-
), collapse = br()
925-
)
926-
} else {
927-
""
928-
}
920+
col_txt <- paste(
921+
plot$facet$params$labeller(
922+
lay[names(plot$facet$params[[col_vars]])]
923+
), collapse = br()
924+
)
925+
if (length(names(plot$facet$params[[col_vars]])) == 0) col_txt <- ""
929926
if (is_blank(theme[["strip.text.x"]])) col_txt <- ""
930927
if (inherits(plot$facet, "FacetGrid") && lay$ROW != 1) col_txt <- ""
931928
if (robust_nchar(col_txt) > 0) {

0 commit comments

Comments
 (0)