You can not just use the selector, because you need a small round schedule in addition to the initial filter, for example cy.$('node:selected').neighborhood('edge'); that is, for the selected nodes get all the connected edges
Or cy.$('node:selected').connectedEdges()
source
share