Menu

not using a layout

2003-06-27
2003-08-04
  • Marc Siramy

    Marc Siramy - 2003-06-27

    Royere uses by default a layout which the ReingoldTilford layout I think.

    I don't want to use that kind of laies out. I want to define positions for nodes in a GraphXML file, and that Royere build the graph depending on the positions I defined, I don't want that a layout change these positions.

    So, I changed the line concerning the default layout in file Royere.pr so that this layout would not be activated in Royere. But it didn't work.
    The "public static Layout selectLayout(Graph graph) " method in royere.cwi.layout.LayoutFactory seems to define ReingoldTilford layout as default if none is define.

    What should I do to prevent Royere from defining a default layout ?

     
    • M. Scott Marshall

      Try loading the graph "UserDefined.xml" in gvf/Graphs. That is an example of defining your own coordinates and works for me.

      Notice the presence of:
      preferredLayout="UserDefined"

      The selection of the layout for a graph is governed by the properties of the graph and the settings of preferredLayout (in the graph description file itself) and DefaultLayout (in Royere.pr). If the preferredLayout is set, but requires properties that the graph doesn't have, then the DefaultLayout is considered. If the graph properties "isDirected" and "isAcyclic" are true, then the graph can be laid out with Reingold-Tilford, which is the generally preferred hierarchical layout for directed acyclic graphs. The last resort layout algorithm chosen in selectLayout() is a random layout that doesn't require any particular graph properties.

       
    • Marc Siramy

      Marc Siramy - 2003-08-04

      Ok,
      I tried this,
      it seems to work.
      I think the origin of the problem was I didn't define DTD extension for node positions like in "UserDefined.xml".

      So, if you want your own coordinates being used by Royere, I guess you have to define a dtd extension at the head of the document, like this :
      !DOCTYPE GraphXML SYSTEM "file:GraphXML.dtd" [
      <!ENTITY % admissibleProperties "
         horizontalPosition CDATA #IMPLIED
         verticalPosition CDATA #IMPLIED
      ">
      ]>

      But if I define positions like it seems to be suggested by GraphXML DTD, like below, I think it doesn't work :
      <node  ... >
              <label>Patrick</label>
              <position x='204.0' y='-78.776513' z='0.0'/>
      </node>

      I think there is a link between this problem and that I exposed in a precedent message called "saving GraphXML file and restoring it".
      I propose you to continue discussion using that message ...

       

Log in to post a comment.