Comments (4)
Hi @dirkgroot
yes, it works without UpdateElementStyle() too (maybe an export option could be useful)
(but if you want the same structurizr colors, ... then you can use it;
and if you use additional styles/tags in DSL you get automatically matching colors too)
BR Helmut
from export.
Possible solutions:
in plantuml-stdlib/C4-PlantUML#228 I found following problems
- update/creates of the required tag definitions (based on the styles) in C4-PlantUML is missing.
- add the tags in reverse order that the most detailed is the first one:
first tag has the highest priority (e.g. if 2 styles/tags define a background color the first wins) - mark "External_xxx" with new "External_xxx" tags
Maybe additional changes could be done (or in another PR?):
- activate
SHOW_PERSON_OUTLINE()
4a. and if description of the person is empty add\n\n
or <25 char add\n
to it that the y-dimension of the shape is higher. If required I could add the \n support in C4-PlantUML itself)
It could be that https://github.com/cloudflightio/structurizr-export-c4plantuml solves most of the problems already and only the PR has to be completed. @klu2: can you please check my assumption?
e.g. with all changes based on following DSL
workspace {
model {
enterprise "Customer" {
dwh_user = person "DWH User" "User of some DWH" "Internal user"
dwh_developer = person "DWH Developer" "Developer of some DWH"
}
dhw_user = person "DHW User" "User of DataHandwerk Toolkit" "External user"
// "External_Person" is only used as workaround atm
dhw_developer = person "DHW Developer" "Developer of DataHandwerk Toolkit" "External_Person"
}
views {
systemlandscape "SystemLandscape" {
include *
autoLayout
}
styles {
element "Person" {
shape Person
background #2222CC
}
element "External_Person" {
shape Person
background #FFCCCC
}
element "Internal user" {
shape Person
background #4444FF
}
element "External user" {
shape Person
background #FF4444
}
}
}
}
with the new rules the generator would create something like
@startuml
title System Landscape for Customer
top to bottom direction
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4.puml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml
' additional changes: 4. activate person outline
SHOW_PERSON_OUTLINE()
' additional changes: 1. update existing tags/styles if required
UpdateElementStyle("person", #2222CC, $ELEMENT_FONT_COLOR)
' additional changes: if SHOW_PERSON_OUTLINE() is not used, structurizr sprite could be used too
UpdateElementStyle("external_person", #FFCCCC, $ELEMENT_FONT_COLOR, $sprite="person2")
' additional changes: 1. create new tags/styles if required
AddElementTag("Internal user", "#4444FF", $ELEMENT_FONT_COLOR)
AddElementTag("External user", "#FF4444", $ELEMENT_FONT_COLOR, $sprite="person2")
Enterprise_Boundary(enterprise, "Customer") {
' additional changes: 2. invert tag order that most detailed tag wins
' additional changes: (as workaround) 4a. add \n
Person(DWHUser, "DWH User", "Userof some DWH\n", $tags="Internal user+Person+Element")
Person(DWHDeveloper, "DWH Developer", "Developer of some DWH\n", $tags="Person+Element")
}
' additional changes: 2. invert tag order that most detailed tag wins
' additional changes: 3. use External_Person instead of Person
Person_Ext(DHWDeveloper, "DHW Developer", "Developer of DataHandwerk Toolkit", $tags="External_Person+Element")
Person_Ext(DHWUser, "DHW User", "User of DataHandwerk Toolkit", $tags="External user+External_Person+Element")
SHOW_LEGEND()
@enduml
@simonbrowndotje: can you accept klu2 PR if everything is working?
Thank you and best regards
Helmut
from export.
I've been fiddling around with this, and the simplest fixes seem to be to just prefix the $tags
for a person with External_Person
, or to not use the tags at all and rely on C4-PlantUML defaults.
@kirchsth Customisation using UpdateElementStyle
and/or the usage of tags is not necessary if you just want to use the default styling provided by C4-PlantUML, right?
@simonbrowndotje I'm curious: Could you clarify what your purpose is with putting Structurizr tags in the PlantUML files?
from export.
I'm curious: Could you clarify what your purpose is with putting Structurizr tags in the PlantUML files?
It was a response to this issue -> structurizr/java-extensions#51
from export.
Related Issues (20)
- Internal property 'structurizr.dsl.identifier' on exported diagrams should be hidden HOT 2
- shadow property for both plantuml exporters HOT 2
- Export workspace as DSL.json
- link to further down diagram HOT 1
- Multiple groups with same name not rendered correctly (PlantUML) HOT 3
- Support for C4-PlantUML's ComponentDb and ComponentQueue in C4PlantUMLExporter?
- C4PlantUMLExporter mistakes container and component description for technologies when only description is present HOT 1
- Export the model to DSL or JSON format HOT 1
- support c4plantuml sequence diagrams HOT 1
- Export PlantUML Sequence Diagram for Dynamic View not working
- How I can rewrite tags autofilling in C4PlantUMLExporter?
- Add support for skinparam svgLinkTarget for C4PlantUML Exporter HOT 3
- Support C4PlantUML borderStyle and borderThickness HOT 2
- Syntax error in WebSequence diagrams HOT 1
- Export relationships as a list HOT 1
- Mermaid render error when description contains `(` HOT 1
- Asynchronous relation rendering with c4plantumlexporter
- C4Plantuml export renders url property in wrong format
- Allow plantuml.includes property to be defined in individual views
- Sequence Diagram Export For PlantUML is no more working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from export.