`plotly::ggplotly` seems to break when the `ggplot2` `key_glyph` argument is used

Hi All,

It looks like plotly::ggplotly breaks when the ggplot2 key_glyph argument is used.

Does anyone know a way to make this work?

Thanks!!!

library(tidyverse)

plot_data <- slice_sample(ggplot2::diamonds, prop = 0.01)

#this works
plot <- ggplot(plot_data) +
  geom_point(aes(carat, price, col = color, fill = color)) 

plot

plotly::ggplotly(plot)

#this does not work
plot <- ggplot(plot_data) +
  geom_point(aes(carat, price, col = color, fill = color), key_glyph = "polygon") 

plot

plotly::ggplotly(plot)

The warning message literally tells you why it does not work and what to do about it:

Warning messages:
1: In geom2trace.default(dots[[1L]][[7L]], dots[[2L]][[1L]], dots[[3L]][[1L]]) :
  geom_() has yet to be implemented in plotly.
  If you'd like to see this geom implemented,
  Please open an issue with your example code at
  https://github.com/ropensci/plotly/issues

...
1 Like

Thanks @martin.R

Added as a github issue

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.