Skip to content

Kkordik/DiagramAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

DiagramAPI

This is backend for Diagrams Creator HuggingChat assistant:

https://hf.co/chat/assistant/65e71408a6654bcc68624d8d

How to run:

Install dependencies:

sudo apt install graphviz
python3 -m venv .venv
source .venv/bin/activate
pip install fastapi graphviz uvicorn

or if on AWS linux

sudo yum install graphviz
python3 -m venv .venv
source .venv/bin/activate
pip install fastapi graphviz uvicorn

Run the code:

uvicorn main:app --reload

How to use

To use first of all write your DOT code:

digraph G { A -> B; }

URI encode it:

digraph%20G%20%7B%20A%20-%3E%20B%3B%20%7D

And send HTTP GET request and save the image to the file:

curl "http://localhost:8000/gen?dot=digraph%20G%20%7B%20A%20-%3E%20B%3B%20%7D" --output graph.png

See the result:

graph.png

About

An API for instant DOT(Graphviz) language code rendering.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages