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

Skinparam inconsistencies on class diagram grouping elements #1464

Open
DRKV333 opened this issue Jun 18, 2023 · 5 comments
Open

Skinparam inconsistencies on class diagram grouping elements #1464

DRKV333 opened this issue Jun 18, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@DRKV333
Copy link
Contributor

DRKV333 commented Jun 18, 2023

Describe the bug
There are various problems with skinparams on the nestable elements found in class/deployment diagrams.

@startuml

title %version()

allowmixing

skinparam packageFontColor green
skinparam packageBorderColor red
skinparam packageStereotypeFontColor blue

package EmptyPackage <<something>>

package PackageWithThing <<something>> {
    class a
}

rectangle EmptyRectangle <<something>>

rectangle RectangleWithThing <<something>> {
    class b
}

@enduml

image

  • *FontColor and *StereotypeFontColor don't work at all. They do work on the empty package elements from deployment diagrams though.
  • *BorderColor works, but it isn't listed in skinparameters.
  • For nesting elements PackageBorderColor applies to other kinds of groups (rectangle, node, etc.) as well. However, it doesn't apply to empty versions of theses elements.

Expected behavior

  • *FontColor and *StereotypeFontColor should work for nesting elements.
  • *BorderColor should be listed in skinparameters.
  • skinparam behavior should be consistent between nesting and empty elements of the same type.

Desktop (please complete the following information):

  • OS: Windows
  • Version 1.2023.9beta4
@The-Lum
Copy link
Collaborator

The-Lum commented Jun 19, 2023

Hi @DRKV333, and all,

See similar/pseudo issue/request here:

It seems also that the issue is also due to the usage of allowmixing. [Mod: See next comment]

See corresponding issue with style:

@startuml
title %version()
allowmixing

<style>
package {
  FontColor green
  LineColor red
  Title {
  /* KO on nested package (OK on global) */
    FontColor green
  }
  stereotype {
  /* KO on nested package */
    FontColor blue
  }
}
</style>

package EmptyPackage <<something>>

package PackageWithThing <<something>> {
    class a
}

rectangle EmptyRectangle <<something>>

rectangle RectangleWithThing <<something>> {
    class b
}
@enduml

@plantuml team: If that can help for debugging...
Regards.

@arnaudroques arnaudroques self-assigned this Jun 19, 2023
@arnaudroques arnaudroques added bug Something isn't working and removed triage labels Jun 19, 2023
@DRKV333
Copy link
Contributor Author

DRKV333 commented Jun 19, 2023

Hi, @The-Lum, thanks for the reply.

It seems also that the issue is also due to the usage of allowmixing.

I don't think this has much to do with allowmixing, I've just used it to show the empty and nested versions side by side. But I can also reproduce the same behavior if I cut the diagram in two.

@startuml
title %version()

skinparam packageFontColor green
skinparam packageBorderColor red
skinparam packageStereotypeFontColor blue

package EmptyPackage <<something>>
rectangle EmptyRectangle <<something>>
@enduml

image

@startuml
title %version()

skinparam packageFontColor green
skinparam packageBorderColor red
skinparam packageStereotypeFontColor blue

package PackageWithThing <<something>> {
    class a
}

rectangle RectangleWithThing <<something>> {
    class b
}
@enduml

image

From the issue that you've linked, I can see that <style> works somewhat better here than skinparam. I admit I haven't used <style> a lot, since I couldn't find much documentation on it.

Using a global title selector indeed works fine, though it does also include the stereotype on empty packages. Though that can be overridden with a stereotype selector.

@startuml

title %version()

allowmixing

<style>
title {
    fontColor red
}
</style>

package EmptyPackage <<something>>

package PackageWithThing <<something>> {
    class a
}

rectangle EmptyRectangle <<something>>

rectangle RectangleWithThing <<something>> {
    class b
}

@enduml

image

Using <style>, a LineColor on package correctly only effects package, and it works similarly when using the rectangle selector.

@startuml

title %version()

allowmixing

<style>
package {
    lineColor red
}
</style>

package EmptyPackage <<something>>

package PackageWithThing <<something>> {
    class a
}

rectangle EmptyRectangle <<something>>

rectangle RectangleWithThing <<something>> {
    class b
}

@enduml

image

But the composite selector does not work with LineColor. (Have confirmed the same without allowmixing.)

@startuml

title %version()

allowmixing

<style>
composite {
    lineColor red
}
</style>

package EmptyPackage <<something>>

package PackageWithThing <<something>> {
    class a
}

rectangle EmptyRectangle <<something>>

rectangle RectangleWithThing <<something>> {
    class b
}

@enduml

image

composite does work however with title fontColor.

@startuml

title %version()

allowmixing

<style>
composite {
    title {
        fontColor red
    }
}
</style>

package EmptyPackage <<something>>

package PackageWithThing <<something>> {
    class a
}

rectangle EmptyRectangle <<something>>

rectangle RectangleWithThing <<something>> {
    class b
}

@enduml

image

rectangle title fontColor also works. But specifically package title fontColor and also package stereotype fontColor does not. (Again, I have confirmed this without allowmixing.)

@startuml

title %version()

allowmixing

<style>
rectangle {
    title {
        fontColor red
    }
    stereotype {
        fontColor purple
    }
}

package {
    title {
        fontColor blue
    }
    stereotype {
        fontColor green
    }
}
</style>

package EmptyPackage <<something>>

package PackageWithThing <<something>> {
    class a
}

rectangle EmptyRectangle <<something>>

rectangle RectangleWithThing <<something>> {
    class b
}

@enduml

image

@The-Lum
Copy link
Collaborator

The-Lum commented Jun 19, 2023

Hi @DRKV333,

(Again, I have confirmed this without allowmixing.)

Sorry for the allowmixing wrong direction (I was focused to have a minimum example).

Then: Thanks a lot for all your examples, in order to help PlantUML team to debug...

Regards.

arnaudroques added a commit that referenced this issue Jun 21, 2023
@arnaudroques
Copy link
Contributor

Many thanks for your tests, it really helps.
The situation is complex :-)

We have fixed some issues in last snapshot (see this example)

Unfortunately, we won't fix issues in skinparam. Skinparam are still supported for very simple case (and for ascending compatibility) but we would like people to migrate to style instead. (The main reason is that code for skinparam is too old and not very well written).

There are also some issues in style (like the one you have found) but we do want to fix them.

Tell us if you have some issues in migrating towards style as we may help you to do so!

@DRKV333
Copy link
Contributor Author

DRKV333 commented Jun 21, 2023

I've ran through all the previously mentioned cases in 1.2023.10beta1, here are the things that work now:

  • *FontColor and *StereotypeFontColor skinparams now work on nesting elements.
  • For <style>: package title FontColor and package stereotype fontColor now work.

Things that still don't work;

  • title FontColor applies to stereotypes on empty elements, but not on nesting elements.
  • composite LineColor doesn't work

Skinparam related things that don't work:

  • *BorderColor isn't listed in skinparameters.
  • PackageBorderColor applies to all nesting elements.

I don't really mind if these two are not fixed.

Additionally, there seems to have been a regression, where composite title FontColor no longer applies to package specifically. (It still works with other nesting elements.)

composite doesn't seem to work with most things in general.

  • composite stereotype FontColor doesn't work.
  • composite BackgroundColor doesn't work.
  • composite LineColor doesn't work.
  • composite FontSize doesn't apply to package.
  • composite FontSize doesn't apply to stereotypes. (But element FontSize does.)
  • composite stereotype FontSize doesn't work.

Right now I'm just using skinparam because it's what I know, but really I'm fine with using whichever works better. Also skinparam has more documentation. I didn't find much on style, though I'm sure that will improve over time. If you can point me at the bits of code that make style work, I could also look at writing some docs myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants