-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Network: set initial position for nodes, but let them wander freely afterwards #215
Comments
Hi Pablo, Could you make a js fiddle showing your problem? I used these settings Regards, Alex |
Hi, Alex. Here's one of my failed strategies: http://jsfiddle.net/97dzy/ My goal is two concentric rings of five nodes each. In this example I try setting coordinates for nodes 1–5 to (0, 0) and then releasing them. Thanks for your reply. Regards, Pablo. |
Hi, Ill look into it Monday when I'm back at work. Regards, Alex |
Hi Pablo, The problem was a bit different than you descibed it. Try it again with the stabilization option off. You can safely initialize your nodes with:
You do not need to release them since your problem lies with your configuration of the physics system. I have edited your fiddle: http://jsfiddle.net/97dzy/4/ and my changes are: setting rest length of the edges for the inner and outer circle, removing your release code. Adding allowedToMove to the nodes. You can imrpove your solution by specifying the positions of all your nodes and then playing with the physics system (http://visjs.org/docs/network.html#PhysicsConfiguration) to get nice round circles. Regards, Alex |
Beautiful! Thanks a lot for your detailed answer. Regards, Pablo. |
Hi, How to stop movable of nodes for hierarchical tree ? Thanks and Regards, Nitin |
Hi Nitin, I already answered this in the other issue but for completeness I'll copy it here. You can use the freezeSimulation(true) method on stabilized to stop the simulation. You could also use the dragNodes option to disable dragging of nodes. Alternatively, you could disable the physics simulation with
It is not possible to lock the position of individual nodes in the hierarchical system. Regards, Alex |
Hi Alex. Thanks for the great work. I have just started using your application, and have the following (I am afraid simple) problem. I have a network with 14,000 nodes and about 30,000 edges. I am able to create the network fine (it takes time). I saved the x/y coordinates, and created a JSON with these hard coded. Problem is that the network with the original output looks very different than the network with the x/y coordinates built in. I have tried various suggestions, but look like I am missing something simple. Physics is false. Any suggestions or links to existing docs? Thanks. |
Hi, It could be due to a bug in the improvedLayout. Try turning that off. Cheers!
|
Hi Alex. I did that, and I turned off physics. In fact, I tried practically every combination of manipulation I could think of – no luck. From: Alex [mailto:[email protected]] Hi, It could be due to a bug in the improvedLayout. Try turning that off. Cheers!
— |
Hi, It would help a lot if I could see the code. Is it shareable? Or reproducible? Our examples do work with fixed locations. Regards
|
Can you share your email ID? |
I'd prefer to discuss this on github since multiple people may have this issue. Regards |
Ok – will do. I will try to get the code down to the core and set it up on fiddle. I wonder if it is the volume of nodes that is throwing it off. But I will experiment and let you know. From: Alex [mailto:[email protected]] I'd prefer to discuss this on github since multiple people may have this issue. Regards — |
Hi,
I'm, working with the Network visualization, and I'm facing a problem: I need to specify the initial position of the nodes (the random initialization doesn't work for me), but I don't want them to remain fixed forever.
I have tried this in several ways, to no avail:
x
,y
,allowedToMoveX: true
andallowedToMoveY: true
when defining the node set.x
andy
and later resetting them tonull
(nothing happens) orundefined
(infinite recursion occurs, for some reason).x
andy
at definition, and later settingallowedToMoveX
andallowedToMoveY
to true.allowedToMoveX: true
andallowedToMoveX: true
at definition, and later settingx
andy
.This all result in the same: whenever I set
x
andy
for a node, it will stay pinned forever, no matter what I do or when I do it.For extra background about my specific needs, I'm trying to define a network formed by three concentric rings (cycles of N nodes):
The definition of the network itself doesn't provide enough information to render it properly, the result being variations of this:
If I were able to hint an initial
x
andy
for each node and let them gravitationally wander off thereafter, I'm pretty sure I'd be able to achieve concentricity.Any ideas? :)
Thanks and regards,
Pablo.
The text was updated successfully, but these errors were encountered: