Chapter 7 shiny garden map

from: https://shiny.rstudio.com/articles/plot-interaction.html

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)
Shiny applications not supported in static R Markdown documents
knitr::include_app("https://yihui.shinyapps.io/miniUI/", 
  height = "600px")