Converts an igraph
graph object into the format required by the g6()
function
and creates an interactive G6 graph visualization. This is a convenience wrapper around
g6()
that allows you to work directly with igraph
objects.
Arguments
- graph
An object of class
igraph::igraph
containing the graph to visualize.- combos
A data frame or list of combo groups in the graph. Each combo should have at least an "id" field. Nodes can be assigned to combos using their "combo" field. See 'Data Structure' section for more details. Default: NULL.
- width
Width of the graph container in pixels or as a valid CSS unit. Default: NULL (automatic sizing).
- height
Height of the graph container in pixels or as a valid CSS unit. Default: NULL (automatic sizing).
- elementId
A unique ID for the graph HTML element. Default: NULL (automatically generated).
Details
This function extracts the node and edge data from an igraph
object, converts them
into the appropriate format for G6, and passes them to g6()
. Node styling is derived
from vertex attributes, and edge styling from edge attributes.
If the graph is directed, edges will automatically be rendered with arrows.
See also
g6()
for more information about node, edge, and combo structure.