Closed kasper2619 closed 9 years ago
So my solution to this became:
server,R
observe({
if(is.null(input$file) == TRUE){
return(NULL)
} else {
ds %>%
ggvis(~wt, ~mpg) %>%
layer_points() %>%
layer_points(size := input_slider(100, 1000, value = 1)) %>%
add_tooltip(function(data){
paste0("Wt: ", data$wt, "<br>", "Mpg: ",as.character(data$mpg), "<br>", "String: ", as.character(data$long))
}, "hover") %>%
bind_shiny("plot", "plot_ui")
}
})
The ui is fine as is.
I guess the problem is that ggvis causes shiny to crash when there is no data loaded. If anyone have better solutions I am all ear...
I am trying to build a large application with Shiny. I have managed to get the sandbox "mtcars" example to work in the app but when I am using the data the app is supposed to work with, shiny crashes due to the ggvis function. The error message is "Error :".
I have scanned the internet over and over again for solutions but without luck. My latest theory is that ggvis plot i being tun before the data is ready, but it is only a theory...
ui.R
server.R
whether i write:
...does not make a difference. I also tried wrapping the ggvis into a reactive function.
Thank you four your help!