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

Description Usage Arguments Examples

View source: R/sigmaAttrs.R

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

1
2
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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

sigmaNet documentation built on May 2, 2019, 11:06 a.m.