以下 R 脚本创建了一个 visNetwork 图,如图所示。如何通过给出弯曲因子手动将直边更改为弯曲边?
我在这里尝试使用带有“平滑”标签的圆度属性的一种方法。但是,无法实现。
library(visNetwork)
nodes <- data.frame(id = 1:3,color = c(rep("blue",1), rep("red",1),
rep("green",1)))
edges <- data.frame(from = c(1,2,3), to = c(2,3,1))
nodes = data.frame(nodes, level = edges$from)
visNetwork(nodes, edges, height = "500px", width = "100%") %>%
visOptions(highlightNearest = list(enabled = T, degree = 2, hover = T)) %>%
visOptions(highlightNearest = F, nodesIdSelection = F, width = 500, height =
500,autoResize = F) %>%
visHierarchicalLayout() %>%
visEdges(shadow = TRUE,
arrows =list(to = list(enabled = TRUE, scaleFactor = 2)),
color = list(color = "black", highlight = "red"),
smooth = list(roundness = 0.3))