Learn R Programming

visNetwork (version 0.1.0)

visLayout: Network visualization layout options

Description

Network visualization layout options. For full documentation, have a look at visDocumentation.

Usage

visLayout(graph, randomSeed = TRUE, hierarchical = NULL)

Arguments

graph
: a visNetwork object
randomSeed
: Number. When NOT using the hierarchical layout, the nodes are randomly positioned initially. This means that the settled result is different every time. If you provide a random seed manually, the layout will be the same every time. Ideally you try with
hierarchical
: Boolean. Default to false. When true, the layout engine positions the nodes in a hierarchical fashion using default settings. For customization you can use visHierarchicalLayout

See Also

visNodes for nodes options, visEdges for edges options, visGroups for groups options, visLayout & visHierarchicalLayout for layout, visPhysics for physics, visInteraction for interaction, ...

Examples

Run this code
nodes <- data.frame(id = 1:10)
edges <- data.frame(from = round(runif(8)*10), to = round(runif(8)*10))

visNetwork(nodes, edges) %>%
 visLayout(randomSeed = 123, hierarchical = FALSE)

visNetwork(nodes, edges) %>%
 visHierarchicalLayout(direction = "LR")

Run the code above in your browser using DataLab