使用分层布局时,循环图在 visNetwork 中显示不正确?

Cyclic graph not displayed correctly in visNetwork when using hierarchical layout?

当我使用 visLayout(hierarchical = TRUE) 时,我得到以下图片,我认为这是错误的:

使用 visLayout(hierarchical = FALSE) 我得到(正确的)图片:

这是一个错误还是我错过了什么?可重现的例子:

nodes <- structure(list(id = 1:4, label = c("node1", "node2", "node3", "node4"),
                        value = c(0.3, 0.3, 0.3, 0.3),
                        title = c("node1", "node2", "node3", "node4")),
                   .Names = c("id", "label", "value", "title"),
                   row.names = c(NA, -4L),
                   class = "data.frame")

edges <- structure(list(from = 1:4,
                        to = c(2L, 3L, 4L, 1L),
                        arrows = c("to", "to", "to", "to")),
                   .Names = c("from", "to", "arrows"),
                   row.names = c(NA, -4L),
                   class = "data.frame")

visNetwork(nodes, edges, height = "100%", width = "100%") %>%
  visOptions(highlightNearest = TRUE) %>%
  visLayout(hierarchical = TRUE) %>%
  visInteraction(navigationButtons = TRUE)

visNetwork(nodes, edges, height = "100%", width = "100%") %>%
  visOptions(highlightNearest = TRUE) %>%
  visInteraction(navigationButtons = TRUE)

我认为这是一个布局问题:
从节点 4 到 1 的边绘制在节点下方。因此,节点 1 和节点 2 之间似乎有一个双向箭头。

这就是为什么在圆形布局中一切都如您所愿。