almende / vis

⚠️ This project is not maintained anymore! Please go to https://github.com/visjs
7.85k stars 1.48k forks source link

network.getConnectedNodes documentation ambiguity (bug?) #4168

Closed clayt85 closed 5 years ago

clayt85 commented 5 years ago

The documentation for the getConnectedNodes method states that the first argument is "a string nodeId or edgeId". What happens if a node and an edge share the same ID? For instance, this code is perfectly valid to create a network:

nodes = new vis.DataSet([{id: 1, label:'Node 1'},{id: 2, label:'Node 2'}]);
edges = new vis.DataSet([{id: 1, from: 1, to: 2, arrows:'to'}]);

But now, what happens if I try network.getConnectedNodes(1)? Does it return 2 (the node connected to Node 1) or [1 2] (the nodes connected to Edge 1)?

mojoaxel commented 5 years ago

But now, what happens if I try network.getConnectedNodes(1)? ...

@clayt85 Why don't you try it and share your findings with the community?

mojoaxel commented 5 years ago

closed in favor of #4167 (looks like somebody likes to create issues...)

clayt85 commented 5 years ago

Looks like nobody likes to fix issues. I guess that is why there is visjs-network