Interactive Angular Accumulation Plot (plotly hover tooltips)
Source:R/utils.R
make_plot_bouquet_interactive.RdBuilds the same turtle-graphics bouquet as make_plot_bouquet() and
converts it to an interactive plotly figure. Hovering over any point on a
path shows the series name, date/time, step number, and value.
Usage
make_plot_bouquet_interactive(
data,
time_col = 1,
series_col = 2,
value_col = 3,
stem_colors = "#3a7d2c",
flower_colors = "#f472b6",
ceiling_pct = 0.8,
launch_deg = 90,
dark_mode = FALSE,
title = NULL,
from = NULL,
to = NULL,
normalise = FALSE,
verbose = FALSE
)Arguments
- data
A long-format data frame – same format as
make_plot_bouquet().- time_col
<
tidy-select> Time column. Default: first column.- series_col
<
tidy-select> Series identifier column. Default: second column.- value_col
<
tidy-select> Numeric value column. Default: third column.- stem_colors
Single hex string or a named character vector (one hex per series name). Default
"#3a7d2c".- flower_colors
Single hex string or a named character vector for the end-of-series markers. Default
"#f472b6".- ceiling_pct
Fraction of maximum angle. Default
0.80.- launch_deg
Launch heading in degrees. Default
90.- dark_mode
Logical. Default
FALSE.- title
Plot title string. Default
NULL.- from
Optional time lower bound for filtering. Default
NULL.- to
Optional time upper bound for filtering. Default
NULL.- normalise
Logical. Per-series angle normalisation. Default
FALSE.- verbose
Logical. Print angle diagnostics. Default
FALSE.
See also
make_plot_bouquet() for the static ggplot2 version with full
styling options. save_bouquet() to export the static version to a file.
cluster_bouquet() to colour-code series by directional cluster before
plotting.
Examples
# \donttest{
if (requireNamespace("plotly", quietly = TRUE)) {
set.seed(42)
n <- 52L
gw <- tibble::tibble(
week = rep(seq(as.Date("2023-01-01"), by = "week", length.out = n), 3L),
station = rep(c("A", "B", "C"), each = n),
level = c(cumsum(rnorm(n)), cumsum(rnorm(n)), cumsum(rnorm(n)))
)
make_plot_bouquet_interactive(gw, "week", "station", "level")
}
# }