-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Determine height of nodes from number of ancestors #96
Comments
Thank you for the kind words and your interest in the Graphviz Visual Editor. Apologies if I misunderstand you proposal. From the online Help -> About: The Graphviz Visual Editor is a web application for interactive visual editing of Graphviz graphs described in the DOT language. It is not a general drawing application. It can only generate graphs that are possible to describe with DOT. The Graphviz Visual Editor does not have any layout algorithms other than provided by Graphviz or the DOT language and therefore it is not possible to affect the layout by changing the implementation of the Graphviz Visual Editor. That said, one way of achieving what you want is to place the nodes in question in a subgraph and use the rank attribute:
Please let me know if you have further questions. |
Thanks for your quick reply! I do already use the rank=same feature. But it does not completely do what I want. Please consider this graph: The number behind the Nodes-Name means their direct and indirect descendants. Their "Score". I want all nodes with the same score in one 'row' of the graph. As you can see: Node E (2) is on the same row as B and D (both 1). Where I'd rather have it standalone on a row above B and D and one below A. Maybe is there a dirty-trick with a hidden node of score 2? Is there a solution for that too? If not: Never mind. I love this tool either way! It helped me so much with my developement and bugtracking of my code! Wow! |
You can add extra invisible edges like in this graph. |
Or without rank completely like in this graph. |
Be aware of the bug I just found in the Export as URL function: #97. |
Hi magjac But now you know exactly, what I meant with my initial question. I would appriciate a "button" somewhere in the settings, which says "Rank the vertices Hingehe-Style" (or something more meaningful). It is easy to implement, because the number of descendants determines the rank in the graph. Maybe it is worth a new feature-request. But that is up to you! You've helped me more than I thought! Thanks for that! I am farest from being a front-end-developer (what is it? VueJS?), so I cannot code it myself, sorry! |
I did understand completely what you wanted, but as I tried to explain above, the Graphviz Visual Editor could never influence the layout in any way. The layout is 100% determined by the DOT source code and the chosen layout engine, which is not implemented in the Graphviz Visual Editor, but in Graphviz itself. If you want to change how the layout engine works (including additions or modifications to the DOT language), you must file an issue at https://gitlab.com/graphviz/graphviz/. |
On second thought, if what you want is a "button" that modifies the users DOT source code by adding invisible edges I guess it could in principle be done in special cases likes yours, but in the general case it wouldn't. Think of graphs with loops for instance. |
This is exactly what I needed for the development of my project. Thanks for that! Except one little thing:
I'd like to have all "leafs" of the tree with the same (lowest) height. If you consider the following edges:
A->B
B->C
You get a straight line from A over B to C, which is fine. But if you then add
A->D
The node D (also a leaf without any descendants) is not on the bottom line beneath C, but it is in the second line beneath B. It would be easy to implement, just by calculating a "row-score" (number of descendants) for each node. This score then determines the vertical position of each node. All leaves with score = 0 are on the bottom line, their direct acenstors are placed above (higher as) them with score = 1 and so on.
The text was updated successfully, but these errors were encountered: