Skip to content
This repository was archived by the owner on Jan 4, 2024. It is now read-only.

Commit b856d5f

Browse files
authored
Merge pull request #1 from cloudflightio/KL/docu
add some more docu
2 parents b3fb0a8 + 06cf5f9 commit b856d5f

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,47 @@ relationship.addTags(CRITICAL);
5454
ContainerView view = workspace.getViews().createContainerView(softwareSystem, "containerView", "");
5555
view.addDefaultElements();
5656

57+
// use the ExtendedC4PlantUmlExporter instead of the default C4PlantUmlExporter
5758
Diagram diagram = new ExtendedC4PlantUmlExporter().export(view);
5859
````
5960

60-
and this will create the following diagram:
61+
and this will create the following PlantUML diagram:
62+
63+
````puml
64+
@startuml
65+
title SoftwareSystem - Containers
66+
67+
top to bottom direction
68+
69+
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4.puml
70+
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml
71+
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
72+
73+
74+
AddElementTag("Container", $bgColor="#efefef")
75+
AddElementTag("server", $bgColor="#00ff00", $fontColor="#ff00ff")
76+
AddElementTag("db", $bgColor="#ff00ff", $fontColor="#00ff00")
77+
AddRelTag("critical", $lineColor="#ff0000", $textColor="#ff0000", $lineStyle=DottedLine())
78+
System_Boundary("SoftwareSystem_boundary", "SoftwareSystem") {
79+
WithoutPropertyHeader()
80+
AddProperty("IP","127.0.0.1")
81+
AddProperty("Region","East")
82+
Container(SoftwareSystem.Container1, "Container 1", "", $tags="server+Container+Element")
83+
WithoutPropertyHeader()
84+
AddProperty("IP","127.0.0.2")
85+
AddProperty("Region","West")
86+
ContainerDb(SoftwareSystem.Container2, "Container 2", "", $tags="db+Container+Element")
87+
}
88+
89+
WithoutPropertyHeader()
90+
AddProperty("Prop1","Value1")
91+
AddProperty("Prop2","Value2")
92+
Rel_D(SoftwareSystem.Container1, SoftwareSystem.Container2, "fetches data", $tags="critical+Relationship")
93+
94+
SHOW_LEGEND()
95+
@enduml
96+
````
97+
98+
which can be rendered to this image using PlantUML:
6199

62100
![Full Example](/fullExample.png)

0 commit comments

Comments
 (0)