hide stereotype in component diagrams

+3 votes
asked Mar 12, 2014 in Wanted features by taharqa (240 points)
Hi

I need to have the hide stereotype feature in component diagram as well, in priority. (but in all diagram would be great).

Because as I understood it, this is the only way to have some graphics get a particulary skin params like background, font size. I maybe wrong. And in that case << XXX >> is visible in the component.

thank you
commented Feb 24, 2015 by arnaud.bourree (140 points)
hide stereotype in all diagrams
I've same issue in object diagram but that work in class diagram

thank you

1 Answer

+1 vote
answered Mar 12, 2014 by plantuml (295,760 points)
selected Mar 12, 2014 by taharqa
 
Best answer

Ok, so with the last beta:
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

You can have:

@startuml
hide stereotype
show <<shared lib>> stereotype

[AA] <<static lib>>
[BB] <<shared lib>>
[CC] <<static lib>>

node node1
node node2 <<shared node>>
database Production
database Production2 << indus >>

skinparam component {
    backgroundColor<<static lib>> DarkKhaki
    backgroundColor<<shared lib>> Green
}

skinparam node {
    borderColor Green
    backgroundColor Yellow
    backgroundColor<<shared node>> Magenta
}
skinparam databaseBackgroundColor Aqua
@enduml

 

commented Mar 12, 2014 by taharqa (240 points)
it was fast and it is working as expected...
It was not asked originally but can you make this also work for package,node, folder, frame, cloud, database ?
Thanks
commented Mar 12, 2014 by plantuml (295,760 points)
The last beta should include this :
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
Very few tests have been done, so do not hesitate to give feedback
Regards,
commented Mar 12, 2014 by taharqa (240 points)
Great ! it works as expected , and on all my diagram I do not see any regression. Thank you for your action!
commented Mar 25, 2014 by rmric (2,140 points)
Thanks for the hide-by-stereotype feature!

I have two comments. The first one is informational: a "show/hide" statement cannot be placed in a skinparam compound, and there must be a space after the "hide" keyword:

skinparam component {
    backgroundColor<<hidden_st>> Yellow
        hide <<hidden_st>> stereotype
}

However the following works fine:

skinparam component {
    backgroundColor<<hidden_st>> Yellow
}
hide <<hidden_st>> stereotype


The second comment is a side effect. The hide statement hides other stereotypes, but only if they are a "component" and they contain something:

@startuml
hide <<hidden_st>> stereotype
component AA <<st_non_empty>> {
  [ZZ]
}
component BB_ok <<st_empty>>
component HH <<hidden_st>>
@enduml

Regards
commented Jun 19, 2015 by klokkie (100 points)
I would also like this feature to be added to all diagrams.
commented Nov 5, 2019 by alonbl (200 points)
Hi,

skinparam component {
    backgroundColor<<hidden_st>> Yellow
     hide<<hidden_st>> stereotype
}

notation is still not working although no error, it does not perform the hide, only hide in global scope and with space between the hide and the '<<' works. Can you please consider to support the hide within the skinparam as it is more consistent method to express the attributes?

Thanks!
...