# export-graph-to-dot-file

## Description

<mark style="color:purple;">`export-graph-to-dot-file`</mark> *adaptor exports a graph as a text file in* [`DOT`](https://en.wikipedia.org/wiki/DOT_\(graph_description_language\)) *format.*

## Inputs

**`graph`**\
Type: `graph`\
Required: Yes\
The graph structure to be exported.

## Outputs

**`dot`**\
Type: `text`\
A text file in DOT format (`.dot`).

## Examples

### Example 1: Default behaviour

#### Inputs:

`graph:`

```
{ 
    "nodes": [ 
                { "id": "a", "label": "a" },
                { "id": "b", "label": "b" },
                { "id": "c", "label": "c" },
                { "id": "d", "label": "d" }
    ],
    "edges": [ 
                { "id": "edge-0", "from": "a", "to": "b", "direction": "none", "attributes": {} },
                { "id": "edge-1", "from": "b", "to": "c", "direction": "none", "attributes": {} },
                { "id": "edge-2", "from": "b", "to": "d", "direction": "none", "attributes": {} } 
    ]
}
```

#### Outputs:

`dot:`

```
graph graphname {
    a -- b -- c;
    b -- d;
}
```

-> Created a DOT text file from an undirected graph.

## Use Cases

* Users may convert a graph file to DOT to enable them to build a network visual in Microreact. Use the DOT file as an input into the network argument in the [`export-to-microreact-project`](http://o/-LB6jV5O6hp6O90DAvtu/s/VJMuSDp56RPG6HerD2nz/~/changes/184/readme-1/adaptors/adaptor-reference-guide/export-to-microreact-project) adaptor to do so.
* Converting a graph to a Dot file makes it compatible with other tools and libraries that support the DOT language.
* Dot files are human-readable and can be easily shared with others to enable discussion among or inspection of the graph behaviors.
