sigmajs for R.

With the rise in popularity of networks, it is important for R users to have access to a package that allows visualising the aforementioned networks in a highly configurable, interactive and dynamic manner. sigmajs leverages the original library’s great many methods by providing numerous proxies, buttons, and more.

All graphs must be initialised with the sigmajs() function, all the functions of the package start with sg_ and its proxies end in _p, functions are pipe-friendly (%>%).

Get Started

Get started with sigmajs , draw your first graphs and learn about settings.

Get Started Docs

Dynamism

Learn how to make a temporal graph in static R markdown documents.

Dynamic Buttons

Shiny

Explore the package's proxies and learn how to capture user interactions.

Guide Demo

Install

# install.packages("devtools")
devtools::install_github("JohnCoene/sigmajs") # github
devtools::install_bitbucket("JohnCoene/sigmajs") # bitbucket

Examples

Most functions have corresponding demo().

Note that the graphs may not work in RStudio viewer, open them in the browser of your choice.

library(sigmajs)

# generate data
nodes <- sg_make_nodes(25) # 20 nodes
edges <- sg_make_edges(nodes, 50) # 50 edges

sigmajs() %>% # initialise
  sg_nodes(nodes, id, label, size, color) %>% # add nodes
  sg_edges(edges, id, source, target) %>% # add edges
  sg_layout() %>%  # layout
  sg_neighbours() # show node neighbours on click

Most functions have corresponding demos, execute the command in the run column to see sigmajs in action. You can also see some of these examples here.

sigmajs demos
name run
add-node demo(add-node, package='sigmajs')
add-edge demo(add-edge, package='sigmajs')
add-node-edge demo(add-node-edge, package='sigmajs')
drop-node demo(drop-node, package='sigmajs')
drop-nodes demo(drop-nodes, package='sigmajs')
drop-edges demo(drop-edges, package='sigmajs')
drop-nodes-edges demo(drop-nodes-edges, package='sigmajs')
clear-graph demo(clear-graph, package='sigmajs')
add-nodes demo(add-nodes, package='sigmajs')
add-edges demo(add-edges, package='sigmajs')
add-nodes-delay demo(add-nodes-delay, package='sigmajs')
add-edges-delay demo(add-edges-delay, package='sigmajs')
add-delay demo(add-delay, package='sigmajs')
custom-shapes demo(custom-shapes, package='sigmajs')
drag-nodes demo(drag-nodes, package='sigmajs')
custom-events demo(custom-events, package='sigmajs')
add-camera demo(add-camera, package='sigmajs')
drop-nodes-delay demo(drop-nodes-delay, package='sigmajs')
drop-edges-delay demo(drop-edges-delay, package='sigmajs')
drop-edges-nodes-delay demo(drop-edges-nodes-delay, package='sigmajs')
export-graph demo(export-graph, package='sigmajs')
filter-nodes demo(filter-nodes, package='sigmajs')