Ability to hide packages

0 votes
asked Jun 22, 2016 in Wanted features by mnjones (160 points)

I have done a quick search for this in the Q&A/bugs but cannot find something that accomplished what I am trying to do.

I have several files which define packages of classes, each of which I include into its own diagram, and into an overview diagram.

In the overview diagram I hide the members so that I can get a view of the interrelations, but in the individual files, I'd like to be able to include the related packages, but hide anything that is not being used. Below is a minimal example - In pkg1.uml I'd like to be able to say 'hide package utils.log' to have the package removed as it is not relevant to the individual diagram.

The suggestions for using a transparent skinparam do not help, as the link between utils.cli and utils.log also needs to be removed...

The workaround route probably involves using a set of !defines, but that seems like more work than necessary. Any other suggestions?


'utils.iuml

  package utils.cli {
     class utils.cli.Command {
       run()
     }
  }
  package utils.log {
  }
  utils.cli -- utils.log
 
'pkg1.iuml
  class one.one extends utils.cli.Command
 
'pkg2.iuml
  class two.two
 
  two -- utils.cli
  two -- utils.log
 
'overview.uml
  @startuml overview.png
  hide members
 
  package utils {
    !include utils.iuml
  }
  package one {
    !include pkg1.iuml
  }
  package two {
    !include pkg2.iuml
  }
  @enduml
 
'pkg1.uml
  @startuml pkg1.png
  package utils {
    !include utils.iuml
  }
 
  package one {
    !include pkg1.iuml
  }
  @enduml
 
'pkg2.uml
  @startuml pkg2.png
  package utils {
    !include utils.iuml
  }
  package two {
    !include pkg2.iuml
  }
  @enduml

 

 

1 Answer

0 votes
answered Jun 24, 2016 by plantuml (134,570 points)

Thanks for the suggestion.

With last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar you can use the "hide" command to hide packages.

Example:

@startuml
class Foo1
class Foo2
hide Foo1
class Foo3
Foo2 *-- Foo3
hide Foo3

package util {
class util1
}

hide util
@enduml

Is this what you are expecting ?

commented Jul 4, 2016 by plantuml (134,570 points)
Note that this has been released in V8045
...