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 · 10 comments · May be fixed by #384
Open

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

SHU-red opened this issue Jan 24, 2025 · 10 comments · May be fixed by #384
Assignees
Milestone

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")

@kirchsth
Copy link
Member

kirchsth commented Feb 8, 2025

Other finding: missing columns are not correct displayed/filled

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

WithoutPropertyHeader()
AddProperty("1", "2", "3", "4")
AddProperty($col1="col1")
AddProperty("", $col2="col2")
AddProperty("", $col3="col3")
AddProperty("", $col4="col4")

Container(c, "Container", $descr="missing columns are not correct filled")

@enduml

AddProperty() has to be updated that empty columns has to be replaced with a space

@kirchsth
Copy link
Member

kirchsth commented Feb 8, 2025

Following fix has to be added

@kirchsth
Copy link
Member

kirchsth commented Feb 9, 2025

Based on a "interesting" newline split I found a solution for the missing columns header too:

@kirchsth
Copy link
Member

kirchsth commented Feb 9, 2025

@SHU-red: Today Arnaud did a bugfix in PlantUML itself too. If you download the latest snapshot from PlantUML the missing header columns work without my workaround. https://github.com/plantuml/plantuml/releases/tag/snapshot

Details see PlantUML commit: plantuml/plantuml@a77c034

@kirchsth kirchsth added this to the v2.12.0 milestone Feb 9, 2025
@kirchsth kirchsth self-assigned this Feb 9, 2025
kirchsth added a commit to kirchsth/C4-PlantUML that referenced this issue Feb 9, 2025
kirchsth added a commit to kirchsth/C4-PlantUML that referenced this issue Feb 9, 2025
@SHU-red
Copy link
Author

SHU-red commented Feb 12, 2025

@SHU-red: Today Arnaud did a bugfix in PlantUML itself too. If you download the latest snapshot from PlantUML the missing header columns work without my workaround. https://github.com/plantuml/plantuml/releases/tag/snapshot

Details see PlantUML commit: plantuml/plantuml@a77c034

Sorry, unfortunately there is no way for me to try this in the near future

I am very grateful for taking a Look into this!

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

Successfully merging a pull request may close this issue.

2 participants