Skip to content

Question for non-standard force layout model #157

Answered by gampleman
NicolasWinsten asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not sure why the Hierarchy module doesn't fit your needs?

The main way you can mess with force layouts is that after each tick you can change the positions and velocities manually. So you could enforce further constraints, such as making a parent node have a lower y value than a child node for instance.

Another trick worth keeping in mind is that links in a force simulation don't have to correspond 1-1 with links that you draw on the screen. So for instance adding an extra invisible link between leftChild and rightChild will make it quite likely that you will end up with a triangular looking layout between the three.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@NicolasWinsten
Comment options

@gampleman
Comment options

@NicolasWinsten
Comment options

Answer selected by NicolasWinsten
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #156 on December 13, 2023 09:13.