icon
menu

Sequence Perspectives

Sequence perspectives show detailed interactions between resources. Sequence perspectives are perfect for showing actions between resources that happen in a sequential order. While relation perspectives are great for showing static relations between resources, sequence diagrams are ideal for showing what resources do in specific scenarios.

An Ilograph diagram with a sequence perspective

To create a sequence perspective, simply declare a sequence in your perspective using the sequence property.

Defining a sequence

In Ilograph source, a sequence is defined like so:

# Resource tree omitted
...
perspectives:
- name: Get Diagram
  color: LimeGreen
  sequence: 
      start: Users
      steps: 
      - to: ns
        label: Get diagram
      - toAndBack: iloUsers
        label: Authenticate user

      - to: getIlograph
        label: Invoke
      - toAndBack: Ilographs
        label: Get metadata
      - toAndBack: Permissions
        label: Get permission
      - toAndBack: diagrams.ilograph.com
        label: Retrieve content

      - to: ns
        label: Return diagram
      - to: Users
        label: Return diagram
...

When rendered, this perspective might look like the above image.

Arrow labels and descriptions

The arrows can be labeled and given colors and descriptions using the label, color, and description properties on each step. Just like with relation perspectives, the label appears above the arrow, while the description appears on mouse-over. Descriptions can contain multiple lines and markdown.

to, toAndBack, toAsync, and restartAt

Each step must define to, toAndBack, toAsync, or restartAt. Each behaves slightly differently.

to - The most common case; when defining a step with to, the sequence control flow moves to the specified resource.

toAndBack - Like to, only a step back to the previous resource is automatically added after. This is a convenient way to specify simple calls that return to the caller right away.

toAsync - Like to, only the sequence control flow doesn’t move to the specified resource; instead, it remains with the previous resource. Async steps are drawn with dashed arrows.

restartAt - Moves the seqeunce control flow to the specified resource without drawing an arrow. The next step will originate from this resource.

bidirectional

Set the bidirectional property to true on a step to draw arrowheads on both ends of the step’s arrow(s). Mostly useful when using toAsync.