Deserializes a previously saved Sideview canvas workspace from a .json or .rds
file and returns a sideview_state object. Optionally launches an interactive session.
Arguments
- file
Path to the saved state file (
.jsonor.rds).- tables
Optional named list of data frames or tables to associate with loaded cards. If
NULL, the tables named by the saved cards are looked up in the calling environment (then every table there, assv_find_tables()finds them).- launch
Logical; if
TRUEand the session is interactive, launchessideview(tables, state = <loaded state>, ...)so cards, zoom, joins and the pipeline come back. If non-interactive, returns the loaded state object.- format
Optional format specification (
"json"or"rds"). IfNULL(default), the format is inferred from the file extension (.jsonor.rds).- ...
Further arguments for
sideview()whenlaunch = TRUE(e.g.viewer).
Value
A sideview_state object of class c("sideview_state", "list"), or the gadget
result if launch = TRUE in an interactive session.
Examples
st <- new_sideview_state()
tf <- tempfile(fileext = ".json")
sv_save_state(st, tf)
loaded <- sv_load_state(tf)
print(loaded)
#> <sideview_state v0.3.0>
#> Cards: 0
#> Connections: 0
#> Canvas: zoom = 1, pan = (0, 0)
#> Active Tab: pipeline
unlink(tf)
