I want to add a vertical line representing the current date in my vistime plot. I have tried multiple ways and still haven't been able to figure it out. Here is a small reproducible code that you can build on.
library(shiny)
library(plotly)
library(vistime)
pres <- data.frame(Position = rep(c("President", "Vice"), each = 3),
Name = c("Washington", rep(c("Adams", "Jefferson"), 2), "Burr"),
start = c("1789-03-29", "1797-02-03", "1801-02-03"),
end = c("1797-02-03", "1801-02-03", "1809-02-03"),
color = c('#cbb69d', '#603913', '#c69c6e'),
fontcolor = c("black", "white", "black"))
shinyApp(
ui = plotlyOutput("myVistime"),
server = function(input, output) {
output$myVistime <- renderPlotly({
vistime(pres, col.event = "Position", col.group = "Name")
})
}
)