... I am having problems getting the plotOutput click option to work correctly when creating a multiple plot output using par(). Clicking on the left third of the first column plots and the last quarter of the forth column plots does not activate the plot_click event.
A simple example
ui <- basicPage(
plotOutput("plot1", click = "plot_click"),
verbatimTextOutput("info")
)
server <- function(input, output) {
output$plot1 <- renderPlot({
nrow = 2
ncol = 4
par(mfrow = c(nrow, ncol), mar = c(1, 3, 2, 1), oma = c(2,0,2,0), cex.main = 2)
for (i in 1:8)
plot(mtcars$wt, mtcars$mpg)
})
output$info <- renderText({
paste0("x=", input$plot_click$x, "\ny=", input$plot_click$y)
})
}
shinyApp(ui, server)
Any help would be appreciated.
UPDATE:
The domain$right and domain$left are incorrect. The click event is not firing outside of the domain (as it should), but the domain boundaries are do not encompass the entire plot.