Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-25-2013, 11:35 AM   #1
Registered: Mar 2006
Posts: 170

Rep: Reputation: 15
How to generate a graphical plot of a tree data structure

I have a 'dependency hell' type situation at work that comes up over and over, and I want a way to generate a plot of the dependency tree, to help humans visualize it.

I can build the dependency tree up manually with my program, which would probably be perl, but I'm trying to find a way to actually generate a plot whether with a perl module, gnuplot, or something i've never heard of. Output format can be svg, png, pdf, whatever.

I looked into the qtree package for \LaTeX, but my \LaTeX skills are not great. The results are pretty however.

It would be extra-cool if the result had collapsible nodes--that you could click to much so that I considered writing the notes as empty files in nested directories and using a file-browser to visualize them! However, writing empty files just so that I can use a gui file browser for visualization is a bit silly, but that's pretty much what I want.

Any ideas appreciated.
Old 02-25-2013, 12:03 PM   #2
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,151
Blog Entries: 4

Rep: Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717Reputation: 2717

In times past, I built quite a complicated Perl program that generated an input-file for this tool, and it worked quite splendidly. The input file describes what the graph is, and the objective of the GraphViz toolset is to determine how best to express it.

Based on my reading of your problem, this is exactly what you need.

Last edited by sundialsvcs; 02-25-2013 at 12:05 PM.
Old 02-25-2013, 09:15 PM   #3
Registered: Mar 2006
Posts: 170

Original Poster
Rep: Reputation: 15
I will definitely check that out, but in the meantime I have gotten the \LaTeX qtree package to work, after discovering the 'low-level interface'.

The problem is, my tree data structures always have 3 levels, but can have arbitrarily many branches at each level. This is a problem because the plots run off the paper. The only solution I can think of is to have a 'large' paper size. The largest I have found is \documentclass{a0poster} which fits SOME of my plots. But then the smaller plots contain a lot of 'negative space'.

I think what I really want is NO paper size. I want \LaTeX to render my plot in cyberspace apart from any idea of paper size. Is it possible to do this?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
PWD and TREE dir structure dump restore debajit_kataki Linux - Server 4 03-11-2009 09:01 AM
Converting a Histogram data into Scatter Plot data kushalkoolwal Linux - Software 2 09-08-2008 01:19 PM
removeing the files but tree structure should be same dina3e Linux - Newbie 1 03-23-2008 05:57 AM
Preserving directory tree structure /etc/fstab Hikito Linux - Newbie 1 09-11-2004 04:07 PM
Recommendation for webpage tree structure Alan Powell Linux - Newbie 1 04-06-2004 02:07 PM

All times are GMT -5. The time now is 05:17 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration