Menu

Edge labels

2003-02-27
2003-03-06
  • philonos philon

    philonos philon - 2003-02-27

    Hi,
           I am trying to find a way to display edge labels in Royere,
    but it is not obvious how to do it. I'm using GraphXML's <label> tag under <edge> tag but no label appears when I open the xml file with Royere.

    Is it possible to have edge labels displayed with royere?

    Thanks for any answer,

     
    • M. Scott Marshall

      Royere doesn't have labels for edges yet. It would be nice..

      Someone recently brought that up:
      https://sourceforge.net/forum/message.php?msg_id=1862397

      The node label implementation could serve as an example for a part of the edge label implementation.

       
      • yugen

        yugen - 2003-03-03

        In particular, the method that draws node labels is ElementDrawing.drawString().  This method could very easily be used to draw edge labels, since its only arguments are the label string and the coordinates where the label should be drawn.

        For example, if you look at the source to DrawingControl.java, inside the drawGraph() method you will see

                  for( i = 0; i < nodes.length; i++ ) {           
                        ...
                        theDraw.drawString(node.n.getLabel(),nodeCoordinates); 
                        ...
                  }

        It would be very simple to add a loop to display the edge labels using (for example) the midpoint of the edge as the coordinates.

         
    • philonos philon

      philonos philon - 2003-03-03

      You are correct on what you say;

      But the most important question is where to place the edge labels. In a directed graph and when an edge has two directions, your proposal is invalid, to place the label at the middle of the edge, because now there are two labels and it wouldn't be clear which label belongs to which arc of the two, if they are to be placed both in the middle.

      If a label is placed along the beginning of the edge then it has to adhere the slope of the edge for the purpose of being symmetrical. This shouldn't be difficult to program. But if the edge labels are lengthy, then they may overlap with other part of the graph (node, edges, labels), making the overall layout more complicated.

      Moreover, the export modules (the modules that export GraphXMLs, SVGs, JPG etc) need to be upgraded, to account for the edge labels; I haven't yet looked at how complicated can that be.

      Well, if it is something to be done, we need to agree where the edge labels should be placed (in my opinion, a very difficult decision to make) and to list the parts of Royere that are influenced by the introduction of this functionality.

      I would really very much like to hear your opinions on this,

       
      • yugen

        yugen - 2003-03-03

        For directed graphs, what do you think about placing the edge labels one-quarter of the distance from source node to target node? 

        I have checked in code to do this, if you'd like to try it out.  Just pull down the latest DrawingControl.java and Vector2D.java from the CVS repository:

        http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/gvf/gvf/source/royere/cwi/view/draw/DrawingControl.java

        http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/gvf/gvf/source/royere/cwi/util/Vector2D.java

        and rebuild.

        GraphXML allows you to define edge labels like this:

              <edge source='p0' target='p1'>
                <label>
                  p0-p1
                </label>
              </edge>

        The edge labels are currently parallel to the edges of the view panel, but I like your idea of aligning them with the slope of the edge.  That should be a simple matter of invoking translate() and rotate() on our Graphics2D object before invoking drawString().  I should be able to try that out this evening.

         
    • philonos philon

      philonos philon - 2003-03-03

      You are correct on what you say;

      But the most important question is where to place the edge labels. In a directed graph and when an edge has two directions, your proposal is invalid, to place the label at the middle of the edge, because now there are two labels and it wouldn't be clear which label belongs to which arc of the two, if they are to be placed both in the middle.

      If a label is placed along the beginning of the edge then it has to adhere the slope of the edge for the purpose of being symmetrical. This shouldn't be difficult to program. But if the edge labels are lengthy, then they may overlap with other part of the graph (node, edges, labels), making the overall layout more complicated.

      Moreover, the export modules (the modules that export GraphXMLs, SVGs, JPG etc) need to be upgraded, to account for the edge labels; I haven't yet looked at how complicated can that be.

      Well, if it is something to be done, we need to agree where the edge labels should be placed (in my opinion, a very difficult decision to make) and to list the parts of Royere that are influenced by the introduction of this functionality.

      I would really very much like to hear your opinions on this,

       
    • philonos philon

      philonos philon - 2003-03-03

      You are correct on what you say;

      But the most important question is where to place the edge labels. In a directed graph and when an edge has two directions, your proposal is invalid, to place the label at the middle of the edge, because now there are two labels and it wouldn't be clear which label belongs to which arc of the two, if they are to be placed both in the middle.

      If a label is placed along the beginning of the edge then it has to adhere the slope of the edge for the purpose of being symmetrical. This shouldn't be difficult to program. But if the edge labels are lengthy, then they may overlap with other part of the graph (node, edges, labels), making the overall layout more complicated.

      Moreover, the export modules (the modules that export GraphXMLs, SVGs, JPG etc) need to be upgraded, to account for the edge labels; I haven't yet looked at how complicated can that be.

      Well, if it is something to be done, we need to agree where the edge labels should be placed (in my opinion, a very difficult decision to make) and to list the parts of Royere that are influenced by the introduction of this functionality.

      I would really very much like to hear your opinions on this,

       
    • philonos philon

      philonos philon - 2003-03-03

      You are correct on what you say;

      But the most important question is where to place the edge labels. In a directed graph and when an edge has two directions, your proposal is invalid, to place the label at the middle of the edge, because now there are two labels and it wouldn't be clear which label belongs to which arc of the two, if they are to be placed both in the middle.

      If a label is placed along the beginning of the edge then it has to adhere the slope of the edge for the purpose of being symmetrical. This shouldn't be difficult to program. But if the edge labels are lengthy, then they may overlap with other part of the graph (node, edges, labels), making the overall layout more complicated.

      Moreover, the export modules (the modules that export GraphXMLs, SVGs, JPG etc) need to be upgraded, to account for the edge labels; I haven't yet looked at how complicated can that be.

      Well, if it is something to be done, we need to agree where the edge labels should be placed (in my opinion, a very difficult decision to make) and to list the parts of Royere that are influenced by the introduction of this functionality.

      I would really very much like to hear your opinions on this,

       
    • yugen

      yugen - 2003-03-03
       
    • philonos philon

      philonos philon - 2003-03-04

      Unfortunately I couldn't compile the latest gvf version out of the box, since there seems to be many bits and pieces still missing from in there.

      but I managed to introduce the changes in the stable version I have.

      at the end of this message there is a sample graph to test this functionality

      The area where royere is projecting graphs is a bit small for this graph. maybe this can be solved by introducing scroll bars.

      but I still think this is not the best way to introduce edge labels... Maybe it is sufficent if the labels are small  (two or three letters wide)

      The layouts function do not produce good results, because they don't account for the edge labels and create small edges in length.

      here is the graphxml document:

      <?xml version="1.0"?>
      <GraphXML>
          <graph>
              <node name="it1.it.google.com"/>
              <node name="hr1.hr.google.com"/>
              <node name="at1.at.google.com"/>
              <node name="hu1.hu.google.com"/>
              <node name="cz1.cz.google.com"/>
              <node name="sk1.sk.google.com"/>
              <node name="de1.de.google.com"/>
              <node name="se1.se.google.com"/>
              <node name="be1.be.google.com"/>
              <node name="gr1.gr.google.com"/>
              <node name="pl1.pl.google.com"/>
              <node name="ch1.ch.google.com"/>
              <node name="uk1.uk.google.com"/>
              <node name="fr1.fr.google.com"/>
              <node name="si1.si.google.com"/>
              <node name="nl1.nl.google.com"/>
              <node name="es1.es.google.com"/>
              <node name="de2.de.google.com"/>
              <node name="ie1.ie.google.com"/>
              <edge source="it1.it.google.com" target="ch1.ch.google.com">
                  <label>so-3/1/1.1(12.51.51.15/11)</label>
              </edge>
              <edge source="it1.it.google.com" target="de2.de.google.com">
                  <label>so-1/1/1.1(12.51.51.12/11)</label>
              </edge>
              <edge source="it1.it.google.com" target="es1.es.google.com">
                  <label>so-1/1/1.1(12.51.51.35/11)</label>
              </edge>
              <edge source="hr1.hr.google.com" target="at1.at.google.com">
                  <label>so-1/1/1.1(12.51.51.112/11)</label>
              </edge>
              <edge source="hr1.hr.google.com" target="hu1.hu.google.com">
                  <label>so-1/1/1.1(12.51.51.131/11)</label>
              </edge>
              <edge source="at1.at.google.com" target="hr1.hr.google.com">
                  <label>so-1/1/1.1(12.51.51.111/11)</label>
              </edge>
              <edge source="at1.at.google.com" target="si1.si.google.com">
                  <label>so-1/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="at1.at.google.com" target="ch1.ch.google.com">
                  <label>so-3/1/1.1(12.51.51.1/11)</label>
              </edge>
              <edge source="at1.at.google.com" target="de2.de.google.com">
                  <label>so-1/1/1.1(12.51.51.1/11)</label>
              </edge>
              <edge source="at1.at.google.com" target="hu1.hu.google.com">
                  <label>so-1/2/1.1(12.51.51.5/11)</label>
              </edge>
              <edge source="hu1.hu.google.com" target="sk1.sk.google.com">
                  <label>so-1/1/1.1(12.51.51.111/11)</label>
              </edge>
              <edge source="hu1.hu.google.com" target="si1.si.google.com">
                  <label>so-1/1/1.1(12.51.51.111/11)</label>
              </edge>
              <edge source="hu1.hu.google.com" target="hr1.hr.google.com">
                  <label>so-1/2/1.1(12.51.51.135/11)</label>
              </edge>
              <edge source="hu1.hu.google.com" target="at1.at.google.com">
                  <label>so-1/2/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="cz1.cz.google.com" target="pl1.pl.google.com">
                  <label>so-1/2/1.1(12.51.51.51/11)</label>
              </edge>
              <edge source="cz1.cz.google.com" target="sk1.sk.google.com">
                  <label>so-1/1/1.1(12.51.51.51/11)</label>
              </edge>
              <edge source="cz1.cz.google.com" target="de1.de.google.com">
                  <label>so-3/1/1.1(12.51.51.13/11)</label>
              </edge>
              <edge source="sk1.sk.google.com" target="hu1.hu.google.com">
                  <label>so-1/2/1.1(12.51.51.111/11)</label>
              </edge>
              <edge source="sk1.sk.google.com" target="cz1.cz.google.com">
                  <label>so-1/1/1.1(12.51.51.52/11)</label>
              </edge>
              <edge source="de1.de.google.com" target="fr1.fr.google.com">
                  <label>so-3/1/1.1(12.51.51.55/11)</label>
              </edge>
              <edge source="de1.de.google.com" target="cz1.cz.google.com">
                  <label>so-1/1/1.1(12.51.51.15/11)</label>
              </edge>
              <edge source="de1.de.google.com" target="nl1.nl.google.com">
                  <label>so-2/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="de1.de.google.com" target="de2.de.google.com">
                  <label>ge-1/1/1.11(12.51.55.151/25)</label>
              </edge>
              <edge source="de1.de.google.com" target="ie1.ie.google.com">
                  <label>so-2/1/1.1(12.51.51.111/11)</label>
              </edge>
              <edge source="se1.se.google.com" target="pl1.pl.google.com">
                  <label>so-1/1/1.1(12.51.51.122/11)</label>
              </edge>
              <edge source="se1.se.google.com" target="de2.de.google.com">
                  <label>so-1/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="se1.se.google.com" target="uk1.uk.google.com">
                  <label>so-3/1/1.1(12.51.51.121/11)</label>
              </edge>
              <edge source="be1.be.google.com" target="nl1.nl.google.com">
                  <label>so-1/2/1.1(12.51.51.21/11)</label>
              </edge>
              <edge source="be1.be.google.com" target="fr1.fr.google.com">
                  <label>so-1/1/1.1(12.51.51.13/11)</label>
              </edge>
              <edge source="gr1.gr.google.com" target="de2.de.google.com">
                  <label>so-1/1/1.1(12.51.51.51/11)</label>
              </edge>
              <edge source="gr1.gr.google.com" target="uk1.uk.google.com">
                  <label>so-1/1/1.1(12.51.51.53/11)</label>
              </edge>
              <edge source="pl1.pl.google.com" target="se1.se.google.com">
                  <label>so-1/1/1.1(12.51.51.121/11)</label>
              </edge>
              <edge source="pl1.pl.google.com" target="cz1.cz.google.com">
                  <label>so-1/1/1.1(12.51.51.51/11)</label>
              </edge>
              <edge source="ch1.ch.google.com" target="at1.at.google.com">
                  <label>so-3/1/1.1(12.51.51.2/11)</label>
              </edge>
              <edge source="ch1.ch.google.com" target="fr1.fr.google.com">
                  <label>so-1/1/1.1(12.51.51.25/11)</label>
              </edge>
              <edge source="ch1.ch.google.com" target="it1.it.google.com">
                  <label>so-1/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="uk1.uk.google.com" target="gr1.gr.google.com">
                  <label>so-1/1/1.1(12.51.51.55/11)</label>
              </edge>
              <edge source="uk1.uk.google.com" target="se1.se.google.com">
                  <label>so-1/1/1.1(12.51.51.121/11)</label>
              </edge>
              <edge source="uk1.uk.google.com" target="nl1.nl.google.com">
                  <label>so-2/1/1.1(12.51.51.115/11)</label>
              </edge>
              <edge source="uk1.uk.google.com" target="ie1.ie.google.com">
                  <label>so-1/2/1.1(12.51.51.115/11)</label>
              </edge>
              <edge source="uk1.uk.google.com" target="fr1.fr.google.com">
                  <label>so-3/1/1.1(12.51.51.51/11)</label>
              </edge>
              <edge source="fr1.fr.google.com" target="es1.es.google.com">
                  <label>so-1/2/1.1(12.51.51.31/11)</label>
              </edge>
              <edge source="fr1.fr.google.com" target="ch1.ch.google.com">
                  <label>so-1/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="fr1.fr.google.com" target="be1.be.google.com">
                  <label>so-1/1/1.1(12.51.51.15/11)</label>
              </edge>
              <edge source="fr1.fr.google.com" target="uk1.uk.google.com">
                  <label>so-3/1/1.1(12.51.51.55/11)</label>
              </edge>
              <edge source="fr1.fr.google.com" target="de1.de.google.com">
                  <label>so-1/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="si1.si.google.com" target="at1.at.google.com">
                  <label>so-1/1/1.1(12.51.51.15/11)</label>
              </edge>
              <edge source="si1.si.google.com" target="hu1.hu.google.com">
                  <label>so-1/2/1.1(12.51.51.112/11)</label>
              </edge>
              <edge source="nl1.nl.google.com" target="be1.be.google.com">
                  <label>so-2/1/1.1(12.51.51.22/11)</label>
              </edge>
              <edge source="nl1.nl.google.com" target="de1.de.google.com">
                  <label>so-1/1/1.1(12.51.51.15/11)</label>
              </edge>
              <edge source="nl1.nl.google.com" target="uk1.uk.google.com">
                  <label>so-2/1/1.1(12.51.51.111/11)</label>
              </edge>
              <edge source="es1.es.google.com" target="fr1.fr.google.com">
                  <label>so-1/2/1.1(12.51.51.15/11)</label>
              </edge>
              <edge source="es1.es.google.com" target="it1.it.google.com">
                  <label>so-1/1/1.1(12.51.51.31/11)</label>
              </edge>
              <edge source="de2.de.google.com" target="gr1.gr.google.com">
                  <label>so-1/2/1.1(12.51.51.55/11)</label>
              </edge>
              <edge source="de2.de.google.com" target="at1.at.google.com">
                  <label>so-1/1/1.1(12.51.51.1/11)</label>
              </edge>
              <edge source="de2.de.google.com" target="it1.it.google.com">
                  <label>so-3/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="de2.de.google.com" target="se1.se.google.com">
                  <label>so-1/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="de2.de.google.com" target="de1.de.google.com">
                  <label>ge-1/1/1.11(12.51.55.155/25)</label>
              </edge>
              <edge source="ie1.ie.google.com" target="uk1.uk.google.com">
                  <label>so-1/1/1.1(12.51.51.113/11)</label>
              </edge>
              <edge source="ie1.ie.google.com" target="de1.de.google.com">
                  <label>so-3/1/1.1(12.51.51.111/11)</label>
              </edge>
          </graph>
      </GraphXML>

       
    • philonos philon

      philonos philon - 2003-03-04

      Unfortunately I couldn't compile the latest gvf version out of the box, since there seems to be many bits and pieces still missing from in there.

      but I managed to introduce the changes in the stable version I have.

      at the end of this message there is a sample graph to test this functionality

      The area where royere is projecting graphs is a bit small for this graph. maybe this can be solved by introducing scroll bars.

      but I still think this is not the best way to introduce edge labels... Maybe it is sufficent if the labels are small  (two or three letters wide)

      The layouts function do not produce good results, because they don't account for the edge labels and create small edges in length.

      here is the graphxml document:

      <?xml version="1.0"?>
      <GraphXML>
          <graph>
              <node name="it1.it.google.com"/>
              <node name="hr1.hr.google.com"/>
              <node name="at1.at.google.com"/>
              <node name="hu1.hu.google.com"/>
              <node name="cz1.cz.google.com"/>
              <node name="sk1.sk.google.com"/>
              <node name="de1.de.google.com"/>
              <node name="se1.se.google.com"/>
              <node name="be1.be.google.com"/>
              <node name="gr1.gr.google.com"/>
              <node name="pl1.pl.google.com"/>
              <node name="ch1.ch.google.com"/>
              <node name="uk1.uk.google.com"/>
              <node name="fr1.fr.google.com"/>
              <node name="si1.si.google.com"/>
              <node name="nl1.nl.google.com"/>
              <node name="es1.es.google.com"/>
              <node name="de2.de.google.com"/>
              <node name="ie1.ie.google.com"/>
              <edge source="it1.it.google.com" target="ch1.ch.google.com">
                  <label>so-3/1/1.1(12.51.51.15/11)</label>
              </edge>
              <edge source="it1.it.google.com" target="de2.de.google.com">
                  <label>so-1/1/1.1(12.51.51.12/11)</label>
              </edge>
              <edge source="it1.it.google.com" target="es1.es.google.com">
                  <label>so-1/1/1.1(12.51.51.35/11)</label>
              </edge>
              <edge source="hr1.hr.google.com" target="at1.at.google.com">
                  <label>so-1/1/1.1(12.51.51.112/11)</label>
              </edge>
              <edge source="hr1.hr.google.com" target="hu1.hu.google.com">
                  <label>so-1/1/1.1(12.51.51.131/11)</label>
              </edge>
              <edge source="at1.at.google.com" target="hr1.hr.google.com">
                  <label>so-1/1/1.1(12.51.51.111/11)</label>
              </edge>
              <edge source="at1.at.google.com" target="si1.si.google.com">
                  <label>so-1/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="at1.at.google.com" target="ch1.ch.google.com">
                  <label>so-3/1/1.1(12.51.51.1/11)</label>
              </edge>
              <edge source="at1.at.google.com" target="de2.de.google.com">
                  <label>so-1/1/1.1(12.51.51.1/11)</label>
              </edge>
              <edge source="at1.at.google.com" target="hu1.hu.google.com">
                  <label>so-1/2/1.1(12.51.51.5/11)</label>
              </edge>
              <edge source="hu1.hu.google.com" target="sk1.sk.google.com">
                  <label>so-1/1/1.1(12.51.51.111/11)</label>
              </edge>
              <edge source="hu1.hu.google.com" target="si1.si.google.com">
                  <label>so-1/1/1.1(12.51.51.111/11)</label>
              </edge>
              <edge source="hu1.hu.google.com" target="hr1.hr.google.com">
                  <label>so-1/2/1.1(12.51.51.135/11)</label>
              </edge>
              <edge source="hu1.hu.google.com" target="at1.at.google.com">
                  <label>so-1/2/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="cz1.cz.google.com" target="pl1.pl.google.com">
                  <label>so-1/2/1.1(12.51.51.51/11)</label>
              </edge>
              <edge source="cz1.cz.google.com" target="sk1.sk.google.com">
                  <label>so-1/1/1.1(12.51.51.51/11)</label>
              </edge>
              <edge source="cz1.cz.google.com" target="de1.de.google.com">
                  <label>so-3/1/1.1(12.51.51.13/11)</label>
              </edge>
              <edge source="sk1.sk.google.com" target="hu1.hu.google.com">
                  <label>so-1/2/1.1(12.51.51.111/11)</label>
              </edge>
              <edge source="sk1.sk.google.com" target="cz1.cz.google.com">
                  <label>so-1/1/1.1(12.51.51.52/11)</label>
              </edge>
              <edge source="de1.de.google.com" target="fr1.fr.google.com">
                  <label>so-3/1/1.1(12.51.51.55/11)</label>
              </edge>
              <edge source="de1.de.google.com" target="cz1.cz.google.com">
                  <label>so-1/1/1.1(12.51.51.15/11)</label>
              </edge>
              <edge source="de1.de.google.com" target="nl1.nl.google.com">
                  <label>so-2/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="de1.de.google.com" target="de2.de.google.com">
                  <label>ge-1/1/1.11(12.51.55.151/25)</label>
              </edge>
              <edge source="de1.de.google.com" target="ie1.ie.google.com">
                  <label>so-2/1/1.1(12.51.51.111/11)</label>
              </edge>
              <edge source="se1.se.google.com" target="pl1.pl.google.com">
                  <label>so-1/1/1.1(12.51.51.122/11)</label>
              </edge>
              <edge source="se1.se.google.com" target="de2.de.google.com">
                  <label>so-1/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="se1.se.google.com" target="uk1.uk.google.com">
                  <label>so-3/1/1.1(12.51.51.121/11)</label>
              </edge>
              <edge source="be1.be.google.com" target="nl1.nl.google.com">
                  <label>so-1/2/1.1(12.51.51.21/11)</label>
              </edge>
              <edge source="be1.be.google.com" target="fr1.fr.google.com">
                  <label>so-1/1/1.1(12.51.51.13/11)</label>
              </edge>
              <edge source="gr1.gr.google.com" target="de2.de.google.com">
                  <label>so-1/1/1.1(12.51.51.51/11)</label>
              </edge>
              <edge source="gr1.gr.google.com" target="uk1.uk.google.com">
                  <label>so-1/1/1.1(12.51.51.53/11)</label>
              </edge>
              <edge source="pl1.pl.google.com" target="se1.se.google.com">
                  <label>so-1/1/1.1(12.51.51.121/11)</label>
              </edge>
              <edge source="pl1.pl.google.com" target="cz1.cz.google.com">
                  <label>so-1/1/1.1(12.51.51.51/11)</label>
              </edge>
              <edge source="ch1.ch.google.com" target="at1.at.google.com">
                  <label>so-3/1/1.1(12.51.51.2/11)</label>
              </edge>
              <edge source="ch1.ch.google.com" target="fr1.fr.google.com">
                  <label>so-1/1/1.1(12.51.51.25/11)</label>
              </edge>
              <edge source="ch1.ch.google.com" target="it1.it.google.com">
                  <label>so-1/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="uk1.uk.google.com" target="gr1.gr.google.com">
                  <label>so-1/1/1.1(12.51.51.55/11)</label>
              </edge>
              <edge source="uk1.uk.google.com" target="se1.se.google.com">
                  <label>so-1/1/1.1(12.51.51.121/11)</label>
              </edge>
              <edge source="uk1.uk.google.com" target="nl1.nl.google.com">
                  <label>so-2/1/1.1(12.51.51.115/11)</label>
              </edge>
              <edge source="uk1.uk.google.com" target="ie1.ie.google.com">
                  <label>so-1/2/1.1(12.51.51.115/11)</label>
              </edge>
              <edge source="uk1.uk.google.com" target="fr1.fr.google.com">
                  <label>so-3/1/1.1(12.51.51.51/11)</label>
              </edge>
              <edge source="fr1.fr.google.com" target="es1.es.google.com">
                  <label>so-1/2/1.1(12.51.51.31/11)</label>
              </edge>
              <edge source="fr1.fr.google.com" target="ch1.ch.google.com">
                  <label>so-1/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="fr1.fr.google.com" target="be1.be.google.com">
                  <label>so-1/1/1.1(12.51.51.15/11)</label>
              </edge>
              <edge source="fr1.fr.google.com" target="uk1.uk.google.com">
                  <label>so-3/1/1.1(12.51.51.55/11)</label>
              </edge>
              <edge source="fr1.fr.google.com" target="de1.de.google.com">
                  <label>so-1/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="si1.si.google.com" target="at1.at.google.com">
                  <label>so-1/1/1.1(12.51.51.15/11)</label>
              </edge>
              <edge source="si1.si.google.com" target="hu1.hu.google.com">
                  <label>so-1/2/1.1(12.51.51.112/11)</label>
              </edge>
              <edge source="nl1.nl.google.com" target="be1.be.google.com">
                  <label>so-2/1/1.1(12.51.51.22/11)</label>
              </edge>
              <edge source="nl1.nl.google.com" target="de1.de.google.com">
                  <label>so-1/1/1.1(12.51.51.15/11)</label>
              </edge>
              <edge source="nl1.nl.google.com" target="uk1.uk.google.com">
                  <label>so-2/1/1.1(12.51.51.111/11)</label>
              </edge>
              <edge source="es1.es.google.com" target="fr1.fr.google.com">
                  <label>so-1/2/1.1(12.51.51.15/11)</label>
              </edge>
              <edge source="es1.es.google.com" target="it1.it.google.com">
                  <label>so-1/1/1.1(12.51.51.31/11)</label>
              </edge>
              <edge source="de2.de.google.com" target="gr1.gr.google.com">
                  <label>so-1/2/1.1(12.51.51.55/11)</label>
              </edge>
              <edge source="de2.de.google.com" target="at1.at.google.com">
                  <label>so-1/1/1.1(12.51.51.1/11)</label>
              </edge>
              <edge source="de2.de.google.com" target="it1.it.google.com">
                  <label>so-3/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="de2.de.google.com" target="se1.se.google.com">
                  <label>so-1/1/1.1(12.51.51.11/11)</label>
              </edge>
              <edge source="de2.de.google.com" target="de1.de.google.com">
                  <label>ge-1/1/1.11(12.51.55.155/25)</label>
              </edge>
              <edge source="ie1.ie.google.com" target="uk1.uk.google.com">
                  <label>so-1/1/1.1(12.51.51.113/11)</label>
              </edge>
              <edge source="ie1.ie.google.com" target="de1.de.google.com">
                  <label>so-3/1/1.1(12.51.51.111/11)</label>
              </edge>
          </graph>
      </GraphXML>

       
      • yugen

        yugen - 2003-03-04

        > The area where royere is projecting graphs is a
        > bit small for
        > this graph. maybe
        > this can be solved by introducing scroll bars.

        Note that Royere gives you the ability to zoom (Ctrl-Up/Down) and pan (Alt-Left/Right).  Zooming solves a lot of the "label clutter".

        > but I still think this is not the best way to
        > introduce edge
        > labels... Maybe
        > it is sufficent if the labels are small  (two or
        > three letters wide)

        Yes... short edge labels are easy :)  I've made some comments on long edge labels below.

        > The layouts function do not produce good
        > results, because
        > they don't account
        > for the edge labels and create small edges in
        > length.

        If you wanted to, you could edit the source to whichever layout algorithm you're using, to accommodate the length of the edge labels.  However, I don't like this solution because it requires the layout algorithm to have knowledge of view-specific information, i.e., the label font size.  But I guess the layout could make some simplifying assumptions about that.  The other objection I have is that off-the-shelf layout algorithms typically do not account for edge label sizes, which means that whenever you wanted to switch to a new layout algorithm, you'd automatically have the extra burden of manual source code revision.  In short, I'd definitely prefer to handle this issue in the view module. 

        I opened your test graph, and noticed a couple of things about long edge labels (under the current experimental implementation, anyway).  First, it's very easy for long edge labels to overlap nearby edges.  Even though the user can deduce a label's associated edge by determining which edge bisects the label, it shouldn't require that much effort.  This seems to be a major problem for horizontal edge labels.  Second, I felt the need for some kind of font distinction (e.g., size or italics) to visually distinguish edge labels from node labels.  If we use exactly the same font for node and edge labels, and they're all horizontal, then the nodes kind of lose their distinctive "feel". 

        Alternatively, as you mentioned above, edge labels could follow the slope of the edge.  However, if the labels are rendered at oblique angles, then we have the potential for label overlap wherever there are edge crossings.  This degrades legibility somewhat, but if we allow the user to toggle individual edge labels on and off, maybe that's not a major issue.  Of course, we still have the possibility that the edge label might be too large for the edge.   One solution would be to simply not display an oversized edge label until the user zooms in close enough.  Any comments on this?

         
    • philonos philon

      philonos philon - 2003-03-04

      >However, I don't like this solution because it requires the layout algorithm to have knowledge of view-specific information, i.e., the label font size

      How is the distance between adjacent nodes calculated by the layout algorithms? Is it a constant number hardcoded in the sourcecode? For example the ring layout algorithm places nodes at the same distance from the centre of the ring it forms. How is the radius of the ring calculated?

      Maybe the view can resize the values it received from the layout algorithm by introducing the edge labels length in its calculations and by making the edges length longer or the edge label smaller according to what it is the best approach. But I worry on whether the export functions also require modification to account for the edge labels, but if they get the coordinates directly from the view (or the view's state) no modification in their sourcecode is necessary other than displaying the edge label as found in the view.

      > Of course, we still have the possibility that the edge label might be too large for the edge

      In which case there could be many posibilities where we cannot really say which is the best possible solution until we evalute them in action. Maybe another idea will be to reduce the label length by replacing the letters of the edge label that exceed the edge's length with `...' .
      But it may be too early to decide.

      What are the alternatives solutions other than displaying edge labels along the edge? (e.g. in bubbles that are connected to the edges through dashed lines...)

       
    • yugen

      yugen - 2003-03-06

      I've checked in code to display edge labels along the slope of the edge:

      http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/gvf/gvf/source/royere/cwi/view/draw/DrawingControl.java

      http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/gvf/gvf/source/royere/cwi/view/draw/ElementDrawing.java

      http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/gvf/gvf/source/royere/cwi/view/draw/java2D/Java2DElementDrawing.java

      N.B. For some labels, there is a slight misalignment between the angle of the label and the angle of the edge, but I don't think it's due to a rounding error.  I have an idea why, but I will have to look into this.  For the time being, though, you can use the code to get the idea of what "sloped" edge labels would look like. 

       

Log in to post a comment.