3

I'm sure I'm missing a basic issue but I'm not currently able to find my way out of this problem.

Is there a way to save a simple (not Shiny) Timevis timeline in html webpage from the code? I've successfully tried by using RStudio export button but I would like to include the function in the code.

htmlwidgets::saveWidget() doesn't work properly as the webpage is incomplete e.g. zoom buttons are missing (see incomplete webpage print screen) even with a minimal code:

 myTimeline<-timevis(
         data.frame(id = 1:2,
                    content = c("one", "two"),
                    start = c("2016-01-10", "2016-01-12"))
     )
htmlwidgets::saveWidget(myTimeLine,"myTimeLine.html")

Thank in advance for any help and advice!

Dan
  • 33
  • 2

2 Answers2

5

There is an open issue on github about this. The workaround is to use selfcontained = FALSE:

htmlwidgets::saveWidget(myTimeline, "myTimeLine.html", selfcontained = F)
GGamba
  • 13,140
  • 3
  • 38
  • 47
0

If you want to use a selfcontained version (e.g. because you want to offer this htmlwidget via plumber), the issue is the lack of zoom buttons.

If you modify the output HTML content to re-include the zoom buttons properly, everything works fine.

parasietje
  • 1,529
  • 8
  • 36