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.

Categories

What does the "Distance" parameter do in labels?

0 votes

I tried to change all parameters in labels and see their effects. Everything works as expected, except the "Distance" parameter, which does not seem to have any effect on the label, its placement or the placement of text inside the label.

What does this parameter do?

in Help by (1.5k points)

1 Answer

0 votes
 
Best answer

The effect of the "Distance" setting depends on the chosen label "Placement".

For discrete (node label) placement policies like "Internal" or "Sandwich", the "Distance" determines - well - the distance from the label border to the node border.
E.g. a "Distance" of 4.0 for placement "Sandwich: North" means there are 4.0 space units between the bottom border of the label and the top border of the node. For "Internal: Left" the same distance means there are 4.0 space units between the left border of the label and the left border of the node.

For placement "Smart Free: Anywhere" the "Distance" settings has only an effect if the label is completely inside the node. In this case, the "Distance" defines an additional snap line when interactively positioning the label inside the node.

Top and left inside-node snap lines for "Smart Free: Anywhere" with "Distance" 20:

by [yWorks] (160k points)
edited by
Is this along x-axis only, or does it include the Y-axis also?

If it is the latter, then it should have two (comma-separated?) figures; such as-

10.0, 4.0

So why does it have only one figure?
OK, I did additional experiments and found that this is a single dimension, and measured on both x and y axis.

This is most dramatically apparent when we select the "Internal" position option, and then drag the label around. We see 9 boxes, that show all possible drop zones. The position of these boxes changes when we change the "distance" parameter. So when we enter a small value, the boxes spread out very near the border of the node. If we enter a larger value, all the boxes move toward the center.
Legal Disclosure | Privacy Policy
...