Understanding Display Order of Components

0 votes
asked Feb 14 in Question / help by FernandoBasso (120 points)

Thanks a lot for PlantUML. It is awesome!

I'm trying to understand why sometimes components (or other types of elements in other types of diagrams) are displayed with a different order than the one they are declared. Let's take this as an example.

Why is ProductCatalog positioned on the far right? Why not on the far left, since it was the first one defined?

I have created about 8 diagrams so far (not very complex stuff), and the most trouble I get is with positioning. Any tips and guidance on this topic? Is there any particular piece of information on the docs that would help with this?

1 Answer

0 votes
answered Feb 14 by plantuml (279,680 points)
Well, thanks for your support!

About layout and positioning, the main idea behind PlantUML is that you should not care about it.
You have very little options in PlantUML so you should forget about it and accept the default behaviour, even if it's not exacly what you would have wished.

It may sound like a major drawback, but in practice, you will notice that it will liberate your creativity: this way, you will focus on the content itself, not on the rendering.
commented Feb 14 by FernandoBasso (120 points)
edited Feb 15 by FernandoBasso

Thanks for your reply.

Yeah, I had read many questions already regarding positioning and by now I am aware PlantUML goal is not to allow fine-tune positioning. I see the point and agree with it. Most of the time, things will work just fine.

I cannot refrain myself from thinking that sometimes we do need some layout tweaking, and that PlantUML even allows for some fiddling with that (just not very granular).

This is what I wanted to show in the opening post, but I ended up just linking to the image without the code. Why is ProductCatalog positioned on the far right? Why not on the far left, since it was the first one defined?

In the context of what I am designing, ProductCatalog seems to be what should be rendered first, on the left. I know that just throwing it here without the context may seem (and perhaps it is) OK with this rendering with CustomerProfile on the far left and ProductCatalog on the far right, but really the order in which they are defined in code seems to be the most reasonable.

With those arguments presented, I must also add I am not a UML expert and I possibly just need to get used to this and "trust" the default rendering order and positioning of things. I must also say that from the posts and questions I read, many people seem to sometimes seek a little more control over positioning. I'm OK with PlantUML design goals though.

Anyway, this is what I was able to achieve (you may need to click the icon to “display rendered file”):


Thanks for all the support.
 

...