Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001817graphvizFdppublic2010-02-15 18:272011-04-28 04:03
Assigned Toerg 
PlatformOSx86-Linux-Ubuntu 9.0.4OS Version
Summary0001817: fdp ignores max size when called as library

Calling common layouts on a simple graph from a C program.
All layouts conform to maximum dimension of 96x10 except
for fdp, which produces a layout much larger.

Minor extension of simple C program from documentation:

#include <graphviz/types.h>
#include <graphviz/graph.h>
#include <graphviz/gvc.h>

#include <stdio.h>

int main()
    Agraph_t *g;
    Agnode_t *n, *l, *d, *f, *h, *s, *t;
    Agedge_t *e, *e2, *e3, *e4, *e5, *e6, *e7;
    GVC_t *gvc;

    /* set up a graphviz context */
    gvc = gvContext();

    /* Create a simple digraph */
    g = agopen("g", AGRAPH);

    n = agnode(g, "nooey");
    l = agnode(g, "looey");
    d = agnode(g, "dooey");
    f = agnode(g, "fooey");
    h = agnode(g, "hooey");
    s = agnode(g, "sooey");
    t = agnode(g, "tooey");

    e = agedge(g, l, n);
    e2 = agedge(g, d, n);
    e3 = agedge(g, d, f);
    e4 = agedge(g, f, h);
    e5 = agedge(g, h, d);
    e6 = agedge(g, f, s);
    e7 = agedge(g, f, t);

    /// set graph global attributes
    agsafeset(g, "nodesep", "2.0", "");
    agsafeset(g, "mindist", "2.0", "");
    agsafeset(g, "center" , "true", "");
    agsafeset(g, "size" , "10,10", "");
    agsafeset(g, "bb" , "0,0,960,960", ""); //96 dpi times 10 inches

    /* Compute a layout using specified layout engine */
    gvLayout(gvc, g, "dot");
        gvRenderFilename(gvc, g, "png","ex1-dot.png");
        gvRenderFilename(gvc, g, "dot", "");
    gvFreeLayout(gvc, g); /* Free layout data */

    gvLayout(gvc, g, "neato");
        gvRenderFilename(gvc, g, "png", "ex1-neato.png");
        gvRenderFilename(gvc, g, "dot", "");
    gvFreeLayout(gvc, g); /* Free layout data */

    // - fdp big layout...
    gvLayout(gvc, g, "fdp");
        gvRenderFilename(gvc, g, "png", "ex1-fdp.png");
        gvRenderFilename(gvc, g, "dot", "");
    gvFreeLayout(gvc, g); /* Free layout data */

    gvLayout(gvc, g, "twopi");
        gvRenderFilename(gvc, g, "png", "ex1-twopi.png");
        gvRenderFilename(gvc, g, "dot", "");
    printCoords(g, "twopi");
    gvFreeLayout(gvc, g); /* Free layout data */

    gvLayout(gvc, g, "circo");
        gvRenderFilename(gvc, g, "png", "ex1-circo.png");
        gvRenderFilename(gvc, g, "dot", "");
    gvFreeLayout(gvc, g); /* Free layout data */

    /* Free graph structures */

    /* close output file, free context, and return number of errors */
return (gvFreeContext(gvc));
Additional Information

This is not a bug. The size attribute is only used during rendering.
The other layouts happen to be small by accident.
TagsNo tags attached.
STATUS-COMMENTFixed (15 Feb 2010)
VERSION     2.20.2
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 => erg

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