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

Can't display a big graph #34

Open
vherrera96 opened this issue Sep 1, 2021 · 3 comments
Open

Can't display a big graph #34

vherrera96 opened this issue Sep 1, 2021 · 3 comments

Comments

@vherrera96
Copy link

vherrera96 commented Sep 1, 2021

Hello!
Thanks for this wonderful package! I've been playing with random graphs and it works great. However after trying to display a "big graph" (44 nodes and ~300 edges) something weird happens. It seems unable to stabilize the graph and it doesn't stop moving. Do you know how to fix this?
Thank you!
ezgif com-gif-maker (1)

@vherrera96 vherrera96 changed the title Can generate a big graph Can display a big graph Sep 1, 2021
@vherrera96 vherrera96 changed the title Can display a big graph Can't display a big graph Sep 1, 2021
@imohitmayank
Copy link
Owner

Hi @vherrera96, this behavior is observed when the physics stabilization engine is not able to converge (which is quite tough for skewed graphs with a high edge to node ratio). One way we can "force" convergence, is by reducing the steps taken for stabilization. Sample code (taken from readme example),

# init Jaal and run server
Jaal(edge_df, node_df).plot(vis_opts={'physics':{'stabilization':{'iterations': 100}}}) # define the convergence iteration of network

Here, you can try reducing the iterations value which will halt the stabilization effort. I should point out that while your graph will stop moving, it might be quite "messy" to see 😅

@dumblob
Copy link

dumblob commented Sep 8, 2021

Maybe allow some manual intervention by letting the user to choose node(s) and "fix them in place" (to slightly clean the "mess" you write about)?

@Famondir
Copy link

Famondir commented Nov 7, 2023

For me the stabilization key word did not help but to change the solver helped. I got best results with repulsion instead of the default BarnesHut:

Jaal(edge_df, node_df).plot(directed=True, vis_opts={'physics':{'solver' : 'repulsion'}})

Using `` the most important settings were centralGravity (increased from 0.3 to 1.0 ) and `springConstant` (reduced from 0.04 to 0.01):

Jaal(edge_df, node_df).plot(directed=True, vis_opts={'physics': {'stabilization': False, 'barnesHut': {'centralGravity': 1, 'springConstant': 0.01}}})

You can turn stabilizationoff or keep it on (and adjust iterations to your liking).

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

4 participants