daattali / timevis

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

timevis and visNetwork do not work together in the same app #11

Closed daattali closed 7 years ago

daattali commented 7 years ago

They both use vis.js library so they are somehow conflicting with each other

Sample code:

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

this is also reported on visNetwork https://github.com/datastorm-open/visNetwork/issues/90