如何在VIS网络图中添加selected by option?

How to add selected by option in VIS network graph?

我想突出显示所选节点的所有邻居(突出最近)

我无法用 javascript

达到同样的效果

Srackblitz link

这个例子放在vis.js website demonstrates how to implement the functionality: https://visjs.github.io/vis-network/examples/network/exampleApplications/neighbourhoodHighlight.html

JSFiddle link

Codepen link