Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » DirectedGraph connection routing
DirectedGraph connection routing [message #208666] Tue, 07 February 2006 21:31 Go to next message
Eclipse UserFriend
Originally posted by: mromijn.remove_this_seagull.nl

I want to create a GEF editor for hierarchical information, i.e. information
that has a parent-child relationship. The number of nodes is in the range of
10 to 100.



I'd like to use the DirectedGraph for representing the model and
DirectedGraphLayout to layout the nodes and the connections.



I looked at the "Database Schema Diagram Editor" article of Phil Zoio and at
the "org.eclipse.gef.examples.pde.PluginDependenciesView" example in the
"org.eclipse.gef.examples.flow" plugin. Both examples use a DirectedGraph,
the Database Schema editor uses the DirectedGraphLayout and the
PluginDependenciesView uses a combination of GraphVisitors for the layout.



However, both examples suffer from the same problem: when the number of
nodes and connections increase, the routing of the connections gets rather
messy.

This is easiest seen by the PluginDependenciesView, since that uses, in my
current workspace, about 80 nodes and 140 edges (for the
PluginDependenciesView to run, I had to comment out lines 153 to 157, since
the HorizontalPlacement has problems otherwise).



Is there another (better?) layout available for showing hierarchical data,
for instance with orthogonal routing of connection?

Is there a good source of information about graph theory and diagram
layouts, so maybe I can write my own?

Note, I know my way around in hierarchical data and such, but I'm not a
mathematician ;-)



Marcel Romijn
Re: DirectedGraph connection routing [message #208839 is a reply to message #208666] Thu, 09 February 2006 14:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

plug-ins are too connected to be displayed in any readable way. I don't
think it's the fault of the algorithm. The best thing to do is try it out on
your own data. See DirectedGraphDemo in org.eclipse.draw2d.example project,
in CVS.

"Marcel Romijn" <mromijn@remove_this_seagull.nl> wrote in message
news:dsb3j8$fr0$1@utils.eclipse.org...
>I want to create a GEF editor for hierarchical information, i.e.
>information
> that has a parent-child relationship. The number of nodes is in the range
> of
> 10 to 100.
>
>
>
> I'd like to use the DirectedGraph for representing the model and
> DirectedGraphLayout to layout the nodes and the connections.
>
>
>
> I looked at the "Database Schema Diagram Editor" article of Phil Zoio and
> at
> the "org.eclipse.gef.examples.pde.PluginDependenciesView" example in the
> "org.eclipse.gef.examples.flow" plugin. Both examples use a DirectedGraph,
> the Database Schema editor uses the DirectedGraphLayout and the
> PluginDependenciesView uses a combination of GraphVisitors for the layout.
>
>
>
> However, both examples suffer from the same problem: when the number of
> nodes and connections increase, the routing of the connections gets rather
> messy.
>
> This is easiest seen by the PluginDependenciesView, since that uses, in my
> current workspace, about 80 nodes and 140 edges (for the
> PluginDependenciesView to run, I had to comment out lines 153 to 157,
> since
> the HorizontalPlacement has problems otherwise).
>
>
>
> Is there another (better?) layout available for showing hierarchical data,
> for instance with orthogonal routing of connection?
>
> Is there a good source of information about graph theory and diagram
> layouts, so maybe I can write my own?
>
> Note, I know my way around in hierarchical data and such, but I'm not a
> mathematician ;-)
>
>
>
> Marcel Romijn
>
>
Re: DirectedGraph connection routing [message #208856 is a reply to message #208839] Thu, 09 February 2006 15:53 Go to previous messageGo to next message
Marcel Romijn is currently offline Marcel RomijnFriend
Messages: 4
Registered: July 2009
Junior Member
Hi Randy,

Thanks for your pointer!

I see that the examples in org.eclipse.draw2d.example indeed have less
connectivity than the plug-in hierarchy.
The complexity of my model resembles that of the plug-in hierarchy, so it
looks like the DirectedGraphLayout is unfortunately not suited for me.

I still like to base my solution on GEF, so it looks like I have to look
into creating a layout myself.
Can you tell me where the GEF team got the information for the design of the
DirectedGraphLayout?
Maybe I can find a good startingpoint there...

Thanks,

Marcel

"Randy Hudson" <none@us.ibm.com> wrote in message
news:dsfjlr$g6d$1@utils.eclipse.org...
> plug-ins are too connected to be displayed in any readable way. I don't
> think it's the fault of the algorithm. The best thing to do is try it out
> on your own data. See DirectedGraphDemo in org.eclipse.draw2d.example
> project, in CVS.
>
> "Marcel Romijn" <mromijn@remove_this_seagull.nl> wrote in message
> news:dsb3j8$fr0$1@utils.eclipse.org...
>>I want to create a GEF editor for hierarchical information, i.e.
>>information
>> that has a parent-child relationship. The number of nodes is in the range
>> of
>> 10 to 100.
>>
>>
>>
>> I'd like to use the DirectedGraph for representing the model and
>> DirectedGraphLayout to layout the nodes and the connections.
>>
>>
>>
>> I looked at the "Database Schema Diagram Editor" article of Phil Zoio and
>> at
>> the "org.eclipse.gef.examples.pde.PluginDependenciesView" example in the
>> "org.eclipse.gef.examples.flow" plugin. Both examples use a
>> DirectedGraph,
>> the Database Schema editor uses the DirectedGraphLayout and the
>> PluginDependenciesView uses a combination of GraphVisitors for the
>> layout.
>>
>>
>>
>> However, both examples suffer from the same problem: when the number of
>> nodes and connections increase, the routing of the connections gets
>> rather
>> messy.
>>
>> This is easiest seen by the PluginDependenciesView, since that uses, in
>> my
>> current workspace, about 80 nodes and 140 edges (for the
>> PluginDependenciesView to run, I had to comment out lines 153 to 157,
>> since
>> the HorizontalPlacement has problems otherwise).
>>
>>
>>
>> Is there another (better?) layout available for showing hierarchical
>> data,
>> for instance with orthogonal routing of connection?
>>
>> Is there a good source of information about graph theory and diagram
>> layouts, so maybe I can write my own?
>>
>> Note, I know my way around in hierarchical data and such, but I'm not a
>> mathematician ;-)
>>
>>
>>
>> Marcel Romijn
>>
>>
>
>
Re: DirectedGraph connection routing [message #208865 is a reply to message #208856] Thu, 09 February 2006 17:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> I see that the examples in org.eclipse.draw2d.example indeed have less
> connectivity than the plug-in hierarchy.
> The complexity of my model resembles that of the plug-in hierarchy, so it
> looks like the DirectedGraphLayout is unfortunately not suited for me.

I think the problem is that 2 dimensions are not suited to your model. Good
luck.

> Can you tell me where the GEF team got the information for the design of
> the DirectedGraphLayout?

Now that would be cheating. Just google directed graph layout
Re: DirectedGraph connection routing [message #208901 is a reply to message #208865] Thu, 09 February 2006 19:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mromijn.remove_this_seagull.nl

"Randy Hudson" <none@us.ibm.com> wrote in message
news:dsfsh8$2m5$1@utils.eclipse.org...
> > I see that the examples in org.eclipse.draw2d.example indeed have less
> > connectivity than the plug-in hierarchy.
> > The complexity of my model resembles that of the plug-in hierarchy, so
it
> > looks like the DirectedGraphLayout is unfortunately not suited for me.
>
> I think the problem is that 2 dimensions are not suited to your model.
Good
> luck.

I have seen some other (commercial) products that do a nice job with an
orthogonal layout.
What can be done with a commercial product should be able to be done in GEF
as well, I think... ;-)

> > Can you tell me where the GEF team got the information for the design of
> > the DirectedGraphLayout?
>
> Now that would be cheating. Just google directed graph layout
>

It never hurts to ask :-)

Thanks.
Re: DirectedGraph connection routing [message #208966 is a reply to message #208901] Fri, 10 February 2006 07:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stephan.vern.chem.tu-berlin.de

Marcel Romijn wrote:
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:dsfsh8$2m5$1@utils.eclipse.org...
>> I think the problem is that 2 dimensions are not suited to your model.
>> Good luck.
>
> I have seen some other (commercial) products that do a nice job with an
> orthogonal layout.
> What can be done with a commercial product should be able to be done in GEF
> as well, I think... ;-)

Or in opensource projects like GraphViz. I wished the DirectedGraphLayout
would be as good as GraphViz. Unfortunately DirectedGraphLayout can handle
only very basic graphs.
Re: DirectedGraph connection routing [message #208974 is a reply to message #208966] Fri, 10 February 2006 08:10 Go to previous messageGo to next message
Marcel Romijn is currently offline Marcel RomijnFriend
Messages: 4
Registered: July 2009
Junior Member
"Stephan Michels" <stephan@vern.chem.tu-berlin.de> wrote in message
news:a1e45c7eb65bf454de1f2d6a3a0456bf$1@www.eclipse.org...

>>
>> I have seen some other (commercial) products that do a nice job with an
>> orthogonal layout.
>> What can be done with a commercial product should be able to be done in
>> GEF
>> as well, I think... ;-)
>
> Or in opensource projects like GraphViz. I wished the DirectedGraphLayout
> would be as good as GraphViz. Unfortunately DirectedGraphLayout can handle
> only very basic graphs.

Check... I found that one using google :-)

The PDF document "A Technique for Drawing Directed Graphs" looks like a good
explanation for directed graphs.
I'll see if I can use that to write a new layout.
Re: DirectedGraph connection routing [message #209029 is a reply to message #208974] Fri, 10 February 2006 15:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> The PDF document "A Technique for Drawing Directed Graphs" looks like a
> good explanation for directed graphs.
> I'll see if I can use that to write a new layout.

You have found the algorithm that we have already implement. Not much point
in re-writing it.
Re: DirectedGraph connection routing [message #209037 is a reply to message #208966] Fri, 10 February 2006 15:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> Or in opensource projects like GraphViz. I wished the DirectedGraphLayout
> would be as good as GraphViz. Unfortunately DirectedGraphLayout can handle
> only very basic graphs.

We used the same algorithm documented by North et. al. If you have a
specific graph that looks better in graphviz, feel free to open a bugzilla
and attach the graph. thanks.
Re: DirectedGraph connection routing [message #209166 is a reply to message #209037] Sun, 12 February 2006 17:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mromijn.remove_this_seagull.nl

> We used the same algorithm documented by North et. al. If you have a
> specific graph that looks better in graphviz, feel free to open a bugzilla
> and attach the graph. thanks.
>

I have found the reason why my graph connections looks 'messy'...

I used the code from the "Database Schema Diagram Editor" and the
DummyEdgeCreator/DummyEdgePart classes.
My graph has disconnected nodes and the Dummy* classes should create dummy
nodes to make the graph connected.
However, when I hane disconnected nodes, the graph layut tends to draw some
edge bottom-to-top, instead of to-to-bottom. The edges are always segmented
top-to-bottom, which causes weird, crossed edges.
You can see this in the Schema Diagram editor:
- Create a new schema, using the 'Pre-created Sample Schema Model'
- Select the toolbar button 'Automatic Layout'
- Select the 'Create a new table' tool in the palette
- Click in the top-left corner of the diagram.
- There is now an edge from table 'DEPT' at the bottom to 'DESK' on the
second rank. On the left hand, an edge segment, spanning 6 ranks is still
drawn top-to-bottom, resulting in a weird crossing.

My graph is quite more complex and has numerous of these upside-down
crossings, hence it looks very messy.

Is there a way around this? Should I not use the
DummyEdgeCreator/DummyEdgePart classes, but use another technique for my
disconnected nodes?

Thanks.
Re: DirectedGraph connection routing [message #209173 is a reply to message #209029] Sun, 12 February 2006 17:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mromijn.remove_this_seagull.nl

> You have found the algorithm that we have already implement. Not much
point
> in re-writing it.
>

That's very true...

It looks like GEF and GraphVis both use the "A Technique for Drawing
Directed Graphs" algorithm.

GraphVis, however, uses splines for the edges. That makes comples graphs
more readable than the segmented edges DirectedGraphLayout uses.

Would it be possible to use curved edges in combination with
DirectedGraphLayout?

Thanks.
Re: DirectedGraph connection routing [message #209238 is a reply to message #209173] Mon, 13 February 2006 12:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ingo.koch[nospam].sap.com

"Marcel Romijn" <mromijn@remove_this_seagull.nl> wrote in message
news:dsnqct$n3f$1@utils.eclipse.org...
>
> > You have found the algorithm that we have already implement. Not much
> point
> > in re-writing it.
> >
>
> That's very true...
>
> It looks like GEF and GraphVis both use the "A Technique for Drawing
> Directed Graphs" algorithm.
>
> GraphVis, however, uses splines for the edges. That makes comples graphs
> more readable than the segmented edges DirectedGraphLayout uses.
>
> Would it be possible to use curved edges in combination with
> DirectedGraphLayout?
>
> Thanks.
>
>

The style of the edges is independent from the layout manager, so why not?
Regards, Ingo
Re: DirectedGraph connection routing [message #209276 is a reply to message #209166] Mon, 13 February 2006 19:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Can you post a picture of the problem?
Re: DirectedGraph connection routing [message #209285 is a reply to message #209173] Mon, 13 February 2006 19:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

If you search for more of their research, you can find clues to the spline
algorithm. I think they build a polygon through which the spline is routed.
The polygon is built using the neighboring nodes of the virtual nodes making
up the edge.

"Marcel Romijn" <mromijn@remove_this_seagull.nl> wrote in message
news:dsnqct$n3f$1@utils.eclipse.org...
>
>> You have found the algorithm that we have already implement. Not much
> point
>> in re-writing it.
>>
>
> That's very true...
>
> It looks like GEF and GraphVis both use the "A Technique for Drawing
> Directed Graphs" algorithm.
>
> GraphVis, however, uses splines for the edges. That makes comples graphs
> more readable than the segmented edges DirectedGraphLayout uses.
>
> Would it be possible to use curved edges in combination with
> DirectedGraphLayout?
>
> Thanks.
>
>
Re: DirectedGraph connection routing [message #209291 is a reply to message #209173] Mon, 13 February 2006 19:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

The routing is a little bit smarter nor for long edges. Please look at the
latest code in M5, when it becomes available at the end of next week. You'll
need to checkout draw2d.example project and run DirectedGraphDemo to see how
to use the new bendpoints from the edge class.


Re: DirectedGraph connection routing [message #209309 is a reply to message #209276] Mon, 13 February 2006 21:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mromijn.remove_this_seagull.nl

"Randy Hudson" <none@us.ibm.com> wrote in message
news:dsqm8a$fg2$1@utils.eclipse.org...
> Can you post a picture of the problem?
>

I have attached an image showing the problem.
It was created with Eclipse 3.2M4 and GEF 3.2M4.

Thanks for your time!


Re: DirectedGraph connection routing [message #209340 is a reply to message #209285] Mon, 13 February 2006 21:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mromijn.remove_this_seagull.nl

"Randy Hudson" <none@us.ibm.com> wrote in message
news:dsqmam$fj9$1@utils.eclipse.org...
> If you search for more of their research, you can find clues to the spline
> algorithm. I think they build a polygon through which the spline is
routed.
> The polygon is built using the neighboring nodes of the virtual nodes
making
> up the edge.

It looks that way...
They define bounding boxes between ranks, between nodes of the same rank and
a series of smaller boxes between existing edges.
These bounding boxes are used to confine the curve of a spline.

The first step is to break the edge up in straight lines that stay within
the bounding boxes and after that, the begin-, end- and bend-points are used
to calculate a Bezier spline.
Re: DirectedGraph connection routing [message #209347 is a reply to message #209291] Mon, 13 February 2006 21:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mromijn.remove_this_seagull.nl

"Randy Hudson" <none@us.ibm.com> wrote in message
news:dsqmfm$ft5$1@utils.eclipse.org...
> The routing is a little bit smarter nor for long edges. Please look at the
> latest code in M5, when it becomes available at the end of next week.
You'll
> need to checkout draw2d.example project and run DirectedGraphDemo to see
how
> to use the new bendpoints from the edge class.

This looks really interesting!

I wonder how my graph will look like with this new routing :-)
Re: DirectedGraph connection routing [message #209354 is a reply to message #209309] Tue, 14 February 2006 04:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

It looks like there is a bug in the flow example which you have adopted.
When in edge is marked as inverted, you need to walk through its virtual
nodes backwards.

You can (soon) just call edge.getPoints() to get the points back from the
edge. The will be ordered in the naturaly direction of the edge (meaning
upward if inverted).

"Marcel Romijn" <mromijn@remove_this_seagull.nl> wrote in message
news:dsqss7$7jp$1@utils.eclipse.org...
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:dsqm8a$fg2$1@utils.eclipse.org...
>> Can you post a picture of the problem?
>>
>
> I have attached an image showing the problem.
> It was created with Eclipse 3.2M4 and GEF 3.2M4.
>
> Thanks for your time!
>
>
>
Re: DirectedGraph connection routing [message #209361 is a reply to message #209354] Tue, 14 February 2006 07:15 Go to previous messageGo to next message
Marcel Romijn is currently offline Marcel RomijnFriend
Messages: 4
Registered: July 2009
Junior Member
"Randy Hudson" <none@us.ibm.com> wrote in message
news:dsrm96$jlh$1@utils.eclipse.org...
> It looks like there is a bug in the flow example which you have adopted.
> When in edge is marked as inverted, you need to walk through its virtual
> nodes backwards.
>
> You can (soon) just call edge.getPoints() to get the points back from the
> edge. The will be ordered in the naturaly direction of the edge (meaning
> upward if inverted).

Something else to look forward to!

Thanks.
Re: DirectedGraph connection routing [message #209537 is a reply to message #209340] Wed, 15 February 2006 21:47 Go to previous messageGo to next message
richbk is currently offline richbkFriend
Messages: 6
Registered: July 2009
Junior Member
I have some old notes re using the output of dot to place nodes and create
splines.

From dotguide.pdf: "Every edge is assigned a pos attribute, which consists
of a list of 3n + 1 locations. These are B-spline control points: points p0;
p1; p2; p3 are the first Bezier spline, p3; p4; p5; p6 are the second, etc.
Currently, edge points are listed top-to-bottom (or left-to-right)
regardless of the orientation of the edge. This may change."





"Marcel Romijn" <mromijn@remove_this_seagull.nl> wrote in message
news:dsqtls$8ul$1@utils.eclipse.org...
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:dsqmam$fj9$1@utils.eclipse.org...
>> If you search for more of their research, you can find clues to the
>> spline
>> algorithm. I think they build a polygon through which the spline is
> routed.
>> The polygon is built using the neighboring nodes of the virtual nodes
> making
>> up the edge.
>
> It looks that way...
> They define bounding boxes between ranks, between nodes of the same rank
> and
> a series of smaller boxes between existing edges.
> These bounding boxes are used to confine the curve of a spline.
>
> The first step is to break the edge up in straight lines that stay within
> the bounding boxes and after that, the begin-, end- and bend-points are
> used
> to calculate a Bezier spline.
>
>
Re: DirectedGraph connection routing [message #209553 is a reply to message #209537] Thu, 16 February 2006 07:54 Go to previous messageGo to next message
Marcel Romijn is currently offline Marcel RomijnFriend
Messages: 4
Registered: July 2009
Junior Member
"Rick Kissh" <richbk@hotmail.com> wrote in message
news:dt0ac4$3i7$1@utils.eclipse.org...
>I have some old notes re using the output of dot to place nodes and create
>splines.
>
> From dotguide.pdf: "Every edge is assigned a pos attribute, which consists
> of a list of 3n + 1 locations. These are B-spline control points: points
> p0; p1; p2; p3 are the first Bezier spline, p3; p4; p5; p6 are the second,
> etc. Currently, edge points are listed top-to-bottom (or left-to-right)
> regardless of the orientation of the edge. This may change."

So what you mean is that I could do the following with my graph:
- Create a dot input-file from it
- Run it through dot
- Parse the dot output-file to extract the locations of the nodes and the
control points of the spline edges
- Use this information to layout GEF with a normal XYLayout

It's not the shortest route, but it is a possibility :-)
Re: DirectedGraph connection routing [message #209602 is a reply to message #209553] Thu, 16 February 2006 23:20 Go to previous message
richbk is currently offline richbkFriend
Messages: 6
Registered: July 2009
Junior Member
Grappa (http://www.research.att.com/~john/Grappa/) has java code to parse
dot files. You may be able to take advantage of it.

I'm looking forward to not using dot and instead using
CompoundDirectedGraphLayout.

Rick

"Marcel Romijn" <CallCatcher@hotmail.com> wrote in message
news:dt1b2v$40n$1@utils.eclipse.org...
>
> "Rick Kissh" <richbk@hotmail.com> wrote in message
> news:dt0ac4$3i7$1@utils.eclipse.org...
>>I have some old notes re using the output of dot to place nodes and create
>>splines.
>>
>> From dotguide.pdf: "Every edge is assigned a pos attribute, which
>> consists of a list of 3n + 1 locations. These are B-spline control
>> points: points p0; p1; p2; p3 are the first Bezier spline, p3; p4; p5; p6
>> are the second, etc. Currently, edge points are listed top-to-bottom (or
>> left-to-right) regardless of the orientation of the edge. This may
>> change."
>
> So what you mean is that I could do the following with my graph:
> - Create a dot input-file from it
> - Run it through dot
> - Parse the dot output-file to extract the locations of the nodes and the
> control points of the spline edges
> - Use this information to layout GEF with a normal XYLayout
>
> It's not the shortest route, but it is a possibility :-)
>
Previous Topic:Double-click on palette entry
Next Topic:Lable outside the figure
Goto Forum:
  


Current Time: Wed Apr 24 23:10:31 GMT 2024

Powered by FUDForum. Page generated in 0.04270 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top