diff --git a/C4.puml b/C4.puml index 0d4c6cf..be4096e 100644 --- a/C4.puml +++ b/C4.puml @@ -219,17 +219,10 @@ $elementSkin !function $tagRelLegendEntry($tagStereo, $textColor, $lineColor) !$tagEntry = "|" - !$bg = $LEGEND_UNDEFINED_BG_COLOR - ' named colors have to start with # too - !if (%substr($bg, 0, 1) != "#") - !$bg = "#" + $bg - !endif -' !$tagEntry = $tagEntry + "<" + $bg +">" ' ..white line !if ($lineColor!="") !$tagEntry = $tagEntry + " " !else -' !$tagEntry = $tagEntry + " " !$tagEntry = $tagEntry + " " !endif !if ($textColor!="") @@ -250,7 +243,9 @@ $elementSkin !endfunction !unquoted procedure $addTagToLegend($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="") -'' ignore workaround tags with & +'' if a combined element tag is defined (e.g. "v1.0&v1.1") then it is typically a merged color, +'' like a new $fontColor="#fdae61" therefore it should be added to the legend +'' and the & combined tags will be not removed ' !if (%strpos($tagStereo, "&")<0) !$tagEntry = $tagLegendEntry($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing) %set_variable_value("$" + $tagStereo + "LegendEntry", $tagEntry) @@ -259,7 +254,12 @@ $elementSkin !endprocedure !unquoted procedure $addRelTagToLegend($tagStereo, $textColor="", $lineColor="") -'' ignore workaround tags with & +'' Arrows have a bug with stereotype/skinparams and cannot combine text colors of one stereotype +'' and the line color of another stereotype. Therefore the text color of one tag and the line color +'' of another tag have to be combined via a "workaround" tag ("v1.0&v1.1"). +'' This workaround tag could be theoretically removed in the legend but after that there would +'' be an inconsistency between the element tags and the rel tags and therefore +'' & combined workaround tags are not removed too (and in unlikely cases the color itself could be changed) ' !if (%strpos($tagStereo, "&")<0) !$tagEntry = $tagRelLegendEntry($tagStereo, $textColor, $lineColor) %set_variable_value("$" + $tagStereo + "_LineLegendEntry", $tagEntry) @@ -635,4 +635,4 @@ $from -[hidden]R- $to !endprocedure !unquoted procedure Lay_L($from, $to) $from -[hidden]L- $to -!endprocedure \ No newline at end of file +!endprocedure diff --git a/C4_Component.puml b/C4_Component.puml index acdc8f7..89d5751 100644 --- a/C4_Component.puml +++ b/C4_Component.puml @@ -86,4 +86,4 @@ database "$getComponent($label, $techn, $descr, $sprite)$getProps()" $toStereos( !unquoted procedure ComponentQueue_Ext($alias, $label, $techn, $descr="", $sprite="", $tags="") queue "$getComponent($label, $techn, $descr, $sprite)$getProps()" $toStereos("external_component",$tags) as $alias -!endprocedure \ No newline at end of file +!endprocedure diff --git a/README.md b/README.md index 8c02ae3..25fa8f2 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ If you want to use the always up-to-date version in this repo, use the following Now let's create a C4 Container diagram: -\(If you don't want run PlantUML locally you can use e.g. the [PlantUML Web Server](http://www.plantuml.com/plantuml/uml/ZOxDIWGn48JlUOeufn5qSjcJfvNHsugBFsV99iqcsEc4T0VTjpSCE2AYUAeAgVwgjYosIakevytBBK824bPdaHms3pg85BuofjgtwHWbj4DZg2wJzDpaSZAliRh04ioykToZ9Nc-snbux_yUlEdGkOTj9AXJwJLAxQ5ofh4iSetHyeKUTlO0E7HpNoHcigXlW5sDosiuLojaT9_kn-aJk40Py_7q1-Znn09fv4N-swuU0ByFNbVyZlYQqmbR8DyIVW00) too.) +\(If you don't want run PlantUML locally you can use e.g. the [PlantUML Web Server](https://www.plantuml.com/plantuml/uml/ZOxDIWGn48JlUOeufn5qSjcJfvNHsugBFsV99iqcsEc4T0VTjpSCE2AYUAeAgVwgjYosIakevytBBK824bPdaHms3pg85BuofjgtwHWbj4DZg2wJzDpaSZAliRh04ioykToZ9Nc-snbux_yUlEdGkOTj9AXJwJLAxQ5ofh4iSetHyeKUTlO0E7HpNoHcigXlW5sDosiuLojaT9_kn-aJk40Py_7q1-Znn09fv4N-swuU0ByFNbVyZlYQqmbR8DyIVW00) too.) After you have included `C4_Container.puml` you can use the defined macro definitions for the C4 elements: `Person`, `Person_Ext`, `System`, `System_Ext`, `Container`, `Relationship`, `Boundary`, and `System_Boundary` @@ -497,7 +497,7 @@ Images can be generated in PNG, in SVG or in LaTeX format. PlantUML was created to allow the drawing of UML diagrams, using a simple and human readable text description. Because it does not prevent you from drawing inconsistent diagrams, it is a drawing tool and not a modeling tool. -It is the most used text-based diagram drawing tool with [extensive support into wikis and forums, text editors and IDEs, use by different programming languages and documentation generators](https://en.plantuml.com/running). +It is the most used text-based diagram drawing tool with [extensive support into wikis and forums, text editors and IDEs, use by different programming languages and documentation generators](https://plantuml.com/running). The [C4 model](https://c4model.com/) for software architecture is an "abstraction-first" approach to diagramming, based upon abstractions that reflect how software architects and developers think about and build software. The small set of abstractions and diagram types makes the C4 model easy to learn and use. diff --git a/percy/C4_Container Diagram Sample - bigbankplc-icons.puml b/percy/C4_Container Diagram Sample - bigbankplc-icons.puml index 895d145..af52f2a 100644 --- a/percy/C4_Container Diagram Sample - bigbankplc-icons.puml +++ b/percy/C4_Container Diagram Sample - bigbankplc-icons.puml @@ -48,4 +48,4 @@ Rel_Back_Neighbor(database, backend_api, "Reads from and writes to", "sync, JDBC Rel_Back(customer, email_system, "Sends e-mails to") Rel_Back(email_system, backend_api, "Sends e-mails using", "sync, SMTP") Rel_Neighbor(backend_api, banking_system, "Uses", "sync/async, XML/HTTPS") -@enduml \ No newline at end of file +@enduml diff --git a/percy/C4_Container Diagram Sample - bigbankplc.puml b/percy/C4_Container Diagram Sample - bigbankplc.puml index 05dee11..6fc0c8e 100644 --- a/percy/C4_Container Diagram Sample - bigbankplc.puml +++ b/percy/C4_Container Diagram Sample - bigbankplc.puml @@ -37,4 +37,4 @@ Rel_Back_Neighbor(database, backend_api, "Reads from and writes to", "sync, JDBC Rel_Back(customer, email_system, "Sends e-mails to") Rel_Back(email_system, backend_api, "Sends e-mails using", "sync, SMTP") Rel_Neighbor(backend_api, banking_system, "Uses", "sync/async, XML/HTTPS") -@enduml \ No newline at end of file +@enduml diff --git a/percy/C4_Container Diagram Sample - message bus.puml b/percy/C4_Container Diagram Sample - message bus.puml index 2f2fbc8..09dbf83 100644 --- a/percy/C4_Container Diagram Sample - message bus.puml +++ b/percy/C4_Container Diagram Sample - message bus.puml @@ -51,4 +51,4 @@ Rel(audit_service, audit_store, "Stores events in") Lay_R(reporting_service, audit_service) -@enduml \ No newline at end of file +@enduml diff --git a/percy/C4_Container Diagram Sample - techtribesjs.puml b/percy/C4_Container Diagram Sample - techtribesjs.puml index fcac4ec..ace556f 100644 --- a/percy/C4_Container Diagram Sample - techtribesjs.puml +++ b/percy/C4_Container Diagram Sample - techtribesjs.puml @@ -50,4 +50,4 @@ Rel(updater, blogs, "Gets content using RSS and Atom feeds from", "HTTP") Lay_R(rel_db, filesystem) -@enduml \ No newline at end of file +@enduml diff --git a/percy/C4_Context Diagram Sample - enterprise.puml b/percy/C4_Context Diagram Sample - enterprise.puml index 197301d..2c61d8b 100644 --- a/percy/C4_Context Diagram Sample - enterprise.puml +++ b/percy/C4_Context Diagram Sample - enterprise.puml @@ -42,4 +42,4 @@ Rel_L(taxamo, braintree, "Uses for credit card processing") Lay_D(customer, braintree) -@enduml \ No newline at end of file +@enduml diff --git a/percy/C4_Deployment Diagram Sample - bigbankplc-details.puml b/percy/C4_Deployment Diagram Sample - bigbankplc-details.puml index 22867a1..9f15946 100644 --- a/percy/C4_Deployment Diagram Sample - bigbankplc-details.puml +++ b/percy/C4_Deployment Diagram Sample - bigbankplc-details.puml @@ -67,4 +67,4 @@ Rel(api, db2, "Reads from and writes to", "JDBC", $tags="fallback") Rel_R(db, db2, "Replicates data to") SHOW_LEGEND() -@enduml \ No newline at end of file +@enduml diff --git a/percy/C4_Deployment Diagram Sample - bigbankplc.puml b/percy/C4_Deployment Diagram Sample - bigbankplc.puml index 233b4ae..67ea39c 100644 --- a/percy/C4_Deployment Diagram Sample - bigbankplc.puml +++ b/percy/C4_Deployment Diagram Sample - bigbankplc.puml @@ -55,4 +55,4 @@ Rel(api, db2, "Reads from and writes to", "JDBC", $tags="fallback") Rel_R(db, db2, "Replicates data to") SHOW_LEGEND() -@enduml \ No newline at end of file +@enduml diff --git a/percy/C4_Dynamic Diagram Sample - bigbankplc.puml b/percy/C4_Dynamic Diagram Sample - bigbankplc.puml index c51d174..5a9faf4 100644 --- a/percy/C4_Dynamic Diagram Sample - bigbankplc.puml +++ b/percy/C4_Dynamic Diagram Sample - bigbankplc.puml @@ -17,4 +17,4 @@ Container_Boundary(b, "API Application") { Rel_R(c1, c2, "Submits credentials to", "JSON/HTTPS") Rel(c2, c3, "Calls isAuthenticated() on") Rel_R(c3, c4, "select * from users where username = ?", "JDBC") -@enduml \ No newline at end of file +@enduml diff --git a/percy/TestLegend.puml b/percy/TestLegend.puml index 1a831c4..9b784b8 100644 --- a/percy/TestLegend.puml +++ b/percy/TestLegend.puml @@ -49,4 +49,4 @@ Rel(allInOne, system2, "line 3+4 cannot be combined without workaround", $tags=" Rel(allInOne, system2, "line 3+4 with workaround", $tags="line3&line4+line3+line4") SHOW_LEGEND(false) -@enduml \ No newline at end of file +@enduml diff --git a/percy/TestRelations.puml b/percy/TestRelations.puml index eb62632..c9a6eca 100644 --- a/percy/TestRelations.puml +++ b/percy/TestRelations.puml @@ -69,4 +69,4 @@ Lay_D(RelFrom, RelShort) Lay_D(RelShort, RelLong) Lay_R(RelLong, BiRelShort) Lay_L(RelLong, BiRelLong) -@enduml \ No newline at end of file +@enduml diff --git a/percy/TestRelationsDynamic.puml b/percy/TestRelationsDynamic.puml index c31ed60..55bbaaa 100644 --- a/percy/TestRelationsDynamic.puml +++ b/percy/TestRelationsDynamic.puml @@ -68,4 +68,4 @@ Lay_D(RelFrom, RelShort) Lay_D(RelShort, RelLong) Lay_R(RelLong, RelIndexShort) Lay_L(RelLong, RelIndexLong) -@enduml \ No newline at end of file +@enduml diff --git a/samples/C4_Container Diagram Sample - bigbankplc-icons.puml b/samples/C4_Container Diagram Sample - bigbankplc-icons.puml index cce5f6f..c295774 100644 --- a/samples/C4_Container Diagram Sample - bigbankplc-icons.puml +++ b/samples/C4_Container Diagram Sample - bigbankplc-icons.puml @@ -42,4 +42,4 @@ Rel_Back_Neighbor(database, backend_api, "Reads from and writes to", "sync, JDBC Rel_Back(customer, email_system, "Sends e-mails to") Rel_Back(email_system, backend_api, "Sends e-mails using", "sync, SMTP") Rel_Neighbor(backend_api, banking_system, "Uses", "sync/async, XML/HTTPS") -@enduml \ No newline at end of file +@enduml diff --git a/samples/C4_Container Diagram Sample - message bus.puml b/samples/C4_Container Diagram Sample - message bus.puml index f375919..ad2369d 100644 --- a/samples/C4_Container Diagram Sample - message bus.puml +++ b/samples/C4_Container Diagram Sample - message bus.puml @@ -48,4 +48,4 @@ Rel(audit_service, audit_store, "Stores events in") Lay_R(reporting_service, audit_service) -@enduml \ No newline at end of file +@enduml diff --git a/samples/C4_Container Diagram Sample - techtribesjs.puml b/samples/C4_Container Diagram Sample - techtribesjs.puml index 51a27c5..60a493d 100644 --- a/samples/C4_Container Diagram Sample - techtribesjs.puml +++ b/samples/C4_Container Diagram Sample - techtribesjs.puml @@ -48,4 +48,4 @@ Rel(updater, blogs, "Gets content using RSS and Atom feeds from", "HTTP") Lay_R(rel_db, filesystem) -@enduml \ No newline at end of file +@enduml diff --git a/samples/C4_Context Diagram Sample - enterprise.puml b/samples/C4_Context Diagram Sample - enterprise.puml index 8d1fb85..2cf7db0 100644 --- a/samples/C4_Context Diagram Sample - enterprise.puml +++ b/samples/C4_Context Diagram Sample - enterprise.puml @@ -39,4 +39,4 @@ Rel_L(taxamo, braintree, "Uses for credit card processing") Lay_D(customer, braintree) -@enduml \ No newline at end of file +@enduml diff --git a/samples/C4_Deployment Diagram Sample - bigbankplc-details.puml b/samples/C4_Deployment Diagram Sample - bigbankplc-details.puml index 50f6553..1d230ce 100644 --- a/samples/C4_Deployment Diagram Sample - bigbankplc-details.puml +++ b/samples/C4_Deployment Diagram Sample - bigbankplc-details.puml @@ -64,4 +64,4 @@ Rel(api, db2, "Reads from and writes to", "JDBC", $tags="fallback") Rel_R(db, db2, "Replicates data to") SHOW_LEGEND() -@enduml \ No newline at end of file +@enduml diff --git a/samples/C4_Deployment Diagram Sample - bigbankplc.puml b/samples/C4_Deployment Diagram Sample - bigbankplc.puml index d4a6692..f8d37f1 100644 --- a/samples/C4_Deployment Diagram Sample - bigbankplc.puml +++ b/samples/C4_Deployment Diagram Sample - bigbankplc.puml @@ -52,4 +52,4 @@ Rel(api, db2, "Reads from and writes to", "JDBC", $tags="fallback") Rel_R(db, db2, "Replicates data to") SHOW_LEGEND() -@enduml \ No newline at end of file +@enduml diff --git a/samples/C4_Dynamic Diagram Sample - bigbankplc.puml b/samples/C4_Dynamic Diagram Sample - bigbankplc.puml index 8c317bc..b231f94 100644 --- a/samples/C4_Dynamic Diagram Sample - bigbankplc.puml +++ b/samples/C4_Dynamic Diagram Sample - bigbankplc.puml @@ -12,4 +12,4 @@ Container_Boundary(b, "API Application") { Rel_R(c1, c2, "Submits credentials to", "JSON/HTTPS") Rel(c2, c3, "Calls isAuthenticated() on") Rel_R(c3, c4, "select * from users where username = ?", "JDBC") -@enduml \ No newline at end of file +@enduml diff --git a/samples/C4_Dynamic Diagram Sample - message bus - old format.puml b/samples/C4_Dynamic Diagram Sample - message bus - old format.puml index 3268c70..bdbb59b 100644 --- a/samples/C4_Dynamic Diagram Sample - message bus - old format.puml +++ b/samples/C4_Dynamic Diagram Sample - message bus - old format.puml @@ -32,4 +32,4 @@ setIndex(5) RelIndex_R($index-2, message_bus, audit_service, "Sends customer update events to", "async") increment() RelIndex($index-2, audit_service, audit_store, "Stores events in") -@enduml \ No newline at end of file +@enduml diff --git a/samples/C4_Dynamic Diagram Sample - message bus.puml b/samples/C4_Dynamic Diagram Sample - message bus.puml index 12ed964..5b7dc67 100644 --- a/samples/C4_Dynamic Diagram Sample - message bus.puml +++ b/samples/C4_Dynamic Diagram Sample - message bus.puml @@ -1,3 +1,4 @@ + @startuml !include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Dynamic.puml @@ -28,4 +29,4 @@ RelIndex(Index()-1, reporting_service, reporting_db, "Stores data in") RelIndex_R(SetIndex(5)-2, message_bus, audit_service, "Sends customer update events to", "async") RelIndex(Index()-2, audit_service, audit_store, "Stores events in") -@enduml \ No newline at end of file +@enduml