render_drake_graph {drake} | R Documentation |
Render a visualization using the data frames
generated by drake_graph_info()
.
Description
This function is called inside
vis_drake_graph()
, which typical users
call more often.
Usage
render_drake_graph(
graph_info,
file = character(0),
layout = NULL,
direction = NULL,
hover = TRUE,
main = graph_info$default_title,
selfcontained = FALSE,
navigationButtons = TRUE,
ncol_legend = 1,
collapse = TRUE,
on_select = NULL,
level_separation = NULL,
...
)
Arguments
graph_info |
List of data frames generated by
|
file |
Name of a file to save the graph.
If |
layout |
Deprecated. |
direction |
Deprecated. |
hover |
Logical, whether to show the command that generated the target when you hover over a node with the mouse. For imports, the label does not change with hovering. |
main |
Character string, title of the graph. |
selfcontained |
Logical, whether
to save the |
navigationButtons |
Logical, whether to add navigation buttons with
|
ncol_legend |
Number of columns in the legend nodes.
To remove the legend entirely, set |
collapse |
Logical, whether to allow nodes to collapse
if you double click on them.
Analogous to |
on_select |
defines node selection event handling.
Either a string of valid JavaScript that may be passed to
|
level_separation |
Numeric, |
... |
Arguments passed to |
Details
For enhanced interactivity in the graph, see the mandrake
package.
Value
A visNetwork
graph.
See Also
vis_drake_graph()
, sankey_drake_graph()
,
drake_ggraph()
Examples
## Not run:
isolate_example("Quarantine side effects.", {
if (suppressWarnings(require("knitr"))) {
load_mtcars_example() # Get the code with drake_example("mtcars").
if (requireNamespace("visNetwork", quietly = TRUE)) {
# Instead of jumping right to vis_drake_graph(), get the data frames
# of nodes, edges, and legend nodes.
vis_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_drake_graph()
# (as in vis_drake_graph()) or you can create
# your own custom visNewtork graph.
render_drake_graph(graph)
}
}
})
## End(Not run)