plotly / plotly.R

An interactive graphing library for R
https://plotly-r.com
Other
2.55k stars 622 forks source link

autoplotly generic similar to ggplot2::autoplot #1885

Open wkdavis opened 3 years ago

wkdavis commented 3 years ago

Would you consider an autoplotly() generic similar to ggplot2::autoplot()? We have a number of classes (in proprietary packages) for which we have created default plotting methods that use plotly. We can create our own autoplotly() generic, but I thought it might be of interest to others as well. Something as simple as:

autoplotly <- function(object, ...) {
  UseMethod("autoplotly")
}
cpsievert commented 3 years ago

That seems like a worthwhile idea, but unfortunately I don't have the bandwidth at the moment to take that on. You'd have my blessing to create an autoplotly package though, and maybe someday plotly could re-export autoplotly::autoplotly

wkdavis commented 3 years ago

@cpsievert Could the autoplotly() generic reside in the plotly package itself (just as the autoplot() generic is part of ggplot2)? Or is that not properly aligned with the scope of plotly? I'm happy to create a PR with the generic if you're okay with it living in plotly.