[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Better layout output in igraph

From: Tamas Nepusz
Subject: Re: [igraph] Better layout output in igraph
Date: Wed, 10 Aug 2011 12:50:10 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11

> Error: Exceeded density grid with x_grid = 491 and y_grid =
> 2147483638.  Program stopped.
This error message is from the DrL layout algorithm. DrL is a third-party
layout algorithm that has been integrated into igraph, and it was originally
distributed as a standalone application, so there are places where it simply
aborts the application instead of returning an error code. If you have a
graph with which this bug is reproducible in a deterministic manner, please
send it to me so I can check what's wrong with it and why the DrL algorithm
fails. Any other layout algorithm works fine as you already noted it in your
other email.

>> curvature of the edge. The Python interface in 0.6 will support custom edge
>> drawer classes, so you would be able to plug in your own edge drawer there.
> Is this function available in the trunk?
The custon edge drawer functionality is available, but there is no edge
drawer yet which supports curved edges. You can check the source code of
igraph.drawing.edge.ArrowEdgeDrawer and .AbstractEdgeDrawer to get a rough
idea of how it works. If you need curved edges, you can implement it as a
subclass of ArrowEdgeDrawer or AbstractEdgeDrawer. Custom edge drawers in
igraph 0.6 can be used like this:

from igraph.drawing.edge import TaperedEdgeDrawer
from igraph.drawing.edge import DefaultGraphDrawer

def my_graph_drawer_factory(*args, **kwds):
    kwds["edge_drawer_factory"] = TaperedEdgeDrawer
    return DefaultGraphDrawer(*args, **kwds)

plot(graph, drawer_factory=my_graph_drawer_factory)

The above code will give you tapered edges in directed networks where each
edge is essentially a narrow triangle pointing towards its target. Make sure
you have the latest revision as the drawer_factory=... keyword argument has
just been added to the supported keyword arguments of Graph.__plot__.

In the long run, I plan to add the curved edge functionality to
ArrowEdgeDrawer, similarly to the way it works with the R interface of
igraph. Actually, I plan to do it this week, so if this is not urgent, it
might be easier for you to wait a bit.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]