Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001249graphvizGraph Librariespublic2008-01-24 17:162011-04-28 04:03
ReporterAric 
Assigned Tonorth 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOS*-Unix-OS Version
Summary0001249: libagraph - attributes not properly set
Description



A pygraphviz user ran into an issue when setting attributes of nodes
with Graphviz (https://networkx.lanl.gov/ticket/143 [^]). After setting a node
attribute (e.g. color) writing the graph to a file does not include
the attribute. Immediately writing the file a second time does
include the attribute.



The is demonstrated in the following C code that uses libagraph. I can
reproduce the same with various versions of Graphviz (including very
recent snapshots). Am I using libagraph correctly here?
<CD>
#include <stdio.h>
#include <agraph.h>
main(int argc, char **argv)
{
  Agraph_t *g;
  Agnode_t *a,*b;
  Agedge_t *e;
  FILE *file;



  const Agdesc_t Agstrictundirected = { 0, 1, 0, 1 };
  const int find = 0;
  const int create = 1;
  g = agopen("tmp",Agstrictundirected,NULL);
  a = agnode(g,"a",create);
  b = agnode(g,"b",create);
  e = agedge(a,b,NULL,create);



  agattr(g,1,"color","");
  agset(a,"color","red");
  file=fopen("red.dot","w");
  agwrite(g,file);



  agset(b,"color","blue");
  file=fopen("redblue.dot","w");
  agwrite(g,file);



  file=fopen("redblue2.dot","w");
  agwrite(g,file);



}
</CD>



Output is



<CD>
# red.dot
strict graph tmp {
        a [color=red];
        a -- b;
}
# redblue.dot
strict graph tmp {
        a [color=red];
        b;
        a -- b;
}
# redblue2.dot
strict graph tmp {
        a [color=red];
        b [color=blue];
        a -- b;
}
</CD>
Additional Information

[erg] This bug is still in cgraph.
TagsNo tags attached.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID1281
INPUT-FILE
OUTPUT-FILE
STATUS-COMMENTFixed (25 Jan 2008)
VERSION     e.g. 2.12
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2011-04-28 04:03 user1 New Issue
2011-04-28 04:03 user1 Assigned To => Stephen North


MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker