elk
elk copied to clipboard
Allow 'negative' priority values
In ELK Layered we have three priority options:
org.eclipse.elk.layered.priority.shortness
org.eclipse.elk.layered.priority.straightness
org.eclipse.elk.layered.priority.direction
All three can be used to make it more likely that an edge is short, straight, or points forwards. However, it is not possible to state that one does not care about an edge being straight.
Two possible solutions:
- Have a larger default priority. Currently
1is both the minimum value allowed and the default priority. - Instead of allowing values
[1,infty]with1being the default, allow[-infty,infty]with0being the default. The question remains how to properly handle this method- and implementation-wise.
If you don't care 0 would be an appropriate value?
I think this is obsolete. By now, we have a hasProperty(...) method which would serve this use case nicely, unless I'm missing something here. Yes, one would have to guard against the property not being present, but one would otherwise also have to guard against its value being "I don't care" instead of a meaningful number.
I think this is obsolete.
The issue is not about default value being present or absent but about extending the range of possible values.
If you don't care
0would be an appropriate value?
I think I had in mind to set it to <0 if you don't care for a particular edge. If you don't care at all the behavior would fall back to what currently is done for 1.
However, as mentioned above I didn't put much thought into it yet.
The issue is not about default value being present or absent but about extending the range of possible values.
Ah, I see. Sorry, I misunderstood.
+1. The default value shouldn't be at the limit of of the range of valid priorities. If I want to decrement the priority of an edge, I shouldn't have to increment the priority of everything else.