Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.


Is there a more complete guide to how "Insets" work, both in group nodes and in "shape" type nodes?

0 votes
In regards to a group node, a single number defines the inset (similar to how CSS handles Padding: top, left, bottom, right or a single value does all 4) for the group label. BUT there appears to be a difference blank and a value of zero. Eg: a label with Insets="" (blank) shows a top, left, bottom inset of "some value", whereas Insets="0 0 0 10" shows a right inset of 10 and an actual top, left, bottom inset of zero.

Further, it seems that the Insets property for shape nodes applies directly to the label but doesn't appear to affect anything else. You can have a huge inset on the label (which you can see when you edit the label), but you can size the shape smaller than the inset border without any apparent effects.
in Help by (470 points)

2 Answers

0 votes
Unfortunately, there is no comprehensive guide to insets.

Let me try to explain how insets work.

Label insets

This is a single text field that may be empty, one integral number, or four space-separated integral numbers. E.g. "", "10", and "10 20 30 40" are valid values.
If the field is empty or its value is not one of the two other valid types, the label will have default insets. A labels default insets a 2 space units on each side.
If the field has a single integral number, the label will have a corresponding inset on each side. E.g. a value of "10" means an inset of 10 space units on each side.
If the field has four space-separated integral numbers, each number specifies the inset for one side in the order top, left, bottom, and right. E.g. a value of "10 20 30 40" means top inset 10, left inset 20, bottom inset 30, and right inset 40.

The quotes above around example values above are not part of the actual values and only serve to mark the enclosed text as example value. The quotes may not be entered into the Insets field.

Group node insets

Some group node styles support insets as well. Those that do provide four separate properties "Top Group Inset", "Left Group Inset", "Bottom Group Inset", and "Right Group Inset". The value for each of the corresponding text fields has to be a single decimal number.
Group node insets only have an effect, if the corresponding group node has at least one child node in the current view. (A closed group node never has children in the current view!)

That's it.

Finally, I would like to clarify that there is no "Insets" property for shape nodes. However, when you select a node, the properties view in yEd's lower right corner will show a section "Label". The properties in this section are the properties of the node's first label. (This is the case for all node styles, not just shape nodes.)
by [yWorks] (160k points)
Unfortunately the only valuable information I got from you answer is that the default value (the value when the field is blank) is 2.
Well, that is a pity. I would have thought that my answer at least clarified there is no insets property for shape nodes as you had thought and that label insets and group node insets take different value types (integral numbers vs decimal numbers).
Sorry, I consider the label to be part of the shape mostly because you can't have a label separate from a shape - although at times I wish I could put a plain text label outside a shape. I made the association because I had mentioned both shape nodes and group nodes. And the insets I'm talking about in group nodes refers to the header label, not the group node itself.
0 votes

Here's what I found out.

The Insets feature provides padding around the text of a label, identical to how CSS padding works (see W3 Schools article on Padding).

A text label will (by default) be placed in the middle of a shape node. The text itself will be modified by the amount specified in "Insets" within the label boundries. It is possible to make the shape smaller than the label, but the location of the text stays relative to the size of the node.

For group nodes, the label placement is in the header. The insets are still indicated in the same order (top, left, bottom, right) even though the default alignment for group labels is "right".

Please comment if you have questions regarding my answer.

by (470 points)

No, label insets are not identical to CSS padding.

No, label insets do not modify text in any way. Label insets affect the size of the label element. (A label is more than text.)

Label placement and label alignment have no effect on label insets.

Insets are identical to CSS padding in that: you can specify the amount of spacing the same way and with the same shorthand (mostly), and they specify the blank space distance between the bounding box of the text and the outside of the label element the same way. The only difference is that in CSS it's 100% spacing which can only be "overwritten" by special rules; in yEd Insets more define the relative positioning of the label inside the shape (be it a shape node or group node header).

Insets modify the text in that insets change the texts position, but yes you're correct, insets don't modify the characters of the text.

Yes, you're correct again. Label Alignment is significantly separate from insets - it's very much related to, but more associated with the "Size" property of the label.
Legal Disclosure | Privacy Policy