Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002276graphvizTcl/Tk Utilitiespublic2013-04-13 01:212013-04-13 01:21
ReporterAndrewStein 
Assigned To 
PriorityhighSeverityimportantReproducibilityalways
StatusnewResolutionopen 
PlatformOSMac OSXOS VersionMtn Lion
Summary0002276: Graph nodes point to themselves
DescriptionOwing to an upgrade from Snow Leopard to Mountain Lion, I had to go from graphviz 2.28 to 2.30.1.
In previously working tcl code, all graph nodes now point to themselves instead of to the head node...

I believe that the issue lies in the file tcldot-graphcmd.c.

The lines form 106 that read:
        head = cmd2n(argv[2]);
        if (!head) {
        if (!(head = agfindnode(g, argv[3]))) {
        Tcl_AppendResult(interp, "Head node \"", argv[3], "\" not found.", NULL);
        return TCL_ERROR;
        }
        }
should extract the head from argv[3] not argv[2]
Steps To Reproduce > tclsh
% package require Tcldot
2.30.1
% set g [dotnew digraph]
graph0x7fca4a100430
% set n1 [$g addnode n1]
node0x7fca4a517380
% set n2 [$g addnode n2]
node0x7fca4a5307e0
% set e [$g addedge $n1 $n2]
edge0x7fca49600130
% $g write stdout dot
digraph {
    graph [bb="0,0,144,36"];
    node [label="\N"];
    n1 [height=0.5,
        pos="27,18",
        width=0.75];
    n1 -> n1 [pos="e,52.443,11.309 52.443,24.691 63.028,25.152 72,22.922 72,18 72,14.77 68.136,12.699 62.488,11.788"];
    n2 [height=0.5,
        pos="117,18",
        width=0.75];
}

As you can see there is an edge from n1 to n1
Additional InformationWorkaround. There is a workaround (which involves changing the tcl source):
Use "$n1 addedge $n2" instead of "$g addedge $n1 $n2]"


 > tclsh
% package require Tcldot
2.30.1
% set g [dotnew digraph]
graph0x7f97e4b0de10
% set n1 [$g addnode n1]
node0x7f97e4c20f40
% set n2 [$g addnode n2]
node0x7f97e4c20fb0
% set e [$n1 addedge $n2]
edge0x7f97e4c21020
% $g write stdout dot
digraph {
    graph [bb="0,0,54,108"];
    node [label="\N"];
    n1 [height=0.5,
        pos="27,90",
        width=0.75];
    n2 [height=0.5,
        pos="27,18",
        width=0.75];
    n1 -> n2 [pos="e,27,36.104 27,71.697 27,63.983 27,54.712 27,46.112"];
}


TagsNo tags attached.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID
INPUT-FILE
OUTPUT-FILE
STATUS-COMMENT
VERSION2.30.1
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2013-04-13 01:21 AndrewStein New Issue


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