创建一个visNetwork图,其中边缘标签不重叠

时间:2018-10-11 12:56:38

标签: r visualization visnetwork

有什么方法可以制作有向的visNetwork图表,其中边缘的标签不重叠? (e5和e4在下面的图表上重叠)

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

0 个答案:

没有答案