elk icon indicating copy to clipboard operation
elk copied to clipboard

Replace 'spacing.labelNode' with 'nodeLabels.margin'

Open uruuru opened this issue 5 years ago • 4 comments

Consider

// TODO only applied to outside labels?
spacing.labelNode: 30
nodeLabels.padding: "[top=10.0,left=10.0,bottom=10.0,right=10.0]"

node n3 {
	nodeLabels.placement: "H_CENTER V_TOP INSIDE"
	label "label1"
	label "label2"
}

node n4 {
	nodeLabels.placement: "H_CENTER V_TOP OUTSIDE"
	label "label1"
	label "label2"
}

which yields image

The labelNode is only applied to the OUTSIDE labels, while padding is used on the inside. @le-cds is it possible that labelNode is partly deprecated in this case after your node label placement changes? Maybe it's reasonable to replace the labelNode by a new margins property for the outside?

uruuru avatar Apr 22 '20 16:04 uruuru

Sure, we could replace the label-node spacing by margins, which would be configurable for all four sides independently.

You don't see a bug here, do you? I'd consider this expected behaviour?

le-cds avatar Apr 24 '20 11:04 le-cds

Not a bug but inconsistent behavior I'd say.

If we were introduce nodeLabels.margins, spacing.nodeLabel would be obsolete, wouldn't it? In that case we should

  • a) either remove it or
  • b) use it - if it's set - to fill all values of padding and margin with nodeLabel.

I kind of like b) since that would preserve the possibility to control all spacings using the spacing group.

uruuru avatar Apr 24 '20 12:04 uruuru

Ah, I see why you find it inconsistent.

If we were introduce nodeLabels.margins, spacing.nodeLabel would be obsolete, wouldn't it?

Absolutely. I guess I'd simply remove it. The spacing options are already way too complex...

le-cds avatar Apr 24 '20 15:04 le-cds

Feel free to participate in the PR :).

uruuru avatar Jun 18 '20 13:06 uruuru