Closed
Description
The ggplotly
fails to convert geom_tile
element with no fill
aesthetic.
Ref : stackoverflow question
library(ggplot2)
set.seed(1503)
df <- data.frame(x = rep(1:3, 3),
y = rep(1:3, 3),
z = sample(c("A","B"), 9,replace = TRUE),
stringsAsFactors = F)
p1 <- ggplot(df)+
geom_tile(aes(x=x,y=y, fill="grey"), color = "black")
p2 <- ggplot(df)+
geom_tile(aes(x=x,y=y),fill="grey", color = "black")
class(plotly::ggplotly(p1))
#> [1] "plotly" "htmlwidget"
class(plotly::ggplotly(p2))
#> Error in `[.data.frame`(g, , c("fill_plotlyDomain", "fill")): undefined columns selected
Details:
looks like the code is breaking here
https://github.com/ropensci/plotly/blob/2cc296de6f77515003378a64b9fbdc93298ab45b/R/layers2traces.R#L849