Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Rendering visualization of tree to block diagram

by tomazos (Deacon)
on Jan 26, 2010 at 21:38 UTC ( #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  |  |
  • Comment on Rendering visualization of tree to block diagram

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?

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
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2023-09-26 05:08 GMT
Find Nodes?
    Voting Booth?

    No recent polls found