# create-graph-from-dot

## Description

<mark style="color:purple;">`create-graph-from-dot`</mark> *adaptor creates a graph structure from text in* [`DOT`](https://en.wikipedia.org/wiki/DOT_\(graph_description_language\)) *language format*.

## Inputs

**`dot`**\
Type: `text`\
Required: Yes\
The text in [DOT language format](https://en.wikipedia.org/wiki/DOT_\(graph_description_language\)).

## Outputs

**`graph`**\
Type: `graph`\
A graph structure defining nodes and edges.

## Examples

### Example 1: Default behaviour.

#### Inputs:

`dot`:

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

#### Outputs:

`list`:

```
{ 
    "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": {} } 
    ]
}
```

-> Created an undirected graph from a DOT text.

## Use Cases

* This adaptor is useful for converting DOT data to graph format enables users to reformat the graph's nodes through the [`apply-force-directed-layout`](http://o/-LB6jV5O6hp6O90DAvtu/s/VJMuSDp56RPG6HerD2nz/~/changes/184/readme-1/adaptors/adaptor-reference-guide/apply-force-directed-layout) adaptor.
* This adaptor is useful for converting a Dot file to a graph allows for detailed analysis of the relationships and connections within the dataset


---

# 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/create-graph-from-dot.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.
