Dear Group,
During some initial experiments with the BGL-GraphViz interface, I observed a
significant asymmetry between a given DOT graph input with
boost::read_graphviz() and output with boost::write_graphviz() (without
changing any attributes).
Given the input DOT file (which is, of course, much longer with the full set
of information)
graph metro
{
node[ fontname = "luxirr", style = filled, fillcolor = white ];
"Arts et Métiers";
subgraph ligne_1
{
node[ fillcolor = "orange" ];
"La Défense/Grande Arch" -- "Esplanade de la Défense";
}
}
The elementary BGL program
#include
int main( void )
{
boost::GraphvizGraph g_dot;
boost::read_graphviz( "metro.dot", g_dot );
boost::write_graphviz( "metro_boost.dot", g_dot );
}
transforms this into the output DOT file
graph ligne_1 {
node [fillcolor="orange", fontname="luxirr", style="filled"];
subgraph ligne_1 {
node [fillcolor="orange", fontname="luxirr", style="filled"];
1[label="La Défense/Grande Arch"];
2[label="Esplanade de la Défense"];
1 -- 2;
}
0[label="Arts et Métiers"];
}
It seems that somewhere on the way, the graph and node (and edge) attributes
get clobbered. Note that even the graph name "metro" gets replaced by the
name of the (last) subgraph "ligne_1", and /all/ node attributes get mixed
up. This seems to be somewhat similar to the recent edge-related problem
posted by Hideaki Hiraki.
I have not (yet) tried to mess with the graphviz parser code, so I am asking
here for help. Thanks.
Greetings,
Andreas