a Single File Graph layout library in c and Java or python

Pedo Anton Lefering be1d0da99e update %!s(int64=3) %!d(string=hai) anos
d4dag be1d0da99e update %!s(int64=3) %!d(string=hai) anos
data 68992cfd1a sfg update %!s(int64=4) %!d(string=hai) anos
gcc 6f49227733 d4dag update %!s(int64=3) %!d(string=hai) anos
hypersfg 84da8f24e2 added qt5 gui program to see the graph layout routines %!s(int64=3) %!d(string=hai) anos
java d1fff930d8 The Java version of sfg runs now %!s(int64=4) %!d(string=hai) anos
java2 933f2d482f extra java info added %!s(int64=4) %!d(string=hai) anos
java3 d0e93a3114 library update %!s(int64=4) %!d(string=hai) anos
javascript bab0fb384c new javascript %!s(int64=4) %!d(string=hai) anos
qsfg 34fcee8acd added screenshot %!s(int64=3) %!d(string=hai) anos
wasm 47ab7436c5 md update %!s(int64=3) %!d(string=hai) anos
.gitignore 25925a2ea1 readme update %!s(int64=3) %!d(string=hai) anos
LICENSE 0123c5a6e0 Initial commit %!s(int64=4) %!d(string=hai) anos
Lindent 9ac6613d17 initial %!s(int64=4) %!d(string=hai) anos
Makefile d574fc81ef added use of C code complexity program %!s(int64=3) %!d(string=hai) anos
README.md d574fc81ef added use of C code complexity program %!s(int64=3) %!d(string=hai) anos
README1 9b3454e1d1 readme update %!s(int64=3) %!d(string=hai) anos
TODO 8b828bca2f wasm support added %!s(int64=3) %!d(string=hai) anos
cflow-csf-c.txt daf58b3f20 generate callgraph from C using GNU cflow %!s(int64=3) %!d(string=hai) anos
dmake 9ac6613d17 initial %!s(int64=4) %!d(string=hai) anos
gen-callgraph.sh c7d5b28de3 generate callgraph from Linux elf binary shell script added %!s(int64=3) %!d(string=hai) anos
gml4gtk-calltree-program.png 5661d39696 added screenshot %!s(int64=3) %!d(string=hai) anos
hypersfg-screenshot.png 84da8f24e2 added qt5 gui program to see the graph layout routines %!s(int64=3) %!d(string=hai) anos
mkedges.sh c7d5b28de3 generate callgraph from Linux elf binary shell script added %!s(int64=3) %!d(string=hai) anos
objcg.peg ad5c43d157 added new call graph and callgraph generation tool in C %!s(int64=3) %!d(string=hai) anos
objlibcg.peg daf58b3f20 generate callgraph from C using GNU cflow %!s(int64=3) %!d(string=hai) anos
qsfg.png 022d520d94 sfg works with qt5 gui in dir qsfg %!s(int64=3) %!d(string=hai) anos
qsfg2.png 224c5f014d updated qt graph editor %!s(int64=3) %!d(string=hai) anos
screenshot.png 786b8cc9f5 swig to python,perl,tcl works %!s(int64=4) %!d(string=hai) anos
screenshotps.png 3a01e1b767 svg drawing output from sfgdemo %!s(int64=4) %!d(string=hai) anos
sfg-c-callgraph-program.gv 901298435f added example callgraph using calltree program %!s(int64=3) %!d(string=hai) anos
sfg-callgraph-from-asm.gv 915588f7df added callgraph from sfg.c from the assembly output %!s(int64=3) %!d(string=hai) anos
sfg-callgraph.gv ad5c43d157 added new call graph and callgraph generation tool in C %!s(int64=3) %!d(string=hai) anos
sfg-cflow-callfraph.gv daf58b3f20 generate callgraph from C using GNU cflow %!s(int64=3) %!d(string=hai) anos
sfg.c 23c394f2f8 updated docs %!s(int64=3) %!d(string=hai) anos
sfg.c.scallgraph.gv f8d7fe81de updated sfg.c %!s(int64=3) %!d(string=hai) anos
sfg.h 921df43bb8 updated sfg.c malloc/free wrappers %!s(int64=3) %!d(string=hai) anos
sfgdemo-callgraph.gv c7d5b28de3 generate callgraph from Linux elf binary shell script added %!s(int64=3) %!d(string=hai) anos
sfgdemo.c 478581351b python script runs now %!s(int64=4) %!d(string=hai) anos
sfgdemo.c.scallgraph.gv f8d7fe81de updated sfg.c %!s(int64=3) %!d(string=hai) anos
sfgdemo.ps 2c2e246814 Javascript version works %!s(int64=4) %!d(string=hai) anos
sfgdemo.py 1e12d7cf93 using python svg image output added %!s(int64=4) %!d(string=hai) anos
sfgdemo.sh 478581351b python script runs now %!s(int64=4) %!d(string=hai) anos
sfgdemo.svg 478581351b python script runs now %!s(int64=4) %!d(string=hai) anos
sfgdemo.txt b4757a5703 screenshot added %!s(int64=4) %!d(string=hai) anos
sfgs.c 1e12d7cf93 using python svg image output added %!s(int64=4) %!d(string=hai) anos
tree2dotx.sh daf58b3f20 generate callgraph from C using GNU cflow %!s(int64=3) %!d(string=hai) anos

README.md

sfgraph

a Single File Graph layout library in c and Java https://graphviewer.nl

See sfgdemo.c or sfg.h and the README1 file for details

In directory hypersfg is GNU GPL Free QT5 gui program using this graph library to see it.

screenshot

The directory wasm is about compiling sfg.c to wasm and run sugiyama graph layout in the browser see this test version

To make the demo program sfgdemo type make
To cleanup use make clean
To indent the source use make indent
To show complexity of the C source using complexity tool use make comp
To check for memory leaks use make valgrind
To make libsfg.a use make sfga
To make libsfg.so use make sfgaso
To make python module with swig use make swigpython
To make perl module with swig use make swigperl
To make c++ with swig use make swigcplus
To make go with swig use make swiggo
To make java with swig use make swigjava
Also javascript, php, modula3 and more interfacing
to sfg.c can be generated with swig software
Using llvm compiler run scan-build-8 make
It compiles to javascript using emscripten emcc compiler
The python script sfgdemo.py runs graph layout using sfg.c
In the java directory is the Java source and a jar file
To run the Java version of sfg use: java -jar sfg.jar

screenshot

Because sfg.c only needs calloc()/free() it is usable for embedded software

To create callgraph as graphviz dot format the GNU cflow program can be used

cflow sfg.c | ./tree2x.sh >sfg-callgraph-cflow.gv

Also the calltree program can be used from schilytools at https://sourceforge.net/projects/schilytools/

Example output of calltree -dot sfg.c is in sfg-c-callgraph-program.gv

calltree

In directory gcc are patches for gcc compiler

The next iteration of sfg.c is called d4dag.c

In directory qsfg is a modified qvge qt5 graph editor running sfg.c graph layouter like this:

qsfg

qsfg