1. Main functionality
This package vistime
provides three main functions:
1) vistime()
to produce interactive Plotly
charts:
2) hc_vistime()
to produce interactive Highcharts
charts:
3) gg_vistime()
to produce static ggplot
output:
timeline_data <- data.frame(event = c("Event 1", "Event 2"), start = c("2020-06-06", "2020-10-01"), end = c("2020-10-01", "2020-12-31"), group = "My Events")
gg_vistime(timeline_data)
3) vistime_data()
, for pure data.frame
output that you can use with the plotting engine of your choice:
timeline_data <- data.frame(event = c("Event 1", "Event 2"), start = c("2020-06-06", "2020-10-01"), end = c("2020-10-01", "2020-12-31"), group = "My Events")
vistime_data(timeline_data)
#> event start end group tooltip col subplot y
#> 1 Event 1 2020-06-06 2020-10-01 My Events from <b>2020-06-06</b> to <b>2020-10-01</b> #8DD3C7 1 1
#> 2 Event 2 2020-10-01 2020-12-31 My Events from <b>2020-10-01</b> to <b>2020-12-31</b> #FFFFB3 1 1
You want to use this for the intelligent y-axis assignment depending on overlapping of events (this can be disabled with optimize_y = FALSE
).