Jean-Michel - 2005-02-24

Hi,

I have some problems when using Giny layouter algorithms. I'm testing on a very basic graph.

1) ForceDirectedLayout

Almost all the coordinates are negative after the algorithms has been called.
I had a look at the code and found this comment:
// Ensure the vertex's position is never negative.

However, it seems that the code does not prevent negative coordinate e.g:

     } else if( newX < 0 && newY >= 0 ) {
        if( thisX > 0 ) {
          xadj = 0 - thisX;
        }  else {
          xadj = 0;
        graphView.setNodeDoubleProperty( v.getGraphPerspectiveIndex(), GraphView.NODE_X_POSITION, xadj );
        graphView.setNodeDoubleProperty( v.getGraphPerspectiveIndex(), GraphView.NODE_Y_POSITION, yadj );
        }
say I have positive thisX then xadj is negative. I suppose I'm missing something obvious. What is wrong here ?

2) SpringEmbeddedLayouter

It seems that this algorithms does not ensure that the nodes are inside the frame view.
I've tried to uncomment this:
    // To make it the size of the current view, try
    // rest_length_constant = Math.sqrt( ( ( graphView.getViewRect().width / graphView.getViewRect.height() ) / 4 ) / graphView.getGraphDiameter() );
   
But I'm still getting nodes placed outside the view.

Thanks very much for any help,

Jean-Michel