almende / vis

⚠️ This project is not maintained anymore! Please go to https://github.com/visjs
7.85k stars 1.48k forks source link

Added option layout.hierarchical.userControlsFreeAxis (revision 2) #4183

Open softwareCobbler opened 5 years ago

softwareCobbler commented 5 years ago

This commit solves a question I asked on stackoverflow: https://stackoverflow.com/questions/53127971/how-can-i-set-node-positions-in-a-hierarchical-layout

Here we override the LayoutEngine logic if a user has BOTH specified this option and supplied a "free axis" value in any of their nodes within the Dataset they've bound to Network. The "free axis" is x if hierarchical.direction is "DU" / "UD", and y if it's "LR" / "RL". Undefined values for the free axis leave LayoutEngine doing what it did prior to this commit.

In addition I added some documentation for this in './docs/network/layout.html'.

softwareCobbler commented 5 years ago

in lieu of an example: Video of what it does