Order of states in timing diagram

+1 vote
asked Oct 20, 2017 in Wanted features by MikaelP
I would like the possibility to specify the displayed order of the states in a timing diagram. Currently the states are displayed in the order they appear.

I have two basic use-cases, both having numerical values for the states and I want to have them displayed in the numerical order, i.e. the lowest value at the bottom.

Consider the following example:

@startuml
robust "Variable" as variable
robust "Binary" as binary

@variable
0 is 0
1 is 2
2 is 1
3 is 3
4 is "-2"

@binary
0 is 1
1 is 0
@enduml

1 Answer

0 votes
answered Jan 17 by Daniel
I'd propse the following syntax:

robust "Variable" as variable
robust "Binary" as binary
variable has "-3"
variable has "-2"
variable has "-1"
variable has 0
variable has 1
variable has 2
variable has 3
variable is 0

binary has 0
binary has 1
binary is 1

@variable
0 is 0
1 is 2
2 is 1
3 is 3
4 is "-2"

@binary
0 is 1
1 is 0
@enduml
commented May 3 by zanedp (140 points)
I'd like to be able to give short names to states as well.

Building on the above proposed syntax:

robust "Flow rate" as rate
rate has "35 gpm" as high
rate has "15 gpm" as low
rate has "0 gpm" as none

@0
rate is high

@5
rate is none

@6
rate is low
commented May 3 by plantuml (180,120 points)
Thanks all for your suggestions.

So last beta http://beta.plantuml.net/plantuml.jar supports following diagrams:

@startuml
robust "Flow rate" as rate
rate has "35 gpm" as high
rate has "15 gpm" as low
rate has "0 gpm" as none

@0
rate is high

@5
rate is none

@6
rate is low
@enduml


@startuml
robust "Flow rate" as rate
rate has high
rate has low
rate has none

@0
rate is high

@5
rate is none

@6
rate is low
@enduml

What do you think about it ?
...