Graphviz is kind of neat

HHunt

Supreme [H]ardness
Joined
Apr 12, 2001
Messages
6,063
I accidentaly found graphviz a few days ago, and wondered if I could find some interesting use for it. For the lack of anything better, I decided to use it to draw dependency graphs for FreeBSD ports. It ended up rather well, so I sort of want to show it off. :D

Python code for getting all dependencies: pGraph.py
Cshell-script wrapper (don't generate graphs that exist, among other things): pGraph.csh
Minimal web interface (PHP): Here.

Trash away, the server is a mostly unused lab PC.
Something suitably evil (e.g. kdebase) will take a while to run the first time. (It will also looks like a nightmare wiring cabinet, or possibly a plate of spaghetti.)

Just as an example, here's aterm:
x11__aterm.gif


edit: The part of my schools network that this computer lives on has a life of its own. It's apparently hobbled together from what they could spare elsewhere (naturally, we're just the CompSci department ...), and connections are randomly refused. I just had to ssh to another school server, then to another computer on the same lab, then to this one, and then ping an outside host from it, just to remind ... something that it actually exists and should recieve outside traffic. Geeez.

IOW: the availability is far from guaranteed, so get a local copy if you want to use any of the images.
 

HHunt

Supreme [H]ardness
Joined
Apr 12, 2001
Messages
6,063
[H]EMI_426 said:
I just ran that bad boy against gnucash. Geez.

Anyway, pretty cool.

Yeah, I noticed. :D

Gnome programs are insane.
(I cleaned up some background stuff and reran gnucash. Scary. Twisty maze of dependencies, all of them alike, etc.)

Thanks, btw. For a few hours of hacking, I'm rather pleased with the results. (I owe most of it to graphviz, to be honest.)
 

HHunt

Supreme [H]ardness
Joined
Apr 12, 2001
Messages
6,063
Did you just run screen without getting a good image?

edit: Ah, I see why.
Code:
portsdb -R misc/screen
misc/screen

No deps, apparently.
 

Lews_Therin

Weaksauce
Joined
Jul 1, 2005
Messages
64
It's interesting how much more tangled GNOME apps are compared to plain old GTK+ apps. I'll have to show that to the next person who asks why I don't use the GNOME libs.
 

HHunt

Supreme [H]ardness
Joined
Apr 12, 2001
Messages
6,063
Lews_Therin said:
It's interesting how much more tangled GNOME apps are compared to plain old GTK+ apps. I'll have to show that to the next person who asks why I don't use the GNOME libs.

Yeah. KDE is almost clean in comparisation. (Take a look at kdebase and kdeutils.)
 

[H]EMI_426

2[H]4U
Joined
Feb 19, 2001
Messages
3,965
Yes, I did run it against screen. It didn't even return the screen port itself, so I figured something went wrong.

I've found that using the port category along with the port name can make things work better.

I thought about doing something like this before with imlib, but I never actually implemented it. Cool idea.
 

HHunt

Supreme [H]ardness
Joined
Apr 12, 2001
Messages
6,063
It filtered it out when anything depended on itself, and without that, there was nothing for it to graph. I removed that filter for now, and the way things work everything you submit will have a dependency on itself (and thus show up).
Screen now looks like this:
misc__screen.gif


The future plans include checking what ports (if any) match, returning a list if it's more than one, and letting the user select one of them. We'll see how bored I am tomorrow. :D
(Right now I just feed it to portsdb and hope for the best.)
 

HHunt

Supreme [H]ardness
Joined
Apr 12, 2001
Messages
6,063
Lews_Therin said:
While not as bad, KDE programs still have hefty requirements. Part of the reason the charts are simpler appears to be FreeBSD's ports system lumping all the KDE stuff together. For a comparison, here are three CD burning tools:

K3b (KDE)

nautilus-cd-burner (GNOME)

xcdroast (plain GTK)

That's true, but OTOH it is how KDE is supposed to be packaged. :)
(As I've understood it, everything else is distro-specific hacks.)
 

Geshtar

Limp Gawd
Joined
Apr 15, 2004
Messages
224
If any of you guys do coding, doxygen makes excellent use of graphviz. You might want to check it out. I use it whenever I get thrown a load of code that I have not worked with before. The call graphs alone are a very useful even if the comments weren't written to get picked up by doxygen.
 
Top