Interactive plotting of an igraph net using threejs.
Usage
draw_graphjs(
net,
vertex_size = 1,
vertex_col = NULL,
vertex_label_col = NULL,
vertex_label_alpha = 0.66,
vertex_frame_col = NA,
vertex_label = NULL,
vertex_shape = "circle",
edge_col = NULL,
edge_alpha = 0.5,
edge_curved = 0.35,
edge_width = 2,
layout = c("fr", "dh", "drl", "gem", "graphopt", "kk", "lgl", "mds", "sugiyama"),
coords = NULL,
layout_params = list(),
cluster = NULL,
groups = NULL,
cluster_params = list(),
cluster_mark_groups = TRUE,
cluster_color_vertices = FALSE,
main = "",
theme = rtemis_theme,
theme_extra_args = list(),
palette = rtemis_palette,
mar = rep(0, 4),
par_reset = TRUE,
filename = NULL,
verbosity = 1L,
...
)
Arguments
- net
igraph
network.- vertex_size
Numeric: Vertex size.
- vertex_col
Color for vertices.
- vertex_label_col
Color for vertex labels.
- vertex_label_alpha
Numeric: Transparency for
vertex_label_col
.- vertex_frame_col
Color for vertex border (frame).
- vertex_label
Character vector: Vertex labels. Default = NULL, which will keep existing names in
net
if any. Set to NA to avoid printing vertex labels.- vertex_shape
Character, vector, length 1 or N nodes: Vertex shape. See
graphjs("vertex_shape")
.- edge_col
Color for edges.
- edge_alpha
Numeric: Transparency for edges.
- edge_curved
Numeric: Curvature of edges.
- edge_width
Numeric: Edge thickness.
- layout
Character: one of: "fr", "dh", "drl", "gem", "graphopt", "kk", "lgl", "mds", "sugiyama", corresponding to all the available layouts in igraph.
- coords
Output of precomputed igraph layout. If provided,
layout
is ignored.- layout_params
List of parameters to pass to
layout
function.- cluster
Character: one of: "edge_betweenness", "fast_greedy", "infomap", "label_prop", "leading_eigen", "louvain", "optimal", "spinglass", "walktrap", corresponding to all the available igraph clustering functions.
- groups
Output of precomputed igraph clustering. If provided,
cluster
is ignored.- cluster_params
List of parameters to pass to
cluster
function.- cluster_mark_groups
Logical: If TRUE, draw polygons to indicate clusters, if
groups
orcluster
are defined.- cluster_color_vertices
Logical: If TRUE, color vertices by cluster membership.
- main
Character: Main title.
- theme
rtemis theme to use.
- theme_extra_args
List of extra arguments to pass to the theme function defined by
theme
.- palette
Color vector or name of rtemis palette.
- mar
Numeric vector, length 4:
par
's margin argument.- par_reset
Logical: If TRUE, reset par before exiting.
- filename
Character: If provided, save plot to this filepath.
- verbosity
Integer: Verbosity level.
- ...
Extra arguments to pass to
igraph::plot.igraph()
.