Skip to contents

[Experimental]

Usage

add_variants(map, variants, ...)

Arguments

map

A stage_map() widget.

variants

A data frame with one row per variant. See "Columns". NULL, or a data frame with no rows (such as data.frame()), adds no variants.

...

Must stay empty. It makes every argument after it a named argument.

Value

The widget, with the variants added. A widget that has variants already is an error of class stagemap_error_layer. A variant id of a card or a link, or the variant of stage_map(), that is not in variants, and an id given twice in variants, are errors of class stagemap_error_data that name the ids.

Details

Variants are versions of one map that the reader switches between, such as a full release and a docs-only one. A card or a link lists the variants it belongs to in its variants column; stage_map()'s variant says which to start on.

Columns

Required columns are marked with an asterisk.

  • variants: id*, label*.

Examples

map <- stage_map(
  cards = data.frame(id = "a", label = "Draft", stage = "w", lane = "docs", variants = "full"),
  stages = data.frame(id = "w", label = "Write"),
  lanes = data.frame(id = "docs", label = "Docs"),
  variant = "full"
) |>
  add_variants(data.frame(id = c("full", "docs"), label = c("Full release", "Docs only")))
class(map)
#> [1] "stage_map"       "stagemap_widget" "htmlwidget"     
if (FALSE) { # interactive()
map
}