Skip to content

Instantly share code, notes, and snippets.

@mhyee
Last active March 27, 2020 17:05
Show Gist options
  • Save mhyee/5876732 to your computer and use it in GitHub Desktop.
Save mhyee/5876732 to your computer and use it in GitHub Desktop.
Graphviz file for drawing a dependency graph. http://www.graphviz.org/
// Online Graphviz: http://webgraphviz.com/
// https://i.imgur.com/NHmoDnj.png
digraph g{
node [shape="box",style=rounded];
"a.out" -> "C.o"
"a.out" -> "B.o"
"a.out" -> "A.o"
"C.o" -> "C.cpp"
"B.o" -> "B.cpp"
"A.o" -> "A.cpp"
"C.cpp" -> "C.h"
"B.cpp" -> "B.h"
"A.cpp" -> "A.h"
"a.out" -> "main.o"
"main.o" -> "main.cpp"
"main.cpp" -> "C.h"
"main.cpp" -> "B.h"
"C.h" -> "A.h"
"B.h" -> "A.h"
}
@benman1
Copy link

benman1 commented Mar 27, 2020

You can simplify this by setting a default shape and style like this:
node [shape="box"; style=rounded];

@mhyee
Copy link
Author

mhyee commented Mar 27, 2020

Thanks for the tip! I also simplified the labels.

This gist is so old that I don't even remember why I posted it...

@benman1
Copy link

benman1 commented Mar 27, 2020

It's a useful snippet, thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment