I would like to be able to specify a filename and dimensions for the ggplotly image that is created when a user selects "download as png" from the mode bar on a plot.
I see that there is a way to do this from a plotly graph as asked here, but would like to have similar control coming from a ggplotly graph, similar to the question asked here.
Using that same code example:
x <- c(1:15)
y <- c(1:15)
xy <- as.data.frame(cbind(x, y))
example <- ggplot(data = xy, aes(x = x, y = y)) + geom_line()
ggplotly(example) %>% config(displaylogo = FALSE,
modeBarButtonsToRemove = c(
'sendDataToCloud',
'autoScale2d',
'resetScale2d',
'hoverClosestCartesian',
'hoverCompareCartesian'
))
Is there another config setting
that I could utilize to specify a filename/attributes? The downloadImage setting has filename, width, and height, but I am unsure how to access those when coming from a ggplot. The list of config settings I found did not seem to have anything I could repurpose.
Having the ability to specify filename and dimensions would be extremely helpful so that users of my site could download images with more ease and consistency. Also, the ability to add a timestamp/text information to those downloaded images would be even more stellar.