4

有没有办法制作一个边缘标签不重叠的有向 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")

在此处输入图像描述

4

0 回答 0