Skip to content

Commit

Permalink
more modes: Raw, Common, Simplified, C4 integration
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoNiepel committed Mar 28, 2019
1 parent c3a0763 commit 21829dc
Show file tree
Hide file tree
Showing 12 changed files with 279 additions and 25 deletions.
69 changes: 69 additions & 0 deletions dist/AzureC4Integration.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
' Legends
' ##################################

!ifdef COMPONENT_BG_COLOR
!define COMPONENT_LEGEND
!else
!ifdef CONTAINER_BG_COLOR
!define CONTAINER_LEGEND
!else
!define CONTEXT_LEGEND
!endif
!endif

!ifdef CONTEXT_LEGEND
!definelong LAYOUT_WITH_LEGEND
hide <<person>> stereotype
hide <<external_system>> stereotype
hide <<system>> stereotype
hide <<external_system>> stereotype
legend right
|= |= Type |
|<PERSON_BG_COLOR> | person |
|<EXTERNAL_PERSON_BG_COLOR> | external person |
|<SYSTEM_BG_COLOR> | system |
|<EXTERNAL_SYSTEM_BG_COLOR> | external system |
|<AZURE_BG_COLOR> | Azure service container |
endlegend
!enddefinelong
!endif

!ifdef CONTAINER_LEGEND
!definelong LAYOUT_WITH_LEGEND
hide <<person>> stereotype
hide <<external_system>> stereotype
hide <<system>> stereotype
hide <<external_system>> stereotype
hide <<container>> stereotype
legend right
|= |= Type |
|<PERSON_BG_COLOR> | person |
|<EXTERNAL_PERSON_BG_COLOR> | external person |
|<SYSTEM_BG_COLOR> | system |
|<EXTERNAL_SYSTEM_BG_COLOR> | external system |
|<CONTAINER_BG_COLOR> | container |
|<AZURE_BG_COLOR> | Azure service container |
endlegend
!enddefinelong
!endif

!ifdef COMPONENT_LEGEND
!definelong LAYOUT_WITH_LEGEND
hide <<person>> stereotype
hide <<external_system>> stereotype
hide <<system>> stereotype
hide <<external_system>> stereotype
hide <<container>> stereotype
hide <<component>> stereotype
legend right
|= |= Type |
|<PERSON_BG_COLOR> | person |
|<EXTERNAL_PERSON_BG_COLOR> | external person |
|<SYSTEM_BG_COLOR> | system |
|<EXTERNAL_SYSTEM_BG_COLOR> | external system |
|<CONTAINER_BG_COLOR> | container |
|<AZURE_BG_COLOR> | Azure service container |
|<COMPONENT_BG_COLOR> | component |
endlegend
!enddefinelong
!endif
21 changes: 9 additions & 12 deletions dist/AzureCommon.puml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
' Azure-PlantUML, version 1.1.0
' Azure-PlantUML, version 2.0.0
' https://github.com/RicardoNiepel/Azure-PlantUML

' Colors
Expand Down Expand Up @@ -38,19 +38,16 @@ skinparam rectangle<<e_stereo>> {
' Layout
' ##################################

!definelong LAYOUT_WITH_LEGEND
hide <<person>> stereotype
hide <<container>> stereotype
hide <<system>> stereotype
legend right
|= |= Type |
|<PERSON_BG_COLOR> | person |
|<AZURE_BG_COLOR> | Azure service container |
|<CONTAINER_BG_COLOR> | other container |
|<SYSTEM_BG_COLOR> | external system |
endlegend
!definelong LAYOUT_AS_SKETCH
skinparam backgroundColor #EEEBDC
skinparam handwritten true
skinparam defaultFontName "Comic Sans MS"
center footer <font color=red>Warning:</font> Created for discussion, needs to be validated
!enddefinelong

!define LAYOUT_TOP_DOWN top to bottom direction
!define LAYOUT_LEFT_RIGHT left to right direction

' Elements
' ##################################

Expand Down
33 changes: 33 additions & 0 deletions dist/AzureRaw.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
' Azure-PlantUML, version 2.0.0
' https://github.com/RicardoNiepel/Azure-PlantUML

' Colors
' ##################################
!define AZURE_COLOR #0072C6
!define AZURE_BG_COLOR #FFFFFF
!define AZURE_BORDER_COLOR #3C7FC0
!define AZURE_SYMBOL_COLOR AZURE_COLOR

' Styling
' ##################################

!define TECHN_FONT_SIZE 12

!definelong AzureEntityColoring(e_stereo)
skinparam rectangle<<e_stereo>> {
BackgroundColor AZURE_BG_COLOR
BorderColor AZURE_BORDER_COLOR

}
!enddefinelong

' Elements
' ##################################

!definelong AzureEntity(e_alias, e_label, e_techn, e_color, e_sprite, e_stereo)
rectangle "==e_label\n<color:e_color><$e_sprite></color>\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//" <<e_stereo>> as e_alias
!enddefinelong

!definelong AzureEntity(e_alias, e_label, e_techn, e_descr, e_color, e_sprite, e_stereo)
rectangle "==e_label\n<color:e_color><$e_sprite></color>\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//\n\n e_descr" <<e_stereo>> as e_alias
!enddefinelong
23 changes: 23 additions & 0 deletions dist/AzureSimplified.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
' Styling
' ##################################

hide stereotype

!definelong AzureEntityColoring(e_stereo)
skinparam rectangle<<e_stereo>> {
BackgroundColor AZURE_BG_COLOR
BorderColor transparent
Shadowing false
}
!enddefinelong

' Overwriting Elements
' ##################################

!definelong AzureEntity(e_alias, e_label, e_techn, e_color, e_sprite, e_stereo)
rectangle "<color:e_color><$e_sprite></color>\n\n==e_label" <<e_stereo>> as e_alias
!enddefinelong

!definelong AzureEntity(e_alias, e_label, e_techn, e_descr, e_color, e_sprite, e_stereo)
rectangle "<color:e_color><$e_sprite></color>\n\n==e_label" <<e_stereo>> as e_alias
!enddefinelong
1 change: 1 addition & 0 deletions samples/C4 usage - Highly scalable web application.puml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

!define AzurePuml https://raw.githubusercontent.com/RicardoNiepel/Azure-PlantUML/master/dist
!includeurl AzurePuml/AzureCommon.puml
!includeurl AzurePuml/AzureC4Integration.puml
!includeurl AzurePuml/Databases/AzureRedisCache.puml
!includeurl AzurePuml/Databases/AzureCosmosDb.puml
!includeurl AzurePuml/Databases/AzureSqlDatabase.puml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

!define AzurePuml https://raw.githubusercontent.com/RicardoNiepel/Azure-PlantUML/master/dist
!includeurl AzurePuml/AzureCommon.puml
!includeurl AzurePuml/AzureC4Integration.puml
!includeurl AzurePuml/Compute/AzureFunction.puml
!includeurl AzurePuml/Analytics/AzureStreamAnalytics.puml
!includeurl AzurePuml/Analytics/AzureEventHub.puml
Expand Down
8 changes: 7 additions & 1 deletion samples/Raw usage - Sprites.puml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@startuml Raw usage - Sprites

!define AzurePuml https://raw.githubusercontent.com/RicardoNiepel/Azure-PlantUML/master/dist
!includeurl AzurePuml/AzureCommon.puml
!includeurl AzurePuml/AzureRaw.puml
!includeurl AzurePuml/Databases/AzureCosmosDb.puml
!includeurl AzurePuml/Compute/AzureFunction.puml

Expand All @@ -10,6 +10,12 @@ component "<color:red><$AzureFunction></color>" as myFunction

database "<color:#0072C6><$AzureCosmosDb></color>" as myCosmosDb

AzureFunction(mySecondFunction, "Stream Processing", "Consumption")

rectangle "<color:AZURE_SYMBOL_COLOR><$AzureCosmosDb></color>" as mySecondCosmosDb

myFunction --> myCosmosDb

mySecondFunction --> mySecondCosmosDb

@enduml
2 changes: 2 additions & 0 deletions scripts/main.csx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public void Main()
}
Directory.CreateDirectory(targetFolder);

File.Copy(Path.Combine(sourceFolder, "AzureRaw.puml"), Path.Combine(targetFolder, "AzureRaw.puml"));
File.Copy(Path.Combine(sourceFolder, "AzureCommon.puml"), Path.Combine(targetFolder, "AzureCommon.puml"));
File.Copy(Path.Combine(sourceFolder, "AzureC4Integration.puml"), Path.Combine(targetFolder, "AzureC4Integration.puml"));

foreach (var service in lookupTable)
{
Expand Down
69 changes: 69 additions & 0 deletions source/AzureC4Integration.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
' Legends
' ##################################

!ifdef COMPONENT_BG_COLOR
!define COMPONENT_LEGEND
!else
!ifdef CONTAINER_BG_COLOR
!define CONTAINER_LEGEND
!else
!define CONTEXT_LEGEND
!endif
!endif

!ifdef CONTEXT_LEGEND
!definelong LAYOUT_WITH_LEGEND
hide <<person>> stereotype
hide <<external_system>> stereotype
hide <<system>> stereotype
hide <<external_system>> stereotype
legend right
|= |= Type |
|<PERSON_BG_COLOR> | person |
|<EXTERNAL_PERSON_BG_COLOR> | external person |
|<SYSTEM_BG_COLOR> | system |
|<EXTERNAL_SYSTEM_BG_COLOR> | external system |
|<AZURE_BG_COLOR> | Azure service container |
endlegend
!enddefinelong
!endif

!ifdef CONTAINER_LEGEND
!definelong LAYOUT_WITH_LEGEND
hide <<person>> stereotype
hide <<external_system>> stereotype
hide <<system>> stereotype
hide <<external_system>> stereotype
hide <<container>> stereotype
legend right
|= |= Type |
|<PERSON_BG_COLOR> | person |
|<EXTERNAL_PERSON_BG_COLOR> | external person |
|<SYSTEM_BG_COLOR> | system |
|<EXTERNAL_SYSTEM_BG_COLOR> | external system |
|<CONTAINER_BG_COLOR> | container |
|<AZURE_BG_COLOR> | Azure service container |
endlegend
!enddefinelong
!endif

!ifdef COMPONENT_LEGEND
!definelong LAYOUT_WITH_LEGEND
hide <<person>> stereotype
hide <<external_system>> stereotype
hide <<system>> stereotype
hide <<external_system>> stereotype
hide <<container>> stereotype
hide <<component>> stereotype
legend right
|= |= Type |
|<PERSON_BG_COLOR> | person |
|<EXTERNAL_PERSON_BG_COLOR> | external person |
|<SYSTEM_BG_COLOR> | system |
|<EXTERNAL_SYSTEM_BG_COLOR> | external system |
|<CONTAINER_BG_COLOR> | container |
|<AZURE_BG_COLOR> | Azure service container |
|<COMPONENT_BG_COLOR> | component |
endlegend
!enddefinelong
!endif
21 changes: 9 additions & 12 deletions source/AzureCommon.puml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
' Azure-PlantUML, version 1.1.0
' Azure-PlantUML, version 2.0.0
' https://github.com/RicardoNiepel/Azure-PlantUML

' Colors
Expand Down Expand Up @@ -38,19 +38,16 @@ skinparam rectangle<<e_stereo>> {
' Layout
' ##################################

!definelong LAYOUT_WITH_LEGEND
hide <<person>> stereotype
hide <<container>> stereotype
hide <<system>> stereotype
legend right
|= |= Type |
|<PERSON_BG_COLOR> | person |
|<AZURE_BG_COLOR> | Azure service container |
|<CONTAINER_BG_COLOR> | other container |
|<SYSTEM_BG_COLOR> | external system |
endlegend
!definelong LAYOUT_AS_SKETCH
skinparam backgroundColor #EEEBDC
skinparam handwritten true
skinparam defaultFontName "Comic Sans MS"
center footer <font color=red>Warning:</font> Created for discussion, needs to be validated
!enddefinelong

!define LAYOUT_TOP_DOWN top to bottom direction
!define LAYOUT_LEFT_RIGHT left to right direction

' Elements
' ##################################

Expand Down
33 changes: 33 additions & 0 deletions source/AzureRaw.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
' Azure-PlantUML, version 2.0.0
' https://github.com/RicardoNiepel/Azure-PlantUML

' Colors
' ##################################
!define AZURE_COLOR #0072C6
!define AZURE_BG_COLOR #FFFFFF
!define AZURE_BORDER_COLOR #3C7FC0
!define AZURE_SYMBOL_COLOR AZURE_COLOR

' Styling
' ##################################

!define TECHN_FONT_SIZE 12

!definelong AzureEntityColoring(e_stereo)
skinparam rectangle<<e_stereo>> {
BackgroundColor AZURE_BG_COLOR
BorderColor AZURE_BORDER_COLOR

}
!enddefinelong

' Elements
' ##################################

!definelong AzureEntity(e_alias, e_label, e_techn, e_color, e_sprite, e_stereo)
rectangle "==e_label\n<color:e_color><$e_sprite></color>\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//" <<e_stereo>> as e_alias
!enddefinelong

!definelong AzureEntity(e_alias, e_label, e_techn, e_descr, e_color, e_sprite, e_stereo)
rectangle "==e_label\n<color:e_color><$e_sprite></color>\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//\n\n e_descr" <<e_stereo>> as e_alias
!enddefinelong
23 changes: 23 additions & 0 deletions source/AzureSimplified.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
' Styling
' ##################################

hide stereotype

!definelong AzureEntityColoring(e_stereo)
skinparam rectangle<<e_stereo>> {
BackgroundColor AZURE_BG_COLOR
BorderColor transparent
Shadowing false
}
!enddefinelong

' Overwriting Elements
' ##################################

!definelong AzureEntity(e_alias, e_label, e_techn, e_color, e_sprite, e_stereo)
rectangle "<color:e_color><$e_sprite></color>\n\n==e_label" <<e_stereo>> as e_alias
!enddefinelong

!definelong AzureEntity(e_alias, e_label, e_techn, e_descr, e_color, e_sprite, e_stereo)
rectangle "<color:e_color><$e_sprite></color>\n\n==e_label" <<e_stereo>> as e_alias
!enddefinelong

0 comments on commit 21829dc

Please sign in to comment.