daattali / timevis

📅 Create interactive timeline visualizations in R
http://daattali.com/shiny/timevis-demo/
Other
653 stars 157 forks source link

timevis and visnetwork can not be used together in Shiny #12

Closed waitalone closed 7 years ago

waitalone commented 7 years ago

I am trying to include the timevis package and the visnetwork package into my Shiny app. but i find it did not work when i put them together. and there are no errors. could you help me see what is the reason? appreciate for your any help.

here is the code below, please refer to it.

**library(timevis) library(shiny) library(visNetwork)

nodes <- data.frame(id = 1:3) edges <- data.frame(from = c(1,2), to = c(1,3))

dataBasic <- data.frame( id = 1:4, content = c("Item one", "Item two" ,"Ranged item", "Item four"), start = c("2016-01-10", "2016-01-11", "2016-01-20", "2016-02-14"), end = c(NA, NA, "2016-02-04", NA) )

ui<-fluidPage( timevisOutput('timeline'), visNetworkOutput('snagraph') )

server<-function(input,output)({

output$snagraph<-renderVisNetwork(visNetwork(nodes,edges)) output$timeline<-renderTimevis(timevis(dataBasic))

} )

shinyApp(ui,server)**

daattali commented 7 years ago

Please see #11 or the issue you opened on visNetwork github

I fixed this on my end, so it will work if you call timevisOutput before visNetworkOutput, but it will not work the other way around until visNetwork also fixed it