Learn R Programming

visNetwork (version 0.1.1)

visLayout: Network visualization layout options

Description

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

Usage

visLayout(graph, randomSeed = NULL, improvedLayout = NULL,
  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
improvedLayout
: Boolean. Defaut to true. When enabled, the network will use the Kamada Kawai algorithm for initial layout. For networks larger than 100 nodes, clustering will be performed automatically to reduce the amount of nodes. This can greatly improve the stabili
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)

visNetwork(nodes, edges) %>%
 visLayout(hierarchical = TRUE)

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

Run the code above in your browser using DataLab