1 #ifndef GRAPH_EXPORTER_
2 #define GRAPH_EXPORTER_
17 template<
typename GraphType >
30 out <<
"graphml output not implemented" << std::endl;
36 out <<
"digraph G {" << std::endl;
40 for(
unsigned int i = 0; node != g_.node_end(); ++node, ++i) {
42 out << node->first+1 <<
" [label=" << node->second->name();
45 out <<
", dependencies=" << node->second->dependencies()->size() <<
", dependents=" << node->second->dependents()->size();
49 if(properties != NULL) {
50 typename GraphType::property_map_t::iterator it;
51 for(it = properties->begin(); it != properties->end(); it++) {
52 out <<
"," << it->first <<
"=" << it->second;
56 if(extra_properties != 0) {
57 properties = extra_properties->get_all_properties(node->second);
58 if(properties != NULL) {
59 typename GraphType::property_map_t::iterator it;
60 for(it = properties->begin(); it != properties->end(); it++) {
61 out <<
"," << it->first <<
"=" << it->second;
68 out <<
", x=" << g_.
position(node->second).first <<
", y=" << g_.
position(node->second).second;
71 out <<
"];" << std::endl;
76 for(eit = g_.edge_begin(); eit != g_.edge_end(); ++eit) {
77 out << eit->first.first+1 <<
"->" << eit->first.second+1
78 <<
" [label=" << (eit->second->absolute() ?
"absolute" :
"relative") <<
"];"
83 out <<
"}" << std::endl;
88 out <<
"Unfortunately CSV export not implemented yet." << std::endl;
void write_csv()
Export to CSV.
Definition: graph_exporter.h:87
void write_graphml(GraphProperties< GraphType > *extra_properties=0)
Write graphml output of the generated graph to the given stream.
Definition: graph_exporter.h:29
GraphProperties< GraphType > & properties()
Fetch the properties.
Definition: grapher.h:155
Definition: graph_exporter.h:18
position_map_t::value_type position(const V_type v)
Fetches the position in a std::pair<int, int> of a specific vertex data.
Definition: grapher.h:173
node_data_t::iterator node_iterator
Type used to iterate over nodes.
Definition: grapher.h:89
void write_graphviz(GraphProperties< GraphType > *extra_properties=0)
Definition: graph_exporter.h:35
Definition: graph_properties.h:7
std::map< std::string, std::string > property_map_t
Type used to map a property (as string) to a value (as string)
Definition: grapher.h:80
bool has_layout()
Returns true if there is a layout.
Definition: grapher.h:150
edge_map_t::iterator edge_iterator
Type used to iterate over edges.
Definition: grapher.h:95