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.


Using a rectangular shape with glue-points on "width" sides only

0 votes

Hi Thomas,

This question seeks additional data for issue #2744. There, you had recommended using basic shapes in place of the thick lines required to depict the Fork and Join nodes.

I have a similar application for argument maps:

  1. The join shape is needed to depict Dependent premises or co-premises. (see here). 
  2. The Fork shape is needed to connect a given node to multiple other nodes. (Often we re-use a given premise to support multiple conclusions.)

In my application, I will not need swim lanes. So this is a simple case of being able to use connectors (edges) correctly.

Well, I can definitely make a rectanglular shape thing enough to resemble a thick line. But when it comes to connecting edges to this shape, I want to make sure that only the "broad" sides of this shape get connected: The "thin" sides of the shape must not get connected with incoming or outgoing edges.

In other words, the glue-points for edges must lie on the "width" sides of the shape, and not on the "thickness" side of the shape.

And this should happen consistently, regardless of the orientation of the shape (I should be able to make it horizontal or vertical).

What should I do to achive this?

in Help by (1.5k points)
recategorized by

1 Answer

+1 vote
Best answer

If you arrange your diagram using the hierarchical layout algorithm, you may use port constraints to restrict sides for connected edges.

  1. Select all horizontal join/fork nodes.
  2. Open "Tools" -> "Constraints" -> "Port Consraints".
  3. Set "Configuration Method" to "Enter Manually".
  4. Choose the appropriate sides for "Side At Source" and "Side At Target".
  5. Enable "Fix Source Port" and/or "Fix Target Port" as required.
  6. Set "Act On" to "Ports at Selected Nodes".
  7. Click "Ok".
  8. Repeat for vertical nodes but adjust "Side At Source" and "Side At Target" accordingly.
  9. Run hierarchical layout.
  10. Open "Tools" -> "Constraints" -> "Port Consraints".
  11. Choose "Remove all Port Constraints".
  12. Click "Ok".

Steps 10 to 12 are important because if you do not remove the previously registered constraints, these constraints will affect all subsequent layout runs as well.

by [yWorks] (151k points)
selected by
Thanks a lot!

BTW step 9 means-
1. Press ALT+SHFT+H
2. Press ENTER (or click on the "OK" button).
Is that correct?
This occurred to me just now:

Why do I need to follow steps 10-12?

As I understand, I have assigned the port behavior to specific nodes, so that they always look like the fork+merge nodes. All the other nodes will not have this behavior.

I want those Fork+merge nodes to have their port constraints forever.

But if I follow steps 10-12, the next time I want to clean up the diagram by using the Hierarchical layout with bottom-to-top orientation, these fork+merge nodes will behave like normal nodes, and allow the edges to be connected anywhere.

In fact, I would like to have this property assigned to a template node in my palette, so that whenever I drag out that node, it already has the required ports at the top and bottom edges.

And this template node in the palette should not lose its ports behavior even when I follow the three steps (10-12). Is that possible?
Legal Disclosure | Privacy Policy