| register_geom | R Documentation |
Adds a geometry to the registry. The optional_args field is the key
mechanism for user discoverability: it is what geom_args() prints, what
the Shiny app reads to build dynamic UI, and what automated documentation
can harvest without parsing source code.
register_geom(
name,
ggplot_fun = NULL,
highcharter_fun = NULL,
required_args = list(),
optional_args = list(),
skip_base_fig = FALSE
)
name |
Character. Unique geometry identifier. |
ggplot_fun |
Function or |
highcharter_fun |
Function or |
required_args |
Named list of |
optional_args |
Named list of |
skip_base_fig |
Logical. Bypasses |
Structure of optional_args:
A named list where each element is itself a list with two fields:
default - the value used when the arg is not supplied (may be NULL)
desc - a short human-readable description (shown by geom_args())
Example:
optional_args = list( smooth = list(default = TRUE, desc = "Spline smoothing (logical)"), dot_size = list(default = 4, desc = "Marker radius in px (numeric)") )
name, invisibly.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.