Could we implement support of DOT rank for better leveling/ordering of components?

0 votes
asked Dec 4, 2019 in Wanted features by boshka (3,040 points)
edited Dec 9, 2019 by boshka

Graphviz/DOT support rank attribute for placing the elements on the same level. 

It looks that we could also rather easily support it in plantuml component diagrams. Probably, we could just do like this:


  1. multiple directives are needed to be supported by plantuml, such as:
    rank same b,c - places components b and c on the same level
    rank sink a  - sinks component a to the bottom
  2. values or rank to support are:
    • same (as in the example)
    • source
    • max
    • sink

Details on the rank attribute

Here is the example:

digraph hierarchy {

		nodesep=1.0 // increases the separation between nodes
		node [color=Red,fontname=Courier,shape=box] //All nodes will this shape and colour
		edge [color=Blue, style=dashed] //All the lines look like this

		Headteacher->{Deputy1 Deputy2 BusinessManager}
		Deputy1->{Teacher1 Teacher2}
		{rank=same;ITManager Teacher1 Teacher2}  // Put them on the same level

Here is the link of the same on Plantuml server:

Here is the specification from Graphviz:

In graphs with time-lines, or in drawings that emphasize source and sink nodes, you may need to constrain rank assignments. The rank of a subgraph may be set to same, min, source, max or sink. A value same causes all the nodes in the subgraph to occur on the same rank. If set to min, all the nodes in the subgraph are guaranteed to be on a rank at least as small as any other node in the layout7 . This can be made strict by setting rank=source, which forces the nodes in the subgraph to be on some rank strictly smaller than the rank of any other nodes (except those also specified by min or source subgraphs). The values max or sink play an analogous role for the maximum rank. Note that these constraints induce equivalence classes of nodes. If one subgraph forces nodes A and B to be on the same rank, and another subgraph forces nodes C and B to share a rank, then all nodes in both subgraphs must be drawn on the same rank. Figures 11 and 12 illustrate using subgraphs for controlling rank assignment. 

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.