Skip to main content

Module grid

Module grid 

Source
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§

PlotStateRenderer 🔒
A GridRenderer implementation that converts grid drawing operations into PlotItems 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 Grob from 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 Gpar from 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 Unit from an R value representing a unit object.
extract_viewport_from_rvalue 🔒
Extract a Rust Viewport from 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 PlotState for 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 just parameter: 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.