An open API service indexing awesome lists of open source software.

https://github.com/jnguyen1098/cdot

Simple header-only C/C++ API for generating Graphviz DOT graphs
https://github.com/jnguyen1098/cdot

c graphviz graphviz-dot header-only headers

Last synced: 8 months ago
JSON representation

Simple header-only C/C++ API for generating Graphviz DOT graphs

Awesome Lists containing this project

README

          

```
───────────────────────────────────────────────────────────────────────────────────────────────
─██████████████─────────────████████████───────────────██████████████───────────██████████████─
─██░░░░░░░░░░██─────────────██░░░░░░░░████─────────────██░░░░░░░░░░██───────────██░░░░░░░░░░██─
─██░░██████████─────────────██░░████░░░░██─────────────██░░██████░░██───────────██████░░██████─
─██░░██─────────────────────██░░██──██░░██─────────────██░░██──██░░██───────────────██░░██─────
─██░░██─────────────────────██░░██──██░░██─────────────██░░██──██░░██───────────────██░░██─────
─██░░██─────────────────────██░░██──██░░██─────────────██░░██──██░░██───────────────██░░██─────
─██░░██─────────────────────██░░██──██░░██─────────────██░░██──██░░██───────────────██░░██─────
─██░░██─────────────────────██░░██──██░░██─────────────██░░██──██░░██───────────────██░░██─────
─██░░██████████─────────────██░░████░░░░██─────────────██░░██████░░██───────────────██░░██─────
─██░░░░░░░░░░██─────────────██░░░░░░░░████─────────────██░░░░░░░░░░██───────────────██░░██─────
─██████████████─────────────████████████───────────────██████████████───────────────██████─────
───────────────────────────────────────────────────────────────────────────────────────────────
▄B▒Ä░WW#╗▄
(█#▄│││││││▀▄
▐▌╡▐█▒#▓╪▓▒▒▌
▌║║▒▒▒▒▒▒▒█
█▒╢▒▒▒▒▒▒║.
.▄▄█▒▒▒▒▒▒▒║b
▄æ▓▒▒▀Ñ╡║▒║▒▒▒▒▒▒║█▓▄▄
▄▄#▒█╡║║║▒▒▒▒▒▒▒▒▒▒▒▒▒▒███▒█▓▓▄
#▓█╚╠╠║╡▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██████▒█▓▄
▄▓▀▒╠│#╢▒▒▒▒▒Ñ▀▀▓▓▒▒▒╡▒▒▒▒▒▒▒▒▒█████▒████▓▄
▄▓█▒▒▒║▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║Ñ▀▀▒▀▀▀▓▀▀███████████▒▓▄
╪█╡▒╠█╡▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓██████████▒▓
▄æ#▒█║▒▒▒▒▒╠▀█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓█████████████⌐
▄█╡▒▒█▒▒▒▒▒▒▒▒▒▒╠▀▀▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓████████████▒█▄
▐▀▒▒▒▒╠█▒▒▒▒▒▒▒▒▒▒▒▒▒▒╡▀▀▀▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██████████▒▒██▒█
╫▒▒╠╠║▒▒╠▀▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║╠▀▀▀▀▀▀▓▓▓▓▓▓▓█▓▓▓▓█████▒▓███▓█
█▒▒░│║▒▒▒║▀▀▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓████████████████████▒█▓å
█▒▓▓▒║║▒▒▒▒▒╠▀▀▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓███████████████████████▓████▌
▌║█▒█▓▓▒▒▒▒▒▒▒▒▒▒║██▓▓▒▒▒▒▒▒▒▓▓▓████████████████████████▒▒███████▄
▐╠█████▒██▓▓▒▒▒▒▒▒▒▓▒▒▓█▒█▒█▓▓▒▒▒▒▓████████████▒▒▒▒▒█▓███▒████████▌
╫|███▌║║███▒██████▓▓▒█████████████▒▒████▒█████▒▒██████████████████╜
▌|███▌║████▀▀██▒███████████████████████████████████████████████▒▀τ
▌|████████▀║║║║Ñ▀▀▀█▒▒█████████████████████████████████████▒▒▀▀τ
█|███████▀|╙╙╚╠╠║║║║██████▀██▒▒▒███████████████████▒▒▒▒██████
╪||▀███▀Ü||||||||╙╙╚╫████▌║║║║┤ÑÑ▀██████▀▀▀▀▀█▒▒▒█║▒▒▓▓▓▓▓▒▒▌
▐▄|∩ ||||||╓█ |||||║█████╙╙╚╚╚╠╠██████▀║║║║▐█▓▓▓▓▓▓▒▒▒▒▒▓▒║=
▀▄| ||||╓▓█║▌|||||.██████B,|¡▄██████▀╙╙╙╙╙█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▌
█▒▓╪╪#▓█▀▒▒▒█B|||||└███████████████Ñ|||||█║▒▒▒▒▒▒▒▒▒▒▒▒▒█.
╙▌║│╠║║║▒▒▒▒▒█B||||||╙▀█████████▀▀||||| █║▒▒▒▒▒▒▒▒▒▒▒▒▒║▀
╙╡║│║║▒▒▒▒▒▒▒█▓ ||||||| ╙╙▀╙┴ |||||||#█║▒▒▒▒▒▒▒▒▒▒▒▒▒║▀
╙█╢╡║▒▒▒▒▒▒▒▒▒█▓▄|||||||||||||||||#▓║▒▒▒▒▒▒▒▒▒▒▒▒▒▒█Ö
▀▒▒▒▒▒▒▒▒▒▒▒▒▒║█▓#▄|||||||||▄╪▓▒▒▒▒▒▒║▒╝▀▀▀▀╙▀▀█▀
╙█║▒▒▒▒▒▒▒▒▒▒▒▒▒▒║█▒▒▒▓▒▒▒║▒▒▒▒▒║▒▀╙` |│||||||╙k
▄▀█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▀Ñ|||||{||||||||||█
▄▀∩||╙▀█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║█▌||||||##░░░░░#|||| ▌
▌ │|||┴▀▀▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║█▐▌||(#╠║║║║║║║║║║M|||▌
▐▌∩|{||||##╠║Ñ██▓▒▒▒▒▒▒▒▒▒▒▒▓█||╙Φ│║║║║║║║║║║║║║╡∩|║=
▀#░M#░╠║║║║║║║██▀ ▀█▒▒▒▒▒▒║█▌||#╠▀▓▒║║║║║║║║║║║╡|║▀
└╙╫▒▒┼#▒▒▒╝▀╙. ╙▀▒▒▒█▀ █|││║║║╡▀▀╪╪▒▒▒▒▒▄▒╫▀
▀▄╚║║║║║║║║║║║║╠▒▀
╙╜╝▒▒▒▒▒╫╝▀╙╙
```

# cdot (WORK IN PROGRESS)

Simple header-only C API for generating Graphviz DOT graphs.

```c
#include "cdot.h"

void cdot_stdout_example(void)
{
INIT_CDOT(stdout);

ADD_EDGE("hello", "world");
ADD_EDGE("world", "foo");

DESTROY_CDOT();
}

void cdot_file_example(void)
{
FILE *fp;
if ((fp = fopen("example.gv", "w"))) {
INIT_CDOT(fp);

const char *line = "123456789";
char first[2] = "";
char last[2] = "";

// Creates a long centipede graph
for (int i = 0; line[i + 1]; i++) {
first[0] = line[i];
last[0] = line[i + 1];
ADD_EDGE(first, last);
}

DESTROY_CDOT();
} else fprintf(stderr, "???\n");
}

int main(void)
{
cdot_stdout_example();
cdot_file_example();
return 0;
}

```

## Attribution

ASCII art of Seedot from https://asciiart.club/

ASCII art of the cdot banner from https://fsymbols.com/generators/carty/