Show label in hidden node

In some cases, the label in hidden modes is visible as in the middle node. In most cases, it is not as in the bottom node. I have not yet found out how I could force the "label-visible" in all hidden nodes. Below my visOptions settings:
highlightNearest = list(
algorithm = "hierarchical",
hover = TRUE,
labelOnly = TRUE,
enabled = TRUE,
degree = 3
),
Trying again... I would like to leave the node text visible in the de-highlighted branch. The example comes closes to the required look (label 2 is visible) when I click on node 5.

library(visNetwork)
library(magrittr)
n = 5
nodes = data.frame(id = 1:n, label = paste(1:n))
edges = data.frame(from = c(1,2,1,3), to = c(2, 4, 3, 5),
font.size = 14
)
visNetwork(nodes, edges) %>%
visOptions(
highlightNearest = list(
algorithm = "hierarchical",
enabled = TRUE,
degree = 2
)) %>%
visNodes(
shape = "box",
widthConstraint = 50,
heightConstraint = 20,
font = list(size = 16)
) %>%
visHierarchicalLayout(
sortMethod = "directed"
)
Hi,
It's not possible at moment... Thinking about a more flexible option of labelOnly
Trying again... I would like to leave the node text visible in the de-highlighted branch. The example comes closes to the required look (label 2 is visible) when I click on node 5.
library(visNetwork) library(magrittr) n = 5 nodes = data.frame(id = 1:n, label = paste(1:n)) edges = data.frame(from = c(1,2,1,3), to = c(2, 4, 3, 5), font.size = 14 ) visNetwork(nodes, edges) %>% visOptions( highlightNearest = list( algorithm = "hierarchical", enabled = TRUE, degree = 2 )) %>% visNodes( shape = "box", widthConstraint = 50, heightConstraint = 20, font = list(size = 16) ) %>% visHierarchicalLayout( sortMethod = "directed" )
excuse me! How can I set the label of nodes into the nodes in the VisNetwork of R