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

Collections won't display text #5

Open
shreyharia opened this issue Jul 22, 2020 · 4 comments
Open

Collections won't display text #5

shreyharia opened this issue Jul 22, 2020 · 4 comments

Comments

@shreyharia
Copy link

shreyharia commented Jul 22, 2020

Collections inside a package won't display text in it.

Code to reproduce:

@startuml
!include https://raw.githubusercontent.com/bschwarz/puml-themes/master/themes/cerulean/puml-theme-cerulean.puml

package World {
  collections Hellos as "Hellos"
}

@enduml

Expected: "Hellos" text within the collections
Actual:

Screen Shot 2020-07-22 at 12 09 45 PM

@bschwarz
Copy link
Owner

For some reason, the background color is not getting properly set, and the FontColor is white, so you won't see the text on a white background. I think there is a bug in plantuml. If you just do collections on its own:

@startuml
!include https://raw.githubusercontent.com/bschwarz/puml-themes/master/themes/cerulean/puml-theme-cerulean.puml

collections Hellos as "Hellos"

@enduml

it works. But as soon as you introduce "package", it doesn't work. I tried to add a skinparam and as well, but those don't work if the collections is within a package. So, I don't think there is anything I can do, since I think this is with plantuml.

The only thing that seemed to help, is if you change the background color of the package, so that the white text shows up in the collections:

@startuml
!include https://raw.githubusercontent.com/bschwarz/puml-themes/master/themes/cerulean/puml-theme-cerulean.puml

skinparam package {
BackgroundColor lightgray
}

package World {
  collections Hellos as "Hellos"
}
@enduml

Sorry I couldn't help more.
Cheers,
Brett

@shreyharia
Copy link
Author

Thanks Brett,

Other themes (as given below) seems to work somehow. Probably it is not plantUML then?

@startuml
!include https://raw.githubusercontent.com/bschwarz/puml-themes/master/themes/cerulean-outline/puml-theme-cerulean-outline.puml

package World {
  collections Hellos as "Hellos"
}

@enduml

Best,
Shrey

@shreyharia
Copy link
Author

On a similar note - even rectangle (as given below) doesn't seem to work:

@startuml
!include https://raw.githubusercontent.com/bschwarz/puml-themes/master/themes/cerulean/puml-theme-cerulean.puml

rectangle Hello as "Hello!"

@enduml

@bschwarz
Copy link
Owner

bschwarz commented Aug 2, 2020

The reason those other themes work is because of the font color for those themes. The "collections" are really meant for sequence diagrams. So, if you look at the puml-themes example for sequence diagrams, the collections are rendered properly (look at "Foo6" in the sequence diagram here ). Notice the background is blue in for the collections in the sequence diagram, and the font is white. However, when the collections are used outside of sequence diagrams, for some reason the background does not get set properly, so you have a background (white) as the same color as the font color (white).

So, I think that is a problem with plantuml. Or maybe collections are allowed outside of sequence diagrams, I'm not sure.

For the rectangle, yes I think that is a bug in puml-themes...the font color is getting set incorrectly. I will fix that. If you need a fix right now for "rectangle", you can add a skinparam after the !include https:// .... line at the top. So, it would look like this:

@startuml

!include https://raw.githubusercontent.com/bschwarz/puml-themes/master/themes/cerulean/puml-theme-cerulean.puml
  skinparam rectangle {
    FontColor $PRIMARY
  }

rectangle Hello as "Hello!"

@enduml

I should have a fix for rectangle this weekend.

Cheers,
Brett

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