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

How do I enforce parent left/right placement?

0 votes
For a biology project I am importing a XLS file to yED with a list of nodes and edges that make up a genealogical tree of certain flower hybrids. Since the parent role ("father" or "mother") do make a difference in hybridation I need "fathers" to always be placed over the right sideof the chid and the mother on the left. Since the same flower may be father or mother in different stages of a hyrid , the parent "role" is a property I have on the edges.

My question: Is threa wa I can influncethe Hierarchical algorithm so that it willnot try to re-arrange parents when forming the tree?

 

Thank you.
in Help by

1 Answer

0 votes
You can try option "Use Drawing As Sketch" from tab "General". With that option enabled, the hierarchical algorithm will respect relative positions. I.e. the algorithm will still assign new coordinates to all elements, but if node A was to the left of node B before the arranging the diagram, node A will still be to the left of node B after arranging the diagram.
by [yWorks] (160k points)
Thank you Thomas, I was trying precisely what you have suggested. Though a bit cumbersome it does work, one thing that happened though in some cases is the edge port did not flip on the child and the resulting edges were crossing each other after I updated the design. Can you please recommend if there is a setting for prohibiting edge overlap?

I am sorry I don't know how to upload a figure but please see how the FATHER edge to CHILD is going around MOTHER and overlapping with MOTHER's parents.

Thanks!

Before:
                  +---+   +---+
                  | F.. |   | M..|
                  +-++   ++-+
+---+ +---+     \      /
| F..|  | M..|  +-+---+--+
++-+ ++-+  | FATHER  |
    \     /        +--+------+
+--+-+---+      /
| MOTHER |     /
+-+------+    /  
     \       ___/
      \    /
   +-+-+-+
   | CHILD|
   +-------+

After:
+---+   +---+
| F.. |   | M..|
+-++   ++-+
      \      /          +---+ +---+
  +-+---+--+      | F..|  | M..|
  | FATHER  |      ++-+ ++-+
  +--+------+--------\---/-------+
                         +--+-+---+    |  
                         | MOTHER |    |
          ________+_+-------+    |  
        /    __________________+
       |   /
   +-+-+-+
   | CHILD|
   +-------+

You can prevent/resolve the undesired edge crossing by selecting both edges connecting to CHILD and enabling option "Selected Elements Incrementally" on tab General in addition to "Use Drawing As Sketch". Note, depending on the complexity of your diagram there may be cases where crossing cannot be prevented for certain edges. (Though this is not the case for the simple diagram you sketched in your comment.)

Please see How to upload files to yEd Q&A? for information on uploading files.

Yes, it works as you suggest, thank you very much.

If there are any future feature plans to allow node or edge properties to influence the Hierarchical algorithm, please let me know as I may start using those.

Best wishes.
Legal Disclosure | Privacy Policy
...