datastorm-open / visNetwork

R package, using vis.js library for network visualization
Other
545 stars 125 forks source link

Apply edge highlight color to all edges selected with highlightNearest #419

Open anjstandearth opened 3 years ago

anjstandearth commented 3 years ago

Is it possible to have the edge highlight color apply to all edges that are highlighted in highlightNearest through VisOptions? For example, in the image of my network below, if I select a node on the second level, the connected nodes and edges all below are highlighted (compared to the rest of the network) but only the nodes directly connected to the selected node turn yellow. I would like all of the connected edges to turn yellow. Is there an option in visEdges or highlightNearest to make this happen? image Here's what I have for my code: visNetwork(JBS_nodes, JBS_edges) %>% visHierarchicalLayout(sortMethod = "directed") %>% visEdges(arrows = "to", color = list(highlight = "yellow", inherit = FALSE)) %>% visOptions(highlightNearest = list(enabled =TRUE, degree = 4, algorithm = "hierarchical"))

Any advice on how to achieve this would be much appreciated! TIA

YoTMo commented 2 years ago

I believe that this Stack Overflow question is effectively asking the same thing. Right?