Events instead of timestamps in timing diagram

+3 votes
asked Feb 20, 2019 in Wanted features by anonymous

Hello,

some years ago I inspired to add the timing diagram. Meanwhile I used it a lot but I'm missing a feature since not all actions are time dependent but event driven. So it would be nice to give some text instead of a timestamp. To make drawing easier it could be a good idea to always give a timestamp but to give an optional text that should be printed instead.

Here a possible example for the language extension:

@startuml
robust "DNS Resolver" as DNS
robust "Web Browser" as WB
concise "Web User" as WU

@0
WU is Idle
WB is Idle
DNS is Idle

@+100 is "URL given"
WU -> WB : URL
WU is Waiting
WB is Processing

@+200 is "URL request"
WB is Waiting
WB -> DNS@+50 : Resolve URL

@+100 is "DNS processing started"
DNS is Processing

@+300
DNS is Idle
@enduml

And here what it should look like:

What do you think?

commented Apr 8, 2025 by ssnyder (250 points)
This would be great to have - it would even allow us to override the time axis with things other than actual time or dates!  (i.e. days of week, arbitrary milestones for a project, etc)

1 Answer

0 votes
answered Apr 8, 2025 by The-Lu (87,240 points)

Hi all,

Here is a possible workaround using comment on hidden binary signal as:

@startuml
<style>
.hidden {
  LineColor transparent
}
</style>
robust "DNS Resolver" as DNS
robust "Web Browser" as WB
concise "Web User" as WU
binary "Event" as E <<hidden>>

@0
WU is Idle
WB is Idle
DNS is Idle

@+100
WU -> WB : URL
WU is Waiting
WB is Processing
E is l : \n\n\nURL given

@+200
WB is Waiting
WB -> DNS@+50 : Resolve URL
E is l : \n\n\nURL request

@+100 
DNS is Processing
E is l :\n\n\n\nDNS processing started

@+300
DNS is Idle
@enduml

Enjoy,
Regards,
Th.

...