Closed roman-tremmel closed 1 year ago
That's not supported unfortunately. The underlying javascript library (https://visjs.github.io/vis-timeline/docs/timeline/index.html) doesn't have any support for this. If you would like you can do it yourself though with just a little bit of CSS, for example:
library(shiny)
ui <- fluidPage(
div(
style = "position: relative",
timevisOutput("test"),
actionButton("btn", "btn", style = "position: absolute; left: 5px; top: 5px")
)
)
server <- function(input, output, session) {
output$test <- renderTimevis({
timevis()
})
}
shinyApp(ui, server)
OK, that was easy. Thank you very much for pointing out the solution.
library(shiny)
ui <- fluidPage(
div(
style = "position: relative",
timevisOutput("test"),
actionButton("btn_zoom", "Resize", icon=icon("maximize"),
style = "position: absolute; right: 70px; top: 5px; padding: 4px; background-color: #ffffff; border-color: #cccccc;"))
)
)
server <- function(input, output, session) {
output$test <- renderTimevis({
timevis()
})
observeEvent(input$btn_zoom, {
timevis::setWindow("test",start = Sys.Date()-10, end=Sys.Date()+10)
})
}
shinyApp(ui, server)
Thanks for following up!
I wonder wether it is possible to add custom buttons next to the
+
and-
button?In leaflet one can use sth like