Show a workflow graph as text in your terminal window using drake_graph_info()
output.
Source: R/text_drake_graph.R
render_text_drake_graph.Rd
This function is called inside
text_drake_graph()
, which typical users
call more often. See ?text_drake_graph
for details.
Arguments
- graph_info
List of data frames generated by
drake_graph_info()
. There should be 3 data frames:nodes
,edges
, andlegend_nodes
.- nchar
For each node, maximum number of characters of the node label to show. Can be 0, in which case each node is a colored box instead of a node label. Caution:
nchar
> 0 will mess with the layout.Logical. If
TRUE
, the graph will print to the console viamessage()
. IfFALSE
, nothing is printed. However, you still have the visualization becausetext_drake_graph()
andrender_text_drake_graph()
still invisibly return a character string that you can print yourself withmessage()
.
Examples
if (FALSE) { # \dontrun{
isolate_example("Quarantine side effects.", {
if (suppressWarnings(require("knitr"))) {
load_mtcars_example() # Get the code with drake_example("mtcars").
pkgs <- requireNamespace("txtplot", quietly = TRUE) &&
requireNamespace("visNetwork", quietly = TRUE)
if (pkgs) {
# Instead of jumpting right to vis_drake_graph(), get the data frames
# of nodes, edges, and legend nodes.
text_drake_graph(my_plan) # Jump straight to the interactive graph.
# Get the node and edge info that vis_drake_graph() just plotted:
graph <- drake_graph_info(my_plan)
# You can pass the data frames right to render_text_drake_graph().
render_text_drake_graph(graph)
}
}
})
} # }