Code Monkey home page Code Monkey logo

Comments (8)

dgutson avatar dgutson commented on August 9, 2024

Removing the whole styles {} block also preserves the behavior.

from export.

dgutson avatar dgutson commented on August 9, 2024

I think I spotted it:

        properties {
            #plantuml.includes https://raw.githubusercontent.com/plantuml/plantuml-stdlib/master/tupadr3/font-awesome-5/users.puml
            #c4plantuml.tags true
            #c4plantuml.legend false
            plantuml.sequenceDiagram true
        }

Commenting and uncommenting c4plantuml.legend false makes the difference between showing or not the stereotype.

from export.

simonbrowndotje avatar simonbrowndotje commented on August 9, 2024

It's the call to SHOW_LEGEND() in the PlantUML that's causing the stereotypes to appear or not. These two examples both render differently:

@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4.puml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml

System(SoftwareSystem, "Software System")

SHOW_LEGEND()
@enduml
@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4.puml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml

System(SoftwareSystem, "Software System")

@enduml

You'll need to ask the C4-PlantUML team why this happens ... I suspect it's because you generally want the legend or the stereotypes, but not both, and not neither.

from export.

dgutson avatar dgutson commented on August 9, 2024

Why not adding HIDE_STEREOTYPES() when c4plantuml.legend is false then?

from export.

dgutson avatar dgutson commented on August 9, 2024

Anyways I can ask to confirm.

from export.

dgutson avatar dgutson commented on August 9, 2024

I found this plantuml-stdlib/C4-PlantUML#37 which could be related.

from export.

dgutson avatar dgutson commented on August 9, 2024

@simonbrowndotje they confirmed, I think structurizr should just add the HIDE_STEREOTYPES() call as I suggested above, since your hypothesis was correct.

from export.

dgutson avatar dgutson commented on August 9, 2024

Didn't test it yet but fix should look like:

--- a/src/main/java/com/structurizr/export/plantuml/C4PlantUMLExporter.java
+++ b/src/main/java/com/structurizr/export/plantuml/C4PlantUMLExporter.java
@@ -165,10 +165,13 @@ public class C4PlantUMLExporter extends AbstractPlantUMLExporter {

     @Override
     protected void writeFooter(View view, IndentingWriter writer) {
+        writer.writeLine();
         if (includeLegend(view)) {
-            writer.writeLine();
             writer.writeLine("SHOW_LEGEND()");
         }
+        else {
+            writer.writeLine("HIDE_STEREOTYPE()");
+        }

         super.writeFooter(view, writer);
     }

from export.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.