Read Rhylthyme programs in R and plot them with ggplot2.
A Rhylthyme program is JSON describing parallel tracks of sequential
steps (a recipe, a lab protocol, a run-of-show), each with a duration and
a start trigger. read_rhylthyme() times every step with the same engine
rhylthyme.com uses (embedded through V8, so no Node.js is needed), and
geom_rhylthyme() draws the schedule.
library(ggplot2)
library(rhylthyme)
p <- read_rhylthyme(system.file("extdata", "breakfast_schedule.json", package = "rhylthyme"))
p
#> <rhylthyme_program> Breakfast Schedule: 3 tracks, 6 steps, 11:30
ggplot(p) + geom_rhylthyme(colour = "white")
autoplot(p) # the same, finished: theme, title, no redundant legend
Bars are filled by track in rhylthyme.com's palette and the time axis reads
as elapsed m:ss or h:mm by default; scale_fill_rhylthyme("cookbook")
picks another web palette, and any ggplot2 scale, theme or labs() works on
top. Anchor a program to the clock and the axis shows clock times:
dinner <- read_rhylthyme("thanksgiving.json", finish_at = "2026-11-26 18:00")
autoplot(dinner) # 14:05 ... 18:00
steps(dinner)[c("name", "start_time", "end_time")]
Lanes can be tracks (the default), steps (a classic Gantt) or resources, where steps that use a resource at the same time stack up:
ggplot(p) + geom_rhylthyme(lanes = "task", aes(fill = task))
Several programs plot together, one panel each (c(p1, p2) or
rhylthyme_programs(Saturday = p1, Sunday = p2); steps() and friends
stack with a program column):
autoplot(c(Saturday = p, Sunday = p))
Run records (what actually happened, from the rhylthyme runner or
rhylthyme.com) read and plot the same way, on the clock time they ran:
run <- read_rhylthyme_run("thanksgiving.run.json", program = dinner)
run # completed, 13 steps, 4:26:42
steps(run) # actual start/end, status (completed, skipped, aborted, ...), plan
autoplot(run)
The program is also plain data:
summary(p) # tracks, resources, makespan
steps(p) # one row per step: start/end (seconds), task, duration type, estimate, ...
dependencies(p) # which step waits on which, with offsets
tracks(p)
resources(p)
validate_rhylthyme() lists schema problems by step; read_rhylthyme()
also takes a URL, a JSON string or a list, and reads rhylthyme.com links
directly: a public program page (https://kitchen.rhylthyme.com/p/<id>) or a
share link (https://www.rhylthyme.com/?share=<id>).
The geom also works by name, on any data with start, end and lane columns:
ggplot(df, aes(xmin = start, xmax = end, y = lane)) +
layer(geom = "rhylthyme", stat = "rhylthyme", position = "identity")
Status: early development. The plan is in issue #1.
# install.packages("remotes")
remotes::install_github("rhylthyme/rhylthyme-r")
Apache License 2.0. The timing engine in inst/js/index.js is a copy of
@rhylthyme/timeline
(Apache-2.0).