Closed noamtamim closed 1 year ago
I knew this project wasn't dead, good, thanks.
Not dead, but clearly overloaded :-)
Anyway, thanks for the suggested parameter name. With last beta http://beta.plantuml.net/plantuml.jar you can now have:
@startuml
skinparam wrapWidth 100
component component1 [
this is a very long component description
]
note left
this is a very long note that show be wrapped
end note
@enduml
and also
@startuml
skinparam wrapMessageWidth 100
A->B:very long long long message name
@enduml
Note sure if we should have separate settings for notes, components... So I let you guys talk about this (no time to think right now :-) )
Wrap width doesn't appear to be working on notes or on components...
Could you give a non-working example ? The following one is working for us: http://www.plantuml.com/plantuml/uml/TOv12W8n34NtESK_mimDvXOkn4MSHbjiaz961szlwK9NGXOFyZwyhJitVvPC_P6qSkE2et4zfU0HwxBGRgMQYZg-jE9C03ocZd6CbxGtikdzvo18trkgdapfGceko7BpVyCfU6H7ZtRWAZEZIY3HCB-q3Hgb7m00
I don't know if wrapWidth is meant to work on sequence diagrams (it would be extremely useful if it did...) but it doesn't do anything at the moment...
Thanks for the feedback. It should be fixed in last beta http://beta.plantuml.net/plantuml.jar
I've noticed with the beta that wrapWidth is not being applied to text in legends:
Yes, but maybe we should use a separate setting for legend: general wrapWidth (for message, notes...) should be different that wrapWidth for legend that can be as wide as the diagram itself. Any though ?
I'm not sure if it should, but wrapWidth doesn't seem to be working in Activity (Beta) for notes:
@startuml
skinparam wrapWidth 150
title: Note wrapWidth Test
start
:This is a very long process step;
note: This is a very very long note
stop
@enduml
I'm not sure if it should, but wrapWidth doesn't seem to be working in Activity (Beta) for notes:
Thanks for the report. This is fixed in last beta http://beta.plantuml.net/plantuml.jar
Thanks for the report. This is fixed in last beta http://beta.plantuml.net/plantuml.jar
This is amazing - not sure you're watching this but I've downloaded the beta and confirmed it sorted on Windows (7) (doesn't use GraphViz but: latest verstion).
Should wrapping work for state diagrams as well? We have some long state names...
Could you post a short snippet that shows the issue ? Thanks
@startuml
state "a" as a
state "In my humble opinion this is definitively too long for a state name one liner and would benefit from wrapping" as b
a -right-> b
@enduml
Thanks your example. This should be fixed in last beta http://beta.plantuml.net/plantuml.jar
@startuml
skinparam wrapWidth 150
state "a" as a
state "In my humble opinion this is definitively too long for a state name one liner and would benefit from wrapping" as b
a -right-> b
@enduml
Tell us if it's not working for you!
Thanks for fixing this. What I forget to include in my example is an additional setting: hideEmptyDescription, which seems to prevent the wrapping from happening:
@startuml
hide empty description
skinparam wrapWidth 150
state "a" as a
state "In my humble opinion this is definitively too long for a state name one liner and would benefit from wrapping" as b
a -right-> b
@enduml
Ok, your example should work with new beta http://beta.plantuml.net/plantuml.jar Tell us if you find other issues! Thanks
Hi!
wrapWidth does not seem to be affecting descriptions in state diagrams. i.e.
@startuml
skinparam wrapWidth 150
state "a" as a
State "b" as b
b: aaaaaaa bbbbbbbbbb ccccccccc ddddddddd eeeeeeeee ffffffffff ggggggggg hhhhhhhh
a -right-> b
@enduml
I know I can insert line breaks manually, but it is not really feasible in my current use case since I'm generating these diagrams from code.
Thanks again for the feedback. It should be fixed in last beta http://beta.plantuml.net/plantuml.jar
That was quick! Also, if you did not fix this simultaneously, it is not working for line labels in state diagrams either:
@startuml
skinparam wrapWidth 150
state "a" as a
State "b" as b
a -right-> b : aaaaaaa bbbbbbbbbb ccccccccc ddddddddd eeeeeeeee ffffffffff ggggggggg hhhhhhhh
@enduml
For some reason, we use a different setting for labels in arrow and lines:
@startuml
skinparam maxMessageSize 150
state "a" as a
State "b" as b
a -right-> b : aaaaaaa bbbbbbbbbb ccccccccc ddddddddd eeeeeeeee ffffffffff ggggggggg hhhhhhhh
@enduml
In your case, you could set both value (maxMessageSize
and wrapWidth
) to 150.
BTW we are not 100% satisfied with current names (maxMessageSize
and wrapWidth
), so any idea is welcome! (We will ensure ascending compatibility even if we change those names)
Hope this help!
Awesome, thank you!
Naming really is the hardest problem in programming. If you don't need two separate parameters, perhaps it could be just maxTextWidth or wrapTextWidth? If you need separate parameters, perhaps maxLabelWidth and maxElementWidth? Not sure if there is some better terminology to use though.
In class diagrams, long constructors get word-wrapped (thanks!), but I expected the visibility indicator (the green circle) to be aligned with the top of the block, and the wrapped parameters to be indented.
Last beta http://beta.plantuml.net/plantuml.jar should align visibility indicator on top.
Could wrapwidth
also apply to class names?
Examples where this would be handy
@startuml
hide members
hide circle
skinparam wrapwidth 200
!unquoted function descriptiveClass($alias, $name, $description)
class "==$name\n\n $description" as $alias
!endfunction
!unquoted function crc($alias, $name, $responsibility, $collaboration)
class "==$name\n\n**Responsibility**\n$responsibility\n\n**Collaboration**\n$collaboration" as $alias
!endfunction
class "==Book\n\n Here is a long section of descriptive text. Can I get it to wrap automatically instead of just continuing?" as book
class "==Shelf\n\n **Responsibility**\nHold books as part of a bookcase\n\n**Collaboration**\nBookcase, Book" as shelf
class "==Bookcase\n\n **Responsibility**\nHolds shelves\n\n**Collaboration**\nShelf" as bookcase
descriptiveClass(school, "School", "Schools include pre-schools, elementary schools, middle schools, high schools, colleges, universities, technical institutes, etc.")
crc(city, "City", "Groups Infrastructure", "Neighborhood, Street, Residence, Business, Park, School, Hospital")
@enduml
I was using wrapwidth
with rectangles that had names with long descriptions and it was working fine, but I needed some of the features of classes - in particular the ability to use nodesep
and ranksep
. Unfortunately switching to classes made me lose the wordwrap functionality.
When I position a note e.g. left of test::member
, the wrapWidth
is not enforced.
It would be great, if this kind of note was included in the width controlling.
It would be nice to have this in work breakdown structures, too!
Thanks for the report.
This has been fixed in last snapshot and on the online server.
Tell us if you find other issues!
@arnaudroques Thank you for providing the wrapWidth
skin parameter :). Is it planned to also be able to use it in Activity Diagrams?
The following example does not wrap unfortunately:
@startuml
skinparam wrapWidth 100
:this is a very long long long long long activity description;
@enduml
@The-Lum thank you for the quick response :). Using MaximumWidth
works fine for me
I am looking for a way to only enforce max width for notes.
Rationale: I'm working with class diagram, and for the classes the one line = one property/method is very important to have clear readability in the diagram. However notes typically contain longer text, without such positional meaning, so those would be best auto-wrapped to a certain width, without affecting the way classes are laid out. In fact I am happy with the layout of all drawing elements, only would like to maximise the width of notes.
@arnaudroques
Note sure if we should have separate settings for notes, components...
Certainly notes are very different from any other elements, so it would be great to have a width control for notes only! wrapNoteWidth
would be incredibly useful!
@BenceSzalai, @arnaudroques:
I just open this wanted request here:
Regards.
That's nice, but I'm afraid that supporting max-width for all elements is a much bigger work than just for notes, as the issue originally requested, and it is certainly better to have some useful features in a realistic time-frame than a huge, all-encompassing feature, that is so big it it may never get delivered eventually.
This should be fixed in V1.2023.0 Tell us if you find other issues! Thanks
Thanks! So for reference, to set minimum and maximum width of notes one can add this to the puml file:
<style>
note {
MinimumWidth 100
MaximumWidth 150
}
</style>
I've just tried and it works fine in Class diagrams. Great to have it!
Not sure why some things are controlled by skinparam
-s and why some by an embedded <style>
, but that's not really the topic here.
Not sure, maybe this issue can be closed now?
Hi all,
Not sure, maybe this issue can be closed now?
[This is an Issue Review] This is now fully fixed and answered.
Regards.
skinparam maxMessageSize
doesn't affect notes. I can see why that may be -- people may want more control over note formatting. Please add another param, maxNoteSize that would do the same for notes.And I see that in #35 you wonder if this name is good. I'd say
wrapMessageWidth
(if measured in pixels) and/orwrapMessageCols
(if measured in characters) are better, since this param doesn't limit the size, it just inserts line breaks.