d3_igraph: Convert 'igraph' to 'd3.js'

View source: R/igraph.R

d3_igraphR Documentation

Convert 'igraph' to 'd3.js'

Description

Convert 'igraph' to 'd3.js'

Usage

d3_igraph(igrf = NULL, json = TRUE)

Arguments

igrf

igraph

json

logical to return as JSON

Value

list

Examples

## Not run: 
library(igraph)
library(igraphdata)
library(d3r)

# with random graph
d3r::d3_igraph(igraph::sample_pa(100))

# check case where vertices 0 cols
d3_igraph(igraph::watts.strogatz.game(1, 50, 4, 0.05))

# with karate from igraphdata
#  notice graph attributes are added
data("karate",package="igraphdata")
(karate_d3 <- d3r::d3_igraph(karate))

listviewer::jsonedit(karate_d3)

data("kite",package="igraphdata")
listviewer::jsonedit(d3_igraph(kite))

## End(Not run)

d3r documentation built on Oct. 2, 2023, 5:08 p.m.