Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

How can I limit the column width of ascii-art sequence drawings for inclusion in RFCs?

0 votes
The normative form of an Internet RFC is the ASCII-7 version, limited to 78 characters in width.

I can't see any way to limit the output width in text mode; does Plant provide this feature and I'm just missing it?
asked Feb 2, 2016 by anonymous

2 Answers

0 votes
Currently, there is no way to limit output width.

We could provide such a feature, but it means that we are going to truncate output after 78 characters. Is this what you are expecting ?

Could you post here the source diagram you are working with ?

Thanks
answered Feb 2, 2016 by plantuml (113,980 points)
Nope; I was hoping for "make the diagram enough taller so that there's room for all the necessary labels.

Example:

@startuml
title RUE Automatic Configuration
box "RUE Side" #5fddd6
actor "RUE User" as RUEUSER
participant "RUE" as RUE
end box
box "Domain Name Service" #bb7068
participant DNS
end box
box "Configuration Service" #5c7068
participant "HTTPS Server" as CONFIGSERVER
participant "Provider Global Settings" AS PROVIDERSETTINGS
end box
box "Customer Relationship Management" #6fc65f
participant "CRM"
end box
autonumber "<b>[0]"
RUEUSER -> RUE: Select a VRS Provider name
RUE -> DNS: Look up SRV DNS for _rueconfig._tcp.providerdomain.com
DNS -> RUE: SRV DNS response with server.providerdomain.com:443
RUE -> DNS: If SRV record found, look up DNS for server.providerdomain.com
RUE -->> DNS: If SRV record does not exist, look up DNS for config.providerdomain.com
DNS -> RUE: IP Address of Config Server
RUE -> CONFIGSERVER: TCP connection to 443: TLS: ClientHello (RFC-5246)
CONFIGSERVER -> RUE: TLS: ServerHello
CONFIGSERVER -> RUE: TLS: ServerCertificate
CONFIGSERVER -->> RUE: TLS: ServerKeyExchange if required for premaster secret handshake
CONFIGSERVER -> RUE: TLS: ServerHelloDone
RUE -> CONFIGSERVER: HTTP: GET https://config.providerdomain.com/v1
CONFIGSERVER -> RUE: HTTP: 401 Unauthorized WWW-Authenticate Digest username="X" realm="Y" qop="auth,auth-int" nonce=...
RUE -> CONFIGSERVER: HTTP: https://config.providerdomain.com/v1 Authorization Digest username="X" realm="Y" qop="auth" nonce=...
CONFIGSERVER -> CRM: Find subscriber information for username="X"
CRM -> CONFIGSERVER: Subscriber specific configuration information
CONFIGSERVER -> PROVIDERSETTINGS: Retrieve provider specific settings
PROVIDERSETTINGS -> CONFIGSERVER: Provider specific configuration information
CONFIGSERVER -> RUE: 200 OK + JSON key/value hash merge of subscriber specific and provider specific configurations
@enduml

I think that's the one I'm after.
You can add \n in your label to manually break them:
For example:
RUE -> DNS: Look up SRV DNS\nfor _rueconfig._tcp.providerdomain.com

The real issue here is that ASCII-art engine has the same behaviour than the graphical engine:
It "pushes to the right" life-lines so that the arrow is long enough for the full text message.
We could imagine a "pack mode" where the length of the arrow does not exceed a fixed limit (choosen by the user), even if it causes the text to overpass the arrow to the right.
With this mode, your example may fit on 78 colonns.

This need so work, though...
Are you interested that we start such a modification ?
I dunno; I'll have to check  How would you quote such a modification?

I can't imagine we're the only people ever to want to put sequence diagrams in an RFC...
0 votes
We have just added a new skin parameter in last beta: https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

With this version, you can have:

@startuml
skinparam maxAsciiMessageLength 8

title RUE Automatic Configuration
box "RUE Side" #5fddd6
actor "RUE User" as RUEUSER
participant "RUE" as RUE
end box
box "Domain Name Service" #bb7068
participant DNS
end box
box "Configuration Service" #5c7068
participant "HTTPS Server" as CONFIGSERVER
participant "Provider Global Settings" AS PROVIDERSETTINGS
end box
box "Customer Relationship Management" #6fc65f
participant "CRM"
end box
autonumber "<b>[0]"
RUEUSER -> RUE: Select a VRS Provider name
RUE -> DNS: Look up SRV DNS for _rueconfig._tcp.providerdomain.com
DNS -> RUE: SRV DNS response with server.providerdomain.com:443
RUE -> DNS: If SRV record found, look up DNS for server.providerdomain.com
RUE -->> DNS: If SRV record does not exist, look up DNS for config.providerdomain.com
DNS -> RUE: IP Address of Config Server
RUE -> CONFIGSERVER: TCP connection to 443: TLS: ClientHello (RFC-5246)
CONFIGSERVER -> RUE: TLS: ServerHello
CONFIGSERVER -> RUE: TLS: ServerCertificate
CONFIGSERVER -->> RUE: TLS: ServerKeyExchange if required for premaster secret handshake
CONFIGSERVER -> RUE: TLS: ServerHelloDone
RUE -> CONFIGSERVER: HTTP: GET https://config.providerdomain.com/v1
CONFIGSERVER -> RUE: HTTP: 401 Unauthorized WWW-Authenticate Digest\nusername="X" realm="Y" qop="auth,auth-int" nonce=...
RUE -> CONFIGSERVER: HTTP: https://config.providerdomain.com/v1 Authorization Digest\nusername="X" realm="Y" qop="auth" nonce=...
CONFIGSERVER -> CRM: Find subscriber information\nfor username="X"
CRM -> CONFIGSERVER: Subscriber specific\nconfiguration information
CONFIGSERVER -> PROVIDERSETTINGS: Retrieve provider specific settings
PROVIDERSETTINGS -> CONFIGSERVER: Provider specific configuration information
CONFIGSERVER -> RUE: 200 OK + JSON key/value hash merge of subscriber specific and\nprovider specific configurations
@enduml

We have added some \n in some message, so that the diagram fits in 78 columns.
Is this what you where expecting ?
answered Feb 4, 2016 by plantuml (113,980 points)
Well, that got all folded up, but I think I get the point.  Cool; let me give that a try.  Thanks.

[ Edit: when I reloaded the whole thread, it was clean again. ]

And oh, my, yes, that works nicely.  What is the "8" parameter, though?
It's the maximum size (in characters) between two lifelines.
If you increase it (for example, set it to 15), you'll see that the diagram will be larger.

So even if you cannot specify the maximum total width of the diagram, playing around with this setting allows an indirect control of the total width.
Got it. Ok; I think I can get somewhere with that; my test render came out pretty nice.  Thanks much, folks.  We'll toss you a sawbuck or two.
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...