Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

Is it possible to only use straight lines in a class diagram?

+11 votes
Hi

At the moment, it seems to me that it's impossible to only use orthogonal lines in a class diagram (already tried the option of using 'skinparam linetype ortho' but the result remains the same).  Is it possible to integrate such a drawing hint in PlantUML?

Thanks in advance!
asked Feb 12, 2014 in Wanted features by david.bm (230 points)
Strongly agree!
PlantUML is very useful to visualize the classes interaction when you need to make changes in a large unknown code base with many classes.
Following the curved lines in the class diagram is very difficult when there are many of them, especially as you don't have control on the classes positions.
It will help a-lot if you will implement this feature.
I Just used this feature.
ortho looks very good, much more clearer.
I have 2 improvements suggestions though:
1. When possible increase the distance between 2 parallel arrows to   make things clearer, either automatically or by a setting.
2. Consider doing what visio is doing when 2 lines intersect e.g. adding
a small bump in one of the lines that looks like the Greek letter omega.
Thanks!!!
Vikingil

2 Answers

+1 vote
Bump

This feature interest me too.
answered Oct 30, 2015 by swilhelm (170 points)
+1 vote

Ok, with last beta version: https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

You can have:

 skinparam linetype polyline

or

 skinparam linetype ortho

This has been not very well tested, so do not hesitate to post here if you find issues!

answered Jan 22, 2016 by plantuml (125,210 points)
Thanks, most appreciated.
When 2 lines intersect you might want to consider adding
a small bump in one of the lines (something like the Greek letter omega).
Thanks!!!
Vikingil
polyline works fine, but with the ortho line style, line labels are positioned far away from their line; for example, in:

@startuml
skinparam linetype ortho
node "Test PC" as PC {
    component Terminal
    component COM1
    Terminal ..o COM1
}
node Adapter
node DUT
PC -- Adapter : USB
Adapter -- DUT : UART
Terminal <~~> DUT
@enduml
The line label positioning issue when linestyle "ortho" is enabled still occurs with PlantUML v8048.

When adding '!pragma svek_trace', converting the `svek.dot` file with GraphViz yields the following error:

Warning: Orthogonal edges do not currently handle edge labels. Try using xlabels.

and the label seems to be misplaced, just like in the PlantUML output.

Changing 'label=' to 'xlabel=' in the Dot file seems to fix this (for GraphViz) at least.

Maybe PlantUML could also generate 'xlabel=' instead of 'label=', possibly only when orthogonal linetype is in effect ?
+1 for implementing this solution for positioning labels better with ortho line style.
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...