[prev in list] [next in list] [prev in thread] [next in thread] 

List:       graphviz-interest
Subject:    Re: [graphviz-interest] iterating through subgraphs
From:       John Ellson <ellson () research ! att ! com>
Date:       2009-08-30 1:36:15
Message-ID: 4A99D78F.1010401 () research ! att ! com
[Download RAW message or body]

You might find tclpkg/gv/gv.cpp a useful source for fragments like 
this.   This file
is the base of all the swig-generated language bindings.

In answer to your question, to iterate over subgraphs you need to 
iterate over the nodes in the
meta_graph,  e.g from the rm(Agraph_t *) function, you can find 
(paraphrasing) :

        for (e = agfstout(g->meta_node->graph, g->meta_node); e;
                         e = agnxtout(g->meta_node->graph, e)) {
             sg = agusergraph(aghead(e));
             /* do something to sg */
         }

John


On 08/29/2009 06:01 PM, Kleag wrote:
> Hello,
>
> I'm trying to use graphviz as a library in kgraphviewer instead of dot. I use
> as documentation "Drawing graphs with Graphviz, Emden R. Gansner, April 27,
> 2009".
>
> I'm able to iterate through nodes and edges but not through subgraphs. I was
> able to find suitable API in cgraph.h but not in graph.h which seems to be the
> right thing to use.
>
> Thanks in advance for any help.
>
> Best regards,
>
> Gaël
>
>    

_______________________________________________
graphviz-interest@research.att.com
https://mailman.research.att.com/mailman/listinfo/graphviz-interest
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic