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

Proposal: automatically color modules in package diagram #4488

Closed
DudeNr33 opened this issue May 22, 2021 · 4 comments · Fixed by #4850
Closed

Proposal: automatically color modules in package diagram #4488

DudeNr33 opened this issue May 22, 2021 · 4 comments · Fixed by #4850
Labels
Enhancement ✨ Improvement to a component pyreverse Related to pyreverse component
Milestone

Comments

@DudeNr33
Copy link
Collaborator

Is your feature request related to a problem? Please describe

I really like the possibility to generate package diagrams using pyreverse. However, a complete diagram can become very big and complex.
The currently just "black and white" output makes it hard to spot modules of the same package.
This is for example the package diagram for pylint itself:
image

Describe the solution you'd like

By coloring modules of the same package with the same color, it is much easier to spot what parts belong together:
image

Additional context

I also experimented with grouping modules of the same package together, but the result is not as clear:
image

To discuss is the best way to implement this. The image above was generated by automatically picking colors from a list based on the first two parts of the module name.
Possible alternatives/extensions would be:

  • Let the user define the colors to use in the configuration file, instead of picking colors automatically
  • Let the user define up to what depth he wants to distinguish subpackages
@Pierre-Sassoulas Pierre-Sassoulas added Enhancement ✨ Improvement to a component pyreverse Related to pyreverse component labels May 23, 2021
@Pierre-Sassoulas
Copy link
Member

I like the colored solution, we could do it in two step with the configuration file for the color being a second step. I also like plantuml diagrams (it would permit to put the code into their package directly so they are already in well defined area) but this seem like a huge task.

@DudeNr33
Copy link
Collaborator Author

Yes, doing it in two steps is probably a good idea.

I'm not sure if I understood the comment regarding plantuml correctly @Pierre-Sassoulas . What do you mean by "putting the code into their package directly"? Do you want more than just an additional backend beside DOT and VCG?
But I also like the idea of using plantuml in the future, as this would also allow for new types of diagrams, like automatically generated sequence diagrams to visualize also dynamic interactions and not just static representations.
Plain Plantuml files are also more readable than DOT files.
But yes this would certainly be a bigger task.

@Pierre-Sassoulas
Copy link
Member

I'm thinking of their class diagram, see:

@startuml

package "Classic Collections" #DDDDDD {
  Object <|-- ArrayList
}

package net.sourceforge.plantuml {
  Object <|-- Demo1
  Demo1 *- Demo2
}

@enduml

The class are already in their respective package and plantuml put them close visually so the color is easy to apply to the whole package. Maybe that's too huge of a step though and coloring the current one is easier/faster.

@DudeNr33
Copy link
Collaborator Author

Thanks for the example.
That would require more effort and thought. The diagram you copied also combines package and class relations into one diagram, which is currently not possible with pyreverse to my knowledge.
So I propose to create a new feature request for plantuml integration and focus on the existing backends for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component pyreverse Related to pyreverse component
Projects
None yet
2 participants