Re: [graphviz-interest] dot2texi cannot handle large graphs
"Emden R. Gansner" <[email protected]> Mon, 24 Feb 2014 09:57:10 -0500
| Newsgroups | gmane.comp.video.graphviz |
|---|---|
| Message-ID | <[email protected]> |
>
> Googling suggests that it's very hard to get TeX to deal with dimensions this large. But I feel
> like there must be some workaround to make dot2texi Graphviz scale down all the numbers, including
> the font sizes... I'd be very grateful for any advice.
There are simple solutions to get the size of the drawing reduced, such as setting the size and
fontsize attributes. This won't do you any good, because your graph is
fairly dense and, more importantly, it's very bushy, There are 5 nodes on level 1, 28 nodes on level
2 and 135 nodes on level 3. You can stagger the edge lengths to help
some, but you still have long edges crossing levels, adding to the width. The nodes can be
compressed within each rank, and then the edges can be redrawn using the
available space, but the resulting layout will probably be ugly. Even if you packed the last level
as 13 rows of 10 nodes each, and used a small font size, that would still
take a lot of room on a page.
For the record, I have attached a layout using staggered nodes. This was produced using
dot graph.gv | gvpr -c -f unflatten | dot
where I've also attached the gvpr script unflatten.
Emden
_______________________________________________
[email protected]
http://lists.research.att.com/mailman/listinfo/graphviz-interest
out.pdf
(application/pdf, 40.3 KB) - not displayed
unflatten
(text/plain, 637 B)
/* Print histogram of levels from dot */
BEG_G {
node_t n;
edge_t e;
graph_t sg, lev[double];
double d;
int i, sh, shift[int];
shift[1] = 10;
shift[2] = 20;
}
N{
d = (double)yOf(pos);
sg = lev[d];
if(!sg) {
sg = subg($G,yOf(pos));
lev[d] = sg;
}
subnode(sg,$);
}
END_G {
forr (lev[d]) {
if (i > 2) {
break;
}
else if (i > 0) {
sg = lev[d];
sh = 1;
for (n = fstnode(sg); n; n = nxtnode_sg(sg,n)) {
for (e = fstout(n); e; e = nxtout(e)) {
e.minlen = (char*)sh;
if (++sh > shift[i]) sh = 1;
}
}
}
i++;
}
}