New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set padding for elements inside a boundary #299
Comments
|
Hi! To make it easier to help, could you post a (simplified) diagram, so we have an example to work with? |
|
In the meantime, I've looked into this some more. Sadly, PlantUML does not offer an easy way to add spacing inside an element. TL;DR (short version)Use a dummy container inside the boundary as a workaround.
Full detailsI'll use this diagram as the basis for further examples:
See full detailsNo skinparam "margin" or "padding"Sadly, there is no skinparam for "margin" or "padding":
Skinparam
|
@startuml
!include <C4/C4_Container>
skinparam nodesep 100 /' horizontal margin '/
skinparam ranksep 100 /' vertical margin '/
Boundary(b, "Boundary") {
Container(c, "Container")
Person(p, "Person")
System(s, "System")
Boundary(b1, "Boundary")
}
@enduml |
Padding and Margin (new CSS-like style) not working
There are padding and margin instruction using the new CSS-like style, but they do not seem to be implemented for the elements used by C4. This could be a bug in PlantUML and might be worth reporting there.
@startuml
!include <C4/C4_Container>
<style>
root {
BackgroundColor #FFE
Margin 100
Padding 100
}
rectangle {
Margin 100
Padding 100
}
.boundary {
Margin 100
Padding 100
}
</style>
Boundary(b, "Boundary") {
Container(c, "Container")
Person(p, "Person")
System(s, "System")
Boundary(b1, "Boundary")
}
@enduml |
Workaround
What could work is a workaround, putting the elements in an invisible container. This does mean adding a container inside every boundary. Not ideal.
@startuml
!include <C4/C4_Container>
skinparam {
rectangle<<DUMMY>> {
borderColor transparent
stereotypeFontSize 0
fontSize 0
}
}
Boundary(b, "Boundary") {
rectangle padding <<DUMMY>> {
Container(c, "Container")
Person(p, "Person")
System(s, "System")
Boundary(b1, "Boundary")
}
}
@enduml |
|
Thank you very much for the descriptive description. From your explanations, I have realized that the issue was the margin between the elements and not the padding. I sorted it out using |
|
Glad to be of help. Happy diagramming! |
I would like to change the padding of the elements in a boundary. How can I do that?
The text was updated successfully, but these errors were encountered: