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.

Left-aligning transition text in state diagrams

0 votes
Guys, first of all thanks fo the great tool - have discovered PlantUML recently, and it seems very promising.

Having skimmed through the guide, looks like there's no builtin way to make the text of a transition event in a state diagram left-aligned. I'd like to display some code along with the event, so the default center alignment doesn't look very good in this case.

Coud you give me any pointers as to the classes/methods in the PlantUML codebase responsible for outputting the text and/or computing the bounding boxes, so that I could patch my local version to display events left-aligned?

Many thanks!

Vasyl
asked Jan 19, 2015 by anonymous

1 Answer

0 votes
 
Best answer

Hello,

Could you post here a diagram as example, so that we could better understand what you are trying to do.

About State Diagram, you have to know that Dot/Graphviz is used for the rendering, and sometimes it gives limitation on what we can do.

You can add the current line in your diagram:

!pragma svek_trace on

This will generate on your disk the temporary dot files used by PlantUML : it may help you to understand how the whole process works.

Thank you.

answered Jan 19, 2015 by plantuml (126,730 points)
Hi,

Thanks for the quick response. Thanks for the tip - will try out the pragma and see if I can dig out something.

Here's the simplest diagram that illustrates the issue:

@startuml
[*] --> One
One --> Two : Alpha {\n  Foo();\n   Bar();\n}
@enduml

As you can see, the code in the Alpha event body is center-aligned.

Thanks again,
Vasyl
We've just uploaded a new beta version
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

This beta version supports the following syntax:

@startuml
skinparam defaultTextAlignment left
[*] --> One
One --> Two : Alpha {\n  Foo();\n   Bar();\n}
@enduml

Feedback welcome!
Hooray!!! You guys are awesome!!!

Just FYI - on OS X 10.10 it has logged the following (the version I've downloaded yesterday worked silently):

Jan 19 21:40:14 iMac.local java[18782] <Error>: The function ‘CGContextErase’ is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance.

The image was totally OK though, so no big deal.

Thank you, thank you, thank you!!!
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...