register_colon_variant: Register a Custom Colon Variant

View source: R/variants.R

register_colon_variantR Documentation

Register a Custom Colon Variant

Description

Adds a new named blueprint to the package's internal variant registry so it can be referenced by variant arguments in geom_colon(), geom_colon_label(), colon_sf(), and colon_heatmap_grid().

Usage

register_colon_variant(name, data)

Arguments

name

A non-empty character string naming the new variant. Existing variants (including "standard" and "sescd") will be overwritten if the same name is supplied.

data

A data frame with at least three columns:

dx

Numeric. Relative x-coordinate of each polygon vertex.

dy

Numeric. Relative y-coordinate of each polygon vertex.

part

Character. Segment name each vertex belongs to.

Each unique part value must have at least 3 rows (minimum for a polygon).

Value

The name string, invisibly.

Examples

my_blueprint <- data.frame(
  dx   = c(0, 1, 1, 0,   2, 3, 3, 2),
  dy   = c(0, 0, 1, 1,   0, 0, 1, 1),
  part = c(rep("SegA", 4), rep("SegB", 4))
)
register_colon_variant("my_colon", my_blueprint)
list_colon_variants()

ggcolonviz documentation built on Oct. 15, 2026, 5:09 p.m.