1

In my application, a graph is loaded initially with the one-net of a particular node. The user can expand the graph by double-clicking any node to add its one-net.

The problem is that every time the user does that, the nodes all jump around, so it's confusing. I don't want to just disable physics, because then the new nodes get jumbled on top of the old ones. For lack of a better explanation, I want to freeze the existing nodes, only using physics to arrange the new nodes (and then freeze them before adding more). I looked at Stop vis.js physics after nodes load but allow drag-able nodes, but that doesn't solve my problem.

I'm pretty clueless about what the various options to the physics solving algorithms mean, and can't find a good description anywhere, so I wonder if there may be tweaks there that would help me.

Thanks!

Community
  • 1
  • 1
betseyb
  • 1,302
  • 2
  • 18
  • 37

1 Answers1

0

You can give some of your nodes a fixed x and y position. There are also methods like getPositions() and storePositions() to retrieve or set the positions after the first stabilization or something like that.

Jos de Jong
  • 6,602
  • 3
  • 38
  • 58
  • I've been having a conversation on the github forum as well. I tried setting the positions to fixed after stabilization, and then the new nodes were placed on top of them. I'm really feeling confused here. – betseyb Jan 10 '16 at 15:53