Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

How do I hide all classes having a given stereotype?

0 votes

I would like to hide classes according to their stereotypes.

The documentation on hiding in the Class page says "You can also provide, just after the hide or show keyword:

  • <<foo1>> for classes which are stereotyped with foo1,

"

this example does not seem to work as of version 8036

@startuml
 
hide <<tag>> 
 
class bob <<tag>>{
}
 
class joe{
}
 
@enduml

 

Instead of hiding the class "bob", i get a third class box as if i did: class hide <<tag>>{}

asked Mar 3, 2016 in bug by anonymous

2 Answers

0 votes

There is a confusion : this command does not hide classes. It hides some information (members...) of a class.

Working example:

@startuml
hide <<tag>> members
class bob <<tag>> {
 some field
}
class joe {
 some field
}
@enduml

 

Anyway, we will think about provide a way to completely hide classes according to their stereotype... We'll post a message here.

answered Mar 4, 2016 by plantuml (122,630 points)
Thanks for the clarification. I am currently using multiple !ifdef blocks to hide relationships and classes in large diagrams. The !ifdef instructions can get a bit complicated though. It helps to be able to control the scope of a dependency graph if I can organize it into layers and turn them on and off easily.
0 votes
With last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

You can now have:

@startuml
hide <<tag>>  
class bob <<tag>>{
}
class joe{
}
@enduml
 

The result might not be exactly what you are expecting : the class is really "hidden" (there are some space when it should normally be printed).

Tell us what you think about it.

Thanks!
answered Mar 4, 2016 by plantuml (122,630 points)
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...