elk icon indicating copy to clipboard operation
elk copied to clipboard

Node size constraints should fall back to defined size if no minimum size is specified

Open uruuru opened this issue 5 years ago • 3 comments

Consider the following graph where nodeSize.minimum is explicitly commented.

With nodeSize.constraints: "[PORTS]" and nodeSize.constraints: "[PORTS MINIMUM_SIZE]" the resulting node width is 0 and 20, respectively. 20 being the default of the minimum size property (afaik).

In both cases it feels intuitive to me that the node width should be 40. I.e. if no minimum size is set, it's "default" should be derived from the specified dimensions.

Am I missing some use case?

node inner2 {
        layout [ size: 40, 40 ]
        portConstraints: FIXED_SIDE
        //nodeSize.minimum: "(40.0,40.0)"
        nodeSize.constraints: "[PORTS MINIMUM_SIZE]"

        port pw1 { ^port.side: WEST }
        port pw2 { ^port.side: WEST }
        port pw3 { ^port.side: WEST }
        port pw4 { ^port.side: WEST }
    }

uruuru avatar May 24 '20 12:05 uruuru

Seems sensible. I was trying to come up with an example where this would mess with minimum sizes of compound nodes, but everything I thought of checked out.

le-cds avatar May 28 '20 13:05 le-cds

@Eddykasp

soerendomroes avatar Nov 16 '22 08:11 soerendomroes

This is something that is currently handled in partially in KLighD. It might be sensible to look into whether this should be extracted and dealt with purely in ELK.

Eddykasp avatar Nov 16 '22 14:11 Eddykasp