Convert igraph graph objects to a simpler form used by graphjs

Share:

Description

Convert igraph graph objects to a simpler form used by graphjs

Usage

1

Arguments

ig

A graph object from igraph

Value

A list with node and edges data frame entries used by graphjs.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
  library(igraph)
  g <- make_ring(10) %>%
       set_edge_attr("weight", value = 1:10) %>%
       set_edge_attr("color", value = "red") %>%
       set_vertex_attr("name", value = letters[1:10])
  (G <- igraph2graphjs(g))

  # Can also directly run:
  graphjs(g)

## End(Not run)