Coder Social home page Coder Social logo

plantuml-stdlib / c4-plantuml Goto Github PK

View Code? Open in Web Editor NEW
6.0K 103.0 1.1K 7.41 MB

C4-PlantUML combines the benefits of PlantUML and the C4 model for providing a simple way of describing and communicate software architectures

License: MIT License

PlantUML 93.48% Python 6.52%
plantuml c4model architecture uml diagram graphviz c4

c4-plantuml's Introduction

release license MIT       commits since last commit build result

C4-PlantUML

Container diagram for Internet Banking System

C4-PlantUML combines the benefits of PlantUML and the C4 model for providing a simple way of describing and communicating software architectures – especially during up-front design sessions – with an intuitive language using open source and platform independent tools.

C4-PlantUML includes macros, stereotypes, and other goodies (like VSCode Snippets) for creating C4 diagrams with PlantUML.

Getting Started

Including the C4-PlantUML library

At the top of your C4 PlantUML .puml file, you need to include the C4_Context.puml, C4_Container.puml or C4_Component.puml file found in the root of this repo.

To be independent of any Internet connectivity, you can download the files found in the root and make use of them by supplying the command line argument -DRELATIVE_INCLUDE="." to PlantUML:

java -jar plantuml.jar -DRELATIVE_INCLUDE="."  ...

For Visual Studio Code, add the following to your settings.json:

"plantuml.jarArgs": [
  "-DRELATIVE_INCLUDE=."
]

If you want to use the always up-to-date version of the C4-PlantUML library in this repo (which obviously requires an Internet connection every time you render a document), use the following:

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

If you don't need the up-to-date version, PlantUML includes the last released C4_... files as standard library C4 (no additional files or Internet is required). You can use it with following:

!include <C4/C4_Container>

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

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

Person(personAlias, "Label", "Optional Description")
Container(containerAlias, "Label", "Technology", "Optional Description")
System(systemAlias, "Label", "Optional Description")

Rel(personAlias, containerAlias, "Label", "Optional Technology")
@enduml

test

In addition to this, it is also possible to define a system or component boundary.

Take a look at the following sample of a C4 Container Diagram:

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

Person(admin, "Administrator")
System_Boundary(c1, "Sample System") {
    Container(web_app, "Web Application", "C#, ASP.NET Core 2.1 MVC", "Allows users to compare multiple Twitter timelines")
}
System(twitter, "Twitter")

Rel(admin, web_app, "Uses", "HTTPS")
Rel(web_app, twitter, "Gets tweets from", "HTTPS")
@enduml

Basic Sample

Entities can also be decorated with icons/sprites using the $sprite parameter, for example:

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

!define DEVICONS https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/master/devicons
!define FONTAWESOME https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/master/font-awesome-5
!include DEVICONS/angular.puml
!include DEVICONS/java.puml
!include DEVICONS/msql_server.puml
!include FONTAWESOME/users.puml

LAYOUT_WITH_LEGEND()

Person(user, "Customer", "People that need products", $sprite="users")
Container(spa, "SPA", "angular", "The main interface that the customer interacts with", $sprite="angular")
Container(api, "API", "java", "Handles all business logic", $sprite="java")
ContainerDb(db, "Database", "Microsoft SQL", "Holds product, order and invoice information", $sprite="msql_server")

Rel(user, spa, "Uses", "https")
Rel(spa, api, "Uses", "https")
Rel_R(api, db, "Reads/Writes")
@enduml

Sprites/Icons

Similar to icons/sprites is it possible to add links to all elements and relationships:

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

Person(admin, "Administrator", $sprite="person2", $link="https://github.com/plantuml-stdlib/C4-PlantUML/blob/master/LayoutOptions.md#hide_person_sprite-or-show_person_spritesprite")
System_Boundary(c1, "Sample System", $link="https://github.com/plantuml-stdlib/C4-PlantUML") {
    Container(web_app, "Web Application", "C#, ASP.NET Core 2.1 MVC", $descr="Allows users to compare multiple Twitter timelines", $link="https://github.com/plantuml-stdlib/C4-PlantUML/blob/master/LayoutOptions.md")
}
System(twitter, "Twitter", $link="https://github.com/plantuml-stdlib/C4-PlantUML")

Rel(admin, web_app, "Uses", "HTTPS", $link="https://plantuml.com/link")
Rel(web_app, twitter, "Gets tweets from", "HTTPS", $link="https://plantuml.com/link")
@enduml

png itself supports no links, therefore the following image is generated as svg image. Github does not support svg links in README.md. If you click on the image a new window is opened and there you can use the links.

Click on the image that the links are working

Elements and relationships can be decorated with tags and explained via a calculated legend, for example:

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

AddElementTag("v1.0", $borderColor="#d73027")
AddElementTag("v1.1", $fontColor="#d73027")
AddElementTag("backup", $fontColor="orange")

AddRelTag("backup", $textColor="orange", $lineColor="orange", $lineStyle = DashedLine())

Person(user, "Customer", "People that need products")
Person(admin, "Administrator", "People that administrates the products via the new v1.1 components", $tags="v1.1")
Container(spa, "SPA", "angular", "The main interface that the customer interacts with via v1.0", $tags="v1.0")
Container(spaAdmin, "Admin SPA", "angular", "The administrator interface that the customer interacts with via new v1.1", $tags="v1.1")
Container(api, "API", "java", "Handles all business logic (incl. new v1.1 extensions)", $tags="v1.0+v1.1")
ContainerDb(db, "Database", "Microsoft SQL", "Holds product, order and invoice information")
Container(archive, "Archive", "Audit logging", "Stores 5 years", $tags="backup")

Rel(user, spa, "Uses", "https")
Rel(spa, api, "Uses", "https")
Rel_R(api, db, "Reads/Writes")
Rel(admin, spaAdmin, "Uses", "https")
Rel(spaAdmin, api, "Uses", "https")
Rel_L(api, archive, "Writes", "messages", $tags="backup")

SHOW_LEGEND()
@enduml

tags

Supported Diagram Types

  • arg: argument required (e.g. alias)
  • ?arg: argument optional (e.g. ?tags); an optional argument can be directly set via its keyword $arg=... (e.g. $tags="specificTag") without the other optional arguments

System Context & System Landscape diagrams

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

  • Macros:

    • Person(alias, label, ?descr, ?sprite, ?tags, ?link, ?type)
    • Person_Ext(alias, label, ?descr, ?sprite, ?tags, ?link, ?type)
    • System(alias, label, ?descr, ?sprite, ?tags, ?link, ?type, ?baseShape)
    • SystemDb(alias, label, ?descr, ?sprite, ?tags, ?link, ?type)
    • SystemQueue(alias, label, ?descr, ?sprite, ?tags, ?link, ?type)
    • System_Ext(alias, label, ?descr, ?sprite, ?tags, ?link, ?type, ?baseShape)
    • SystemDb_Ext(alias, label, ?descr, ?sprite, ?tags, ?link, ?type)
    • SystemQueue_Ext(alias, label, ?descr, ?sprite, ?tags, ?link, ?type)
    • Boundary(alias, label, ?type, ?tags, ?link)
    • Enterprise_Boundary(alias, label, ?tags, ?link)
    • System_Boundary(alias, label, ?tags, ?link)
  • Sprites:

    • person
    • person2
    • robot
    • robot2
  • C4 Model extension: Person() and System() support $type argument too. Is uses the same notation as $techn, e.g. $type="characteristic A" is displayed as [characteristic A]

Container diagram

  • Import: !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
  • Additional Macros (based on context diagram macros):
    • Container(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link, ?baseShape)
    • ContainerDb(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)
    • ContainerQueue(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)
    • Container_Ext(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link, ?baseShape)
    • ContainerDb_Ext(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)
    • ContainerQueue_Ext(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)
    • Container_Boundary(alias, label, ?tags, ?link)

Component diagram

  • Import: !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml
  • Additional Macros (based on container diagram macros):
    • Component(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link, ?baseShape)
    • ComponentDb(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)
    • ComponentQueue(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)
    • Component_Ext(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link, ?baseShape)
    • ComponentDb_Ext(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)
    • ComponentQueue_Ext(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)

Dynamic diagram

  • Import: !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Dynamic.puml

  • Additional Macros (based on component diagram macros):

    • (lowercase) increment($offset=1): increase current index (procedure which has no direct output)
    • (lowercase) setIndex($new_index): set the new index (procedure which has no direct output)
    • LastIndex(): return the last used index (function which can be used as argument)

    following 2 macros requires V1.2020.24Beta4 (can be already tested with https://www.plantuml.com/plantuml/)

    • Index($offset=1): returns current index and calculates next index (function which can be used as argument)
    • SetIndex($new_index): returns new set index and calculates next index (function which can be used as argument)
  • All relationship macros are extended with ?index= :

    All RelIndex...() calls are obsolete and can be replaced with calls like Rel($index=..., ...) or Rel(..., $index=). A full sample see samples/C4_Dynamic Diagram Sample - message bus.puml

Deployment diagram

  • Import: !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Deployment.puml
  • Additional Macros (based on container diagram macros):
    • Deployment_Node(alias, label, ?type, ?descr, ?sprite, ?tags, ?link)
    • Node(alias, label, ?type, ?descr, ?sprite, ?tags, ?link): short name of Deployment_Node()
    • Node_L(alias, label, ?type, ?descr, ?sprite, ?tags, ?link): left aligned Node()
    • Node_R(alias, label, ?type, ?descr, ?sprite, ?tags, ?link): right aligned Node()

(C4 styled) Sequence diagram

C4-PlantUML does not offer a full sequence diagram support, but existing elements and relationships can be reused as participants and calls in the corresponding styles.

!!! Contrary to all other diagrams, please define boundaries without { and } and mark a boundary end with Boundary_End() !!!

  • Import: !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Sequence.puml

  • Macros (based on component diagram macros):

    • Basically all element specific macros (Person, System, Container...) can be reused with following differences:
      • element descriptions are typically not displayed (can be activated via SHOW_ELEMENT_DESCRIPTIONS())
      • boundaries have to be defined without { and } and instead of } the Boundary_End() macro has to be called
    • Additional (element specific) Macros:
      • Boundary_End()
    • Additional Layout Options:
      • SHOW_ELEMENT_DESCRIPTIONS(?show)
      • SHOW_FOOT_BOXES(?show)
      • SHOW_INDEX(?show)
    • Only following (extended) relationship specific macros is supported:
      • Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="", $rel="")
        $index enables the definition of active/next index with e.g. the related index macros below
        $rel enables the definition of all PlantUML specific arrow types, details see e.g. All arrow types and Slanted or odd arrows
    • The index related macros (like the dynamic diagram)
      • Index($offset=1): returns current index and calculates next index (function which can be used as argument)
      • SetIndex($new_index): returns new set index and calculates next index (function which can be used as argument)
      • LastIndex(): return the last used index (function which can be used as argument)
      • (lowercase) increment($offset=1): increase current index (procedure which has no direct output)
      • (lowercase) setIndex($new_index): set the new index (procedure which has no direct output)
  • (Typically additional used) PlantUML statements:

Samples

Take a look at each of the C4 Model Diagram Samples.

Relationship Types

  • Rel(from, to, label, ?techn, ?descr, ?sprite, ?tags, ?link)
  • BiRel (bidirectional relationship)

You can force the direction of a relationship by using:

  • Rel_U, Rel_Up
  • Rel_D, Rel_Down
  • Rel_L, Rel_Left
  • Rel_R, Rel_Right

In following sample a person uses different systems, and a group of persons which have bidirectional relationships

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

Person(a, "A")
Person(b, "B")
Person(c, "C")
Person(d, "D")
Person(e, "E")

BiRel_U(a, b, "talk with")
BiRel_R(a, c, "talk with")
BiRel_D(a, d, "talk with")
BiRel_L(a, e, "talk with")

Person(x, "X")
System(s1, "S1")
System(s2, "S2")
System(s3, "S3")
System(s4, "S4")

Rel_U(x, s1, "uses")
Rel_R(x, s2, "uses")
Rel_D(x, s3, "uses")
Rel_L(x, s4, "uses")
@enduml

(unidirectional) relationship versus bidirectional relationship

Layout (arrange) elements (without relationships)

In rare cases, you can force the layout of elements which have no relationships by using:

  • Lay_U(from, to), Lay_Up(from, to)
  • Lay_D(from, to), Lay_Down(from, to)
  • Lay_L(from, to), Lay_Left(from, to)
  • Lay_R(from, to), Lay_Right(from, to)

In following sample a person uses different systems, and a group of persons which have no relationships

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

Person(a, "A")
Person(b, "B")
Person(c, "C")
Person(d, "D")
Person(e, "E")

Lay_U(a, b)
Lay_R(a, c)
Lay_D(a, d)
Lay_L(a, e)

Person(x, "X")
System(s1, "S1")
System(s2, "S2")
System(s3, "S3")
System(s4, "S4")

Rel_U(x, s1, "uses")
Rel_R(x, s2, "uses")
Rel_D(x, s3, "uses")
Rel_L(x, s4, "uses")
@enduml

Relationship versus Layout

(In combination with SHOW_FLOATING_LEGEND()) a greater distance between an element and the e.g. floating legend could be required that all e.g. corners of the drawing area can be reached.

  • Lay_Distance(from, to, ?distance): Sets the distance between from and to with down alignment (Lay_Distance(from,to,0) equals Lay_D(from, to)). The default alias of the floating legend is LEGEND().

In following sample the floating legend should be in the left bottom corner of the drawing are. (The normal SHOW_LEGEND() call requires no extra Lay_Distance() call and the legend is automatically drawn below the diagram on the right side)

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

!define DEVICONS https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/master/devicons
!define FONTAWESOME https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/master/font-awesome-5
!include DEVICONS/angular.puml
!include DEVICONS/java.puml
!include DEVICONS/msql_server.puml
!include FONTAWESOME/users.puml

Person(user, "Customer", "People that need products", $sprite="users")
Container(spa, "SPA", "angular", "The main interface that the customer interacts with", $sprite="angular")
Container(api, "API", "java", "Handles all business logic", $sprite="java")
ContainerDb(db, "Database", "Microsoft SQL", "Holds product, order and invoice information", $sprite="msql_server")

Rel(user, spa, "Uses")
Rel(spa, api, "Uses")
Rel_R(api, db, "Reads/Writes")

SHOW_FLOATING_LEGEND()
Lay_Distance(LEGEND(), db, 1)
@enduml

db below legend, 1 unit distance

Global Layout Options

C4-PlantUML also comes with some layout options to make it easy and reusable to create nice and useful diagrams:

C4-PlantUML also comes with some person sprite/portrait options:

Sprites and other images

C4-PlantUML offers predefined person and robot sprites which can be directly used:

  • person,person2
  • robot, robot2
@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml

Person(pB, "Sam", $sprite="person2")
Person_Ext(pA, "Bob", $sprite="person")

System_Ext(robB, "Robot A", $sprite="robot2")
System_Ext(robA, "Robot B", $sprite="robot")

SHOW_LEGEND()
@enduml

Predefined person and robot sprites

Additional $sprite (images) can be defined with following PlantUML supported options:

  • included (standard library) sprites via their {SpriteName}; details see sprites
  • images via img:{File or Url}
  • OpenIconic via &{OpenIconicName}; details see openiconic

Size of the displayed images can be changed with ,scale={factor}. Color of the displayed images can be changed with ,color={color}.

(If sprites are defined via $tags then the calculated legend is updated too)

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

'stdlib users.puml defines sprite "users"
!include <office/users/users.puml>


AddRelTag("plantuml", $textColor="$ARROW_FONT_COLOR", $lineColor="$ARROW_COLOR", $sprite="img:http://plantuml.com/logo3.png{scale=0.3}", $legendSprite="img:http://plantuml.com/logo3.png{scale=0.1}", $legendText="console triggered")

Person(user, "user group displayed with a sprite", $sprite="users")


Container(container, "Container with scaled and colored OpenIconic", $sprite="&folder,scale=5.0,color=gray")

System(system, "System with an image", $sprite="img:http://plantuml.com/logo3.png")

Rel(user, system, "Rel with image (via tags)", $tags="plantuml")
Rel(user, container, "Rel with OpenIconinc", $sprite="&folder")

SHOW_LEGEND()
@enduml

Sprite, image and OpenIconic

Relationship specific sprites are typically smaller and therefore following options are possible:

  • use smaller icons (like the $triangle in the following sample)
  • use an additional scale factor (direct as part of the argument, or via a variable)
  • if sprite argument starts with & an OpenIconic name can be used too (details see https://useiconic.com/open)
@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml

Person(user, "User")
Person(user1, "User 1")
Person(user2, "User 2")
Person(user3, "User 3")

System(system, "System")

' normal sprites are too big 
Rel_L(user, user2, "informs", "courier", "normal sprites are too big", $sprite="person2")

' scaled sprites are ok
Rel_R(user, user3, "informs", "courier", "scaled sprites are OK", $sprite="person2,scale=0.5")

' combine sprite and scale to a new sprite
!$combinedSprite="person2,scale=0.5"
Rel_R(user, user3, "informs", "courier", "combined sprites are OK", $sprite=$combinedSprite)

' special smaller sprites can be used
sprite $triangle {
    00000000000
    00000F00000
    0000FBF0000
    0000FBF0000
    000F999F000
    000F999F000
    00F66666F00
    00F66666F00
    0F3333333F0
    0F3333333F0
    0FFFFFFFFF0
    00000000000
}
Rel_R(user1, system, "orders", "http", "small sprites, like the small triangle", $sprite="triangle")

' if sprite starts with &, sprite defines a OpenIconic, details see https://useiconic.com/open/
Rel_D(user, user1, "requests", "async message", "if sprite starts with &, it defines a OpenIconic like &envelope-closed", $sprite = "&envelope-closed")
@enduml

Relationship with sprite or OpenIconic

Custom tags/stereotypes support and skinparam updates

Additional tags/stereotypes can be added to the existing element stereotypes (component, ...) and highlight,... specific aspects:

  • AddElementTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?sprite, ?techn, ?legendText, ?legendSprite, ?borderStyle, ?borderThickness): Introduces a new element tag. The styles of the tagged elements are updated and the tag is displayed in the calculated legend.
  • AddRelTag(tagStereo, ?textColor, ?lineColor, ?lineStyle, ?sprite, ?techn, ?legendText, ?legendSprite, ?lineThickness): Introduces a new Relationship tag. The styles of the tagged relationships are updated and the tag is displayed in the calculated legend.
  • AddBoundaryTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?type, ?legendText, ?borderStyle, ?borderThickness, ?borderStyle, ?borderThickness): Introduces a new Boundary tag. The styles of the tagged boundaries are updated and the tag is displayed in the calculated legend.
  • UpdateElementStyle(elementName, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?sprite, ?techn, ?legendText, ?legendSprite, ?borderStyle, ?borderThickness): This call updates the default style of the elements (component, ...) and creates no additional legend entry.
  • UpdateRelStyle(textColor, lineColor): This call updates the default relationship colors and creates no additional legend entry.
  • UpdateBoundaryStyle(?elementName, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?type, ?legendText, ?borderStyle, ?borderThickness): This call updates the default style of the existing boundaries and creates no additional legend entry. If the element name is "" then it updates generic, enterprise, system and container boundary style in on call.
  • RoundedBoxShape(): This call returns the name of the rounded box shape and can be used as ?shape argument.
  • EightSidedShape(): This call returns the name of the eight sided shape and can be used as ?shape argument.
  • DashedLine(): This call returns the name of the dashed line and can be used as ?lineStyle or ?borderStyle argument.
  • DottedLine(): This call returns the name of the dotted line and can be used as ?lineStyle or ?borderStyle argument.
  • BoldLine(): This call returns the name of the bold line and can be used as ?lineStyle or ?borderStyle argument.
  • SolidLine(): This call returns the name of the solid line and can be used as ?lineStyle or ?borderStyle argument (enables e.g. a reset of dashed boundaries).

Each element can be extended with one or multiple custom tags via the keyword argument $tags="...", like Container(spaAdmin, "Admin SPA", $tags="v1.1"). Multiple tags can be combined with +, like Container(api, "API", $tags="v1.0+v1.1").

Element specific tag definitions

Sometimes an added element tag is element specific and all element specific colors should be used, e.g. a specific user role should be defined as element tag with the specific colors ...PERSON_... like

AddElementTag("admin", $fontColor=$PERSON_FONT_COLOR, $bgColor=$PERSON_BG_COLOR, $borderColor=$PERSON_BORDER_COLOR, $sprite="osa_user_audit", $legendText="administration user")

Therefore element Add...Tag() shortcuts are added which use the specific colors as default values and the call can be simplified like

AddPersonTag("admin", $sprite="osa_user_audit", $legendText="administration user")

Following calls introduces new element tags with element specific default colors:

  • AddPersonTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?sprite, ?legendText, ?legendSprite, ?type, ?borderStyle, ?borderThickness)
  • AddExternalPersonTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?sprite, ?legendText, ?legendSprite, ?type, ?borderStyle, ?borderThickness)
  • AddSystemTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?sprite, ?legendText, ?legendSprite, ?type, ?borderStyle, ?borderThickness)
  • AddExternalSystemTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?sprite, ?legendText, ?legendSprite, ?type, ?borderStyle, ?borderThickness)
  • AddComponentTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?sprite, ?techn, ?legendText, ?legendSprite, ?borderStyle, ?borderThickness)
  • AddExternalComponentTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?sprite, ?techn, ?legendText, ?legendSprite, ?borderStyle, ?borderThickness)
  • AddContainerTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?sprite, ?techn, ?legendText, ?legendSprite, ?borderStyle, ?borderThickness)
  • AddExternalContainerTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?techn, ?sprite, ?legendText, ?legendSprite, ?borderStyle, ?borderThickness)
  • AddNodeTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?sprite, ?techn, ?legendText, ?legendSprite, ?borderStyle, ?borderThickness) (node specific: $type reuses $techn definition of $tags)

Boundary specific tag definitions

Like the element specific tag definitions exist boundary specific calls with their default colors and type:

  • UpdateContainerBoundaryStyle(?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?type, ?legendText, ?borderStyle, ?borderThickness)
  • UpdateSystemBoundaryStyle(?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?type, ?legendText, ?borderStyle, ?borderThickness)
  • UpdateEnterpriseBoundaryStyle(?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?type, ?legendText, ?borderStyle, ?borderThickness)

Comments

  • SHOW_LEGEND() supports the customized stereotypes
    (LAYOUT_WITH_LEGEND() cannot be used, if the custom tags/stereotypes should be displayed in the legend).

  • SHOW_LEGEND() has to be last line in diagram.

  • Don't use space between $tags and = (PlantUML does not support it).

  • Don't use , as part of the tag names (PlantUML does not support it in combination with keyword arguments).

  • If 2 tags define the same skinparam, the first definition is used.

  • If specific skinparams have to be merged (e.g. 2 tags change the font color) an additional combined tag has to be defined. Use & as part of combined tag names.

  • Automatically merging colors of relationship tags is not supported in PlantUML before v.1.2022
    If an older version is used and one tag modifies the line color and the other the text color, an additional combined tag has to be defined and used.

Sample with different tag combinations

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

UpdateElementStyle(person, $fontColor="green")
AddElementTag("v1.0", $fontColor="#d73027", $borderColor="#d73027")
AddElementTag("v1.1", $fontColor="#ffffbf", $borderColor="#ffffbf")
AddElementTag("v1.0&v1.1", $fontColor="#fdae61", $borderColor="#fdae61")
AddElementTag("fallback", $bgColor="#444444")

' If spaces are requested in the legend, legend text with space has to be defined (incl. all other additional details)
AddElementTag("microService", $shape=EightSidedShape(), $legendText="micro service (eight sided) (no text, no back color)")
' If no special tag names should be displayed in legend, no explicit legend text definition is required (all additional details are automatically calculated) 
AddElementTag("storage", $shape=RoundedBoxShape())

UpdateRelStyle(black, black)
AddRelTag("service1", $textColor="red")
AddRelTag("service2", $lineColor="red")
AddRelTag("service1&service2", $textColor="red", $lineColor="red")

Container(spa, "SPA", "angular", "The main interface that the customer interacts with via v1.0", $tags="v1.0")
Container(spaAdmin, "Admin SPA", "angular", "The administrator interface that the customer interacts with via new v1.1", $tags="v1.1")
Container(api, "API", "java", "Handles all business logic (incl. new v1.1 extensions)", $tags="v1.0&v1.1+v1.0+v1.1")
Container(spa2, "SPA2", "angular", "The main interface that the customer interacts with via v1.0", $tags="v1.0+fallback")
Container(spaAdmin2, "Admin SPA2", "angular", "The administrator interface that the customer interacts with via new v1.1", $tags="fallback+v1.1")

Container(services, "Services", "techn", $tags="microService")
Container(fileStorage, "File storage", "techn", $tags="storage")

Rel(spa, api, "Uses", "https")
Rel(spaAdmin, api, "Uses", "https")
Rel_L(spa, spa2, "Updates", "https")
Rel_R(spaAdmin, spaAdmin2, "Updates", "https")

Rel_D(api, services, "uses service1 via this call", $tags="service1")
Rel_D(api, services, "uses service2 via this call", $tags="service2")
Rel_D(services, fileStorage, "both services stores via this call", $tags="service1&service2+service1+service2")

SHOW_LEGEND(false)
@enduml

merged tags

Sample with tag dependent sprites and custom legend text

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

!define osaPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-opensecurityarchitecture2-icons/master
!include osaPuml/Common.puml
!include osaPuml/User/all.puml

!include <office/Servers/database_server>
!include <office/Servers/file_server>
!include <office/Servers/application_server>
!include <office/Concepts/service_application>
!include <office/Concepts/firewall>

AddExternalPersonTag("anonymous_ext", $sprite="osa_user_black_hat", $legendText="anonymous user")
AddPersonTag("customer", $sprite="osa_user_large_group", $legendText="aggregated user")
AddPersonTag("admin", $sprite="osa_user_audit,color=red", $legendSprite="osa_user_audit,scale=0.25,color=red", $legendText="administration user")

AddContainerTag("webApp", $sprite="application_server", $legendText="web app container")
AddContainerTag("db", $sprite="database_server", $legendText="database container")
AddContainerTag("files", $sprite="file_server", $legendText="file server container")
AddContainerTag("conApp", $sprite="service_application", $legendText="console app container")

AddRelTag("firewall", $textColor="$ARROW_FONT_COLOR", $lineColor="$ARROW_COLOR", $sprite="firewall,scale=0.3,color=red", $legendText="firewall")

Person_Ext(anonymous_user, "Bob", $tags="anonymous_ext")
Person(aggregated_user, "Sam, Ivone", $tags="customer")
Person(administration_user, "Bernd", $tags="admin")

System_Boundary(c1, "techtribes.js"){
    Container(web_app, "Web Application", "Java, Spring MVC, Tomcat 7.x", $tags="webApp")
    ContainerDb(rel_db, "Relational Database", "MySQL 5.5.x", $tags="db")
    Container(filesystem, "File System", "FAT32", $tags="files")
    ContainerDb(nosql, "NoSQL Data Store", "MongoDB 2.2.x", $tags="db")
    Container(updater, "Updater", "Java 7 Console App", $tags="conApp")
}

Rel(anonymous_user, web_app, "Uses", "HTTPS", $tags="firewall")
Rel(aggregated_user, web_app, "Uses", "HTTPS", $tags="firewall")
Rel(administration_user, web_app, "Uses", "HTTPS", $tags="firewall")

Rel(web_app, rel_db, "Reads from and writes to", "SQL/JDBC, port 3306")
Rel(web_app, filesystem, "Reads from")
Rel(web_app, nosql, "Reads from", "MongoDB wire protocol, port 27017")

Rel_U(updater, rel_db, "Reads from and writes data to", "SQL/JDBC, port 3306")
Rel_U(updater, filesystem, "Writes to")
Rel_U(updater, nosql, "Reads from and writes to", "MongoDB wire protocol, port 27017")

Lay_R(rel_db, filesystem)

SHOW_LEGEND()
@enduml

tags with sprites and custom legend

Sample with different boundary tag combinations

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

' Update the generic boundary style and the "system", "enterprise", "container" boundaries styles too
UpdateBoundaryStyle($bgColor="gold", $fontColor="brown", $borderColor="brown")
' (Re-)Updates the system boundary styles; re-set $bgColor avoids '(no back color)' in legend too
UpdateSystemBoundaryStyle($bgColor="gold", $fontColor="white", $borderColor="white")

Boundary(b, "A Boundary") {
}

Container_Boundary(cb, "A Container Boundary") {
}

System_Boundary(sb, "A System Boundary") {
}

' defines a new border style incl. new border type
AddBoundaryTag("repository", $bgColor="green", $fontColor="white", $borderColor="white", $shadowing="true", $shape = RoundedBoxShape(), $type="GitHub repository")

Boundary(c4Respository, "plantuml-stdlib/C4-PlantUML", $tags="repository") {
  Component(readMe, "README.md", "Markdown")
}

' boundary tags are internally extended with '_boundary' that it uses a different name space
' this enables different element and boundary styles for the same tag name
AddBoundaryTag("v1", $bgColor="lightgreen", $fontColor="green", $borderColor="green")
AddElementTag("v1", $bgColor="lightred", $fontColor="red", $borderColor="red")

Boundary(anotherBoundary, "Another Boundary", $type="BOUNDARY TYPE", $tags="v1") {
  Component(anotherComponent, "Another Component", $techn="COMPONENT TYPE", $tags="v1", $descr="Component and boundary use different tag name spaces that both v1 tags can use different styles")
}

Lay_R(b, cb)
Lay_R(cb, sb)

Lay_D(b, c4Respository)

Lay_R(c4Respository, anotherBoundary)

SHOW_LEGEND()
@enduml

custom border tags

Custom schema definitions (via UpdateElementStyle())

Via UpdateElementStyle() calls, it is possible to change the default colors, sprites, legend text, tags, ... It automatically updates the legend too.
If the corresponding section is stored in a separate file then it can be reused as default of all diagrams.

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

' <<<<< this section could be stored in a separate file and reused in all other diagrams too
' it defines new default colors, different default sprites and legend 
!$COLOR_A_5 = "#7f3b08"
!$COLOR_A_4 = "#b35806"
!$COLOR_A_3 = "#e08214"
!$COLOR_A_2 = "#fdb863"
!$COLOR_A_1 = "#fee0b6"
!$COLOR_NEUTRAL = "#f7f7f7"
!$COLOR_B_1 = "#d8daeb"
!$COLOR_B_2 = "#b2abd2"
!$COLOR_B_3 = "#8073ac"
!$COLOR_B_4 = "#542788"
!$COLOR_B_5 = "#2d004b"
!$COLOR_REL_LINE = "#8073ac"
!$COLOR_REL_TEXT = "#8073ac"

UpdateElementStyle("person", $bgColor=$COLOR_A_5, $fontColor=$COLOR_NEUTRAL, $borderColor=$COLOR_A_1, $shadowing="true", $legendText="Internal user")
UpdateElementStyle("external_person", $bgColor=$COLOR_B_5, $fontColor=$COLOR_NEUTRAL, $borderColor=$COLOR_B_1, $legendText="External user")
UpdateElementStyle("system", $bgColor=$COLOR_A_4, $fontColor=$COLOR_NEUTRAL, $borderColor=$COLOR_A_2, $sprite="robot", $legendText="Our chatbot based system")
UpdateElementStyle("external_system", $bgColor=$COLOR_B_4, $fontColor=$COLOR_NEUTRAL, $borderColor=$COLOR_B_2, $legendText="External system")
UpdateRelStyle($lineColor=$COLOR_REL_LINE, $textColor=$COLOR_REL_TEXT)
' >>>>> end of section

Person(customer, "Personal Banking Customer")
System(banking_system, "Internet Banking System")

System_Ext(mail_system, "E-mail system")
System_Ext(mainframe, "Mainframe Banking System")

Rel(customer, banking_system, "Uses")
Rel_Back(customer, mail_system, "Sends e-mails to")
Rel_Neighbor(banking_system, mail_system, "Sends e-mails")
Rel(banking_system, mainframe, "Uses")

SHOW_LEGEND()
@enduml

custom schema

Element and Relationship properties

A model can be extended with (a table of) properties that concrete deployments or more detailed concepts can be documented:

  • SetPropertyHeader(col1Name, col2Name, ?col3Name, ?col4Name) The properties table can have up to 4 columns. The default header uses the column names "Name", "Description".
  • WithoutPropertyHeader() If no header is used, then the second column is bold.
  • AddProperty(col1, col2, ?col3, ?col4) (All columns of) a property which will be added to the next element.

Following sample uses all 3 different property definitions (and the aligned deployment node).

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

' default header Property, Value
AddProperty("Name", "Flash")
AddProperty("Organization", "Zootopia")
AddProperty("Tool", "Internet Explorer 7.0")
Person(personAlias, "Label", "Optional Description (with default property header)")

SetPropertyHeader("Property","Value", "Description")
AddProperty("Prop1", "Value1", "Details1")
AddProperty("Prop2", "Value2", "Details2")
Deployment_Node_L(nodeAlias, "Label", "Optional Type", "Optional Description (with custom property header)") {

  WithoutPropertyHeader()
  AddProperty("PropC1", "ValueC1")
  AddProperty("PropC2", "ValueC2")
  Container(containerAlias, "Label", "Technology", "Optional Description (without property header)")
}

System(systemAlias, "Label", "Optional Description (without properties)")

' starting with v.2.5.0 relationships support properties too
WithoutPropertyHeader()
AddProperty("PropC1", "ValueC1")
AddProperty("PropC2", "ValueC2")
Rel(personAlias, containerAlias, "Label", "Optional Technology", "Optional Description")
@enduml

properties sample

Version information

C4-PlantUML offers version information like PlantUML with its %version() call.

  • C4Version(): Current C4-PlantUML version (e.g. 2.4.0beta1).
  • C4VersionDetails(): (Floating) version details with the current PlantUML and C4-PlantUML version. (It can be referenced via the alias C4VersionDetailsArea.)
@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml

' existing plantuml version as text
%version()

' new C4-Plantuml version as text 
C4Version()

' new C4-Plantuml version details (incl. PlantUML version) as table
C4VersionDetails()

' version functions used in e.g. footer
footer drawn with PlantUML v. %version() and C4-PlantUML v. C4Version()
@enduml

version sample

Snippets for Visual Studio Code

Because the PlantUML support inside of Visual Studio Code is excellent with the PlantUML extension, you can also find VS Code snippets for C4-PlantUML at .vscode/C4.code-snippets.

Project level snippets are now supported in VSCode 1.28. Just include the C4.code-snippets file in the .vscode folder of your project.

It is possible to save them directly inside VS Code: Creating your own snippets.

C4-PlantUML Snippets Video

Live Templates for IntelliJ

Prerequisites

Graphviz download
PlantUML Integration

Install

  1. Download IntelliJ live template.
  2. Select File | Manage IDE Settings | Import Settings from the IntelliJ IDEA menu.
  3. Specify the path to the downloaded ZIP file: c4_live_template.zip.
  4. In the Import Settings dialog, select the Live templates checkbox and click OK.
  5. Restart IntelliJ.

Usage

  • Create new PlantUML file (.puml).
  • Type c4_ for displaying artifacts templates for C4-PlantUML
  • Live template create correct C4 model artifact with stubbed arguments.
    • E.g. alias, label, type, technology, description
  • Replace stubbed arguments with desired values.

C4-PlantUML Snippets Video C4-PlantUML Snippets Video

Advanced Samples

The following advanced samples are reproductions with C4-PlantUML from official C4 model samples created by Simon Brown.

The core diagram samples from c4model.com are available here.

techtribes.js

Source: C4_Container Diagram Sample - techtribesjs.puml

techtribesjs

Message Bus and Microservices

Source: C4_Container Diagram Sample - message bus.puml

messagebus

(C4 styled) Sequence diagram

TODO: better sample is missing ...

Source: C4_Sequence Diagram Sample - complex.puml

sequence

Background

PlantUML is an open source project that allows you to create UML diagrams. Diagrams are defined using a simple and intuitive language. 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.

The C4 model 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. C4 stands for context, containers, components, and code — a set of hierarchical diagrams that you can use to describe your software architecture at different zoom levels, each useful for different audiences.

The C4 model was created as a way to help software development teams describe and communicate software architecture, both during up-front design sessions and when retrospectively documenting an existing codebase.

More information can be found here:

License

This project is licensed under the MIT License - see the LICENSE file for details

c4-plantuml's People

Contributors

adrianvlupu avatar bricker avatar coldacid avatar coryodaniel avatar darwinjs avatar deining avatar freakin avatar hkdobrev avatar iecg avatar iorlandoni avatar justinbritt avatar kirchsth avatar leilapearson avatar marcogario avatar mgrolinger avatar nagelp-bosch avatar naveenraju9 avatar netrounds-fredrik avatar oatkiller avatar patrickp-at-work avatar pniewiejski avatar potherca avatar qrilka avatar rcelebrone avatar ricardoniepel avatar stawirej avatar torrespro avatar valgard avatar vipinthomasvertexinc avatar ysholomii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

c4-plantuml's Issues

Add missing layout in C4_Deployment Diagram Sample - bigbankplc.puml

@adrianvlupu thank you that you merged my dynamic and deployment extension into stdlib.

In the "C4_Deployment Diagram Sample - bigbankplc.puml" I would (re)add

  • the directed relations
Rel(mobile, api, "Makes API calls to", "json/HTTPS")
Rel(spa, api, "Makes API calls to", "json/HTTPS")
Rel_U(web, spa, "Delivers to the customer's web browser")
Rel(api, db, "Reads from and writes to", "JDBC")
Rel(api, db2, "Reads from and writes to", "JDBC")
Rel_R(db, db2, "Replicates data to")
  • add the linebreak in the node tech (I fixed itsize:$TECHN_FONT_SIZE)
Deployment_Node(comp, "Customer's computer", "Mircosoft Windows of Apple macOS"){
    Deployment_Node(browser, "Web Browser", "Google Chrome, Mozilla </size>\n<size:$TECHN_FONT_SIZE>Firefox, Apple Safari or </size>\n<size:$TECHN_FONT_SIZE>Microsoft Edge"){
        Container(spa, "Single Page Application", "JavaScript and Angular", "Provides all of the Internet Banking functionality to customers via their web browser.")
    }
}

And in the "README" I would

  • add "$index" as dynamic macro

Should I do it?

Best regards
Helmut

Microservice container

Thanks for the great work. I would like to use hexagon for microservice container instead of rectangle. Where should I add this additional container type?

Custom images

> package "Other Groups" {
> FTP - [Second Component]
> note left
>  You can use images
> <img:D:\TensorBoard\DB2-Setup.jpg{scale=0.3}>
> end note
> [First Component] --> FTP
> }

This code works if I don't use the C4 plugin.
This also works with the C4 plugin if I don't use the img tag.

System Boudary Add labels in corners

Hello, good afternoon.

Is there an option to add text or labels in the corners of the System_Boundary at the same time?

as the following example:

System_Boundary(c1, "DeskTop PC", "Wintel","Windows 10","Browser\nChrome or IE"){

}
and get something like the following picture

System_Boundary

Thanks a lot
Domingo Tapia

Overlapping labels

For a couple of my containers A and B, adding two relationships between them (one for each direction) caused the label text to overlap. This didn't happen when the same thing was done on some other containers within my diagram. I assume this is a graphviz thing... Is there a suggested remedy for this kind of thing?

Agree on review / merge guidelines

As MRs are being opened and work commenses, I thought it might be good idea to address the topic of whom is "allowed" to merge. (As this is actionable, I created an Issue, rather than a Discussion)

I've seen this become a bottleneck in other projects caused by bystander apathy.

As we want to help @RicardoNiepel by taking over some of the load, my proposed guidelines are:

  1. Add the most active developers for a review (Currently @adrianvlupu, @aheil, @IOrlandoni, and @RicardoNiepel)
  2. When an MR has X approvals from those developers it can be merged.
  3. The author of the MR should merge their own MR (in case of conflicts they will be best suited to resolve things), unless someone else is waiting for the work from that MR.
  4. Don't worry about things too much. A merge to master is not the same as a release.
    There is always time to correct (or undo) anything that goes in the wrong direction.
    Better to keep moving forward than to have to wait for everyones approval.

I know all of this is implicitly more or less the way of doing things but I think it would be good to make it Explicit.

So what do you say? Agree/Disagree? Suggestions for improvement?

Tasks

Still supported?

Hi,

I really love using this library to create C4 models of my applications. But I can't help noticing that the development has stopped. Even simple pull requests with typos aren't merged.

If this library isn't in development anymore, I will need to search for an alternative for future projects.

File not found error for C4_*.puml in !include on local server

I've opened an issue at the PlantUML-Server project:
plantuml/plantuml-server#143

The summary is that the server can't find the puml files I copied from your repo to the root of the server repo and restarted the server, but I get the file not found error for "!include C4_Context.puml" for example.

I need to know where to place those files so that I can use the local !include directives instead of the remote !includeurl paths.

Thanks,
Ajit

No issue just a Thank You

I stumbled on this because of a link from https://kroki.io/

You are doing stuff with PlantUML that I had no idea was possible despite me spending a lot of time looking at the docs. I have been using PlantUML in my tech documents for a year or so and I love it but you are bringing some stuff in the includes to a whole other level.

Thank you!!!!

decouple "hide stereotype" from "LAYOUT_WITH_LEGEND()", make an own macro

If I don't want a legend I get automatically the stereotypes in the diagrams.
Wouldn't it be better if the stereotypes could be activated/deactivated in a separate call (too)?
like e.g. STEREOTYPE_HIDE() and STEREOTYPE_SHOW()?

@startuml
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Component.puml
Container(alias, "label", "technology")
@enduml

with stereotype

@startuml
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Component.puml
LAYOUT_WITH_LEGEND()
Container(alias, "label", "technology")
@enduml

without stereotype

White space issues

I have recently started using C4-PlantUML, but I have been disapointed with a few things that tend to keep on happending. When there are multiple external systems in place the diagram tends to get "wider" causing a very funky layout.
image

Here the code for this diagram is:

@startuml C4_Elements
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Container.puml

skinparam linetype ortho

Person(OrbitShareUser, "Orbit-Share User", "A User of the Orbit-Share web solution, with a personal UNI-Login Account")

System_Boundary(WebSolution, "Orbit-Share Web Solution"){
Container(SPA, "Single-Page-Application", "Container: Angular", "Client containing all of the websites UI functionality for teachers using their preferenced web browser")
Container(DeployedPage, "Deployed Web Server", "Container:Node.js, Express.js & Heroku CLI", "Deployed webserver")
Container(API, "REST API", "Container:Node.js & Express.js", "Allows users to access and share teaching resources")
ContainerDb(collectionDB, "Orbit-Share-Database", "Containts User, Content and Collection data into their respective collections")
}
System_Ext(UserDevice, "User's Device", "Stores the exported teaching resource(s) to the users device")
System_Ext(UniLogin, "UNI-Login Management System", "Optional Description")
System_Ext(OrbitBox, "ORBIT-Box", "A System that contains the sensors and actuators necessary to conduct a lessons experiments, can contain and view the teaching resource")


Rel(OrbitShareUser, DeployedPage, "Visits orbitshare.com", "HTTPS")
Rel(DeployedPage, SPA, "Delivers to user's browser")

Rel(SPA, API, "Makes API calls to", "HTTP")

Rel(API, collectionDB, "Reads from and writes to")
Rel(API, UserDevice, "Downloads teaching resource to")
Rel(API, UniLogin, "Authenticates user login using","SAML")
Rel(API, OrbitBox, "Exports Orbit-Box Files to")

@enduml

Is there any way to fix this issue with the commands that are already in place or is this a bug? I have tried using the layout options, but it was to no avail. Hope someone can help me out!

Deployment diagrams support

As an infrastructure architect
I want to be apple to skin plantuml diagrams as C4 deployment diagrams
So that I'll get all my diagrams with the same look and feel

Font related error previewing in VSC

Hi,

Firstly, thanks for this repo, it's helped me get up and running quite quickly.

I have everything functioning for previews in VSC except I am seeing a red exclamation mark appear above my renders complaining about a font and what looks to be a security violation.

Error found in diagram Fabric Statements Rendering in CCM
2020-03-17 12:43:45.429 java[81535:1647976] CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-03-17 12:43:45.429 java[81535:1647976] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
2020-03-17 12:43:45.430 java[81535:1647976] CoreText note: Client requested name ".SFNS-Bold", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-03-17 12:43:45.430 java[81535:1647976] CoreText note: Client requested name ".SFNSMono-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-03-17 12:43:45.434 java[81535:1647976] CoreText note: Client requested name ".SFNSMono-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-03-17 12:43:45.434 java[81535:1647976] CoreText note: Client requested name ".SFNSMono-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-03-17 12:43:45.434 java[81535:1647976] CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-03-17 12:43:45.434 java[81535:1647976] CoreText note: Client requested name ".SFNS-Bold", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sourceforge.plantuml.svg.SvgGraphics (file:/Users/faizn/.vscode/extensions/jebbs.plantuml-2.13.6/plantuml.jar) to constructor com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl()
WARNING: Please consider reporting this to the maintainers of net.sourceforge.plantuml.svg.SvgGraphics
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

I can work around this but I'm mentioning it in case it became a problem in future versions of the background software.

I've googled 'CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].' and quite a few projects are running into it.

https://www.google.com/search?q=CoreText+note%3A+Client+requested+name+%22.SFNS-Regular%22%2C+it+will+get+Times-Roman+rather+than+the+intended+font.+All+system+UI+font+access+should+be+through+proper+APIs+such+as+CTFontCreateUIFontForLanguage()+or+%2B%5BNSFont+systemFontOfSize%3A%5D.&oq=CoreText+note%3A+Client+requested+name+%22.SFNS-Regular%22%2C+it+will+get+Times-Roman+rather+than+the+intended+font.+All+system+UI+font+access+should+be+through+proper+APIs+such+as+CTFontCreateUIFontForLanguage()+or+%2B%5BNSFont+systemFontOfSize%3A%5D.&aqs=chrome..69i57.187j0j7&sourceid=chrome&ie=UTF-8

Shapes for boxes

Users don't look like users and databases don't look like databases.

Call JavaScript Functions instead of Links (URL)

Hello, there is some way to call a JavaScript function instead of a URL, for example:

I want to call the profiledetail function of javascrip:

actor "This is [[javascript:profiledetail('/Architecture/PlantArchitectureDiagram?handler=DetailSystem','tibco_icc') Operator]] profile" as Operator

Instead of

actor "This is [[http://plantuml.com/sequence Operator]] profile" as Operator

thank you so much for your support.
DTapia

Choice list VS Code snippet

In a bid to help manage the proliferation of system names used in our C4 plantuml scripts, I was experimenting with using choice lists in the VS Code snippet..

It works well.. but keen to explore whether it is possible for the choice values can be externalised.

"C4_System_ANZx": {
"scope": "diagram",
"prefix": "System for ANZx",
"body": [
"System(${1|cap,ctm,ocv,fabric,zafin|}, {\$get_label($1)))",
"$0"
],
"description": "Add System to C4 diagram"
},

Rel between entities with children

When using Rel to connect two higher level entities (e.g. System) both having children (e.g. Container), the rendered image will display the following: "===label", instead of the formatted label.

Example:

@startuml
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Component.puml

System(A, "systemA") {
    Container(B,"containerB","B")
}
System(C, "systemC") {
    Container(D,"containerD","D")
}
'This is wrong:
Rel(A,C,"AC")

'These are all OK:
'Rel(A,B,"AB")
'Rel(A,D,"AD")
'Rel(B,C,"BC")
'Rel(B,D,"BD")
'Rel(C,D,"CD")
@enduml

Tier Application Architecture

Hello, is it possible to generate Tier Application Architecture?, for example in FrontEnd, MiddleWare and BackEnd.

as in the following yellow image

C4Grouping

Update in plantuml-stdlib, request to tag version

Hi! I'm in the process of opening MRs in plantuml-stdlib. It looks like changes have been made since the *.puml files were last updated in plantuml-stdlib, but since there is no versioning available in this repo, it's not something I can easily automate.

Would it be possible to add git tags to this project?

XML size appearing with context

Example

@startuml Container Diagram
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Container.puml

Container(c, "My Container", "Application", "Does stuff and things.")

@enduml

Result renders with <size:TECHN_FONT_SIZE>[Application]</size> in the place Application should have been rendered.

I am running the docker plantuml/plantuml-server:jetty image server.

This only started happening recently. I know it was working two weeks ago.

[Question] Is there an option to align some components to increase readability?

I have diagram like this:
initial

I want to add arrows between components in section A. I want to end up with something like this:
expected

Currently I get this:
actual

This approach downgrade readability. Can I align somehow all components in section A?

Source codes
without internal connection:

@startuml
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Container.puml

LAYOUT_LEFT_RIGHT

Person(person, "Person")

Enterprise_Boundary(a, "A") {
    System(system_a_1, "System A1")
    System(system_a_2, "System A2")
    System(system_a_3, "System A3")
}
Enterprise_Boundary(b, "B") {
    System(system_b_1, "System B1")
    System(system_b_2, "System B2")
}

Rel(person, system_a_3, " ")

Rel(person, system_a_2, " ")

Rel(system_a_2, system_b_2, " ")
Rel(system_a_1, system_b_1, " ")
Rel(system_b_1, system_a_1, " ")

Rel(system_a_3, system_b_1, " ")
@enduml

with internal connection:

@startuml C1 System context diagram
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Container.puml

LAYOUT_LEFT_RIGHT

Person(person, "Person")

Enterprise_Boundary(a, "A") {
    System(system_a_1, "System A1")
    System(system_a_2, "System A2")
    System(system_a_3, "System A3")
}
Enterprise_Boundary(b, "B") {
    System(system_b_1, "System B1")
    System(system_b_2, "System B2")
}

Rel(person, system_a_3, " ")

Rel(person, system_a_2, " ")

Rel(system_a_2, system_b_2, " ")
Rel(system_a_1, system_b_1, " ")
Rel(system_b_1, system_a_1, " ")

Rel(system_a_3, system_b_1, " ")

Rel(system_a_1, system_a_2, " ")
Rel(system_a_2, system_a_1, " ")
@enduml

Getting started is not clear enough

At the top of your C4 PlantUML .puml file

What need to be done, to understand Getting Started section? I have no idea, what is your C4 PlantUML .puml file)

I could create it and fill it with example code, but the next question is: how to transpile .puml file to .svg file?

syntax error with LAYOUT_WITH_LEGEND and LAYOUT_AS_SKETCH

I am using PlantUML extension in Visual Studio Code.

Seems to work fine until i try the Layout with legend or layout as sketch.

This specific test is with the C4_Context.puml file. I get the error with all files though.

I get a syntax error in the preview window:

...
.. (skipping 85 lines)
...

skinparam database<<external_system>> {
StereotypeFontColor #FFFFFF
FontColor #FFFFFF
BackgroundColor #999999
BorderColor #8A8A8A
}

Turns out that text is just prior to the macro definition for the LAYOUT_WITH_LEGEND. So something is not right with the macro, or the plantUML extension maybe has a bug with multi line macros?

Plantuml syntax error

Hi,

I would like to use your C4 model for plantuml but it doesn't work for the types System and Enterprise_Boundary. The error is an syntax error in plantuml. I also tried your samples, but the same behavior. If i try to use include instead of includeurl, i get an error, that the referenced file is not there.

What do you need to reproduce the issue?

Regards Constantin

Layout issues (again)

I have been trying to use Rel_U, Rel_L, Rel_D, Rel_R to get a better layout, but it is simply too difficult to use this on a larger project with little to no reference on what the different relations do. This is the code right now:

@startuml C4_Elements
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Component.puml

' skinparam linetype ortho
skinparam minClassWidth 200

LAYOUT_TOP_DOWN


Container(SPA, "Single-Page-Application","Container: TypeScript and Angular", "A User of the Orbit-Share web solution, with a personal UNI-Login Account")


System_Boundary(AngularApp, "Angular Application"){
Component(FieldErrors, "FieldErrors Component", "Component: Angular Component", "Contains functionality to view")
Component(Home, "Home Component", "Component: Angular Component", "Contains a list of all uploaded content and collections, reused to show search results")
Component(Profile, "Profile Component", "Component: Angular Component", "A users profile containing a list of all content and collections they have uploaded and profile management")
Component(Support, "Support Component", "Component: Angular Component", "Support Page component containing a template and no other functionality")
Component(Toolbar, "Toolbar Component", "Component: Angular Component", "Toolbar containing features for navigation, search and logout")
Component(Welcome, "Welcome Component", "Component: Angular Component", "Component containing welcome page template")
Component(AuthenticationModule, "Auth Module", "Component: Angular Module", "Module which contains all components referring to authentication and authorization")
Component(Login, "Login Component", "Component: Angular Component", "Login functionality and layout")
Component(Register, "Register Component", "Component: Angular Component", "Registration functionality and layout")
Component(ContentModule, "Content Module", "Component: Angular Module", "Module which contains all components referring to content")
Component(CreateContent, "Create Content Component", "Component: Angular Component", "Component for uploading a single item")
Component(ViewContent, "View Content Component", "Component: Angular Component", "Component for viewing content uploaded to the platform")
Component(CollectionModule, "Collection Module", "Component: Angular Module", "Module which contains all components referring to Collections")
Component(CreateCollection, "Create Collection Component", "Component: Angular Component", "Component for uploading multiple items at once")
Component(SocialModule, "Social Module", "Component: Angular Component", "Module which contains all components referring to Social aspects")
Component(Comments, "Comments Component", "Component: Angular Component", "Gives the user the ability to comment on content")
Component(AuthenticationService, "Authentication Service", "Component: Angular Service", "Authenticates and Authorizes Users")
Component(CommentsService, "Comments Service", "Component: Angular Service", "Authenticates and Authorizes Users")
Component(ErrorService, "Error Service", "Component: Angular Service", "Creates Error messages for other services")
Component(ViewContentService, "Content Viewing Service", "Component: Angular Service", "Accesses endpoints to fetch content data")
Component(CreateContentService, "Content Creation Service", "Component: Angular Service", "Accesses endpoints to POST uploaded form data to server")
Component(CreateCollectionService, "Collection Creation Service", "Component: Angular Service", "Accesses endpoints to POST uploaded Collections to server")
Component(HomeService, "Home Service", "Component: Angular Service", "GET's all collection and content text data")
Component(ProfileService, "Profile Service", "Component: Angular Service", "GET's the currently logged in user's username, content and collection")
}

Container(Server, "REST API", "Container:Node.js & Express.js", "Expres.js webserver containing a RESTful API")

Rel(SPA, FieldErrors, "Shows validation errors using")
Rel(SPA, Home, "Upon authentication shows")
Rel(SPA, Toolbar, "Shows on all authorized pages")
Rel(SPA, Support, "Shows on support button press")
Rel(SPA, Welcome, "Start page routes to")
Rel(SPA, Login, "Logs in using")
Rel(SPA, Profile, "Uses have a")
Rel(SPA, Register, "Registers users with")
Rel(SPA, CreateContent, "Creates content with")
Rel(Home, ViewContent, "Views content with")
Rel(ViewContent, ContentModule, "Is Part of")
Rel(CreateContent, ContentModule, "Is Part of")
Rel(SPA, CreateCollection, "Creates content with")
Rel(SPA, CollectionModule, "Creates content with")
Rel(ViewContent, Comments, "Contains")
Rel(Comments, SocialModule, "Is Part of")
Rel(Login, AuthenticationModule, "Is Part of")
Rel(Register, AuthenticationModule, "Is Part of")
Rel(Register, AuthenticationModule, "Is Part of")
Rel(Login, AuthenticationService, "Authenticates using")
Rel(Register, AuthenticationService, "Authenticates using")
Rel(AuthenticationService, ErrorService, "Logs errors using")
Rel(Comments, CommentsService, "GET's and POST's using")
Rel(CreateContent, CreateContentService, "POST's using")
Rel(ViewContent, ViewContentService, "POST's using")
Rel(CreateCollection, CreateCollectionService, "POST's using")
Rel(Home, HomeService, "Gets content and collections using")
Rel(Profile, ProfileService, "Gets all information about users from")
Rel(CommentsService, ErrorService, "Logs errors using")
Rel(CreateContentService, ErrorService, "Logs errors using")
Rel(ViewContentService, ErrorService, "Logs errors using")
Rel(CreateCollectionService, ErrorService, "Logs errors using")
Rel(ProfileService, ErrorService, "Logs errors using")
Rel(HomeService, ErrorService, "Logs errors using")
Rel(AuthenticationService, Server, "Accesses endpoints")
Rel(CommentsService, Server, "Accesses endpoints")
Rel(CreateContentService, Server, "Accesses endpoints")
Rel(ViewContentService, Server, "Accesses endpoints")
Rel(CreateCollectionService, Server, "Accesses endpoints")
Rel(HomeService, Server, "Accesses endpoints")
@enduml

And this produces the following:
image

This is completely unreadable, is there nothing you can do to fix a diagram like this. Another thing is that when converting to LaTeX none of the items are centered anymore. Hope someone can clarify once again.

Direct linetype

Hi!

Currently, 2 types of relationships are supported (skinparam linetype):

  • Standard (when elements are loosely connected and arrows (skinparam linetype disabled))
    -ortho (when the bend angles of the arrows are at right angles (skinparam linetype ortho))

Is it possible to establish a “direct” connection style when each element is connected and the arrows do not bend?

Add custom stereotypes

I would like to add custom stereotypes to Container(...) but the current syntax don't allow that.

My precise use case is two-fold : I have deployment diagrams built with Structurizr-plantuml and I would like to highlight

  1. Containers defined in architecture diagram but not deployed (<missing> containers)
  2. Container version (and the match of this version with the one defined in architecture)

How can I do that if I can't put a stereotype and have a custom rendering done with skinParam ?

Future of C4-PlantUML

Hi community,

first of all, big thanks to all of you constantly pushing me.
For private and professional reasons I could not find enough love for this project in the last two years.
I apologize for this!

I propose the following changes / next steps:

  • adding two additional contributors to the project
  • choosing (and aligning with the owner - should in my view one of the contribs above) one fork and merging everything back
  • add the usage of GitHub Actions for creating the samples and verifying the lib
  • updating C4-PlantUML in the PlantUML Standard Library
  • after that also applying the same to https://github.com/RicardoNiepel/Azure-PlantUML/

Anything I forgot?
And most important:

  • Which is the most used / future ready fork and would love to be also a contributor?
  • Who wants to be one of the additional contributors?
    (I would really love to have somone here who is using it every week and thus has an ongoing interest of it)

@adrianvlupu, @fineconstant, @IOrlandoni, @stawirej, @xmobe, @Potherca, @aheil

LAYOUT_WITH_LEGEND Syntax Error?

Снимок экрана 2019-10-28 в 15 07 42

I use PlantUML extension for VSCode. Most of the examples from readme not working because of LAYOUT_WITH_LEGEND. After removing it I have additional captions in blocks:

Снимок экрана 2019-10-28 в 15 09 34

How to remove these «component/container» captions?

PlantUML Stuck With No Responding

Hi Richardo,

I was trying to use C4-PlantUML to render a C4 diagram, but the application is stuck there, and the log like below:

java -jar plantuml.jar /Users/x/Documents/MyTechDocs/C4PumlTest.puml -v 
(0.000 - 245 Mo) 237 Mo - PlantUML Version 1.2019.03 
(0.013 - 245 Mo) 237 Mo - GraphicsEnvironment.isHeadless() false 
(0.013 - 245 Mo) 237 Mo - Forcing resource load on OpenJdk 
(1.254 - 245 Mo) 236 Mo - Found 1 files 
(1.254 - 245 Mo) 236 Mo - Working on /Users/x/Documents/MyTechDocs/C4PumlTest.puml 
(1.265 - 245 Mo) 236 Mo - Setting current dir: . 
(1.265 - 245 Mo) 236 Mo - Setting current dir: /Users/x/Documents/MyTechDocs 
(1.268 - 245 Mo) 236 Mo - Using default charset 
(1.271 - 245 Mo) 236 Mo - Reading from C4PumlTest.puml 
(1.271 - 245 Mo) 236 Mo - Creating AParentFolderRegular /Users/x/Documents/MyTechDocs 
(1.283 - 245 Mo) 234 Mo - ImportedFiles::getAFile nameOrPath = /Users/x/Documents/Arch/C4PlantUML/C4_Container.puml 
(1.284 - 245 Mo) 234 Mo - ImportedFiles::getAFile currentDir = AParentFolderRegular::/Users/x/Documents/MyTechDocs 
(1.285 - 245 Mo) 234 Mo - Using default charset 
(1.285 - 245 Mo) 234 Mo - Reading from /Users/x/Documents/Arch/C4PlantUML/C4_Container.puml 
(1.292 - 245 Mo) 234 Mo - Using default charset 
(1.292 - 245 Mo) 234 Mo - Reading from /Users/x/Documents/Arch/C4PlantUML/C4_Container.puml 
(1.292 - 245 Mo) 234 Mo - Getting parent of AFileRegular::/Users/x/Documents/Arch/C4PlantUML/C4_Container.puml 
(1.292 - 245 Mo) 234 Mo - Creating AParentFolderRegular /Users/x/Documents/Arch/C4PlantUML 
(1.292 - 245 Mo) 234 Mo - -->The parent is AParentFolderRegular::/Users/x/Documents/Arch/C4PlantUML 
(1.293 - 245 Mo) 234 Mo - Creating AParentFolderRegular /Users/x/Documents/Arch/C4PlantUML 
(1.294 - 245 Mo) 234 Mo - Using default charset

And my .puml file content like below:

@startuml Basic Sample
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Container.puml

Person(admin, "Administrator")
System_Boundary(c1, "Sample System") {
    Container(web_app, "Web Application", "C#, ASP.NET Core 2.1 MVC", "Allows users to compare multiple Twitter timelines")
}
System(twitter, "Twitter")

Rel(admin, web_app, "Uses", "HTTPS")
Rel(web_app, twitter, "Gets tweets from", "HTTPS")
@enduml

Could you please tell what's going wrong here?

The include section of all "percy" diagrams looks wrong

all "percy" diagramms has a include section like

!include ./../C4_Container.puml
!include ./../C4_Context.puml
!include ./../C4.puml

This looks wrong for me.

  1. C4_Container.puml includes C4_Context.puml already, why is it repeated?
  2. If this pattern is used with "first" C4_Dynamic.puml and "last" C4.puml, then the automatic indexing is overwritten.

I think "percy" should include only the "first" *.puml and skip all following includes

BR Helmut

Samples have missing parenthesis in LAYOUT_* macros

It seems that the preprocessor has deprecated zero-argument macros without parenthesis in a recent version of PlantUML. So all of the samples that use LAYOUT_WITH_LEGEND or LAYOUT_LEFT_RIGHT fail to compile with a syntax error

@startuml Gives a lovely picture
!includeurl <C4/C4_Context.puml>

LAYOUT_WITH_LEGEND()

Person(admin, "Administrator")
@enduml

looks like this

@startuml Gives a syntax error
!includeurl <C4/C4_Context.puml>

LAYOUT_WITH_LEGEND

Person(admin, "Administrator")
@enduml

gives syntax error

I don't really fancy being the person to fix up all of the samples myself, but someone has to... I think this may also be the explanation for the issue described in #78

Add dotted arrows for relationships

Hello,

An option to make relationship arrows dotted would be very useful to express different types of relationships and distinguish them visually 😃

I made a pull request with changes here #66
For now I named new elements using _Async suffix e.g. Rel_Async(...), but maybe it is better not to suggest that these new relationships are asynchronous and normal ones are synchronous... in the end it can mean something different based the context.
Other names like _Weak, _Dotted or something entirely else are possible - feel free to comment on this or suggest something 😄

Documentation on how to use Lay_D, Lay_U etc

I often find it hard to get the layout I want and I see in your examples that you use "layout commands", such as Lay_D and Lay_U. Could you please add a few lines in the documentation on how to use these and how to think about how to order the elements (ie should I use Rel_R or Lay_R, for example).

Errors on Export to either HTML or PDF

When testing on a single diagram, I get errors when attempting to export to either HTML or PDF format.

When exporting to HTML, I get the following stack trace in the VS Code Output window:

Error found in diagram Basic Sample
java.lang.UnsupportedOperationException: HTML
	at net.sourceforge.plantuml.ugraphic.ImageBuilder.createUGraphic(ImageBuilder.java:400)
	at net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageInternal(ImageBuilder.java:238)
	at net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageTOBEMOVED(ImageBuilder.java:179)
	at net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFileInternal(CucaDiagramFileMakerSvek.java:127)
	at net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFile(CucaDiagramFileMakerSvek.java:71)
	at net.sourceforge.plantuml.cucadiagram.CucaDiagram.exportDiagramInternal(CucaDiagram.java:425)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:202)
	at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:135)
	at net.sourceforge.plantuml.SourceStringReader.outputImage(SourceStringReader.java:154)
	at net.sourceforge.plantuml.Pipe.managePipe(Pipe.java:111)
	at net.sourceforge.plantuml.Run.managePipe(Run.java:359)
	at net.sourceforge.plantuml.Run.main(Run.java:166)
Exception in thread "main" java.lang.UnsupportedOperationException: HTML
	at net.sourceforge.plantuml.ugraphic.ImageBuilder.createUGraphic(ImageBuilder.java:400)
	at net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageInternal(ImageBuilder.java:238)
	at net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageTOBEMOVED(ImageBuilder.java:179)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramError(UmlDiagram.java:255)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramError(UmlDiagram.java:217)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:210)
	at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:135)
	at net.sourceforge.plantuml.SourceStringReader.outputImage(SourceStringReader.java:154)
	at net.sourceforge.plantuml.Pipe.managePipe(Pipe.java:111)
	at net.sourceforge.plantuml.Run.managePipe(Run.java:359)
	at net.sourceforge.plantuml.Run.main(Run.java:166)

When exporting to PDF, I get this stack trace:

Error found in diagram Basic Sample
java.lang.ClassNotFoundException: org.apache.batik.apps.rasterizer.SVGConverter
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at net.sourceforge.plantuml.pdf.PdfConverter.convert(PdfConverter.java:57)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramInternalPdf(UmlDiagram.java:337)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:198)
	at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:135)
	at net.sourceforge.plantuml.SourceStringReader.outputImage(SourceStringReader.java:154)
	at net.sourceforge.plantuml.Pipe.managePipe(Pipe.java:111)
	at net.sourceforge.plantuml.Run.managePipe(Run.java:359)
	at net.sourceforge.plantuml.Run.main(Run.java:166)
Exception in thread "main" java.lang.UnsupportedOperationException
	at net.sourceforge.plantuml.pdf.PdfConverter.convert(PdfConverter.java:76)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramInternalPdf(UmlDiagram.java:337)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:198)
	at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:135)
	at net.sourceforge.plantuml.SourceStringReader.outputImage(SourceStringReader.java:154)
	at net.sourceforge.plantuml.Pipe.managePipe(Pipe.java:111)
	at net.sourceforge.plantuml.Run.managePipe(Run.java:359)
	at net.sourceforge.plantuml.Run.main(Run.java:166)

Exporting to an image (like PNG) seems to work as expected.

Change Shape of System artifacts

Hello.

How I can change the shape of technology artifacts?

For example, the artifacts shown in the following image

TechnologyArtifacts

I use them to represent the state of each system or component in my architecture.

any help to achieve this is greatly appreciated.

cordial greetings...

bidirectional relationship?

Hi, is it possible to have "bidirectional" arrows between two type of entities (X <-----> Y) to abbreviate things? For example I'd like to represent that there is a response to the transaction request.

thanks in advance.
Domingo Tapia

<<boundary>> stereotype colors/skinparams not changeable

Hi,

I am trying to manipulate the <> stereotype font color or size, but it seems to have no effect. All other types working correctly.

No matter what I do, the stereotype remains here white and the size remains default:

image

what I currently have for styling:

!define BORDER_COLOR      #333333
!define FONT_COLOR        #333333

skinparam rectangle<<boundary>> {
  Shadowing false
  StereotypeFontSize 0
  StereotypeFontColor FONT_COLOR
  FontColor FONT_COLOR
  BorderColor BORDER_COLOR
  BorderStyle dashed

Thanks for your help.

Enhance the look of Person (actor)

This projects is just what I need now, after getting stuck using Structurizr.Net to generate PlantUML.

There just one thing, the look of Person (Actor in PlantUML) which leave something to be desired. Would it be possible to either use the Actor element from PlantUML or modify the shape to look more like the shape used by Simon Brown in C4?

Do you have any plans to continue to enhance the look of the generated diagrams?

Layout control issue

I am using Rel_L to orient the flow of my diagram. The other directions work but Rel_L keep pointing the flow to the right when I need it to go left.

The Behavior I am noticing. The last relationship at the bottom of the diagram is the only one that will work with Rel_L. Everything else will automatically go to the right even if I am specifying Rel_L.

My diagrams contains multiple boundaries and nested boundaries. I am defining the relationships between system objects. I am trying to go left with in the boundaries to make my diagram more readable.

Please me know if there is more information is needed to pin point the issue.

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.