Is there a way to set the max width of a class element?

0 votes
asked Sep 6 in Question / help by anonymous
Hello.

There's a skinparam for "MinClassWidth", but is there a way of setting a maximum class width? I'm using class diagram entities to store user stories and there's no way of auto-wrapping. A "MaxClassWidth" skinparam would be great. I've tried using the new style "MinimumWidth" and "MaximumWidth" properties but they don't look to work with classes or entities?

Any suggestions other than using the manual "\n" line-breaks would be appreciated :)

Thanks!
commented Sep 8 by The-Lu (49,760 points)

Hello all, and PlantUML team,

I test MinimumWidth and MaximumWidth on class or deployment...

And it seems that style examples are without effects on class or deployment (Observed on V1.2022.8beta2)...
Only OK on WBS or Activity...

CodeOutput
@startuml
<style>
class {
  MinimumWidth 100
  MaximumWidth 150
  Fontcolor red
}
</style>
class a
class "a long long long long long long long name" as A {
function()
elt
a long long long long long long long name
}
@enduml

KO
@startuml
<style>
node {
  MinimumWidth 100
  MaximumWidth 150
  Fontcolor red
}
</style>
node a
node A [
a long long long long long long long name
function()
elt
a long long long long long long long name
]
@enduml

KO
@startuml
<style>
element {
  MinimumWidth 100
  MaximumWidth 150
  Fontcolor green
}
</style>
:this is a very long component description;
:a long long long long long long long name
function()
elt
a long long long long long long long name;
@enduml


OK, see also:

Thanks for the improvement.

Regards.

1 Answer

0 votes
answered Sep 8 by The-Lu (49,760 points)

Hello A.,

A pseudo, not soo good solution:

  • Could you test `skinparam wrapwidth nnn`?

Then I continue to test with style, but without good result....
Regards.

...