visNetwork (version 0.1.1)

visHierarchicalLayout: Network visualization Hierarchical layout options

Description

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

Usage

visHierarchicalLayout(graph, enabled = TRUE, levelSeparation = NULL,
  direction = NULL, sortMethod = NULL)

Arguments

graph
: a visNetwork object
enabled
: Boolean. Default to TRUE when calling this function. Enable or disable the hierarchical layout.
levelSeparation
: Number. Default to 150. The distance between the different levels.
direction
: String. Default to 'UD'. The direction of the hierarchical layout. The available options are: UD, DU, LR, RL. To simplify: up-down, down-up, left-right, right-left.
sortMethod
: String. Default to 'hubsize'. The algorithm used to ascertain the levels of the nodes based on the data. The possible options are: hubsize, directed.

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) %>%
 visHierarchicalLayout()

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

Run the code above in your browser using DataLab