[Top][All Lists]

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

Re: [igraph] [C] Drawing algorithms - coordinates question

From: Tamas Nepusz
Subject: Re: [igraph] [C] Drawing algorithms - coordinates question
Date: Wed, 3 Feb 2010 14:40:41 +0000
User-agent: Mutt/1.5.20 (2009-06-14)


> "Layout generator functions (or at least most of them) try to place the
> vertices  and  edges  of a graph on a 2D plane or in 3D space in a way
> which visually pleases the human eye.
> Just want to precise:
> 1) In what units of measure result is represented?
They are totally abstract, so feel free to scale them and translate them
however you want. As for the parameters (maxdelta, area, repulserad
etc), there are some sensible default values for them. I use the
following defaults in the Python interface:

- maxdelta: the number of vertices
- area: the number of vertices squared
- coolexp: 1.5
- repulserad: area * maxdelta

> 2) What negatives values in the result matrix do mean? If there is
> strong cartesian coordinates with 4 qusters, where the (0,0) point is?
It depends on the layout algorithm; for instance, the circle layout
algorithm will put the center of the circle at (0, 0). For
force-directed layout algorithms, I guess the center is around the "mass
centre" of the calculated layout, but again, there is no guarantee for
that as the coordinates are in abstract units. Feel free to calculate
the average of the X and Y coordinates and translate all of them so that
the average is at (0, 0).

> 3) How to calculate "area" parameter? In case of drawing on the
> screens, is it right to just calculate the square multiplying height
> pixels with weight pixels?
See above, a sensible default is area * maxdelta.

> 4) The most stupid question: after the drawing function complete, the
> matrix x has a size of cols = a vertex number and rows = 2.
> Does x[0,0] mean "x" coordinate and x[0,1] "y" coordinate for vertex 0?


reply via email to

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