View source: R/sankey_drake_graph.R
sankey_drake_graph | R Documentation |
To save time for repeated plotting,
this function is divided into
drake_graph_info()
and render_sankey_drake_graph()
.
A legend is unfortunately unavailable
for the graph itself, but you can see what all the colors mean with
visNetwork::visNetwork(drake::legend_nodes())
.
sankey_drake_graph(
...,
file = character(0),
selfcontained = FALSE,
build_times = "build",
digits = 3,
targets_only = FALSE,
from = NULL,
mode = c("out", "in", "all"),
order = NULL,
subset = NULL,
make_imports = TRUE,
from_scratch = FALSE,
group = NULL,
clusters = NULL,
show_output_files = TRUE,
config = NULL
)
... |
Arguments to |
file |
Name of a file to save the graph.
If |
selfcontained |
Logical, whether
to save the |
build_times |
Character string or logical.
If character, the choices are
1. |
digits |
Number of digits for rounding the build times |
targets_only |
Logical, whether to skip the imports and only include the targets in the workflow plan. |
from |
Optional collection of target/import names.
If |
mode |
Which direction to branch out in the graph
to create a neighborhood around |
order |
How far to branch out to create
a neighborhood around |
subset |
Optional character vector.
Subset of targets/imports to display in the graph.
Applied after |
make_imports |
Logical, whether to make the imports first.
Set to |
from_scratch |
Logical, whether to assume all the targets
will be made from scratch on the next |
group |
Optional character scalar, name of the column used to
group nodes into columns. All the columns names of your original |
clusters |
Optional character vector of values to cluster on.
These values must be elements of the column of the |
show_output_files |
Logical, whether to include
|
config |
Deprecated. |
A visNetwork
graph.
render_sankey_drake_graph()
, vis_drake_graph()
,
drake_ggraph()
, text_drake_graph()
## Not run:
isolate_example("Quarantine side effects.", {
if (suppressWarnings(require("knitr"))) {
load_mtcars_example() # Get the code with drake_example("mtcars").
if (requireNamespace("networkD3", quietly = TRUE)) {
if (requireNamespace("visNetwork", quietly = TRUE)) {
# Plot the network graph representation of the workflow.
sankey_drake_graph(my_plan)
# Show the legend separately.
visNetwork::visNetwork(nodes = drake::legend_nodes())
make(my_plan) # Run the project, build the targets.
sankey_drake_graph(my_plan) # The black nodes from before are now green.
# Plot a subgraph of the workflow.
sankey_drake_graph(my_plan, from = c("small", "reg2"))
}
}
}
})
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.