Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class diagrams: how to make best use of space in large diagrams #1187

Closed
mcraveiro opened this issue Nov 12, 2022 · 4 comments
Closed

Class diagrams: how to make best use of space in large diagrams #1187

mcraveiro opened this issue Nov 12, 2022 · 4 comments

Comments

@mcraveiro
Copy link

mcraveiro commented Nov 12, 2022

Hi PlantUML developers,

Thanks for an amazing tool which I have been using in anger over the years. Presently I am working with what I'd call fairly large class diagrams, and PlantUML is able to render them without breaking a sweat, which is fantastic. The only slight downside is that the layout I am getting is not the most readable. I decided to open this issue to see if I can improve on the output.

Problem

The key problem I have is that all of my namespaces are being added to the right of each other. The following zoomed in picture should give you an idea of the problem:

Screenshot from 2022-11-12 18-27-43

The full source is available here [1]. The diagram continues far into the left. Interestingly, some namespaces appear below others, but on the main, they are to the right of each other. I also tried adding relationships between namespaces to see if they would get placed above each other but it seems the layout engine ignores these hints. They seem to work well in diagrams with few classes, but my diagrams have many hundreds of elements and, to the layperson, that seems to have an impact in the layout engine's ability to perform layouts.

I have a similar problem with regards to classes. I noticed that in same cases the layout engine does "cluster" classes rather than group them in a rectangle:

Screenshot from 2022-11-12 18-30-57

My sample size is small, but it seems to correlate with class width.

Questions

  • Is there a way to "force" placement of unrelated elements to be more like a "square" than a very wide "rectangle"?
  • do hidden relations between elements such as namespaces stop working when there are very large numbers of elements in a diagram?

Any other tips that may help with the layout of larger class diagrams are appreciated.

Material Consulted

I have consulted several sources with regards to layouts and whilst there are many interesting approaches, I haven't yet bumped into one that fits my needs. Before I progress I'll list the materials that I have consulted in case they are helpful to anyone else:

  • Section "Help on layout" in manual [2]
  • Using ELK layout engine [3]
  • using hidden relationships (also in manual)
  • "The Hitchhiker's Guide to PlantUML", section 6. "Layout" [4]
  • "PlantUML layout and styles tutorial" [5]
  • "PlantUML GraphViz Layout" [6]

Some of these documents have improved my diagrams but did not solve my general problems.

Many thanks for your time.

[1] https://raw.githubusercontent.com/MASD-Project/dogen/master/projects/dogen.text/modeling/dogen.text.svg
[2] https://plantuml.com/class-diagram
[3] https://plantuml.com/elk
[4] https://crashedmind.github.io/PlantUMLHitchhikersGuide/layout/layout.html
[5] https://www.augmentedmind.de/2021/01/17/plantuml-layout-tutorial-styles/
[6] https://isgb.otago.ac.nz/infosci/mark.george/Wiki/wiki/PlantUML%20GraphViz%20Layout

@mcraveiro mcraveiro changed the title Class diagrams: attaining a more "square-like" use of space in large diagrams Class diagrams: how to make best use of space in large diagrams Nov 12, 2022
@oliv3r
Copy link

oliv3r commented Nov 15, 2022

I've been using C4 a bit in the past, and found https://github.com/plantuml-stdlib/C4-PlantUML/blob/master/LayoutOptions.md to be very useful. Sadly, this isn't yet standard plantuml supported yet :( I think changing orientation from landscape to portrait would help in your case already alot?

@mcraveiro
Copy link
Author

@oliv3r thanks a lot for your ideas, will look into both - using the default orientation at present, so presumably landscape.

@Aemilivs
Copy link

@mcraveiro did you find a solution?

@mcraveiro
Copy link
Author

I'm afraid not. I'll close the ticket for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants