Re: graphs (layouting-related)

Oscar,

> The approach sounds interesting, but I would definitely not make that part
> of the java interface for the graph layout.  You should provide a very
> "thin" api for doing the layout, possibly just a single signature of the
> form:
>
> public interface ILayoutAlgorithm {
>   public void doLayout(IGraph graph, ICoordinates coords) throws
> LayoutException;
> }
>
> Where the coordinates are pre-allocated to the size of the graph.  Or do
> what swing does for performance reasons and make it return a new one only
> if the param version is invalid or null.

Do you think of the coords like a map of positions for each node int the
graph?

> Then if you want to construct what you describe, you could make a class
> that implements ILayoutAlgorithm using a collection of nested layout
> algorithms and weights.

Yes, you are right.

> Notice taht I made the graph an interface as well because there are
> definitely very different implementations that will need to be supported
> (sparse/dense).

Definitely. The same goes for the way to display nodes, labels, edges and
all the rest. I am currently thinking about a decorator-style mechanism, for
display as well as user interaction: a bare display-node is nothing but a
position, and display-objects (that extract properties from the underlying
model) are used to add visad-specific "scene" objects.

This would allow to separate layout from display - altough I feel this
border must be crossed sometimes, for example to get the bounding box of a
node.

I am currently just playing around with different ways to get the nodes on
screen, to get a feeling of visad (it impresses me more each hour.)

In the next weeks I will move my office and get a dedicated server - if you
are interested, I can put a wiki then, so our talk don't get lost in the
depths of this mailing-list.

Manuel




  • 2002 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: