sigma.js for R. A powerful, full-featured R package for interactive graph visualisation.




Start with the 1) get started guide to get up to speed, then move on to 2) layouts then to 3) buttons and finally 4) dynamic graphs and you should be at ease with the core functionalities.

Features

Customisation

Easily and neatly layout and cluster nodes on your sigmajs graphs.


Layout Cluster

Dynamism

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

Dynamic Buttons

Animations

Animate the color, size, and x/y coordinates of the nodes on the canvas.

Animate

sigmajs plays hand-in-hand with Shiny, it lets you:

  • Catch how users interact with your graphs.
  • Easily apply filters.
  • Trigger events.

Have sigmajs play hand-in-hand with other htmlwidgets, such as leaflet, or DT to highlight nodes and neighbours on click.

Build sigmajs graphs from igraph objects or GEXF files in a single function call.

Install

Install the stable version from CRAN.

install.packages("sigmajs")

or the development version Github or Bitbucket.

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

Example

Note that the graphs do not work in the RStudio viewer, and thus open in your default browser.

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) %>% # add nodes
  sg_edges(edges, id, source, target) %>% # add edges
  sg_layout() %>%  # layout
  sg_cluster() %>% # cluster
  sg_drag_nodes() %>% # allows user to drag nodes
  sg_neighbours() # show node neighbours on node click


sigmajs is part of the twinetverse, a set of packages for Twitter network analysis and visualisation: it'll 1) get you started with network data and 2) walk you through from basic use cases to advanced functions.