View source: R/sankey_drake_graph.R
render_sankey_drake_graph | R Documentation |
drake_graph_info()
.
This function is called inside
sankey_drake_graph()
, which typical users
call more often. A legend is unfortunately unavailable
for the graph itself, but you can see what all the colors mean with
visNetwork::visNetwork(drake::legend_nodes())
.
render_sankey_drake_graph(
graph_info,
file = character(0),
selfcontained = FALSE,
...
)
graph_info |
List of data frames generated by
|
file |
Name of a file to save the graph.
If |
selfcontained |
Logical, whether
to save the |
... |
Arguments passed to |
A visNetwork
graph.
sankey_drake_graph()
, vis_drake_graph()
,
drake_ggraph()
## Not run:
isolate_example("Quarantine side effects.", {
load_mtcars_example() # Get the code with drake_example("mtcars").
if (suppressWarnings(require("knitr"))) {
if (requireNamespace("networkD3", quietly = TRUE)) {
if (requireNamespace("visNetwork", quietly = TRUE)) {
# Instead of jumpting right to sankey_drake_graph(), get the data frames
# of nodes, edges, and legend nodes.
sankey_drake_graph(my_plan) # Jump straight to the interactive graph.
# Show the legend separately.
visNetwork::visNetwork(nodes = drake::legend_nodes())
# Get the node and edge info that sankey_drake_graph() just plotted:
graph <- drake_graph_info(my_plan)
# You can pass the data frames right to render_sankey_drake_graph()
# (as in sankey_drake_graph()) or you can create
# your own custom visNewtork graph.
render_sankey_drake_graph(graph)
}
}
}
})
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.