Types
The highdir framework defines four categories of specifications used to construct plots. Each category serves a distinct role in data definition, visual configuration, and geom‑level customization.
1. hd_spec()
Defines the data specifications that apply universally across all geom types. These specifications describe the input data structure and mappings required by the plotting system.
2. hd_opts()
Specifies presentation options that control chart appearance. These options are shared across multiple geoms and include settings related to layout, style, and display behavior.
3. Required Specifications
Parameters that a given geom must provide for successful rendering. These vary by geom and represent the minimum information needed for the geom to function.
4. Optional Specifications
Additional parameters that may be supplied depending on the selected geom. These extend or refine the behavior of a geom but are not mandatory.
To see the required and optionals arguments:
geom_args("line") #args in geom line
geom_args("arearange")
# or
highdir:::.get_geom("ranked_bar")$optional_args
highdir:::.get_geom("arearange")$required_argsTheming
# Set package-wide defaults for the session
hd_set_theme(
hc_theme = "helsedirektoratet",
colors = c("#025169", "#7C145C", "#C68803"),
font = "Source Sans Pro"
)
# All subsequent hd_make() calls use these settings automatically
hd_make(spec, "column")