Open clayt85 opened 5 years ago
network.getConnectedNodes(1,'from') return nothing because u dont have an edge that connects to Node 1. You need to have another edge like {from: 2, to : 1}.
I understand why network.getConnectedNodes(1,'from') returns nothing. The issue (in my opinion) is that the edge (in the code above) is specified to be bi-directional. Yet the second argument of the getConnectedNodes() method does not allow for an input of the form "to, from".
This has a workaround (I have already implemented it) but seems like an obvious missing feature.
If I have something like the following:
Then network.getConnectedNodes(1,'to') will return 2, but network.getConnectedNodes(1,'from') returns empty. The converse holds true for the node with id:2. It appears the getConnectedNodes() method is relying on the "from" and "to" fields of the edge data, but not taking into account the arrow type?
Meanwhile, it seems (from the documentation) that getConnectedNodes() does not support a "to, from" direction?