Skip to contents

Core Scene Graph

Primary objects for describing graphics scenes

grab_atom()
Create a primitive grab (leaf node)
grab_bag()
Create a bag grab (interior node)
scene()
Create a scene (root grab_bag with device dimensions)
assign_node_ids()
Assign deterministic node IDs
is_grab()
Test if an object is any grab (prim or group)

Scene Schema

Schema versioning and scene serialization

scene_schema_version()
Current scene schema version
scene_to_list()
Serialize a scene graph to a versioned R list
scene_to_json()
Serialize a scene graph to JSON
scene_to_yaml()
Serialize a scene graph to YAML

Aesthetics

Specification and management of graphic attributes

aes_spec()
Create an aesthetic specification
aes_empty()
Empty (default) aesthetic spec
aes_merge()
Merge two aes_spec objects — child overrides parent
aes_resolve()
Resolve an aes_spec against defaults, returning a plain list

Units & Viewports

Coordinate systems and layout

rel()
Create a relative unit (fraction of parent dimension)
mm()
Create an absolute unit in millimetres
resolve_unit()
Resolve a unit to millimetres given a parent dimension in mm
unit_add()
Add two units, possibly of different types
vp()
Create a viewport
vp_grid()
Create a grid of viewports (CSS-grid inspired)

Rendering

Turning scene graphs into output

render_scene()
Render a scene or grab tree using a backend device
device_backend()
Create a backend device contract
is_device_backend()
Test if an object is a backend device
device_svg()
Create an SVG backend device

Utilities

Inspection and introspection

prim_shapes()
Valid primitive shape names
grab_tree()
Return a tidy data.frame describing the scene tree structure
grab_filter()
Filter rows in atom data
grab_mutate()
Add or modify columns in atom data
grab_select()
Select columns from atom data
grab_left_join()
Left-join lookup data into atom data
grab_modify_data()
Modify atom data in a grab tree
grab_map_atoms()
Apply a function to every atom in a grab tree
dfr()
Create a compact row-data tibble

Integration

Bridges to other systems

ggbuild_to_scene()
Convert a ggplot_build() result to a grab scene