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
- Host: GitHub
- URL: https://github.com/jnguyen1098/cdot
- Owner: jnguyen1098
- License: isc
- Created: 2021-03-27T17:35:56.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-31T21:25:28.000Z (over 4 years ago)
- Last Synced: 2025-01-10T11:02:12.059Z (10 months ago)
- Topics: c, graphviz, graphviz-dot, header-only, headers
- Language: C
- Homepage:
- Size: 12.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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/