Skip to contents

Plot graph using networkD3

Usage

draw_graphD3(
  net,
  groups = NULL,
  color_scale = NULL,
  edge_col = NULL,
  node_col = NULL,
  node_alpha = 0.5,
  edge_alpha = 0.33,
  zoom = TRUE,
  legend = FALSE,
  palette = get_palette(getOption("rtemis_palette")),
  theme = choose_theme(getOption("rtemis_theme")),
  ...
)

Arguments

net

igraph network.

groups

Vector, length n nodes indicating group/cluster/community membership of nodes in net.

color_scale

D3 colorscale (e.g. networkD3::JS("d3.scaleOrdinal(d3.schemeCategory20b);")).

edge_col

Color for edges.

node_col

Color for nodes.

node_alpha

Float [0, 1]: Node opacity.

edge_alpha

Float [0, 1]: Edge opacity.

zoom

Logical: If TRUE, graph is zoomable.

legend

Logical: If TRUE, display legend for groups.

palette

Character vector: Colors to use.

theme

Theme object.

...

Additional arguments to pass to networkD3.

Value

forceNetwork object.

Author

EDG

Examples

if (FALSE) { # interactive()
library(igraph)
g <- make_ring(10)
draw_graphD3(g)
}