-
Notifications
You must be signed in to change notification settings - Fork 38
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
Getting collapsed edge containing certain edge #137
Comments
Hi @Alexithemia Collapsed edges are stored inside the data property In fact, defining new API methods similar to |
Unfortunately there does not seem to be a way to go upwards like with Currently I'm using a sketchy fix by getting the source and target of the edge, and using |
@canbax could a simple |
No, it is not simple. Why don't you follow what I said? Just a recursive function and iterate through all edges and their collapsed children. Also here what is a parent? If nesting is allowed a parent might be a collapsed edge. |
Because iterating through possibly thousands of edges to check each of it's edges in collapsedEdges is very process heavy, when having a reference to the edge it is collapsed under would take a single operation. Here's an example of what I'm trying to get this to do. Here is a short video showing what I'm running into in very small demo scale. Some workspaces in our app have 4000+ links. Linkselect.mp4 |
@Alexithemia iterating through 4000+ edges should be fast if your algorithm is linear (it should be). Did you try that? Secondly, collapsing edges is done manually by the API user. So you are the one who is collapsing edges. So you can keep a map on your own. You can also listen for events like |
Is there any way to get the collapsed edge that an edge belongs to?
For example, a certain part of my app selects a certain edge, that is collapsed into a group edge, I want to indicate that group edge as selected to show that. How can I find that edge?
I know there is
api.getParent(id)
but that does not work for edges.The text was updated successfully, but these errors were encountered: