Horizontal orientation when connecting complex components in component diagram

0 votes
asked Feb 13, 2015 in To be sorted by anonymous
Consider the below example. When I run plantuml on this, the diagram will draw "SomethingElse" below "Something". Is there a way I can get the (complex) components placed next to each other horizontally instead?

- Toralf

@startuml
' Example to show how components tend to be connected vertically
' even if form if '-' form of connector is used, at least when linking
' sub components of different complex components

component Something {
  component Provider
  Provider -() Interface
}

component SomethingElse {
  component User
  Interface )- User
}

@enduml

1 Answer

0 votes
answered Feb 13, 2015 by rmric (2,140 points)

This is an old known bug^Wproblem, still happening in current versions: http://plantuml.sourceforge.net/qa/?qa=1628/layout-of-grouping-component

The work-around is to add the following sentence:

  !pragma horizontalLineBetweenDifferentPackageAllowed

Rem: the result is looking better when writing "Interface )-left- User", rendered as straight line instead of image below with your example, but I don't understand why?

commented Feb 16, 2015 by anonymous
OK. Besides the weird "bend" that you mention, this works well in some simple cases. Unfortunately, with a more complex diagram I'm working on, I get a graphviz problem; /usr/bin/dot exits with SIGABRT. Any ideas about what may cause this?

I'm not sure I can give you the full diagram, unfortunately - it has information that some might consider confidential.
commented Feb 16, 2015 by anonymous
I decided to make a (much) simplified version of my "real" diagram, with some of the texts changed - it's included below. I still get a crash with this simpler form.

@startuml
' A diagram that makes graphviz crash if the following pragma is used
!pragma horizontalLineBetweenDifferentPackageAllowed

component "My\nSystem" as app {
  [Config\nHandler] as configHandler
  [Compute] as compute

  database "Configuration" as configDb

  configDb <- configHandler

  configDb --> compute

  () "Output data" as output
  compute -- output
}


component "An External System" as extApp {
  database "Configuration" as extAppConfigDb
  database "Observation\ndata" as extAppDataDb

  [Inversion] as extAppInv
  [Receivers] as extAppData

  extAppInv <-- extAppDataDb
  extAppConfigDb -> extAppInv
  
  extAppData -> extAppDataDb

  () "Configuration" as config
  config -- extAppConfigDb

  () "Final\nData" as final
  final -- extAppInv
}
configHandler -( config
output )- extAppData

@enduml
commented Feb 23, 2015 by rmric (2,140 points)
What version of graphviz do you have? Is it up-to-date?

No matter what you throw at a program, it should never abort without an explanation message. When that happens, it calls for a bug report :-)
commented Feb 24, 2015 by anonymous
I used version 2.26, which is the one supplied with Red Hat/CentOS 6. The crash does not occur if I use version 2.38 built from source instead.

I might report this issue, but it would probably be helpful if I had the graphviz input data. Is this stored anywhere by PlantUML?
commented Feb 24, 2015 by plantuml (294,960 points)
You can use an "!pragma svek_trace on" line that would create two files (one .dot and one .svg). Example:

@startuml
!pragma svek_trace on
package "Package" {
node node1  {
[component1-1]
[component1-2]
[component1-3]
}
}
@enduml
...