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.


How do I auto-wrap node labels?

0 votes
When I import nodes and edges from an XLSX file, I use the LABEL checkbox to name the node that gets created. Some of my node labels are very long, thus the node is created in one long line. I would rather see a single node that is three lines high (each of length 40), than see that node one line high and 120 characters long.

Is there a way to adjust the label text so that the text displayed is wrapped at, say, every 40 characters or so? Thank you very much for your help.
in Help by

1 Answer

+2 votes
Select all the nodes for which you want text wrapping then go to yEd's properties view in the lower right corner. In section "Label" change setting "Size" to value "Fit Node Width" or "Fit Node Size" and setting "Configuration" to value "Cropping".
by [yWorks] (161k points)
What is the best practice for formatting labels?
Doesn't seem to work on yEd version on Linux Ubuntu 18.04.4.
CORRECTION: yes it *does* work, but APPARENTLY it works *PROVIDED* I don't have any shift-enter in the label text, or it won't wrap ANY lines... *OR* maybe the point is that I need to have set such properties values BEFORE creating the label, not sure about it yet.

Anyway, editing is on ONE LINE, and I have small nodes with short labels AND GREATER NODES with LONG TEXT on *VARIOUS* LINES.

No chances to have a multi-line text editor, like the text fields in Inkscape?

(If no, I'm afraid I'll have to stick with Inkscape for now, well I was starting to like yEd but this is a work in progress with feedback from many persons and I'll certainly have to edit the text quite a bit in the future.)


Line break do not disable wrapping.
Please see this sample for a proof-of-concept.

It is also not necessary to configure a label for wrapping prior to editing its text. You can switch between "Standard" and "Cropping" configurations any time you want.

Finally, there is a multi-line text editor in yEd. It is a bit hidden, though. Click into the "Text" value field of a selected node or label in the properties table in yEd's lower right corner. A "..." button will appear on the right end of the value field. If you click the "..." button, the multi-line text editor will open.
Alternatively, use F6 to open yEd's properties dialog for any selected element.

Is there a way to auto wrap node labels with icons, and Not have the icons disappear?
Unfortunately, the "Cropping" configuration does not support icons. I.e. it is not possible to use icons and automatic text wrapping in one label in yEd.

You could try to use two labels, though. One that uses the "Standard" configuration and displays an icon and a second one that uses the "Cropping" configuration and displays text.
Legal Disclosure | Privacy Policy