# Working with Diagram Builder

The first step is to create the diagram templates your organisation will use.&#x20;

To help you get started we have provided 4 suggested templates which you can modify to meet the specifics of your environment.

* Hosting Infrastructure Diagram - This represents the logical compute and network elements. It useful in identifying connectivity aspects of a design. In particular it can show you which firewalls are being traversed.
* Disaster Recovery Diagram - This represents the physical locations. It useful in identifying availability aspects of a design.
* Network Zone Model Diagram - This represents zones of trust. It useful in identifying non-compliant flows which breach trust boundaries.
* Information Security Diagram - This represents the data classification of applications. It useful in identifying non-compliant flows which could leak sensitive data.

To start modifying these suggested templates or to create your own we have Diagram Builder. The sections below will guide you through the use of Diagram Builder.

## Diagram Builder

### Layout

The layout of diagram builder consists of:

* Creation Form - This is where you specify the attributes of your diagram
* Rendered Diagram - This is the preview of diagram you are creating. There is a download icon on the top right corner which downloads to a svg image file.
* Diagram json - This is the contents of diagram file. There is a download icon on the top right corner which downloads the file. This is useful if you wish to edit the file directly using a code editor.

![](https://1900778133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LXcVZrFQb4d_ipoLx14%2F-LXkEh5L-3-6DiMBTgAQ%2F-LXkHCGjk_4Cl6QaXtQY%2FInfViz%20-%20Diagram%20Builder%20Basic.png?alt=media\&token=18266d61-7e90-415f-9584-d5dcb170e134)

### File

This section is used to open, edit and create diagram templates.

#### Diagram Open

This opens an existing diagram file to edit.&#x20;

* If set to 'None' this is implies it is a new diagram
* Save and Delete options are available after you have opened a file.
* To save as a new file use Diagram Save As

### Box

This section is used to specify the boxes in your diagram.

| Box Attributes   | Description                                                                                             |
| ---------------- | ------------------------------------------------------------------------------------------------------- |
| Id               | Internal name used to reference the diagram canvas. In most cases it is best to leave as "DrawingFrame" |
| Label            | Text which will appear as the title in your diagram                                                     |
| Box Orientation  | Controls the direction multiple boxes will be drawn. By default they will be drawn 'vertical'           |
| Node Orientation | Controls the direction multiple nodes will be drawn. By default they will drawn 'horizontal'            |

#### Box Levels (Contains)

This controls the number of boxes to be drawn and the nesting of boxes.

| Box Level (Contains) | Description                                                                                                                       |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| Id                   | Internal name used to reference the box.                                                                                          |
| Label                | Text which will appear as the title of the box.                                                                                   |
| Border Colour        | Colour of the box border. By default it is set to 'black'. To make it invisible set another colour and then set it back to 'None' |
| Box Orientation      | Controls the direction multiple boxes will be drawn. By default they will be drawn 'vertical'                                     |
| Box Width Match      | Matches the width of another box                                                                                                  |
| Box Height Match     | Matches the height of another box                                                                                                 |
| Node Orientation     | Controls the direction multiple nodes will be drawn. By default they will drawn 'horizontal'                                      |
| Node Position        | Controls the direction multiple nodes will be drawn. By default they will drawn 'horizontal'                                      |
| Node Wrap            | Number of node to put on a single row                                                                                             |
| Disable Routing      | Prevents the box from being affected by routing rules                                                                             |
| Accept               | Alternate names which the box can be referenced as                                                                                |

### Box Group

Box Group is used to group multiple boxes into a single large box.

| Box Group Attributes | Description                                     |
| -------------------- | ----------------------------------------------- |
| Label                | Text which will appear as the title of the box. |
| Box                  | Box ids which belong to the group               |

### Style

Styles dictate the specific attributes of the diagram.

| Style Attributes | Description                                                                                                                        |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Text Only        | If true displays nodes as text boxes & uses node text property. If false displays nodes as icons & uses node icon & label property |
| Line Label       | Displays label on the end node of a line                                                                                           |
| Node Line        | Displays lines between nodes                                                                                                       |
| Focus            | Displays boxes only which contains nodes                                                                                           |
| Metadata         | Displays metadata of nodes in a table                                                                                              |
| Legend           | Displays legend in a table                                                                                                         |
| Top Left Dot     | Displays colour dot on top left corner                                                                                             |
| Top Right Dot    | Displays colour dot on top right corner                                                                                            |
| Route Link       | Displays lines using route logic                                                                                                   |
| Route Error      | Display a table with any route errors                                                                                              |
| Route Info       | Displays a table with route logic                                                                                                  |

### Nodes

Nodes are used to represent servers or services within your diagram. These can also be added later by combining with a design file.

| Node Attributes     | Description                                                    |
| ------------------- | -------------------------------------------------------------- |
| Id                  | Internal name used to reference the node                       |
| Label               | Text which will appear underneath the node                     |
| Icon                | Icon which will be displayed                                   |
| Top Left Dot Colour | Puts a dot colour on the top left of the icon                  |
| Text                | Text to displayed instead of an icon when text mode is enabled |
| In                  | The box which the node will be drawn in                        |
| Metadata: \*        | Metadata table to be displayed underneath the diagram          |

### Lines

Lines are used to connect nodes or boxes. These can also be added later by combining with a design file.

| Line Attributes | Description                                                                                                                                                                                        |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Id              | Internal reference for easy identification                                                                                                                                                         |
| From            | Start node or box                                                                                                                                                                                  |
| To              | End node or box                                                                                                                                                                                    |
| Label           | Short label written on top of the node                                                                                                                                                             |
| Colour          | Colour of the line                                                                                                                                                                                 |
| Style           | <p>How the will be drawn.</p><p>clean - Default option which will create a neat line</p><p>straight - will draw direct point to point line</p><p>route - will route the line through gateways </p> |
| Direction       | Manipulate the path of line.                                                                                                                                                                       |
| Arrow           | To display arrow. Default is True.                                                                                                                                                                 |

### Gateways

Gateways are used to route traffic between boxes. This is usually used to mimic network traffic logic.

| Gateway Attributes | Description                                               |
| ------------------ | --------------------------------------------------------- |
| Id                 | Internal reference for easy identification                |
| Label              | Label for underneath gateway node                         |
| Icon               | Icon which will be displayed                              |
| On Position        | Where the gateway will be draw on the box                 |
| On                 | The box which the gateway will be drawn on                |
| Route              | The target boxes which lines will go through this gateway |
