Convert ggplot2 objects to plotly
Arguments
- p
ggplot2 object
Logical. If TRUE, returns the plot as a
tagListobject.- tooltip
Character. The tooltip to display. Default is "text".
- ...
Arguments passed on to
plotly::ggplotlywidthWidth of the plot in pixels (optional, defaults to automatic sizing).
heightHeight of the plot in pixels (optional, defaults to automatic sizing).
dynamicTicksshould plotly.js dynamically generate axis tick labels? Dynamic ticks are useful for updating ticks in response to zoom/pan interactions; however, they can not always reproduce labels as they would appear in the static ggplot2 image.
layerDatadata from which layer should be returned?
originalDatashould the "original" or "scaled" data be returned?
sourcea character string of length 1. Match the value of this string with the source argument in
event_data()to retrieve the event data corresponding to a specific plot (shiny apps can have multiple plots).
Examples
x <- data.frame(a = c(1,2,3), b = c(2,3,4))
p <- ggplot2::ggplot(x, ggplot2::aes(x = a, y = b)) + ggplot2::geom_point()
MotifPeeker:::to_plotly(p, html_tags = FALSE)