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

Structurizr type diagrams do not support themes #1268

Closed
kelcydeg opened this issue May 18, 2022 · 8 comments · Fixed by #1289
Closed

Structurizr type diagrams do not support themes #1268

kelcydeg opened this issue May 18, 2022 · 8 comments · Fixed by #1289
Labels
👀 investigating ☕ java Related to Java code

Comments

@kelcydeg
Copy link

kelcydeg commented May 18, 2022

hello my problem is as follows

Definition:

workspace "Amazon Web Services Example" "An example AWS deployment architecture." {

    model {
        springPetClinic = softwaresystem "Spring PetClinic" "Allows employees to view and manage information regarding the veterinarians, the clients, and their pets." "Spring Boot Application" {
            webApplication = container "Web Application" "Allows employees to view and manage information regarding the veterinarians, the clients, and their pets." "Java and Spring Boot"
            database = container "Database" "Stores information regarding the veterinarians, the clients, and their pets." "Relational database schema" "Database"
        }

        webApplication -> database "Reads from and writes to" "MySQL Protocol/SSL"

        live = deploymentEnvironment "Live" {

            deploymentNode "Amazon Web Services" {
                tags "Amazon Web Services - Cloud"

                region = deploymentNode "US-East-1" {
                    tags "Amazon Web Services - Region"

                    route53 = infrastructureNode "Route 53" {
                        description "Highly available and scalable cloud DNS service."
                        tags "Amazon Web Services - Route 53"
                    }

                    elb = infrastructureNode "Elastic Load Balancer" {
                        description "Automatically distributes incoming application traffic."
                        tags "Amazon Web Services - Elastic Load Balancing"
                    }

                    deploymentNode "Autoscaling group" {
                        tags "Amazon Web Services - Auto Scaling"

                        deploymentNode "Amazon EC2" {
                            tags "Amazon Web Services - EC2"

                            webApplicationInstance = containerInstance webApplication
                        }
                    }

                    deploymentNode "Amazon RDS" {
                        tags "Amazon Web Services - RDS"

                        deploymentNode "MySQL" {
                            tags "Amazon Web Services - RDS MySQL instance"

                            databaseInstance = containerInstance database
                        }
                    }

                }
            }

            route53 -> elb "Forwards requests to" "HTTPS"
            elb -> webApplicationInstance "Forwards requests to" "HTTPS"
        }
    }

    views {
        deployment springPetClinic "Live" "AmazonWebServicesDeployment" {
            include *
            autolayout lr

            animation {
                route53
                elb
                webApplicationInstance
                databaseInstance
            }
        }

        styles {
            element "Element" {
                shape roundedbox
                background #ffffff
            }
            element "Database" {
                shape cylinder
            }
            element "Infrastructure Node" {
                shape roundedbox
            }
        }

        themes "https://static.structurizr.com/themes/amazon-web-services-2020.04.30/theme.json"
    }

}

Result: https://structurizr.com/dsl
structurizr-AmazonWebServicesDeployment-004

Result: https://kroki.io/structurizr/svg/eNq9Vt9v0zAQfs9fcQpviLZjgxckkMZWxNCYxjLE89W5tgbHDrbbrkP73zknaZt0SddtCD8l9vm-u-9-eWHsL5ejIIiPM7w1Gn7QCBKycynIwfAGs1xRzKcaqPyB4x8JpJQrs8xIe0ArptKT8DNL_Rj-RBHwykxKin-gWi63Uk8uyZ8oqaWA9-DM2C_Qkls6TxnESSEBa5EAqpRZOKAsgBHb4w3MJS0AdQoZapwQSD02NkMv2XZLE7Rp0OKnBHPyxCrRStTuVbEllGST-Sco4A1pISfv2OwV_EdjPBznuZKi0BnXfAhrQaPaKbshjPYoNVmIA3WNq__VgS84x2K75kncsD1FjyN01LT6tNoNHHjD8fhnFl2RKpSg2kA7MaUM4xrs2sS7KOpgufdho4C1YupgbE1WQC4sJ18glnV-XSbfzuHSGm-EUYMkOY83OpWcB883mTvUc2mNLpI4PufTdfKuCVvLXnA6t5bIdn6E5XHi2uupByfKzNI4uneHeS7zaRvze9IbovO9121ID6FdFVpb4ApIM_P09ogxOeCWMeysKOIS9yqcwtujLtiSHyeszIsYxZ_lZKqWwFkoFY64T4ToOIHljwh-w-lFAq40rx93qt3p0cqs1tt37Z6SGnV4OVS8w-3o3GAKH9lWLcju7fLxzJtQJ-wke55KVi5HM1-UkDBZqBqspbG3OB5L8UTPW0xlgEfxcC-f2f4QoWDohNMh3-X5LtuCIkhKTR3ZtqOehieHu4AfJIavRztvN9vJmXY-xLneBtd7TdFOrXfPor104-o0eSrf4er-NBdt8TkMMxyUvVVWPD1A-Kpb76R6JfR8kpuCWwKrNsdDJPSB-JOx_OzgEWLp94ycr2bH5-vry6RZTUGcb3Vkz56KStsqm8Lsd7VA1J5R2w-kaiJVEeGArOJxur6zHVJuOmrGAX_Z2EWuTYVLZgGUbVKDWlZj_n5uVLRFLb002q--ooeyImqPYS1-zi8VuS3rSFE5s4flR1tmuynmFHzQKaUjc3NPYITi16Q4hxfjYkXdGbVG3LyVuiDFksOXkt1H21ljIEEo1kf70kobP8Mypi2eep-7d4MB082To7-Ckre2z-NpUIoNsMiwHgexV81m1zs8ODzoH7zpHx2UUv2fLrwjKpy7vxVuYY4=

test

please help!!

@ggrossetie
Copy link
Member

ggrossetie commented May 18, 2022

That's a good question, I guess this feature is not supported by the PlantUML exporter?

this.structurizrPlantUMLExporter = new StructurizrPlantUMLExporter();

Is that correct @simonbrowndotje?

However, we might be missing something since I get colors when using the PlantUML exporter from the Structurizr site:

image

https://plantuml.com/plantuml/img/pLTRRziw37xthn2orpNBfUrwYZHOUXcseHjwwWvxQ8k1aUb4g2nbafoi6yv_FvJZ98wRjd4Q34kA1gP8wIFvaQBVMGV6fOaCd70IMJWoGWtO1ReJAPJWR8UTuaZg-mILeuTpCSOWa1WxvZGpOZ1qB186kHDQ1O6z4se41XBsEs3C3Y7I4xzV3D8YIS0OFNclbGl5BsJD1eaYZ26LxWf_kfuK0vKTnEaV6bgT61Xz4v4RibR3QoVmypDQ2mFCTsW4_mN1K4J8B5cWTlSZBE9GEi9EnyEkznBufTKtx8TeneAZhNyDpy2wPhsNEcqvaCU3WT7fA5SzEsbrkvadny3l_8gAJhJKXhsAim-jU6ToMNImlzziUsrj8ZHbQMvk51foXc1N1PcjN9w6LJ2r-xi7d9SnpQKROgg2eDLknMqi8vXBNnoLKkggGEEyrThVBKERIv-05e63FjWAIQj_lW__FQ-VveRVcrM0Dh9F6MY_vRzBk7mXWXh8vu6TIVeH_5n3T0mI54TJ1T7-FstEzyg8vjAjSNqQjZ_3-FM3TwbJXtljloTWLP0qTzzY7yf8vjAj1EZnXbedzTve90K7VsLiiGvMG0zyx5XjUZYZazaCwOswBjnhNqZjjiQUQ7TWsUgr3FpqcA_XZlT-frbfyq8A7praffCTDZikzugAPAFpbkwJPqzUQESOPYYo-dmXW7cHLu0njPc3OVEMp6f7HxCkUwCwbiQ4msQZUtr2D091r3XaboWpye5SM5a-n0HkEs-yGVT6tQZGQKFv5IhM9idqgG06O28_qBWXiZ7In24K607Aliv4N0gA03s0Yhn063P2P-lLex5yKrGEJC4yZn1LG-4dfz2YJ5bMfnicyk4Tl0RWab69LpcxgMDi1zFII5STtSAyGBbvF_ISyzsbqDWUeTud64D6ZdpGFjRQ5KdNar9FBCF4Eun4Fvgonm8dcKq2YWRVFyV8Iaty9J5ziDzApYw5EvzVc1zWs6o2AGRzeueDgPYKkzJWb3V5G1CO7qF28-_f5OOqHPzkTL_mN2S-eh10n9o1E1PydR2jdgoU3yyAkuTkPvC7ssjNyFG3lQIHYqGy8Q5FstWc-3na3rpgD6AdNq9cfu3MSN4n_pplLguRP6cal-sHXDMlNxrj-EzhDnJyJj6BuL7hjjxTl5UoGrRhS3zM7EPRToyH8ijYevCiS1CZN5QMb85bnMb23hhNqvlfmcYdIUDD69xFqb4BrWlMnfwjuD0AbzvhCw6kOObQFrAqxcbtFbnTNOHhUx0AmSPvgi25BNlv3bMK9l9_

@ggrossetie ggrossetie added 👀 investigating ☕ java Related to Java code labels May 18, 2022
@simonbrowndotje
Copy link

The PlantUML exporter should use the colours from the theme, although the theme is accessed via a HTTPS network call. If that's blocked, you won't see any colours.

@ggrossetie
Copy link
Member

The PlantUML exporter should use the colours from the theme, although the theme is accessed via a HTTPS network call. If that's blocked, you won't see any colours.

Thanks for you reply!
I don't remind explicitly blocking HTTPS network call 🤔
So colours are loaded as part of the theme.json file https://static.structurizr.com/themes/amazon-web-services-2020.04.30/theme.json correct? Is there a way to load a local file (similar to what PlantUML is doing with "stdlib")?

@simonbrowndotje
Copy link

You will need to add ThemeUtils.loadThemes(workspace); to load external themes, if you're not doing so already (example).

@ggrossetie
Copy link
Member

@simonbrowndotje Would it be possible to mark Styles.addStylesFromTheme as public to programmatically add styles?

https://github.com/structurizr/java/blob/075db91cbee4bb95f21e768bff8bbfb589870e60/structurizr-core/src/com/structurizr/view/Styles.java#L231-L233

I'm fetching styles from resource files (classloader) and I want to call Styles.addStylesFromTheme directly (without calling ThemeUtils.loadThemes

Thanks!

@ggrossetie
Copy link
Member

I guess I will also need RelationshipStyle to have a public constructor since I'm decoding JSON.

@frafra
Copy link

frafra commented May 12, 2023

theme default is broken/ignored. I tested both kroki.io and kroki locally using the Docker image.

@ggrossetie
Copy link
Member

Indeed, we do not support theme default but we can easily add it in:

https://github.com/yuzutech/kroki/blob/main/server/src/main/java/io/kroki/server/service/Structurizr.java#L56-L60

We should also probably update the existing themes with the latest version available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 investigating ☕ java Related to Java code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants