Skip to content

Instantly share code, notes, and snippets.

@jcheng5
Created June 22, 2013 00:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jcheng5/5835269 to your computer and use it in GitHub Desktop.
Save jcheng5/5835269 to your computer and use it in GitHub Desktop.
shinyServer(function(input, output) {
output$myplot <- renderPlot({ plot(cars) })
output$hoverinfo <- renderTable({
if (is.null(input$myplot_hover))
NULL
else
data.frame(x=input$myplot_hover$x, y=input$myplot_hover$y)
})
})
shinyUI(basicPage(
plotOutput("myplot", hoverId="myplot_hover"),
tableOutput("hoverinfo")
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment