sigmajs (version 0.1.5)

sg_neighbours: Highlight neighbours

Description

Highlight node neighbours on click.

Usage

sg_neighbours(sg, nodes = "#eee", edges = "#eee")

sg_neighbors(sg, nodes = "#eee", edges = "#eee")

sg_neighbours_p(proxy, nodes = "#eee", edges = "#eee")

sg_neighbors_p(proxy, nodes = "#eee", edges = "#eee")

Arguments

sg

An object of class sigmajsas intatiated by sigmajs.

nodes, edges

Color of nodes and edges

proxy

An object of class sigmajsProxy as returned by sigmajsProxy.

Value

A modified version of the sg object.

Examples

Run this code
# NOT RUN {
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()

# }

Run the code above in your browser using DataCamp Workspace