enhance rendering using directed arrows

0 votes
asked Mar 23, 2017 in Wanted features by stephan (270 points)

in my current setup, directed arrows seem to have little to no effect if they appear in a more complex context where the linked nodes have further links

@startuml
interface input
interface output
node first
node second
first -> second
input -d-> first  'THIS HAS NO EFFECT
input -> second
second -d-> output
@enduml
 
is there already some progress in the background going on to support such more complex graphs?
commented Mar 23, 2017 by stephan (270 points)
I even stumbled upon one case, where a right arrow (would also render as such if the subgraph is rendered alone) turns into a left arrow (when rendering the subgraph as part of a more complex graph with additional links

However I feel like not having the time to minify my private example,
still I hope this comment can be useful to you

1 Answer

0 votes
answered Mar 23, 2017 by plantuml (295,000 points)

GraphViz is designed to draw graphs from bottom to top. Even if PlantUML tries to do is best to allow left/right arrow, you should avoid them. As you can see, there are some limitation.

Furthermore, the idea behind GraphViz/PlantUML is that you should not care to much about the layout, and let the algorithms work on their own, even is the result is not exactly what you are expecting. So my advise is to use only --> arrow (at least, at the beginning).

So in your example, you should probably do:
http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuShCAqajIajCJbN8p2ieBK7YvvUMW0JoybDI5T8oYugXpEBKvFoy52wmY8AkhXrC0AmTB01HZE135K0ei0ZKQ8VKl1IW6m00

@startuml
interface input
interface output
node first
node second
first --> second
input --> first
input --> second
second --> output
@enduml


And if you want to change direction, you can have:

@startuml
left to right direction
interface input
interface output
node first
node second
first --> second
input --> first
input --> second
second --> output
@enduml


http://www.plantuml.com/plantuml/uml/JOvH2e0m34F_TufUm2l8hY9RfmLjfSlkByw9VgLvf26nOd6qOmyx5n2CNDODbCKvGKo3ADZBafX4puQVjuORg6Mc8bx7MJcPvj09JTFyWlxUmHF-_0WyqiceZgpvtdO1


 

...