Learn R Programming

sigmaNet (version 1.1.0)

addInteraction: Modify the interactivity of a 'sigmaNet' object.

Description

Modify the interactivity of a 'sigmaNet' object using the below options. By default, visualizations include on-click neighbor events, double-click zoom, and mouse-wheel zoom. These can all be disabled or modified per the below options.

Usage

addInteraction(sigmaObj, neighborEvent = "onClick", doubleClickZoom = TRUE,
  mouseWheelZoom = TRUE)

Arguments

sigmaObj

A 'sigmaNet' object - created using the 'sigmaFromIgraph' function

neighborEvent

Enable/disable event that highlights a node's neighbors. Can either be onClick, onHover, or None.

doubleClickZoom

Enable/disable zoom event on double click

mouseWheelZoom

Enable/disable zoom event on mouse wheel

Examples

Run this code
# NOT RUN {
library(igraph)
library(sigmaNet)
library(magrittr)

data(lesMis)

l <- layout_nicely(lesMis)
#change neighbor highlighting to on-hover, disable double-click zoom, enable mouse-wheel zoom
sig <- sigmaFromIgraph(graph = lesMis, layout = l) %>%
  addInteraction(neighborEvent = 'onHover', doubleClickZoom = FALSE, mouseWheelZoom = TRUE)
sig

# }

Run the code above in your browser using DataLab