Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

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

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

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

wants to merge 5 commits into from

Conversation

softwareCobbler
Copy link

@softwareCobbler softwareCobbler commented Nov 4, 2018

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'.

  • Provide an additional or update an example to demonstrate your changes or new features.
  • Update the documentation if you introduced new behavior or changed existing behavior.
  • Expect review comments and change requests by reviewer.

@softwareCobbler
Copy link
Author

softwareCobbler commented Nov 4, 2018

in lieu of an example: Video of what it does

@softwareCobbler softwareCobbler changed the title Added option hierarchical.layout.userControlsFreeAxis (revision 2) Added option layout.hierarchical.userControlsFreeAxis (revision 2) Nov 4, 2018
console.log(this.layoutEngine);
//
// this clears "userControlsFreeAxis" when "hierarchical" is disabled
// without doing this, and performing the following steps:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May still be a good idea to clear the userControlsFreeAxis option if hierarchical layout is disabled, but the bug I was attempting to fix is probably #4228.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants