Learn R Programming

drake (version 4.4.0)

render_graph: Function render_graph

Description

render a graph from the data frames generated by dataframes_graph()

Usage

render_graph(graph_dataframes, file = character(0),
  layout = "layout_with_sugiyama", direction = "LR", hover = TRUE,
  main = graph_dataframes$default_title, selfcontained = FALSE,
  navigationButtons = TRUE, ncol_legend = 1, ...)

Arguments

graph_dataframes

list of data frames generated by dataframes_graph(). There should be 3 data frames: nodes, edges, and legend_nodes.

file

Name of HTML file to save the graph. If NULL or character(0), no file is saved and the graph is rendered and displayed within R.

layout

name of an igraph layout to use, such as 'layout_with_sugiyama' or 'layout_as_tree'. Be careful with 'layout_as_tree': the graph is a directed acyclic graph, but not necessarily a tree.

direction

an argument to visNetwork::visHierarchicalLayout() indicating the direction of the graph. Options include 'LR', 'RL', 'DU', and 'UD'. At the time of writing this, the letters must be capitalized, but this may not always be the case ;) in the future.

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

title of the graph

selfcontained

logical, whether to save the file as a self-contained HTML file (with external resources base64 encoded) or a file with external resources placed in an adjacent directory. If TRUE, pandoc is required.

navigationButtons

logical, whether to add navigation buttons with visNetwork::visInteraction(navigationButtons = TRUE)

ncol_legend

number of columns in the legend nodes

...

arguments passed to visNetwork().

Examples

Run this code
# NOT RUN {
load_basic_example()
graph = dataframes_graph(my_plan)
render_graph(graph, width = '100%') # The width is passed to visNetwork
# }

Run the code above in your browser using DataLab