Description Usage Arguments Value Examples
Highlight node neighbours on click.
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")
)
|
sg |
An object of class |
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 |
A modified version of the sg
object.
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()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.