Computes the plot geometry once and serializes it to the chosen render target: a standalone SVG document ("static") or a self-contained interactive HTML page with a <canvas> element, hover tooltips, and scroll-to-zoom ("interactive").

render(plot, ...)

Arguments

plot

A GgnextPlot object.

...

Method arguments. The GgnextPlot method takes target ("static" for SVG, "interactive" for HTML/canvas; defaults to "static" unless the plot carries an interact() spec) and file (optional path to write the output to — use .svg for the static target and .html for the interactive one).

Value

The rendered document as a length-1 character vector of class ggnext_render (printed as a short summary, not the full source), invisibly when file is given.

Examples

p <- ggnext(cars, aes(speed, dist)) + geom_point()
svg <- render(p)                          # static SVG (the default)
html <- render(p + interact())            # interactive HTML/canvas