Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazily add edges #37

Open
strarsis opened this issue Oct 3, 2022 · 2 comments
Open

Lazily add edges #37

strarsis opened this issue Oct 3, 2022 · 2 comments

Comments

@strarsis
Copy link

strarsis commented Oct 3, 2022

When an edge is added, non-existing nodes are added automatically.

However, sometimes the edges of a node are added while the other nodes, including those to be connected, haven't been added yet. Therefore it would be very helpful if those edges were added without creating non-existing nodes.
Even better: An event is emitted when those yet non-existing nodes are queries, so they can be dynamically added (e.g. by network request).

@anvaka
Copy link
Owner

anvaka commented Oct 20, 2022

Edges by definition connect nodes - I can't think of a scenario where edge exists without nodes. So this does seem to work as designed.

Yet I feel like I'm missing something in your use case. Tell me more what were you trying to do and what was missing?

@strarsis
Copy link
Author

From an API a list of nodes (each has an individual ID) is fetched, each node has a list of connections with other node IDs.
The nodes list is iterated over and each node is added to the ngraph as graph node, and each connections list of the node is also iterated over and each connection should also be added as graph edge - and here is the underlying issue:
The graph edge needs the target node to be existing. One would need multiple iterations over all the nodes and their connections to avoid this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants