 Home
 CRAN
 DiagrammeR: Create Graph Diagrams and Flowcharts Using R
 set_global_graph_attrs: Set global graph attributes
Set global graph attributes
Description
Set global attributes of a specific
type (either graph_attrs
, node_attrs
,
or edge_attrs
for a graph object of class
dgr_graph
).
Usage
1  set_global_graph_attrs(graph, type, attr_for_type, value)

Arguments
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 
Value
a graph object of class dgr_graph
.
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  library(magrittr)
# Create a new graph and set some global attributes
graph < create_graph() %>%
set_global_graph_attrs(
"graph", "overlap", "true") %>%
set_global_graph_attrs(
"node", "fontname", "Helvetica") %>%
set_global_graph_attrs(
"edge", "color", "gray")
# Verify that the global attributes have been set
get_global_graph_attrs(graph)
#> $graph_attrs
#> [1] "overlap = true"
#>
#> $node_attrs
#> [1] "fontname = Helvetica"
#>
#> $edge_attrs
#> [1] "color = gray"

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.
 add_balanced_tree: Add a balanced tree of nodes to the graph
 add_cycle: Add a cycle of nodes to the graph
 add_edge: Add an edge between nodes in a graph object
 add_edge_df: Add edges from an edge data frame to an existing graph object
 add_edges_from_table: Add edges and attributes to graph from a table
 add_edges_w_string: Add one or more edges using a text string
 add_n_nodes: Add one or several unconnected nodes to the graph
 add_n_nodes_ws: Add a multiple of new nodes with edges to or from one or more...
 add_node: Add a node to an existing graph object
 add_node_df: Add nodes from a node data frame to an existing graph object
 add_nodes_from_table: Add nodes and attributes to graph from a table
 add_path: Add a path of nodes to the graph
 add_prism: Add a prism of nodes to the graph
 add_star: Add a star of nodes to the graph
 add_to_series: Add graph object to a graph series object
 cache_edge_attrs: Cache edge attributes in the graph
 cache_edge_attrs_ws: Cache edge attributes (based on a selection of edges) in the...
 cache_edge_count_ws: Cache a count of edges (available in a selection) in the...
 cache_node_attrs: Cache node attributes in the graph
 cache_node_attrs_ws: Cache node attributes (based on a selection of nodes) in the...
 cache_node_count_ws: Cache a count of nodes (available in a selection) in the...
 clear_selection: Clear a selection of nodes or edges in a graph
 combine_edges: Combine multiple edge data frames into a single edge data...
 combine_graphs: Combine two graphs into a single graph
 combine_nodes: Combine multiple node data frames into a single node data...
 country_graph: Create a graph object that contains the boundaries of a...
 create_edges: Create a data frame with edges and their attributes
 create_graph: Create a graph object
 create_nodes: Create a data frame with nodes and their attributes
 create_random_graph: Create a randomized graph
 create_series: Create a graph series object
 create_subgraph_ws: Create a subgraph based on a selection of nodes or edges
 delete_edge: Delete an edge from an existing graph object
 delete_edges_ws: Delete all selected edges in an edge selection
 delete_node: Delete a node from an existing graph object
 delete_nodes_ws: Delete all selected nodes in a node selection
 DiagrammeR: R + mermaid.js
 DiagrammeROutput: Widget output function for use in Shiny
 do_dfs: Perform a depthfirst search
 edge_count: Get count of all edges or edges with distinct relationship...
 edge_info: Get detailed information on edges
 edge_present: Determine whether a specified edge is present in an existing...
 edge_rel: Create, read, update, delete, or report status of an edge...
 export_csv: Export a graph to CSV files
 export_graph: Export a graph to various file formats
 get_all_connected_nodes: Get all nodes connected to a specified node
 get_articulation_points: Get articulation points
 get_betweenness: Get betweenness centrality scores
 get_bridging: Get bridging scores
 get_cache: Get a cached vector from a graph object
 get_closeness: Get closeness centrality values
 get_common_nbrs: Get all common neighbors between two or more nodes
 get_connected_components: Get all nodes associated with connected components
 get_constraint: Get constraint scores for one or more graph nodes
 get_degree_histogram: Get histogram data for a graph's degree frequency
 get_eccentricity: Get node eccentricities
 get_edge_attrs: Get edge attribute values
 get_edge_df: Get an edge data frame from a graph
 get_edges: Get node IDs associated with edges
 get_global_graph_attrs: Get global graph attributes
 get_graph_diameter: Get the graph diameter
 get_graph_from_series: Get a graph available in a series
 get_graph_name: Get graph name
 get_graph_time: Get the graph datetime or timezone
 get_nbrs: Get all neighbors of one or more nodes
 get_node_attrs: Get node attribute values
 get_node_df: Get a node data frame from a graph
 get_nodes: Get a vector of node ID values
 get_non_nbrs: Get nonneighbors of a node in a graph
 get_paths: Get paths from a specified node in a directed graph
 get_periphery: Get nodes that form the graph periphery
 get_predecessors: Get node IDs for predecessor nodes to the specified node
 get_s_connected_components: Get nodes within strongly connected components
 get_selection: Get the current selection available in a graph object
 get_similar_nbrs: Get neighboring nodes based on node attribute similarity
 get_successors: Get node IDs for successor nodes to the specified node
 graph_count: Count graphs in a graph series object
 graph_info: Get metrics for a graph
 grViz: R + viz.js
 grVizOutput: Widget output function for use in Shiny
 image_icon: Icons and their download locations
 import_graph: Import a graph from various graph formats
 invert_selection: Invert selection of nodes or edges in a graph
 is_graph_connected: Is the graph a connected graph?
 is_graph_directed: Is the graph a directed graph?
 is_graph_empty: Is the graph empty?
 join_edge_attrs: Join new edge attribute values using a data frame
 join_node_attrs: Join new node attribute values using a data frame
 mermaid: R + mermaid.js
 node_count: Get count of all nodes or certain types of nodes
 node_info: Get detailed information on nodes
 node_present: Determine whether a specified node is present in an existing...
 node_type: Create, read, update, delete, or report status of a node type...
 remove_from_series: Remove a graph from a graph series
 renderDiagrammeR: Widget render function for use in Shiny
 render_graph: Render the graph or output in various formats
 render_graph_from_series: Render a graph available in a series
 renderGrViz: Widget render function for use in Shiny
 replace_in_spec: Razorlike template for diagram specification
 rescale_edge_attrs_ws: Rescale numeric edge attribute values for edges in a...
 rescale_node_attrs_ws: Rescale numeric node attribute values for nodes in a...
 reverse_edge_direction: Reverse the graph's edge direction
 select_edges: Select edges in a graph
 select_edges_by_node_id: Select edges in a graph using node ID values
 select_last_edge: Select last edge in a series of edges defined in a graph
 select_last_node: Select last node in a series of node IDs in a graph
 select_nodes: Select nodes in a graph
 select_nodes_by_degree: Select nodes in the graph based on their degree values
 select_nodes_by_id: Select nodes in a graph by ID values
 select_nodes_in_neighborhood: Select nodes based on a walk distance from a specified node
 series_info: Get information on a graph series
 set_edge_attrs: Set edge attributes
 set_edge_attrs_ws: Set edge attributes with an edge selection
 set_global_graph_attrs: Set global graph attributes
 set_graph_name: Set graph name
 set_graph_time: Set graph datetime and timezone
 set_graph_undirected: Convert graph to an undirected graph
 set_node_attrs: Set node attributes
 set_node_attrs_ws: Set node attributes with a node selection
 subset_series: Subset a graph series object
 to_igraph: Convert a DiagrammeR graph to an igraph one
 trav_both: Traverse from one or more selected nodes to predecessors and...
 trav_in: Traverse inward to a selected node, skipping over edges, and...
 trav_in_edge: Traverse from one or more selected nodes onto adjacent,...
 trav_in_node: Traverse from one or more selected edges toward adjacent...
 trav_out: Traverse outward from a selected node, skipping over edges,...
 trav_out_edge: Traverse from one or more selected nodes onto adjacent,...
 trav_out_node: Traverse from one or more selected edges toward adjacent...
 trigger_script: Trigger a script embedded in a graph series object
 visnetwork: Render graph with visNetwork
 vivagraph: Render graph with VivaGraphJS
 x11_hex: X11 colors and hexadecimal color values