Skip to content

Instantly share code, notes, and snippets.

@yihui yihui/server.R forked from jcheng5/server.R
Last active Dec 18, 2015

Embed
What would you like to do?
xy = matrix(0.5, 1, 2)
shinyServer(function(input, output) {
output$myplot = renderPlot({
hover = input$myplot_hover
if (!is.null(hover))
xy <<- rbind(xy, c(hover$x, hover$y))
par(mar = rep(0, 4))
plot.new()
points(xy, pch = rep(c(21, 19), c(nrow(xy) - 1, 1)))
box()
})
})
shinyUI(basicPage(
plotOutput("myplot", hoverId="myplot_hover")
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.