Expand description
Grid graphics builtins — R-facing functions for the grid graphics system.
Grid objects are represented as R lists with S3 class attributes:
- Unit:
list(value=..., units=...)with class “unit” - Gpar:
list(col=..., fill=..., ...)with class “gpar” - Viewport:
list(x=..., y=..., width=..., ...)with class “viewport” - Grobs:
list(x=..., y=..., gp=..., ...)with class c(“”, “grob”)
Structs§
- Plot
State 🔒Renderer - A
GridRendererimplementation that converts grid drawing operations intoPlotItems for the existing egui_plot rendering pipeline.
Constants§
- DEVICE_
HEIGHT_ 🔒CM - DEVICE_
WIDTH_ 🔒CM - Device dimensions in centimeters (default ~7 inches square).
Statics§
- __
INTERP_ 🔒REG_ INTERP_ CIRCLE_ GROB - __
INTERP_ 🔒REG_ INTERP_ CURRENT_ VIEWPORT - __
INTERP_ 🔒REG_ INTERP_ DATA_ VIEWPORT - __
INTERP_ 🔒REG_ INTERP_ DOWN_ VIEWPORT - __
INTERP_ 🔒REG_ INTERP_ GLIST - __
INTERP_ 🔒REG_ INTERP_ GPAR - __
INTERP_ 🔒REG_ INTERP_ GRID_ CIRCLE - __
INTERP_ 🔒REG_ INTERP_ GRID_ DRAW - __
INTERP_ 🔒REG_ INTERP_ GRID_ EDIT - __
INTERP_ 🔒REG_ INTERP_ GRID_ GET - __
INTERP_ 🔒REG_ INTERP_ GRID_ LAYOUT - __
INTERP_ 🔒REG_ INTERP_ GRID_ LINES - __
INTERP_ 🔒REG_ INTERP_ GRID_ NEWPAGE - __
INTERP_ 🔒REG_ INTERP_ GRID_ POINTS - __
INTERP_ 🔒REG_ INTERP_ GRID_ POLYGON - __
INTERP_ 🔒REG_ INTERP_ GRID_ RECT - __
INTERP_ 🔒REG_ INTERP_ GRID_ REMOVE - __
INTERP_ 🔒REG_ INTERP_ GRID_ SEGMENTS - __
INTERP_ 🔒REG_ INTERP_ GRID_ SHOW_ LAYOUT - __
INTERP_ 🔒REG_ INTERP_ GRID_ TEXT - __
INTERP_ 🔒REG_ INTERP_ GRID_ XAXIS - __
INTERP_ 🔒REG_ INTERP_ GRID_ YAXIS - __
INTERP_ 🔒REG_ INTERP_ GTREE - __
INTERP_ 🔒REG_ INTERP_ LINES_ GROB - __
INTERP_ 🔒REG_ INTERP_ NULL_ GROB - __
INTERP_ 🔒REG_ INTERP_ PLOT_ VIEWPORT - __
INTERP_ 🔒REG_ INTERP_ POINTS_ GROB - __
INTERP_ 🔒REG_ INTERP_ POLYGON_ GROB - __
INTERP_ 🔒REG_ INTERP_ POP_ VIEWPORT - __
INTERP_ 🔒REG_ INTERP_ PUSH_ VIEWPORT - __
INTERP_ 🔒REG_ INTERP_ RECT_ GROB - __
INTERP_ 🔒REG_ INTERP_ SEEK_ VIEWPORT - __
INTERP_ 🔒REG_ INTERP_ SEGMENTS_ GROB - __
INTERP_ 🔒REG_ INTERP_ TEXT_ GROB - __
INTERP_ 🔒REG_ INTERP_ UNIT - __
INTERP_ 🔒REG_ INTERP_ UP_ VIEWPORT - __
INTERP_ 🔒REG_ INTERP_ VIEWPORT
Functions§
- auto_
grob_ 🔒name - Generate a unique grob name with the given prefix and a counter.
- build_
rust_ 🔒grob - Build a Rust-level
Grobfrom a type class name and list entries. - default_
npc 🔒 - Default NPC unit value (0.5 npc).
- default_
npc_ 🔒half - Default unit of 0.5 npc for x/y.
- default_
npc_ 🔒one - Default unit of 1 npc for width/height.
- default_
npc_ 🔒zero - Default unit of 0 npc.
- ensure_
unit 🔒 - Wrap a unit value: if x is already a unit object, return it; otherwise
create
unit(x, default_units). - extract_
gpar_ 🔒from_ rvalue - Extract a Rust
Gparfrom an R gpar list object. - extract_
justification 🔒 - Extract justification from an R value.
- extract_
labels 🔒 - Extract a vector of label strings from an R value.
- extract_
pch 🔒 - Extract pch (plotting character) from an R value.
- extract_
rot 🔒 - Extract rotation angle from an R value.
- extract_
unit_ 🔒from_ rvalue - Extract a Rust
Unitfrom an R value representing a unit object. - extract_
viewport_ 🔒from_ rvalue - Extract a Rust
Viewportfrom an R viewport list object. - find_
viewport_ 🔒by_ name - Find a viewport by name in the viewport stack. Returns the index in the stack if found.
- flush_
grid - Public API: flush any accumulated grid graphics to the GUI thread.
- flush_
grid_ 🔒to_ plot - Internal: flush the grid display list to a PlotState and send it to the plot channel (if the plot feature is enabled).
- grid_
to_ 🔒plot_ state - Convert the grid Rust display list into a
PlotStatefor the existing egui rendering pipeline. - interp_
circle_ 🔒grob - Create a circle grob object without drawing it.
- interp_
current_ 🔒viewport - Return the current (topmost) viewport.
- interp_
data_ 🔒viewport - Create a viewport with scales determined by data ranges.
- interp_
down_ 🔒viewport - Navigate down to a named viewport in the stack.
- interp_
glist 🔒 - Create a gList (list of grobs).
- interp_
gpar 🔒 - Create a graphical parameter object (gpar) for grid graphics.
- interp_
grid_ 🔒circle - Draw a circle on the grid graphics device.
- interp_
grid_ 🔒draw - Record a grob on the grid display list for later rendering.
- interp_
grid_ 🔒edit - Modify properties of a grob on the display list.
- interp_
grid_ 🔒get - Retrieve a grob from the display list by name.
- interp_
grid_ 🔒layout - Create a grid layout object specifying rows and columns.
- interp_
grid_ 🔒lines - Draw line segments (polyline) on the grid graphics device.
- interp_
grid_ 🔒newpage - Clear the grid display list and viewport stack, starting a new page.
- interp_
grid_ 🔒points - Draw points on the grid graphics device.
- interp_
grid_ 🔒polygon - Draw a polygon on the grid graphics device.
- interp_
grid_ 🔒rect - Draw a rectangle on the grid graphics device.
- interp_
grid_ 🔒remove - Remove a grob from the display list by name.
- interp_
grid_ 🔒segments - Draw line segments between pairs of points.
- interp_
grid_ 🔒show_ layout - Visualize a grid layout by drawing labeled rectangles for each cell.
- interp_
grid_ 🔒text - Draw text on the grid graphics device.
- interp_
grid_ 🔒xaxis - Draw an x-axis on the grid graphics device.
- interp_
grid_ 🔒yaxis - Draw a y-axis on the grid graphics device.
- interp_
gtree 🔒 - Create a gTree (group of grobs).
- interp_
lines_ 🔒grob - Create a lines grob object without drawing it.
- interp_
null_ 🔒grob - Create a null grob (empty placeholder).
- interp_
plot_ 🔒viewport - Create a viewport with margins specified in lines of text.
- interp_
points_ 🔒grob - Create a points grob object without drawing it.
- interp_
polygon_ 🔒grob - Create a polygon grob object without drawing it.
- interp_
pop_ 🔒viewport - Pop viewports from the viewport stack.
- interp_
push_ 🔒viewport - Push a viewport onto the viewport stack.
- interp_
rect_ 🔒grob - Create a rect grob object without drawing it.
- interp_
seek_ 🔒viewport - Find and navigate to a named viewport anywhere in the viewport tree.
- interp_
segments_ 🔒grob - Create a segments grob object without drawing it.
- interp_
text_ 🔒grob - Create a text grob object without drawing it.
- interp_
unit 🔒 - Create a unit object representing a measurement with given units.
- interp_
up_ 🔒viewport - Navigate up the viewport stack without popping.
- interp_
viewport 🔒 - Create a viewport object for grid graphics.
- make_
grid_ 🔒object - Create an RValue::List with the given named entries and set its class attribute.
- make_
grob 🔒 - Helper to create a grob and optionally draw it.
- normalize_
just 🔒 - Normalize the
justparameter: convert string names like “centre”, “left”, “top” to numeric c(hjust, vjust) pairs matching R’s grid convention. - num_
to_ 🔒just - Convert a numeric justification (0.0, 0.5, 1.0) to a
Justification. - opt_
value 🔒 - Extract an optional RValue from args by name or position, returning NULL if absent.
- parse_
color_ 🔒string - Parse a hex color string to RGBA.
- parse_
grid_ 🔒color - Parse an R color value to RGBA.
- parse_
unit_ 🔒type - Parse a unit type string into a
UnitType. - record_
on_ 🔒display_ list - Record a grob on the grid display list.
- record_
rust_ 🔒grob - Record a Rust grob on the Rust display list.