Build a Publication-Mode Figure Container from ggWebGL Panels
Source:R/publication-figure.R
ggwebgl_publication_figure.RdCreate a package-owned HTML container for publication capture. Each child panel is rendered through ggWebGL in publication mode unless it already declares a different rendering contract explicitly.
Arguments
- panels
A non-empty list of panel sources. Supported sources are
ggplotobjects,ggWebGLhtmlwidgets,ggwebgl_specobjects, or raw renderer payloads accepted byggWebGL(). Each element may also be a list withsourceplus optionalshow_panel_overlay.- layout
One of
"single","row", or"grid".- labels
Optional character vector of panel labels.
- annotations
Optional list of figure-level text annotations. Each entry should contain
text,x, andy, with optionalsize,colour,font,hjust, andvjust.- inset
Optional inset specification containing a panel
sourceplus fractionalleft,top,width, andheight.- background
Figure background colour.
- preset
Publication styling preset.
"publication"adds subtle panel borders and muted overlay text.- width, height
Optional figure dimensions in pixels.
Examples
demo_spec <- ggwebgl_spec(
layers = list(
ggwebgl_layer_points(
data.frame(x = c(0.15, 0.52, 0.84), y = c(0.20, 0.78, 0.42)),
x = "x",
y = "y",
colour = c("#0f766e", "#f97316", "#2563eb"),
alpha = 0.8,
size = 5
)
)
)
figure <- ggwebgl_publication_figure(
panels = list(demo_spec),
width = 420,
height = 280
)
inherits(figure, "ggwebgl_publication_figure")
#> [1] TRUE