neighbours: Highlight neighbours

Description Usage Arguments Value Examples

Description

Highlight node neighbours on click.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
sg_neighbours(
  sg,
  nodes = "#eee",
  edges = "#eee",
  on = c("clickNode", "overNode", "clickNode|overNode")
)

sg_neighbors(
  sg,
  nodes = "#eee",
  edges = "#eee",
  on = c("clickNode", "overNode", "clickNode|overNode")
)

sg_neighbours_p(
  proxy,
  nodes = "#eee",
  edges = "#eee",
  on = c("clickNode", "overNode", "clickNode|overNode")
)

sg_neighbors_p(
  proxy,
  nodes = "#eee",
  edges = "#eee",
  on = c("clickNode", "overNode", "clickNode|overNode")
)

Arguments

sg

An object of class sigmajsas intatiated by sigmajs.

nodes, edges

Color of nodes and edges

on

The sigmajs event on which to trigger the neighbours highlighting. 'clickNode' (default) means when a node is clicked on. 'overNode' means when mouse is hovering on a node. 'clickNode|overNode' means a combination of the two modes at the same time.

proxy

An object of class sigmajsProxy as returned by sigmajsProxy.

Value

A modified version of the sg object.

Examples

1
2
3
4
5
6
7
8
nodes <- sg_make_nodes()
edges <- sg_make_edges(nodes, 20)

sigmajs() %>%
  sg_nodes(nodes, id, size, color) %>%
  sg_edges(edges, id, source, target) %>%
  sg_layout() %>%
  sg_neighbours()

JohnCoene/sigmajs documentation built on Feb. 1, 2021, 12:12 p.m.