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.

Bug: "Nodes as label"/"Label as nodes" does not behave as expected

0 votes
The node "Entity with Attributes" in "Enitity Relationship" does not behave correctly if I press "Tools" --> "Nodes as label". Instead of considering all the attributes (both the entity title, as well as the body), it only consideres the entity titel. The same goes for "Tools" --> "Labels as Nodes".

Thanks for fixing.
asked Jul 31, 2015 in Help by Bruce Leeds (220 points)
recategorized Aug 3, 2015 by thomas.behr

1 Answer

0 votes

Assuming with "Tools" -> "Nodes as label" you mean "Tools" -> "Fit Node to Label" and with "Tools" -> "Labels as Nodes" you mean "Tools" -> "Fit Label to Node", the behavior you describe is actually not a bug.

These tools only consider the first label of each node on purpose. For nodes with multiple labels the "correct" size very much depends on user expectation. Thus it is very hard to implement a correct behavior for "Fit Node to Label" and "Fit Label to Node" with regards to nodes with multiple labels.

(I understand that for the special case of entity nodes, the "correct" behavior is obvious. However, this obvious behavior is based on semantic information that is not available to the "Fit Node to Label" and "Fit Label to Node" tools.)

answered Aug 3, 2015 by thomas.behr [yWorks] (96,330 points)
Thanks for your answer. Would you have an idea how to resize 500 entity nodes? I used the standard entity relationship node from the palette. It contains two labels. One with the entity name and one with the attribute names. Node Data 1 contains the entity name and Node Data 2 contains a list of attribute names formated with line breaks. Different nodes may have a different amount of attributes. The node description is empty. Maybe reorganizing the data could help?

Greetings from Frankfurt,

I have hit the same problem using the UML Class objects - if you add any UML attributes (a very common thing to do in a UML class diagram) then you have to remember to never use Fit Node To Label as you will have to either undo or manually resize them.

My suggestion is to either add a control to the Fit Node To Label to allow the user to choose to include all labels (not my preferred option as it will affect all nodes on the diagram), or have a control on each shape to allow the user to choose whether to fit-to-all-labels or not (this could be disabled by default for most shapes, but enabled by default for some shapes such as UML classes, Entity objects etc.)
As of yEd 3.17.1, "Fit Node to Label" handles the special case of entity nodes in a better way.