Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: representing a tree graphically...

by clemburg (Curate)
on Jan 09, 2002 at 21:13 UTC ( #137496=note: print w/ replies, xml ) Need Help??


in reply to representing a tree graphically...

OK, after looking at your sample output I realize this is not what you need ... but anyway, for those that have a similar need (visualizing tree structures) let me point out GraphViz, the Perl interface to the GraphViz tool.

With GraphViz installed, making a little nice postscript (could be PNG, too, or whatever you can postscript convert too) image of your treepath input from above (assumed to be in file try.txt below) becomes as easy as this little shell script:

echo 'digraph G { concentrate = true; ' > try.dot cat try.txt | perl -lane '$F[2] =~ s/:000//g; $F[2] =~ s/:/ -> /g; $F[ +2] .= ";"; print $F[2] if $F[2] =~ /->/' >> try.dot echo '}' >> try.dot dot -Tps -o try.ps try.dot

Where file try.txt is:

1 => 001:000:000 2 => 001:002:000 3 => 001:003:000 4 => 001:003:004 5 => 001:002:005

Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com


Comment on Re: representing a tree graphically...
Select or Download Code
Re: Re: representing a tree graphically...
by merlyn (Sage) on Jan 09, 2002 at 21:40 UTC

      I stand corrected.

      Christian Lemburg
      Brainbench MVP for Perl
      http://www.brainbench.com

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://137496]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2014-09-17 21:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (100 votes), past polls