Grid Layout of grouped components

0 votes
asked May 13, 2020 in Question / help by carlheinmostert (200 points)

Good day

I am trying to force component contain in a grouping element to create a 3 column by N grid.

In this example it works well:  https://liveuml.com/view/5ebbdb07663178088afef347

Then when I group the A1 and A2, it insists on having C in column 1 row 1.

see here: https://liveuml.com/view/5ebbdb07663178088afef347

Code dump:

'left to right direction
'top to bottom direction
'

Folder group as P {

component "A" as A  {
   component "A.1" as A1 {
   }   
}

component "A" as A  {
   component "A.2" as A2 {
   }
}


component "B" as B  {
}
component "C" as C  {
}
component "D" as D  {
}
component "E" as E  {
}
component "F" as F {
}
}

'assume 3 column grid

A1 -r-> A2
A2 -r-> B
A1  -d-> C
C  -r-> D
D  -r-> E
C  -d-> F

Any suggestions on how to achieve a grid layout of components, where some components are grouped themselves, would be sincerely appreciated.

Best regards

Carl-Hein Mostert

1 Answer

0 votes
answered May 13, 2020 by The-Lu (64,340 points)
edited May 13, 2020 by The-Lu

Hello Carl-Hein,

Is this layout acceptable?

PlantUML diagram
[Click to the image to see on the PlantUML Server site]

Or after a little search, see:

You can add a together for only one element! (for component B), just before the A declaration!

...
Folder group as P {

together {
component "B" as B  {
}
}

component "A" as A  {
   component "A.1" as A1 {
   }   
}

component "A" as A  {
   component "A.2" as A2 {
   }
}
...
And observe that:
PlantUML diagram
[Click to the image to see on the PlantUML site]

If that can help,
Regards,
Th.

commented May 14, 2020 by Carl

Thanks so much.

The below option worked for me.

together { component "B" as B { } }

Implied in your solution is that you have to, in this scenario, print the furthes to the right component first in the PUML file and then so on in reverse.

The order seems to also have impact.

Agreed?

Many thanks!

Carl

...