How can I use invisible packages (to improve layout of class diagrams) along with visible packages?

0 votes
asked Jul 23, 2015 in Wanted features by Fuhrmanator (1,700 points)

Invisible packages (as discussed in the related answer) are a big help when you want to improve (or control) to some degree the layout of a diagram with lots of classes and associations.

The problem I found is that if you also want to have some visible packages, it's not obvious how to do that. The skinparam definition sets all packages to have the colors.

I initially tried to do it with a stereotype, as one does with classes, e.g., <<LayoutGroup>> for packages used for grouping purposes. But I see there are no colors associated with Package stereotypes in skinparam.

Perhaps it would be nice to have a new package stereotype called <<LayoutGroup>> which by default has everything hidden, perhaps with skinparams analogous to class stereotypes, which can be redefined in skinparam.

These are just suggestions and I realize they could have implications with other features.

Also, for the record, I think it's better to use Transparent as a color to hide the packages (as opposed to White in my answer above) 

skinparam package {
  borderColor Transparent
  fontColor Transparent
}

 

1 Answer

0 votes
answered Aug 1, 2015 by plantuml (294,960 points)
edited Aug 2, 2015 by plantuml

Thanks again for your suggestion.

With the last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar you can have:

@startuml
skinparam shadowing false
'skinparam backgroundColor red
skinparam package {
  fontColor blue
  stereotypeFontColor red
}
skinparam package<<Layout>> {
  borderColor Transparent
  backgroundColor Transparent
  fontColor Transparent
  stereotypeFontColor Transparent
}

package p1 <<Dummy>> {
class Foo1 <<Other>>
}

package p2 <<Layout>> {
class Foo2
}
@enduml

 

There are still some bugs: Transparent is not that transparent (if you put a general backgroundColor to red, you'll see)

commented Jun 25, 2018 by anonymous
Can we use "together" instead of a hidden package to group items? e.g.

together {
class Foo2
class Foo3
}
...