fix/COMPASS-9944 alternative applyLayout for no edges #151
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
layered
andforce
algorithms are intended for diagrams with both nodes and edges. A bit surprisingly, when no edges are provided to thelayered
algorithm, it doesn't apply the node spacing we've specified and instead uses the default (20). The issue is actually present in the tests as well, I just didn't realise before that there was a spacing config that was ignored.ELK
provides other algorithms for unconnected nodes, like rectpacking. I was thinking how to best combine this with our existingdirection
options - here I'm adding it under aRECTANGLE
option. Additionally I've added options, so far onlyaspectRatio
but there might be more that are useful in the future.This is a breaking change for the util, so the next bump will be major.
Before
After