Option for advanced label positioning to prevent label cloud

0 votes
asked Apr 8, 2014 in Wanted features by majkinetor (260 points)

This is most problematic: if you have bunch of connections with labels, in many cases labels group and its not possible to know which label belongs to which connection.

 

Check out this immage: http://goo.gl/SkpLih

Notice the labels in the middle (labels code dokumentacija instalacija migracija)

Code label clearly belongs to connection between repository and jenkins service but other labels are grouped in the middle and its not clear which label belongs to which connection.

 

I propose existance of a syntax element to move label up/down the connection curve. If we say that 0 is the start of the curve and 100 is the end, then we can specify position of the label on the curve with a number:

 

For instance this will put it in the middle, like it is now and should be default

component1 --> component2 :50 label

This will put it near the end

component1 --> component2 :85 label

 

I am not suggesting this syntax tho, any would do.

1 Answer

+1 vote
answered Apr 8, 2014 by plantuml (295,000 points)
edited Apr 8, 2014 by plantuml

Hello,

Thanks for the suggestion.
Unfortunatly, we are limited here by GraphViz/Dot capability (but we will look at what we can do)

Note that you can use some limited features like:
http://plantuml.sourceforge.net/classes.html#Label

If you change your line:
  jenkins <-[#green]-> redmine: dokumentacija

To this following:
  jenkins <-[#green]-> redmine : " " "dokumentacija"
 
(caution, there is a space inside quotes : we have to fix that)

You will have a slightly better result:

http://goo.gl/M9Sdzj



Hope it helps

commented Apr 8, 2014 by majkinetor (260 points)
I get this err: http://goo.gl/kTjpWz

It works fine on simple graph such as the one bellow but for some reason it doesn't work when I use this line in my complete plantUML code


component jenkins
component redmine

jenkins <-[#green]-> redmine : " " "  dokumentacija"
commented Apr 8, 2014 by majkinetor (260 points)
BTW, have you noticed that GraphViz/dot limitation pops up quite frequently. While I think this was good design choice at the beginning, at this stage IMO it limits plantUML features.

I think you should consider removing this dependency if possible. For those that need such graphs, there can be new keyword like with salt - @start graph
commented Apr 8, 2014 by plantuml (295,000 points)
Yes, we agree that removing Graphviz/DOT dependency would be nice.

But finding another product/library (Open-source and eventually coded in Java) that does the same job is difficult.

We had a look on:
http://en.wikipedia.org/wiki/Gephi
http://wiki.eclipse.org/Zest/DOT
http://www.vogella.com/tutorials/EclipseZest/article.html

If anyone succeeds in making a short snippset that generates a simple diagram with two nodes and an edge, please publish it here!

Thanks,
commented Apr 8, 2014 by majkinetor (260 points)
I can't make your solution work, it always reports this error. But I found another one which behaves even better IMO:

@startuml
  !define NL5 \n\n\n\n\n
  !define NL10 \n\n\n\n\n\n\n\n\n\n
  !define NL15 \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
  component jenkins
  component redmine
  

  jenkins <-[#green]-> redmine : "NL10 documentation"
  jenkins <-[#green]-> redmine : "documentationNL15"

@enduml

Out: http://goo.gl/LiiY0F

I will check out Java libs about it. Thanks for considering it.
commented Jan 11, 2018 by Yannik
Are there some news for the better postioning of labels? At this moment the component diagramms are confusing because of the unclear labels?

Thanks and best regards,
Yannik
...