Metadata-Version: 2.1
Name: graph2img
Version: 1.2.6
Summary: graph2img: convert a graph to a png file.
Home-page: https://github.com/ForwardStar/graph_drawer
Author: Haoxuan Xie
Author-email: haoxuanxie@link.cuhk.edu.cn
License: LICENSE
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.8
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# Installation by pip

Install with pip:
```sh
pip install graph2img
```

Then write your edge information into ``graph.txt``. For example:
```
1 2 1
2 3 2
1 3 3
```

This will return a triangular graph.

Then run the program:
```sh
graph2img graph.txt
```

This will return a file ``graph.png``:

![](https://raw.githubusercontent.com/ForwardStar/graph_drawer/main/graph.png)

Or to draw a tree:
```
1 2 1
1 3 2
2 4 2
2 5 3
3 6 3
3 7 2
1 9 1
2 8 2
```

This will return a tree:

![](https://raw.githubusercontent.com/ForwardStar/graph_drawer/main/graph_tree.png)

# Options

Two options are provided:
```
--save-temp-files=true/false
--output-format=png/svg
```

If you want to save the temporary files (like tex codes), set ``--save-temp-files`` as ``true``;

If you want to generate a svg format image, set ``-output-format`` as ``svg``.

# Installation from source

```sh
git clone https://github.com/ForwardStar/graph_drawer.git
cd graph_drawer
python setup.py install
```

