-
Notifications
You must be signed in to change notification settings - Fork 425
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
Dynamic Graph With Constant Layout #23
Comments
@ibnesayeed Do you have a link to reproduce the problem? PS: Are you trying to make all nodes fixed or you need some of them to be positioned by vivagraph? |
I have a JSON file that has pre-calculated X and Y positions of each node as well as color and other attributes are encoded in JSON itself. I want to apply one node at a time from JSON to the graph. The nature of my need is such that I cannot pre-render all the nodes in advance. Hence, all the nodes will be added dynamically on a constant layout. I will try to write a small example code that can reproduce this issue and I will post it here soon. Thanks for the help! |
Here is a fiddle http://jsfiddle.net/HE7tb/ Three nodes were supposed to be panted while only one node is being painted in this fiddle. and it throws error saying, "Uncaught TypeError: Cannot read property 'x' of undefined" |
Fixed. If your example reflects what you are doing, you might also want to add a fake node before call to the renderer.run, and remove it afterwards. This trick will auto-center the graph: http://jsfiddle.net/HE7tb/2/ |
Thanks for the fix. You were really very helpful. And thanks again for the additional trick to auto-center the graph. I am closing this bug report. :-) |
I am trying to use constant layout to specify node placement myself. I also want to dynamically add or remove nodes/edges in the graph periodically. I am getting two types of errors while doing this.
Any help please!
The text was updated successfully, but these errors were encountered: