# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cgps.gitbook.io/data-flo/reference-guide/export-graph-to-dot-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
