Open
Description
When using plotly with Shiny, would it be possible to implement a feature in plotly::plotlyOutput()
similar to plotOutput("plot", click = "plot_click")
to capture the exact coordinates of a mouse click like in the example below?
library(shiny)
ui <- basicPage(
plotOutput("plot1", click = "plot_click"),
verbatimTextOutput("info")
)
server <- function(input, output) {
output$plot1 <- renderPlot({
plot(mtcars$wt, mtcars$mpg)
})
output$info <- renderText({
paste0("x=", input$plot_click$x, "\ny=", input$plot_click$y)
})
}
shinyApp(ui, server)
I am hoping to be able to reproduce the exact mouse click positions during a data analysis and reuse them in a different analysis.