elk icon indicating copy to clipboard operation
elk copied to clipboard

Allow 'negative' priority values

Open uruuru opened this issue 8 years ago • 5 comments

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 1 is both the minimum value allowed and the default priority.
  • Instead of allowing values [1,infty] with 1 being the default, allow [-infty,infty] with 0 being the default. The question remains how to properly handle this method- and implementation-wise.

uruuru avatar Mar 03 '17 12:03 uruuru

If you don't care 0 would be an appropriate value?

spoenemann avatar Jul 20 '17 14:07 spoenemann

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.

le-cds avatar Jul 21 '17 07:07 le-cds

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 0 would 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.

uruuru avatar Jul 22 '17 15:07 uruuru

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.

le-cds avatar Jul 23 '17 09:07 le-cds

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

nturley avatar Dec 29 '17 15:12 nturley