-
Notifications
You must be signed in to change notification settings - Fork 324
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
Graph settles off canvas #310
Comments
I think you put a too high repulsion, but that's just my theory 😅 |
Hi not sure if you have resolved this, but I looked all through the docs and found nothing until I stumbled across vis.js and its option for network.fit(); I checked the neovis.js library and it exists there. I messed around with repulsion and didnt get any change in the display however fit() moved it to center. so you would use something like neoVis.network.fit(); to get it to center. Hope that helps you or someone else who has this issue |
Awesome! Thanks, cooincidence I was just on this last night and got ssl working. Now I can work on the presentation! The weird thing I am noticing is if I add the network.fit() method after render like this:
I will get an error:
But if I run neoViz.network.fit() in the console it runs and works fine. Any idea on that? Is there where you implemented this? FYI I also noticed that network.stabilize() seems to have the same effect as well. |
Yeah, I've tried everything I can at this point. Moved the scripts from the footer to the header. Ran draw() from the footer with defer, and then back to body onload. At this point the scripts are all in the header, and using body onload="draw()" with neoViz.network.fit() both in the script (at the very end), and also in the footer with defer. In both cases I now get |
Neovis have an event when the draw complete, listen to it and run neoViz.network.fit() there |
ok Thank you for the input! I now have the following in my script, and at least there are not error messages but the .stablilize() or .fit() method does nto seem to be called or function. (If I call it again at the console it works). Is there something wrong with the syntax?
|
I found that calling it when the div is hidden will not have the desired result ie it hasnt actually rendered and therefore there is nothing to stablize or fit is coastsystems.net your site? if so you are using jquery so instead of using onload='draw();' you could load it within .ready(). I couldnt find the script that was controlling the graph but you could try move your draw(); function to ready() and then call fit() there. I havent had much luck with 'completed' event |
Crazy. I sourced the main script in the header now. (proverbs.js) and tried:
in the footer. And the graph gets drawn (albeit not centered properly) But it is giving me:
But it STILL works from the console. Too weird. I'm going to try and put it back to body=onload and a timeout on fit(). |
I did also notice this comment elsewhere:
It would be nice it there were a concrete practical example of where and how to listen that the network graph is drawn completed. |
Next try was in footer:
with result:
But running neoViz.network.fit() from the console works. |
Is the graph rendered before you call neoViz.network.fit(); ie what happens if you console.log(neoViz) |
Hi, thanks for this awesome project!
I have a graph that typically will display 5 to 20 nodes. Not usually more. I have found that it most often settles at the left side of the canvas and if I move a node sometimes it will even totally settle of canvas so you can't even see it. There are a ton of options here. Any ideas on what is the best to try and
Please see my current code. (There are so many options and I am not) even sure everything is in the right place!!
https://coastsystems.net
The text was updated successfully, but these errors were encountered: