Skip to content

Commit ddbb38a

Browse files
greebieruebot
authored andcommitted
Remove graph attributes from gexf output (not supported by networkx). (#69)
1 parent 96aded8 commit ddbb38a

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

src/main/gexf.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -127,28 +127,6 @@ extern int igraph_write_graph_gexf(const igraph_t *graph, FILE *outstream,
127127
ret=fprintf(outstream, " <graph id=\"G\" defaultedgetype=\"%s\">\x0A", (igraph_is_directed(graph)?"directed":"undirected"));
128128
if (ret<0) IGRAPH_ERROR("Write failed", IGRAPH_EFILE);
129129

130-
/* graph attributes */
131-
ret=fprintf(outstream, " <attributes class=\"graph\">\x0A");
132-
if (ret<0) IGRAPH_ERROR("Write failed", IGRAPH_EFILE);
133-
for (i=0; i<igraph_vector_size(&gtypes); i++) {
134-
char *name, *name_escaped;
135-
igraph_strvector_get(&gnames, i, &name);
136-
IGRAPH_CHECK(igraph_i_xml_escape(name, &name_escaped));
137-
if (VECTOR(gtypes)[i] == IGRAPH_ATTRIBUTE_STRING) {
138-
ret=fprintf(outstream, " <attribute id=\"%s%s\" title=\"%s\" type=\"string\"/>\x0A", gprefix, name_escaped, name_escaped);
139-
if (ret<0) IGRAPH_ERROR("Write failed", IGRAPH_EFILE);
140-
} else if (VECTOR(gtypes)[i] == IGRAPH_ATTRIBUTE_NUMERIC) {
141-
ret=fprintf(outstream, " <attribute id=\"%s%s\" title=\"%s\" type=\"double\"/>\x0A", gprefix, name_escaped, name_escaped);
142-
if (ret<0) IGRAPH_ERROR("Write failed", IGRAPH_EFILE);
143-
} else if (VECTOR(gtypes)[i] == IGRAPH_ATTRIBUTE_BOOLEAN) {
144-
ret=fprintf(outstream, " <attribute id=\"%s%s\" attr.title=\"%s\" type=\"boolean\"/>\x0A", gprefix, name_escaped, name_escaped);
145-
if (ret<0) IGRAPH_ERROR("Write failed", IGRAPH_EFILE);
146-
}
147-
igraph_Free(name_escaped);
148-
}
149-
ret=fprintf(outstream, " </attributes>\x0A");
150-
if (ret<0) IGRAPH_ERROR("Write failed", IGRAPH_EFILE);
151-
152130
/* vertex attributes */
153131
ret=fprintf(outstream, " <attributes class=\"node\">\x0A");
154132
if (ret<0) IGRAPH_ERROR("Write failed", IGRAPH_EFILE);

0 commit comments

Comments
 (0)