5

Is there any way to make a directed visNetwork chart where labels of edges do not overlap? (e5 & e4 overlap on the chart below)

library(visNetwork)
nodes = data.frame(id = c(0, 1, 2, 3, 4),
                   X = c("x0", "x1", "x2", "x3", "x4"),
                   label = c("x0", "x1", "x2", "x3", "x4"),
                   shape = "circle")
edges = data.frame(from = c(0, 0, 1, 1, 2, 2),
                   to = c(1, 2, 3, 4, 3, 4),
                   arrows = "to",
                   label = c("e1", "e2", "e3", "e4", "e5", "e6"))

graph = visNetwork(nodes, edges)
visHierarchicalLayout(graph, 
                      levelSeparation = 150, 
                      sortMethod = "directed", 
                      direction = "LR")

enter image description here

epo3
  • 2,991
  • 2
  • 33
  • 60
Serhii
  • 362
  • 4
  • 15

0 Answers0