graphing link list nodes... modules?

Discussion in 'Perl Misc' started by hennessy, Jun 2, 2004.

  1. hennessy

    hennessy Guest

    Hi,
    I need to put together a PNG or PDF chart using a linked list of
    'nodes', and I was wondering if there were any modules that handled this
    kind of thing already? That is, if I had a listref of hashrefs like so:

    $nodes->[$entry]->{'id'}
    $nodes->[$entry]->{'parent_id'}
    $nodes->[$entry]->{'name'}
    $nodes->[$entry]->{'description'}

    I would feed it the LoH and tell it which keys to use as id and
    parent id, and it would create graphics representing name & description
    and arrows relating the relationships between the LoH nodes, say as
    objects in a default layout which could be modified by object calls or
    something.

    I'm thinking maybe this is too generic a problem, but if anyone
    can point me to a module or recipe I'd be terribly grateful...

    (oh yes, and perl.com seems down from my end and CPAN didn't have
    anything in search that was screamingly obvious)

    Cheers!
    - Matt

    --
    "When in doubt, use brute force."
    - Ken Thompson
     
    hennessy, Jun 2, 2004
    #1
    1. Advertising

  2. hennessy

    Ben Morrow Guest

    Quoth 9.net (hennessy):
    > Hi,
    > I need to put together a PNG or PDF chart using a linked list of
    > 'nodes', and I was wondering if there were any modules that handled this
    > kind of thing already? That is, if I had a listref of hashrefs like so:
    >
    > $nodes->[$entry]->{'id'}
    > $nodes->[$entry]->{'parent_id'}
    > $nodes->[$entry]->{'name'}
    > $nodes->[$entry]->{'description'}
    >
    > I would feed it the LoH and tell it which keys to use as id and
    > parent id, and it would create graphics representing name & description
    > and arrows relating the relationships between the LoH nodes, say as
    > objects in a default layout which could be modified by object calls or
    > something.
    >
    > I'm thinking maybe this is too generic a problem, but if anyone
    > can point me to a module or recipe I'd be terribly grateful...


    The module B::Graph uses an external program called 'dot' to generate
    its graphs; you may find that useful. It will generate both ps and png
    output (despite the manpage claiming it only produces gif).

    http://www.research.att.com/sw/tools/graphviz/

    Ben

    --
    It will be seen that the Erwhonians are a meek and long-suffering people,
    easily led by the nose, and quick to offer up common sense at the shrine of
    logic, when a philosopher convinces them that their institutions are not based
    on the strictest morality. [Samuel Butler, paraphrased]
     
    Ben Morrow, Jun 2, 2004
    #2
    1. Advertising

  3. hennessy

    hennessy Guest

    In article <c9l28f$q1l$>,
    Ben Morrow <> wrote:
    >http://www.research.att.com/sw/tools/graphviz/


    PERFECT!

    (I think I'll try the GraphViz module though, or one of its children..)

    Thanks!
    - Matt
    --
    "When in doubt, use brute force."
    - Ken Thompson
     
    hennessy, Jun 2, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. asd
    Replies:
    3
    Views:
    448
    Arnaud Berger
    May 23, 2005
  2. gavnosis
    Replies:
    0
    Views:
    532
    gavnosis
    Aug 2, 2003
  3. Timo Nentwig

    selecting nodes between other nodes

    Timo Nentwig, Jun 16, 2004, in forum: XML
    Replies:
    1
    Views:
    419
    Patrick TJ McPhee
    Jun 17, 2004
  4. Johnny Ooi

    Looking A Nodes From Within Nodes

    Johnny Ooi, Nov 13, 2004, in forum: XML
    Replies:
    10
    Views:
    664
    Johnny Ooi
    Nov 14, 2004
  5. john
    Replies:
    2
    Views:
    314
    Tim Evans
    Sep 24, 2003
Loading...

Share This Page