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

WithoutPropertyHeader() leads to missing "Value" column if first Property is "" #383

Open
SHU-red opened this issue Jan 24, 2025 · 5 comments

Comments

@SHU-red
Copy link

SHU-red commented Jan 24, 2025

Hi there,

not sure since when this problem exists but using:

  • Plantuml 1.2024.8
  • C4-Container diagram

The Property table seems broken when:

  1. Using WithoutPropertyHeader()
  2. First Property is empty

Leads to a missing Value Column

For fast tracing i added a example syntax ans example below. It can be seen that Value Column is missing even if 444 has a Value for Sender

@startuml
!include <C4/C4.puml>
!include <C4/C4_Container.puml>


left to right direction


' Base style
UpdateElementStyle(container, $fontColor="black", $borderColor="black", $bgColor="white", $borderStyle = SolidLine())
UpdateRelStyle(, $textColor="grey", $lineColor="grey")
UpdateBoundaryStyle(, $fontColor="grey", $borderColor="grey", $borderStyle = SolidLine())

' Base Query Boundary
AddBoundaryTag("BaseQuery", $fontColor="black", $borderColor="black")

' Item Styles

AddElementTag("Interface", $bgColor="#999999")

' Line Styles
AddRelTag("Versioned", $lineStyle = DashedLine())

' Boundaries/Containers

' WithoutPropertyHeader()
AddProperty("document_short_title", "")
AddProperty("sender", "Foo")
Container(22222, "22222", "Interface", $link="test", $tags="Interface+Queried")

WithoutPropertyHeader()
AddProperty("document_short_title", "")
AddProperty("sender", "Bar")
Container(444, "444", "Interface", $link="test", $tags="Interface+Queried")

' Show legend
SHOW_LEGEND()
@enduml

Image

@kirchsth
Copy link
Member

kirchsth commented Jan 24, 2025

Hi @SHU-red,

If you use a space " " (in the first row) instead an empty string "" then it works.
(the first row defines the number of visible columns; and "" is the "no column-value marker")

BR Helmut

PS.: if you use LAYOUT_LANDSCAPE() instead of left to right direction then the orientation of the relations are fixed too (e.g. Rel_Up() is up and not rotated). Details see https://github.com/plantuml-stdlib/C4-PlantUML/blob/master/LayoutOptions.md#layout_top_down-or-layout_left_right-or-layout_landscape

PPS.: if you defined the $fontColor too then you have a cleaner legende

AddElementTag("Interface", $fontColor="black", $bgColor="#999999")

@SHU-red
Copy link
Author

SHU-red commented Jan 24, 2025

The values of the properties are fed by a datasource in my case. As far as i can tell you say that the behavior is intended and i should e.g. try to replace "" by " "

Is that correct?

@kirchsth
Copy link
Member

kirchsth commented Jan 24, 2025

"yes" (it was not indented from my side that the second column in the second row is ignored, but it is the current PlantUML implementation, and I cannot fix in C4-Stdlib itself)

@SHU-red
Copy link
Author

SHU-red commented Jan 24, 2025

Ok, so thank you very much for taking the time and highlighting further improvements to me ;-)

@kirchsth
Copy link
Member

kirchsth commented Jan 24, 2025

no problem.

I have another one, if your diagrams has no explicit containers:
If you define the container tage without $borderStyle (it is already solid), and the interface defines the $fontColor and $borderColor too then the UI representation of the interface is complete (it overwrites all "lower" definitions of the container) and the legend requires only the interface and the (practically not used container are avoided)

UpdateElementStyle(container, $fontColor="black", $borderColor="black", $bgColor="white")
AddElementTag("Interface",  $fontColor="black", $borderColor="black", $bgColor="#999999")

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