sigmaFromIgraph: Make a basic 'sigmaNet' graph object from an 'igraph' object

Description Usage Arguments Value Examples

Description

Create a 'sigmaNet' object from an 'igraph' object. The 'sigmaNet' object will be a basic visualization of the 'igraph' object and is meant to be the starting point for the development of a useful 'Sigma.js' visualization. If you are familiar with the 'ggplot' syntax, this is similar to the basic 'ggplot' function.

Usage

1
2
sigmaFromIgraph(graph, layout = NULL, width = NULL, height = NULL,
  elementId = NULL)

Arguments

graph

An 'igraph' object

layout

The output of one of the 'igraph' layout functions. If not provided, layout_nicely() will be used (note, this will slow things down).

width

Width of the resulting graph - defaults to fit container, probably leave this alone

height

Height of the resulting graph - defaults to fit container, probably leave this alone

elementId

Do not specify, this is used by the 'htmlwidgets' package

Value

A 'sigmaNet' object (which is an 'htmlwidget'). This object is meant to be called directly to render a default 'Sigma.js' visualization, or it can be passed to other arguments to change visualization attributes (colors, sizes, interactivity, etc.).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(igraph)
library(sigmaNet)

data(lesMis)

l <- layout_nicely(lesMis)
sig <- sigmaFromIgraph(graph = lesMis, layout = l)

#render basic visualization by calling the object
sig

iankloo/sigmaNet documentation built on May 13, 2019, 1:37 a.m.