I wanted to highlight all neighbors of the selected node (highlightNearest)
I am not able to achieve the same with javascript
asked Feb 17, 2020 at 10:35
IamGrooot
1,0402 gold badges25 silver badges56 bronze badges
1 Answer 1
This example on the vis.js website demonstrates how to implement the functionality: https://visjs.github.io/vis-network/examples/network/exampleApplications/neighbourhoodHighlight.html
answered Feb 17, 2020 at 11:22
niiyeboah
1,3599 silver badges19 bronze badges
Sign up to request clarification or add additional context in comments.
3 Comments
IamGrooot
Here they are writing custom methods for highlighting nodes. If you see vis documentation they have builtin method
visOptions(highlightNearest = true) which we can make use of. I am able to achieve that with R. But with js no luck datastorm-open.github.io/visNetwork/options.html niiyeboah
It seems you are referring to this visNetwork R package which is a separate library built on top of vis.js. I have looked through the official vis-network docs and was not able to find a
highlightNearest option. It seems that unfortunately to do this in JS, currently the only way is to use a custom method.IamGrooot
ahh ok. my bad. Thanks
lang-js