Multiple separate diagrams in one file. Is it possible?

+1 vote
asked Feb 16 in Question / help by dickmaley (4,160 points)
I have experimented with multiple separate diagrams in the same file.  I was hoping to do this to demonstrate the different themes.

@startuml
!theme amiga
Alice -> Bob: Hello
Bob -> Alice: Hi there!
@enduml

@startuml
!theme aws-orange
class Car {
  +String make
  +String model
  +int year
}
@enduml

@startuml
!theme black-knight
c -> d: Hello
d -> c: Hi there!
@enduml

The themes bleed into each other.  It would be nice if there was a keyword that forced the start of a new diagram.

Is there a way to force each diagram to display below the last one?

Dick Maley
commented Feb 16 by dickmaley (4,160 points)
The following allows me to individually select a them by index, however it does not answer the question can plantuml diagrams be concatenated vertically.

@startuml
!$THEME = %splitstr("amiga~aws-orange~black-knight~bluegray~blueprint~carbon-gray~cerulean~cerulean-outline~cloudscape-design~crt-amber~crt-green~cyborg~cyborg-outline~hacker~lightgray~mars~materia~materia-outline~metal~mimeograph~minty~mono~none~plain~reddress-darkblue~reddress-darkgreen~reddress-darkorange~reddress-darkred~reddress-lightblue~reddress-lightgreen~reddress-lightorange~reddress-lightred~sandstone~silver~sketchy~sketchy-outline~spacelab~spacelab-white~Sunlust~superhero-outline~toy~united~vibrant","~")
'$THEME[ 0]="amiga"
'$THEME[ 1]="aws-orange"
'$THEME[ 2]="black-knight"
'$THEME[ 3]="bluegray"
'$THEME[ 4]="blueprint"
'$THEME[ 5]="carbon-gray"
'$THEME[ 6]="cerulean-outline"
'$THEME[ 7]="cerulean"
'$THEME[ 8]="cloudscape-design"
'$THEME[ 9]="crt-amber"
'$THEME[10]="crt-green"
'$THEME[11]="cyborg-outline"
'$THEME[12]="cyborg"
'$THEME[13]="hacker"
'$THEME[14]="lightgray"
'$THEME[15]="mars"
'$THEME[16]="materia-outline"
'$THEME[17]="materia"
'$THEME[18]="metal"
'$THEME[19]="mimeograph"
'$THEME[20]="minty"
'$THEME[21]="mono"
'$THEME[22]="none"
'$THEME[23]="plain"
'$THEME[24]="reddress-darkblue"
'$THEME[25]="reddress-darkgreen"
'$THEME[26]="reddress-darkorange"
'$THEME[27]="reddress-darkred"
'$THEME[28]="reddress-lightblue"
'$THEME[29]="reddress-lightgreen"
'$THEME[30]="reddress-lightorange"
'$THEME[31]="reddress-lightred"
'$THEME[32]="sandstone"
'$THEME[33]="silver"
'$THEME[34]="sketchy-outline"
'$THEME[35]="sketchy"
'$THEME[36]="spacelab-white"
'$THEME[37]="spacelab"
'$THEME[38]="Sunlust"
'$THEME[39]="superhero-outline"
'$THEME[40]="superhero"
'$THEME[41]="toy"
'$THEME[42]="united"
'$THEME[43]="vibrant"
'[0..43]
!$THEMEINDEX = 1
!theme $THEME[$THEMEINDEX]
Bob -> Alice : $THEME[$THEMEINDEX]
@enduml

Dick Maley

3 Answers

+1 vote
answered Feb 17 by dickmaley (4,160 points)
selected Feb 17 by dickmaley
0 votes
answered Feb 17 by The-Lu (85,820 points)

Hello D.,

Yes, it seems there are some issues on that (issue on the online server, issue on propagation of style).

  • How do you use plantuml?
  • By online webserver or on local jar?

Then here is a [little bugged] possible answer to concatenate vertically the diagrams:

@startuml
label l [
{{
!theme amiga
Alice -> Bob: Hello
Bob -> Alice: Hi there!
}}

{{
!theme aws-orange
class Car {
  +String make
  +String model
  +int year
}
}}

{{
!theme black-knight
c -> d: Hello
d -> c: Hi there!
}}
]
@enduml

See also:

Enjoy,
Regards,
Th.

0 votes
answered Feb 18 by The-Lu (85,820 points)

Hi D.,

FYI: to compare themes there is also the theme gallery:

Regards,
Th.

...