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

Skinparameters for sequence groups affect non-empty packages #1795

Open
nkhancock opened this issue May 24, 2024 · 2 comments
Open

Skinparameters for sequence groups affect non-empty packages #1795

nkhancock opened this issue May 24, 2024 · 2 comments

Comments

@nkhancock
Copy link

nkhancock commented May 24, 2024

The bug
The sequence skinparameters groupBorderColor and groupBorderThickness override the package skinparameters borderColor and borderThickness for packages that include other elements, such as classes.

groupBorderColor and groupBorderThickness do not affect packages that contain no elements.

This issue can be reproduced with PlantUML releases going back to at least plantuml-1.2022.12.

To Reproduce
The following PlantUML code can be used to reproduce this behavior.

@startuml

  skinparam arrowColor #limegreen

  skinparam Class {
    backgroundColor #white
    borderColor #limegreen
    borderThickness 1
  }

  skinparam Package {
    backgroundColor #white
    fontSize 11
    fontStyle normal
    borderColor #LimeGreen
    ' borderThickness 1
  }
  
  skinparam Sequence {
    actorBorderColor #darkgreen
    boxBackgroundColor #whitesmoke
    boxBorderColor #darkgrey
    groupBorderColor #black
    groupBorderThickness 3
    groupBackgroundColor #darkgrey
    lifeLineBorderColor #limegreen
    lifeLineBackgroundColor #limegreen
    participantBackgroundColor #limegreen
    participantBorderColor #limegreen
  }

  package "external-module" as external_module {
  }
  package "my-module" as my_module {
    class "my-class" as my_class
  }

  external_module +-- my_module
@enduml

Generating the above PlantUML code with release v1.2024.4 results in the following image:
image

Although the borderColor defined for packages is LimeGreen and the border of the package without any contents is LimeGreen, the border of the package containing the class is nevertheless black.

After some experimenting, I found that the skinparameter groupBorderColor for sequences caused this behavior. The same was true for borderThickness \ groupBorderThickness. There may be other such parameter pairs affected.

Note that if skinparameter groupBorderColor is not defined, the border color of the package with the class is LimeGreen as expected. If skinparameter groupBorderThickness is not defined, the border thickness of the package with the class is as expected. So it seems that if a groupBorder* skinparameter is not explicitly defined, the value defined for packages is not affected.

This can be reproduced by commenting out the parameters groupBorderColor and groupBorderThickness as shown in the following image:
image

Expected behavior
The borderColor and borderThickness defined as skinparamters of a package must apply to both empty packages and packages containing elements and not be affected by any other skinparameters, i.e., skinparameters for sequence groups.

Desktop (please complete the following information):

  • OS: Windows 10
  • IDE: PyCharm 2024.1.1
  • Tested with PlantUML releases: 1.2022.12, 1.2023.2, 1.2024.4
@The-Lum The-Lum removed the triage label Jun 9, 2024
@The-Lum
Copy link
Collaborator

The-Lum commented Jun 9, 2024

Hello @nkhancock,

Instead using of old skinparam, you can now use style, as:

@startuml
<style>
arrow {LineColor #limegreen}
classDiagram {
    backgroundColor #white
    LineColor #limegreen
    LineThickness  1
}
package {
    backgroundColor #white
    fontSize 11
    fontStyle normal
    LineColor #LimeGreen
    LineThickness 1
}
sequenceDiagram {
  actor,participant {
    LineColor #darkgreen
  }
  group {
    BackgroundColor #darkgrey
    LineColor #black
    LineThickness 3
  }
  box {
    BackgroundColor #whitesmoke
    LineColor #whitesmoke
  }
  lifeLine {
    BackGroundColor #limegreen
    LineColor #limegreen
  }
}

</style>

  package "external-module" as external_module {
  }
  package "my-module" as my_module {
    class "my-class" as my_class
  }

  external_module +-- my_module
@enduml

See alslo doc. here:

Enjoy,
Regards,
Th.

@nkhancock
Copy link
Author

@The-Lum : Thanks for this information.
Our project currently uses skinparam definitions in a global include file. I will have to investigate converting this to styles, which appears much more flexible.

Some initial quick attempts resulted in some unexpected behaviour such as style definitions for class diagrams affecting other skinparam definitions for other diagrams, such as packages. I'll have to investigate this further.

Are there any know issues when mixing stye definitions with skinparam definitions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants