Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Rendering visualization of tree to block diagram

by tomazos (Deacon)
on Jan 26, 2010 at 21:38 UTC ( [id://819784]=perlquestion: print w/replies, xml ) Need Help??

tomazos has asked for the wisdom of the Perl Monks concerning the following question:

I have a tree represented recursively as follows: each node of the tree is a %hash with keys that are named subtrees and one special keyvalue, the $hash{COUNT}, that holds an integer.

The COUNT at each node is greater than the sum of its children's COUNT.

I want to render a graphical block diagram such that each node is represented by a solid rectangle of random color with an area proportional to COUNT, and each child node is rendered within the solid rectangle of its parent, and not overlapping its siblings. (Because of the constraint that the parent's COUNT is greater than its children you can see this is possible)

Which CPAN module(s) would you recommend to do this? Is there a suitable visualization-specific module you would recommend? Or should I use a general drawing module?


Andrew Tomazos  |  andrew@tomazos.com  |  www.tomazos.com

Replies are listed 'Best First'.
Re: Rendering visualization of tree to block diagram
by pemungkah (Priest) on Jan 26, 2010 at 22:04 UTC
    You're looking for a treemap. Gtk3::Ex::TreeMap is one alternative on CPAN. You might also want to look at this page for a bunch of alternatives, some good, some not as.
Re: Rendering visualization of tree to block diagram
by scorpio17 (Canon) on Jan 27, 2010 at 14:41 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://819784]
Approved by blokhead
Front-paged by MadraghRua
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-03-29 11:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found