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

C4PlantUMLExporter not following C4-PlantUML best practices with c4plantuml.tags true #263

Closed
cc-stjm opened this issue Mar 21, 2024 · 1 comment

Comments

@cc-stjm
Copy link

cc-stjm commented Mar 21, 2024

Description

As part of plantuml-stdlib/C4-PlantUML#342 there are some suggestions on how to improve the exporter to better match how the C4-PlantUML library expects to be called.

This is based on using the property c4plantuml.tags true

$borderstyle should use lowercase values "solid",... (or I would even prefer the macros SolidLine(),...)
if $borderThickness="1" should not be displayed in the legend then it should not be set otherwise it is assumed it has a special meaning and therefore it is added to the legend
(not relevant for the concrete problem, but maybe it can be changed too)
instead of "top to bottom direction" it should use LAYOUT_TOP_DOWN()
instead of "left to right direction" LAYOUT_LANDSCAPE(), in special LAYOUT_LANDSCAPE() offers a special implementation that the directions of the relations are correct

It's possible that that issue might create further recommendations too - it's about ensuring the legend display doesn't include unexpected text.

(Note: I'd be happy to work up a merge request for this if you agree with the proposed solutions)

Steps to reproduce

Problem is demonstrated using the c4-plantuml renderer on https://structurizr.com/dsl with the following plan. (Only addition is the property c4plantuml.tags true

workspace {

    model {
        user = person "User" "A user of my software system."
        softwareSystem = softwareSystem "Software System" "My software system."

        user -> softwareSystem "Uses"
    }

    views {
        systemContext softwareSystem "SystemContext" {
            include *
            autoLayout
        }
        
        properties {
            c4plantuml.tags true
        }

        styles {
            element "Software System" {
                background #1168bd
                color #ffffff
            }
            element "Person" {
                shape person
                background #08427b
                color #ffffff
            }
        }
    }
    
}

Screenshot

image
(Image is from the diagram in "steps to reproduce")

Code sample

workspace {

    model {
        user = person "User" "A user of my software system."
        softwareSystem = softwareSystem "Software System" "My software system."

        user -> softwareSystem "Uses"
    }

    views {
        systemContext softwareSystem "SystemContext" {
            include *
            autoLayout
        }
        
        properties {
            c4plantuml.tags true
        }

        styles {
            element "Software System" {
                background #1168bd
                color #ffffff
            }
            element "Person" {
                shape person
                background #08427b
                color #ffffff
            }
        }
    }
    
}

Configuration

Demonstrable on https://structurizr.com/dsl v2.1.1

Severity

Minor

Priority

I have no budget and there's no rush, please fix this for free

More information

No response

@simonbrowndotje
Copy link
Contributor

I've fixed the two issues related to borderStyle and borderThickness ... the layout related suggestions will require some more thought since they may look different to existing exports.

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

No branches or pull requests

2 participants