|
Boost Users : |
Subject: Re: [Boost-users] BGL: Write graphviz file with invisible edges
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-06-21 12:48:59
On Tue, 21 Jun 2011, David Doria wrote:
> I found out that if you write a graph (.dot) file like this:
>
> graph G {
> 0;
> 1;
> 2;
> 0--1;
> 1--2 [style=invis];
> }
>
> graphviz will layout the graph as if it has two edges (0--1, and
> 1--2), but not display the edge between vertices 1 and 2. This is
> useful when trying to keep the vertices stationary and show changes to
> the connectivity. How would I setup the graph in BGL so I could mark
> particular edges so they will be written with [style=invis]?
The strategy for doing that is to create a dynamic_properties object, add
an entry to it for the "style" edge property and some property map, and
then pass that to write_graphviz_dp. An example of what you want to do is
in libs/graph/example/graphviz.cpp; see how the "weight" property is
handled. In your case, the value type of the property would be
std::string.
-- Jeremiah Willcock
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net