set_global_graph_attr {DiagrammeR} | R Documentation |
Set global attributes of a specific type (either
graph_attrs
, node_attrs
, or edge_attrs
for a graph
object of class dgr_graph
.
set_global_graph_attr(graph, type, attr_for_type, value)
graph |
a graph object of class |
type |
the specific type of global graph attribute to set. The type is
specified with |
attr_for_type |
the name of the attribute to set for the |
value |
the value to be set for the chosen attribute specified in the
|
a graph object of class dgr_graph
.
## Not run: library(magrittr) # Create a new graph and set some global attributes graph <- create_graph() %>% set_global_graph_attr("graph", "overlap", "true") %>% set_global_graph_attr("node", "fontname", "Helvetica") %>% set_global_graph_attr("edge", "color", "gray") # Verify that the global attributes have been set get_global_graph_attr(graph) #> $graph_attrs #> [1] "overlap = true" #> #> $node_attrs #> [1] "fontname = Helvetica" #> #> $edge_attrs #> [1] "color = gray" ## End(Not run)