Sequence diagram commands for command driven diagramming

Create a document with “Command drive” style and type commands into the field. Then click “Build” button or press a shortcut Cmd+R. You can add additional shapes from the palette which will be preserved after rebuild.

Participants
sequenceDiagram
	    participant John
	    participant Alice
	    Alice->>John: Hello John, how are you?
	    John-->>Alice: Great!
The participants can be defined implicitly as in the first example on this page. The participants or actors are rendered in order of appearance in the diagram source text. Sometimes you might want to show the participants in a different order than how they appear in the first message. It is possible to specify the actor’s order of appearance by doing the following:
Messages
[Actor][Arrow][Actor]:Message text
Messages can be of two displayed either solid or with a dotted line. There are six types of arrows currently supported:
->
which will render a solid line without arrow
Alice->John: Hello John, how are you?
–>
which will render a dotted line without arrow
Alice-->John: Hello John, how are you?
->>
which will render a solid line with arrowhead
Alice->>John: Hello John, how are you?
–>>
which will render a dotted line with arrowhead
Alice-->>John: Hello John, how are you?
-x
which will render a solid line with a cross at the end (async)
Alice-xJohn: Hello John, how are you?
–x
which will render a dotted line with a cross at the end (async)
Alice--xJohn: Hello John, how are you?
Notes
Note [ right | left ] of [Actor]: Text in note content
sequenceDiagram
	    participant John
	    Note right of John: Text in note
It is possible to add notes to a sequence diagram. This is done by the notation Note [ right | left ] of [Actor]: Text in note content
Loops
loop Loop text
	... statements ...
	end
sequenceDiagram
	    Alice->John: Hello John, how are you?
	    loop Reply every minute
	        John-->Alice: Great!
	    end
Alt
alt Describing text
	... statements ...
	else
	... statements ...
	end
or if there is sequence that is optionat (if without else).
opt Describing text
	... statements ...
	end
sequenceDiagram
	      Alice->>Bob: Hello Bob, how are you?
	        alt is sick
	            Bob->>Alice: Not so good :(
	        else is well
	            Bob->>Alice: Feeling fresh like a daisy
	        end
	        opt Extra response
	            Bob->>Alice: Thanks for asking
	        end

Flowchart commands for command driven diagramming

Create a document with “Command drive” style and type commands into the field. Then click “Build” button or press a shortcut Cmd+R. You can add additional shapes from the palette which will be preserved after rebuild.

Graph
graph TD
This statement declares a new graph and the direction of the graph layout.
  • TB – top bottom
  • BT – bottom top
  • RL – right left
  • LR – left right
  • TD – same as TB
	graph TB;
	    A-->B;
	    A-->C;
	    B-->D;
	    C-->D;
	graph LR;
	    A-->B;
	    A-->C;
	    B-->D;
	    C-->D;
A node (default)
id1
graph TB;
    A
A node with text
id1[This is the text in the box]
It is also possible to set text in the box that differs from the id. If this is done several times, it is the last text found for the node that will be used. Also if you define edges for the node later on, you can omit text definitions. The one previously defined will be used when rendering the box.
graph TB;
    A[This is the text in the box]
A node with round edges
id1(This is the text in the box);
graph TB;
    A(This is the text in the box)
A node in the form of a circle
id1((This is the text in the circle));
graph TB;
    A((This is the text in the circle))
A node in an asymetric shape
id1>This is the text in the box]
graph TB;
    A>This is the text in the box]
A node (rhombus)
id1{This is the text in the box}
graph TB;
    A{This is the text in the box}
A link with arrow head
A–>B
graph TB;
    A-->B
An open link
A — B
graph TB;
    A---B
Text on links
A– This is the text — B
or
A—|This is the text|B;
graph TB;
    A-- This is the text --- B
Dotted link
-.->
graph TB;
    A-.->B
Dotted link with text
-. text .->
graph TB;
    A-. text .->B
Thick link
==>
graph TB;
    A==>B
Thick link with text
== text ==>
graph TB;
    A== text ==>B
Subgraphs
subgraph title
graph definition
end
graph TB
        subgraph subsystem one
        a1-->a2
        end
        subgraph subsystem two
        b1-->b2
        end
        subgraph subsystem three
        c1-->c2
        end
        c1-->a2
Styling links
linkStyle 3 stroke:#ff3,stroke-width:4px;
It is possible to style links. For instance you might want to style a link that is going backwards in the flow. As links have no ids in the same way as nodes, some other way of deciding what style the links should be attached to is required. Instead of ids, the order number (starting from 0) of when the link was defined in the graph is used. In the example below the style defined in the linkStyle statement will belong to the fourth link in the graph
graph LR
    id1(Start)-->id2(Stop);
    linkStyle 0 stroke:#ff0000,stroke-width:4px;
Styling a node
graph LR
    id1(Start)-->id2(Stop)
    style id1 fill:#f9f,stroke:#333,stroke-width:4px;
    style id2 fill:#ccf,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5;

UML sequence diagrams

First create a document with “UML Sequence” style (see also below a command driven way to create sequence diagrams).

The editor for sequence diagrams consists of 2 parts: an outline and graphic image. How to create a sequence diagram.

1. Create two or more timelines:

seq1Large

2. Double click a timeline caption to rename it:

seq2Large

3. Right-click a sequence area to add a message:

seq3Large

(or select Add Message from the drop down menu).

4. Select where the source and target are:

seq4Large

5. Build the diagram (Cmd+R):

seq5Large

6. Double click a Text cell to add a message:

seq6Large

Then you can add other messages or containers:

seq7Large

Drag messages to drop it into a container or change the order. Rebuild the diagram to see result. You can also drag and drop timeline columns:

seq8Large

For containers you can change a title:

seq9Large

There is also an option to switch between message and response.

You can change visual properties of a diagram as usual and they will be kept after re-build. See some Preferences in the Inspector:

seq10Large

Vector drawing tools

There is an additional component “Vector Drawing Tools” that allows you to create your own shapes and lines and use them along with predefined shapes. In fact this is a vector drawing editor inside Diagrammix! This component available as in-app purchase both for Mac App Store and non App Store version of the app. See menu Store inside the app.

Import

You can import stencils from Graffletopia.com. Import option is located on the Template Chooser (File – New or Cmd + N).

help23.1large

You can also import stencils into the current document (File – Import). Unnecessary imported groups could be removed from the palette. Right click on the group caption and click Delete menu item.

After import you can edit imported elements. Drag element from the palette, ungroup it one or more times (Cmd+Shift+G), edit, group again or group as element (Object – Group as element, Cmd+Shift+E) if you need connectable element, drag result back to the palette.

Imported elements will be added to the derived template based on Customizable Style.

New document with all imported elements will be created after import to check results.

Files with imported elements are located in the “~/Library/Application Support/Diagrammix/Notations/Imported/”. To remove imported stencil right click icon on the Style chooser panel and click Delete menu item.

Please, report about probable problems with import. We are currently improving this feature, but many stensils are imported without problems. Try it.

Export

You can export Diagrammix drawings to these formats:
– PDF,
– PNG,
– JPEG,
– TIFF

and SVG (File > Export as SVG).

When you export a drawing using the Export dialog box (File menu), an Export the Drawing dialog box may appear, in which you can specify settings for the exported file. If necessary, you can crop exported images to visible objects bounds, specify background transparency (PNG, TIFF). Resolutions from 72 dpi to 300 dpi are available.

Printing

In Diagrammix, the drawing size and printer paper size are set separately. You can set a drawing page size that is the same as, larger than, smaller than, or has a different orientation from the printer paper. The drawing page size is set in the Preferences – Units & Grid section. You can select one of the predefined drawing size or set any drawing size.

You can change the printer paper size in the File – Page setup dialog.

There is special layer Pages (Layer – Layers Palette) to show pages layout. You can move the grid of pages and resize each page. After resizing each page will be scaled to the size of printer paper.

PagerLayerLarge

All process is shown on the next picture:

paginationLarge

Right click on the Pages layer to show context menu with commands “Reset pages layout”, “Add page to the printing range”, “Remove page from the printing range”.
Click with Cmd to add (or remove) current page to the printing range.

With this feature you can easily print just what you need with scaling to the target paper size:

EasySelectionScalingForPrinting

Replace shapes

You can change shape into another shape. Text and connectors are preserved.

help21.1

Working with Selection

You can access an element’s, connector’s, table’s properties via Inspector. After you have a selection, you can perform operations on the selected objects, similar to the actions you can perform in a popup windows.