elk
elk copied to clipboard
HierarchyHandling problematic when directly using layout provider
There's a method in the RecursiveGraphLayoutEngine that explicitly computes and sets the hierarchyHandling layout option for all hierarchical nodes. This may be problematic when using a layout provider directly. The layout provider cannot really assume that the values have been set and would have to duplicate the logic.
private void evaluateHierarchyHandlingInheritance(final ElkNode layoutNode) { ... }
We could put that logic into a public utility method which is then also used by the RecursiveGraphLayoutEngine?
Who would call it in the case of plain java layout?
Well, if the RecursiveGraphLayoutEngine is used the answer is rather obvious. If people call layout algorithms directly I think it's fine to require them to call said method beforehand. First, it's only really necessary if hierarchy is involved. And second, I don't really see why one would call a layout algorithm directly anyhow. And if it is indeed necessary, I guess we may safely assume people who do that to know what they're doing.
Ok.
We should evaluate how this relates to #314.
It might make sense to move the hierarchy handling computation to LayoutAlgorithmResolver.
Yes, we were thinking along those lines. Since that requires a bit of thought I don't expect that will happen for the next release.