-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
Hierarchical Layout with large clusters still creates gaps after v6.4.5 #276
Comments
could you provide an MWE for this? Because in my tests it works perfectly. Regarding performance sure it's slower, it does more work. I'm definitely not the best programmer in the world so it most likely could be improved. PRs and suggestions are always welcome. |
So I investigated this a bit and at least I found out why you have so huge holes in the network. The nodes are positioned when the network is created and then when the clusterByHubSize method is called a lot of nodes disappear but there is nothing to move the nonclustered nodes into the empty space. With default configuration physics would do it but you disabled it. There are three ways how you can solve this:
The slow down is impossible not to notice when updating but I can't figure out why it happened. It even happens when the levels are forced (as in you Codepen). The changed layouting code is not invoked at all in such case. |
So the culprit is _condenseHierarchy method. Removing it took the time down to less than a second from almost 60 seconds. The purpose of this method is to reduce the amount of space between nodes on the same level which I guess is pretty tricky thing to do (the method has 370 lines) but I didn't look into it yet. I'm still not sure why it slowed down though. Nobody touched this thing in the past two years. |
Hi @Thomaash Thanks for the help, just a quick question: If I have all the layouts disabled by default, start the network and do the clusterByHubsize and then enable the layout, that should work for this, but it doesn't seem to change anything? Calling I have physics disabled because it seems to make the network bounce around with some of the interaction options I use. (Changing node size on hover, showing full node label on hover, showing edge labels on hover) |
if you have such issues maybe it would be a good idea to open a new issue, provide an MWE and see if it's a bug in the library that should be fixed. I don't think that what you describe should cause the network to bounce though I'm not sure what exactly to bounce refers to. |
Hi @Thomaash The bounce is basically when I hover over an edge or node, all the nodes and edges move around erratically. It looks like they're bouncing around.
Why would the fix not work for a pre-clustered network and then enabling the hierarchical layout? I've updated the codepen with a timeout that enables the hierarchical layout after 5 seconds. This shows that the network is clustered before the layout runs, however it still leaves the gaps. |
Hi @Thomaash, Have you managed to have a look at the new codepen? Or anything more on this issue? |
Hi Guys,
Thanks for #270, it works really well on small to medium graphs, however it does not fix #264, in fact it seems slower than before and still creates big gaps in the network.
Still using the same dataset as in #264
The text was updated successfully, but these errors were encountered: