| pip_get_graph | R Documentation |
Builds graph data (nodes and edges) describing the pipeline's step
structure, suitable for visualisation with visNetwork::visNetwork().
pip_get_graph(x, include_upstream = FALSE)
x |
A pipeflow pip or view. |
include_upstream |
Logical. Only relevant for views. If |
Node shapes reflect execution mode:
auto/plain: hexagon
reduce: dot
split: star
A named list with two data.frames: nodes and edges.
p <- pip_new()
pip_add(p, "load", \(x = 1) x, tags = "io")
pip_add(p, "clean", \(x = ~load) x + 1, tags = "io")
pip_add(p, "fit", \(x = ~clean) x * 2, tags = "model")
graph <- pip_get_graph(p)
graph$nodes # data.frame: id, label, shape, color
graph$edges # data.frame: from, to, arrows
# For a view, include_upstream = TRUE adds upstream deps to the graph
v <- pip_view(p, i = "fit")
pip_get_graph(v, include_upstream = TRUE)
if (require("visNetwork", quietly = TRUE)) {
do.call(what = visNetwork::visNetwork, args = graph)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.