# documents_to_networkx

> **Function** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/graph_vectorstores/networkx/documents_to_networkx)

Return the networkx directed graph corresponding to the documents.

## Signature

```python
documents_to_networkx(
    documents: typing.Iterable[Document],
    *,
    tag_nodes: bool = True,
) -> nx.DiGraph
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `documents` | `typing.Iterable[Document]` | Yes | The documents to convenrt to networkx. |
| `tag_nodes` | `bool` | No | If `True`, each tag will be rendered as a node, with edges to/from the corresponding documents. If `False`, edges will be between documents, with a label corresponding to the tag(s) connecting them. (default: `True`) |

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/graph_vectorstores/networkx.py#L13)