Graphics, Figures & Tables ⇒ Advice on building dependency diagram
Advice on building dependency diagram
I have to build a dependency diagram
There are 5 systems, S1, S2, S3, S4, S5
S1 --> S2 means S1 depends on S2
S1 --> S2, S3, S4
S2 --> S3, S5
S3 --> S2, S5
S4 --> S5
S5 --> S1, S2, S3, S4
How can I build dependency diagram like the one attached?
Also, is it possible that once I click on node S1, I get all the direct dependencies highlighted?
There are 5 systems, S1, S2, S3, S4, S5
S1 --> S2 means S1 depends on S2
S1 --> S2, S3, S4
S2 --> S3, S5
S3 --> S2, S5
S4 --> S5
S5 --> S1, S2, S3, S4
How can I build dependency diagram like the one attached?
Also, is it possible that once I click on node S1, I get all the direct dependencies highlighted?
- Attachments
-
- dependancy_graph.jpg (24.46 KiB) Viewed 9059 times
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Advice on building dependency diagram
Hi and welcome,
for drawing, i would recommend tikz. A bunch of quite similar graphs can be found in the graphs directory of TeXample.net.
What exactly do you mean by clicking and highlighting? Not sure, if this is so easy without the normal pdf-spec.
for drawing, i would recommend tikz. A bunch of quite similar graphs can be found in the graphs directory of TeXample.net.
What exactly do you mean by clicking and highlighting? Not sure, if this is so easy without the normal pdf-spec.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Re: Advice on building dependency diagram
Thanks Johannes_B
This is what I mean by highlighting
http://live.yworks.com/demobrowser/inde ... aph-Viewer
Also, using Texample, can I just put my dependencies in one file and all the graphs would be built automatically as I keep changing the data ?
This is what I mean by highlighting
http://live.yworks.com/demobrowser/inde ... aph-Viewer
Also, using Texample, can I just put my dependencies in one file and all the graphs would be built automatically as I keep changing the data ?
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: Advice on building dependency diagram
the pdf format is kind of static, for good reasons. There might be something doable with Java Script inside pdf, but this is not really a good idea (imho).
What do you mean by putting all dependencies in a file? Each graph will most likely be on tikz-picture. You need to do manual some work to get the graphs, there is no completely automated version.
What do you mean by putting all dependencies in a file? Each graph will most likely be on tikz-picture. You need to do manual some work to get the graphs, there is no completely automated version.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Advice on building dependency diagram
What I mean is given this dataJohannes_B wrote:
What do you mean by putting all dependencies in a file? Each graph will most likely be on tikz-picture. You need to do manual some work to get the graphs, there is no completely automated version.
S1-->S2, S3
S3-->S1, S4
the program should position the nodes and draws lines accordingly between different nodes
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: Advice on building dependency diagram
Ah, now i understand. Yues, tikz should do that for you.
But to be honest, i am no tikz expert.
But to be honest, i am no tikz expert.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Advice on building dependency diagram
Yes, there's a graphdrawing library which works on similar dependency input, and creates graphs. It's described in the
TikZ manual, Part IV. I just don't have a compiler at hand right now, perhaps I can show an example later.
Stefan

Stefan
LaTeX.org admin
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Advice on building dependency diagram
Here's a sample with your data.
Compiling with LuaLaTeX gives:
Stefan
Code: Select all
Code, edit and compile here:
\documentclass{article}\usepackage{tikz}\usetikzlibrary{arrows.meta,graphs,graphdrawing}\usegdlibrary{trees, layered, circular, force}\begin{document}\begin{tikzpicture}[>=stealth, rounded corners]\graph [layered layout, level distance=6em,sibling distance=8em,nodes={draw,circle}] {S2 -> {S3, S5},S1 -> {S2, S3, S4},S3 -> {S2, S5},S4 -> S5,S5 -> {S1, S2, S3, S4};{ [same layer] S1, S4 };{ [same layer] S2, S3 };};\end{tikzpicture}\end{document}
Stefan
LaTeX.org admin
Re: Advice on building dependency diagram
Thanks so much Stefan
it worked!
it worked!