-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Get static node position #787
Comments
Hi Kritika, here: http://jsfiddle.net/m2f0hr59/6/ For this example I did not need the entire thing. I have a few questions for you.
Regards, Alex |
Thanks Alex, your code helped me fix my position issue! One LAST question, Below is the option i set: Why does the same options not apply when i am just updating the new data set each time to the same local network. THANKS ! |
Hi, It'd be really helpful if you could show this. I assume you're using the dataset.clear followed by the dataset.add method to change the nodes in your local view? Try doing a setData instead. Stabilization does not start when updating the dataset because you'd freeze the network on every small update. In 4.0 you can manually call stabilize but it's not out yet. Nothing is stopping you from calling the destroy method on the network and creating a new one but it's a little sloppy. Regards |
You are right, I am using dataset.clear and add. Even if i try to manually set options it does not seem to work when I dynamically want to change the same network each time. Its tough for me to show as my graph is updated each time from the database, however now i just plan to leave it this way as it stabilizes eventually. I also noticed another issue, though i manually set radius/value for a large set of nodes, the nodes are invisible. I am not sure if it is the graph size/dataset/my options which is not bringing up the nodes. Thanks |
Hi Let me restate what I said: The nodes are not invisible. You did not supply the right data so it crashes and does not draw (or does not know where to draw). Print your obj variable. The first node looks like this:
Our docs say: To fix:
Now lets look at the options.
First, I assume you want to use static smooth edges, but you turn off dynamic. This will make is much much more computationally intensive. Secondly,
should be:
I assume you were trying to use repulsion because of the error in the console window saying that there is a recursion problem in barnesHut (because all the coordinates are strings). I'd recommend: dont use repulsion for this big a dataset. It's slow. Please pay close attention to the documentation, a lot of these issues could have been avoided. Regards, Alex |
THANK YOU SO MUCH ! |
Hi Alex,
I managed to get a working sample code of what I am doing (to get a rough idea).
http://jsfiddle.net/kritika688/m2f0hr59/1/
I have the x and y axis for my global nodes, when i click on the local nodes, each time my node position changes. I am trying to get the same node position any number of time i refresh. I want my local nodes always fixed. In this example i have hardcoded the local nodes, however in the actual project the local network keeps changing.
I tried focusOnNode option keeping the same x and y coordinates, however i could not get that working.
storePositions options would not work for me as i already have the x and y coordinates already assigned. Is there any way i can always get nodes sorted by ID numer?
I would be grateful if you could help me regarding the same.
Thanks,
Kritika
The text was updated successfully, but these errors were encountered: