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.


Lock nodes position and size within a group

+2 votes

I am trying to achieve kinda "locked" nodes within a group node, the size and position of which are not affected by the choosed routing. 

My goal is database ER diagraming with an exact column-to-column link. Like on the  following (attached) picture.

© 2010 Hewlett-Packard Development Company, L.P


So far I´m doing this with a Shape-In-Shape "trick", then manual placement and sizing of the nodes. This way I can use Edge Routing. Unfortunatelly I can't use any of the yEd's powerfull routing alorithms, as they will reorder ans resize the "column" nodes.

I would be glad to hear if such functionality exists in yEd.

Thank you for the amazing program!


Here is a GraphML example.


in Help by

1 Answer

0 votes

I suggest using the "Entity with Attributes" node template from the "Entity Relationship" palette section. Select the attributes label using CTRL+click and format your text in columns using HTML markup. E.g. the HTML markup for the "TEST_PARAMS" attributes would be:

Corresponding GraphML.

by [yWorks] (160k points)
Thanks for the nice HTML tip. It is pretty useful in some cases.

In the above question I am looking for a possibility to link a "column" to another one. In the context of an HTML it would sounds like: to connect an yEd's object to a HTML Table's cell.

I've uploaded a better .graphml in the initial post.

Well, connecting cells is not possible. However, with port constraints it is possible to fix edge connection points for "Layout" -> "Hierarchical" and "Layout" -> "Edge Routing" -> "Orthogonal". This works as follows:

  1. Create an edge.
  2. Manually adjust the vertical edge connection point so it is properly align with the desired attribute (i.e. HTML row in the label text). This can be done by selecting the edge and dragging the small black square to the desired location. Alternatively, select the edge, go to properties view in yEd's lower right corner, and adjust values for "Source Port X", "Source Port Y", "Target Port X", and "Target Port Y".
  3. When you are done adjusting all your edges, go to "Tools" -> "Constraints" -> "Port Constraints", choose "From Sketch" as "Configuration Method". Check "Fix Source Port", "Fix Target Port", and choose a value for "Act On" as appropriate.
  4. Run a layout/routing algorithm that supports port constraints.


Legal Disclosure | Privacy Policy