Straight or right angled lines in Class Diagram's arrows

+12 votes
asked Apr 23, 2013 in Wanted features by anonymous

Hi,

I would like to know if there is a way to represent straight or at least right angled lines in the arrows of the Class Diagram?

Indeed, when there are a dozen of classes with several relationships only, this is no big deal and PlantUML/GraphvizX manage it without a problem.

But as soon as there are complex relationships between a lot of classes, the arrow's lines start to curve, sometimes in a weird way, apparently trying to avoid relation's labels.

Straight or right angled lines would ease the reading of the class diagram in that case.

Thanks a lot for the work already done and those to come!

Douglas DAVID

2 Answers

0 votes
answered Jun 7, 2013 by Fuhrmanator (2,210 points)

I found that if you don't have multiplicity on the ends, PlantUML will stick with straight lines (at least with simple diagrams):

@startuml
Driver - Car : drives >
Car o-- Wheel : has > 
@enduml
 
However, as soon as you add multiplicities, the curved lines are made on the horizontal associations:
 
@startuml
Driver "1" - "1" Car : drives >
Car "1" o-- "4" Wheel : has > 
@enduml
0 votes
answered Mar 5 by Anthony-Gaudino (7,640 points)

PlantUML has the skinparam linetype

You can try using skinparam linetype ortho or skinparam linetype polyline

...