My PlantUML code looks like this
package "parent" {
package "child1" {
}
package "child2" {
}
package "child3" {
}
//and so on...
}
The rendered diagram has all the child packages side by side and so the diagram is too wide. Is there a way to force all packages after child2
to be below (line break) the previous packages?
<br>: The Line Break element. The <br> HTML element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division of lines is significant.
Press ALT+ENTER to insert the line break.
To do a line break in HTML, use the <br> tag. Simply place the tag wherever you want to force a line break. Since an HTML line break is an empty element, there's no closing tag.
Updated: 07/31/2022 by Computer Hope. A line break is a command or sequence of control characters that returns the cursor to the next line and does not create a new paragraph. Essentially, line breaks denote the end of one line and the start of a new one.
As mentioned in this answer, the simplest approach approach is to use hidden links. However, to ensure better layout and minimize the number of hidden links, use the together
keyword to "group" objects. All objects in a group will maintain the same relative position set by a single link.
An expanded version of your example
package "parent" {
together {
package "childA2" {
}
package "childA1" {
}
}
together {
package "childB4" {
}
package "childB3" {
}
package "childB2" {
}
package "childB1" {
}
}
together {
package "childC2" {
}
package "childC1" {
}
}
childA1 -[hidden]-> childB1
childB1 -[hidden]-> childC1
}
would yield the following diagram.
The typical approach is to add hidden edges, as described in the Help on layout section of PlantUML.
e.g.
package "parent" {
package "child1" {
}
package "child2" {
}
package "child3" {
}
child1 -[hidden]-> child2
' you can add more space by adding more dashes
child2 -[hidden]---> child3
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With